#include <WAnchor>
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. | |
WResource * | resource () const |
Get the resource. | |
void | setText (const WString &text) |
Set the label text. | |
const WString & | text () const |
Get the label text. | |
void | setImage (WImage *image) |
Set the image. | |
WImage * | image () 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. |
WAnchor is an inline widget.
Use an anchor to link to another web page, using a text and/or image.
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.
AnchorTarget Wt::WAnchor::target | ( | ) | const [inline] |