Wt::WAnchor Class Reference

A widget that represents an HTML anchor (to link to other documents). More...

#include <WAnchor>

Inheritance diagram for Wt::WAnchor:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 WAnchor (WContainerWidget *parent=0)
 Create an anchor going nowhere without any text.
 WAnchor (const std::string &ref, WContainerWidget *parent=0)
 Create an anchor with a destination URL, but without any text.
 WAnchor (WResource *resource, WContainerWidget *parent=0)
 Create an anchor with a dynamically generated document, but without any text.
 WAnchor (const std::string &ref, const WString &text, WContainerWidget *parent=0)
 Create an anchor with a destination URL and anchor message.
 WAnchor (WResource *resource, const WString &text, WContainerWidget *parent=0)
 Create an anchor with a dynamically generated document and anchor message.
 WAnchor (const std::string &ref, WImage *image, WContainerWidget *parent=0)
 Create an anchor with a destination URL and anchor image.
 WAnchor (WResource *resource, WImage *image, WContainerWidget *parent=0)
 Create an anchor with a dynamically generated document and anchor image.
void setRef (const std::string &ref)
 Change the destination URL for this anchor.
const std::string & ref () const
 Get the destination URL for this anchor.
void setResource (WResource *resource)
 Set the resource for a dynamically generated document.
WResourceresource () const
 Get the resource.
void setText (const WString &text)
 Set the label text.
const WStringtext () const
 Get the label text.
void setImage (WImage *image)
 Set the image.
WImageimage () const
 Get the image.
void setTarget (AnchorTarget target)
 Specify where the location where the reference should be displayed.
AnchorTarget target () const
 Get the location where the reference should be displayed.


Detailed Description

A widget that represents an HTML anchor (to link to other documents).

WAnchor is an inline widget.

Use an anchor to link to another web page, using a text and/or image.


Member Function Documentation

void Wt::WAnchor::setRef ( const std::string &  ref  ) 

Change the destination URL for this anchor.

Not available when the document is specified as a resource.

const std::string& Wt::WAnchor::ref (  )  const [inline]

Get the destination URL for this anchor.

When the document is specified as a resource, this returns the current resource URL.

void Wt::WAnchor::setResource ( WResource resource  ) 

Set the resource for a dynamically generated document.

This overrides the URL set by setRef() with the URL that corresponds to the resource.

void Wt::WAnchor::setTarget ( AnchorTarget  target  ) 

Specify where the location where the reference should be displayed.

By default, the reference is displayed instead of the application.

See also:
target()

AnchorTarget Wt::WAnchor::target (  )  const [inline]

Get the location where the reference should be displayed.

See also:
setTarget(AnchorTarget)


The documentation for this class was generated from the following files:
Generated on Mon Apr 14 15:15:00 2008 for Wt by doxygen 1.5.3