#include <Wt/WTextArea>
Public Member Functions | |
WTextArea (WContainerWidget *parent=0) | |
Construct a text area with empty content and optional parent. | |
WTextArea (const WString &content, WContainerWidget *parent=0) | |
Construct a text area with given content and optional parent. | |
void | setColumns (int cols) |
Set the number of columns. | |
void | setRows (int rows) |
Set the number of rows. | |
int | columns () const |
Returns the number of columns. | |
int | rows () const |
Returns the number of rows. | |
const WString & | text () const |
Returns the current content. | |
virtual void | setText (const WString &text) |
Change the content of the text area. | |
WValidator::State | validate () |
Validate the field. |
To act upon text changes, connect a slot to the changed() signal. This signal is emitted when the user changed the content, and subsequently removes the focus from the line edit.
To act upon editing, connect a slot to the keyWentUp() signal.
At all times, the current content may be accessed with the text() method.
Usage example:
Wt::WContainerWidget *w = new Wt::WContainerWidget(); Wt::WLabel *label = new Wt::WLabel("Comments:", w); Wt::WTextArea *edit = new Wt::WTextArea("", w); label->setBuddy(edit);
The widget corresponds to an HTML <textarea>
tag.
WTextArea is an inline widget.
void Wt::WTextArea::setColumns | ( | int | cols | ) |
Set the number of columns.
The default value is 20.
void Wt::WTextArea::setRows | ( | int | rows | ) |
Set the number of rows.
The default value is 5.
int Wt::WTextArea::columns | ( | ) | const [inline] |
int Wt::WTextArea::rows | ( | ) | const [inline] |
void Wt::WTextArea::setText | ( | const WString & | text | ) | [virtual] |