Wt
3.3.0
|
A date edit. More...
#include <Wt/WDateEdit>
Public Member Functions | |
WDateEdit (WContainerWidget *parent=0) | |
Creates a new date edit. | |
void | setDate (const WDate &date) |
Sets the date. | |
WDate | date () const |
Returns the date. | |
virtual WDateValidator * | validator () const |
Returns the validator. | |
void | setFormat (const WString &format) |
Sets the format used for representing the date. | |
WString | format () const |
Returns the format. | |
void | setBottom (const WDate &bottom) |
Sets the lower limit of the valid date range. | |
WDate | bottom () const |
Returns the lower limit of the valid date range. | |
void | setTop (const WDate &top) |
Sets the upper limit of the valid date range. | |
WDate | top () const |
Returns the upper limit of the valid range. | |
WCalendar * | calendar () const |
Returns the calendar widget. | |
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation()) |
Hide/unhide the widget. | |
Protected Member Functions | |
virtual void | render (WFlags< RenderFlag > flags) |
Renders the widget. | |
virtual void | propagateSetEnabled (bool enabled) |
Propagates that a widget was enabled or disabled through children. |
A date edit.
A date picker is a line edit with support for date entry (using an icon and a calendar).
A WDateValidator is used to validate date entry.
In many cases, it provides a more convenient implementation of a date picker compared to WDatePicker since it is implemented as a line edit. This also makes the implementation ready for a native HTML5 control.
WDate Wt::WDateEdit::bottom | ( | ) | const |
Returns the lower limit of the valid date range.
WCalendar* Wt::WDateEdit::calendar | ( | ) | const |
Returns the calendar widget.
The calendar may be 0 (e.g. when using a native date entry widget).
WDate Wt::WDateEdit::date | ( | ) | const |
Returns the date.
Reads the current date.
Returns an invalid date (for which WDate::isValid() returns false
) if the date could not be parsed using the current format().
WString Wt::WDateEdit::format | ( | ) | const |
Returns the format.
void Wt::WDateEdit::propagateSetEnabled | ( | bool | enabled | ) | [protected, virtual] |
Propagates that a widget was enabled or disabled through children.
When enabling or disabling a widget, you usually also want to disable contained children. This method is called by setDisabled() to propagate its state to all children.
You may want to reimplement this method if they wish to render differently when a widget is disabled. The default implementation will propagate the signal to all children.
Reimplemented from Wt::WFormWidget.
void Wt::WDateEdit::render | ( | WFlags< RenderFlag > | flags | ) | [protected, virtual] |
Renders the widget.
This function renders the widget (or an update for the widget), after this has been scheduled using scheduleRender().
The default implementation will render the widget by serializing changes to JavaScript and HTML. You may want to reimplement this widget if you have been postponing some of the layout / rendering implementation until the latest moment possible. In that case you should make sure you call the base implementation however.
Reimplemented from Wt::WFormWidget.
void Wt::WDateEdit::setBottom | ( | const WDate & | bottom | ) |
Sets the lower limit of the valid date range.
This sets the lower limit of the valid date range in the validator.
void Wt::WDateEdit::setDate | ( | const WDate & | date | ) |
void Wt::WDateEdit::setFormat | ( | const WString & | format | ) |
Sets the format used for representing the date.
This sets the format in the validator.
The default format is 'dd/MM/yyyy'
.
void Wt::WDateEdit::setTop | ( | const WDate & | top | ) |
Sets the upper limit of the valid date range.
This sets the upper limit of the valid date range in the validator.
WDateValidator * Wt::WDateEdit::validator | ( | ) | const [virtual] |
Returns the validator.
Most of the configuration of the date edit is stored in the validator.
Reimplemented from Wt::WFormWidget.