Wt  3.2.3
Public Types | Public Member Functions
Wt::Ext::LineEdit Class Reference

A line edit. More...

#include <Wt/Ext/LineEdit>

Inheritance diagram for Wt::Ext::LineEdit:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EchoMode { Normal, Password }
 Enum that describes how the contents is displayed. More...

Public Member Functions

 LineEdit (WContainerWidget *parent=0)
 Create a new line edit with empty content.
 LineEdit (const WString &content, WContainerWidget *parent=0)
 Construct a line edit with given content.
void setTextSize (int chars)
 Specify the width of the line edit in number of characters.
int textSize () const
 Return the current width of the line edit in number of characters.
void setText (const WString &value)
 Change the content of the line edit.
const WStringtext () const
 Return the current content.
void setMaxLength (int length)
 Specify the maximum length of text that can be entered.
int maxLength () const
 Returns the maximum length of text that can be entered.
void setEchoMode (EchoMode echoMode)
 Set the echo mode.
EchoMode echoMode () const
 Return the echo mode.
virtual WValidator::State validate ()
 Validate the field.
EventSignal< WKeyEvent > & keyWentDown ()
 Event signal emitted when a keyboard key is pushed down.
EventSignal< WKeyEvent > & keyPressed ()
 Event signal emitted when a keyboard key is pressed.
EventSignal< WKeyEvent > & keyWentUp ()
 Event signal emitted when a keyboard key is released.
EventSignalenterPressed ()
 Event signal emitted when enter was pressed.

Detailed Description

A line edit.

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.

The API is a super-set of the WLineEdit API.


Member Enumeration Documentation

Enum that describes how the contents is displayed.

See also:
setEchoMode
echoMode
Enumerator:
Normal 

Characters are shown.

Password 

Hide the contents as for a password.


Member Function Documentation

EventSignal & Wt::Ext::LineEdit::enterPressed ( )

Event signal emitted when enter was pressed.

This signal is emitted when the Enter or Return key was pressed.

See also:
WInteractWidget::enterPressed()
int Wt::Ext::LineEdit::maxLength ( ) const

Returns the maximum length of text that can be entered.

See also:
setMaxLength(int)
void Wt::Ext::LineEdit::setEchoMode ( EchoMode  echoMode)

Set the echo mode.

The default echo mode is Normal.

void Wt::Ext::LineEdit::setMaxLength ( int  length)

Specify the maximum length of text that can be entered.

A value <= 0 indicates that there is no limit.

The default value is -1.

int Wt::Ext::LineEdit::textSize ( ) const

Return the current width of the line edit in number of characters.

See also:
setTextSize(int)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator

Generated on Thu Nov 1 2012 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1