Wt: Wt::WDateEdit Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions
Wt::WDateEdit Class Reference

A date edit. More...

`#include <Wt/WDateEdit>`

Inheritance diagram for Wt::WDateEdit:
[legend]

List of all members.

## 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.

## Detailed Description

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.

## Member Function Documentation

WDate Wt::WDateEdit::bottom | ( |  | ) | const

Returns the lower limit of the valid date range.

See also:
  setBottom()

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().

See also:
  setDate(), WDate::fromString(), WLineEdit::text()

WString Wt::WDateEdit::format | ( |  | ) | const

Returns the format.

See also:
  setFormat()

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.

See also:
  WDateValidator::setBottom()

void Wt::WDateEdit::setDate | ( | const WDate & | date | ) |

Sets the date.

Does nothing if the current date is `Null`.

See also:
  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'`.

See also:
  WDateValidator::setFormat()

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.

See also:
  WDateValidator::setTop()

WDate Wt::WDateEdit::top | ( |  | ) | const

Returns the upper limit of the valid range.

See also:
  setTop()

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.

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator