Wt::WPushButton Class Reference

A widget that represents a push button. More...

#include <Wt/WPushButton>

Inheritance diagram for Wt::WPushButton:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 WPushButton (WContainerWidget *parent=0)
 Creates a push button.
 WPushButton (const WString &text, WContainerWidget *parent=0)
 Creates a push button with given label text.
void setText (const WString &text)
 Sets the button text.
const WStringtext () const
 Returns the button text.
void setIcon (const std::string &url)
 Sets an icon.
const std::string & icon () const
 Returns the icon.
virtual void refresh ()
 Refresh the widget.


Detailed Description

A widget that represents a push button.

To act on a button click, connect a slot to the clicked() signal.

Usage example:

 Wt::WPushButton *ok = new Wt::WPushButton("Okay");
 ok->clicked().connect(SLOT(ok, Wt::WPushButton::disable));
 ok->clicked().connect(SLOT(this, MyClass::processData));

WPushButton is an inline widget.

CSS

The widget corresponds to the HTML <button> tag and has the Wt-btn style. It may be styled through the current theme, or you can override the style using internal or external CSS as appropriate.


Member Function Documentation

const WString& Wt::WPushButton::text (  )  const [inline]

Returns the button text.

See also:
setText()

void Wt::WPushButton::setIcon ( const std::string &  url  ) 

Sets an icon.

The icon is placed to the left of the text.

const std::string& Wt::WPushButton::icon (  )  const [inline]

Returns the icon.

See also:
setIcon()

void Wt::WPushButton::refresh (  )  [virtual]

Refresh the widget.

The refresh method is invoked when the locale is changed using WApplication::setLocale() or when the user hit the refresh button.

The widget must actualize its contents in response.

Reimplemented from Wt::WWebWidget.


Generated on Fri Mar 26 17:12:07 2010 for Wt by doxygen 1.5.6