public class DatePicker extends Widget:
Themed date selection field with a calendar popup.
The widget behaves like a combo box whose popup lets the user choose a date. value is a signal property, so it can be bound or watched directly. Enable quickEditMode when the expected workflow is year, then month, then day.
import klyn.gui.windows import klyn.time picker = DatePicker(DateTime(year=2026, month=6, day=14)) picker.quickEditMode = true Binding.watch(picker::value, lambda(value: Object): print(value))
| Modifier and Type | Member | Description |
|---|---|---|
| public property | buttonAreaWidthbuttonAreaWidth as Int = 42 |
Width reserved for the calendar button at the right side of the field. |
| public property | isExpandedisExpanded as Boolean = false |
Whether the popup is currently visible. |
| public property | paddingXpaddingX as Int = 12 |
Horizontal text padding inside the collapsed field. |
| public property | quickEditModequickEditMode as Boolean = false |
Enables the three-click picker: year, month, then day. |
| Modifier and Type | Member | Description |
|---|---|---|
| public event | dateChangeddateChanged as ActionEvent |
Event emitted after the selected date changes. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | DatePickerDatePicker(value as DateTime = null): |
Creates a date picker. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | collapsecollapse() as Boolean: |
Closes the calendar popup. |
| public | expandexpand() as Boolean: |
Opens the calendar popup. |
| public override | paintpaint(painter as Painter) as Void: |
Paints the collapsed field. |
| public override | paintOverlaypaintOverlay(painter as Painter) as Void: |
Paints the calendar popup above the regular widget tree. |
| public | popupContainsPoint | Returns true when a point falls inside the open popup. |
| public override | resolvePreferredHeightresolvePreferredHeight() as Int: |
Resolved preferred height after runtime content zoom. |
| public override | resolvePreferredWidthresolvePreferredWidth() as Int: |
Resolved preferred width after runtime content zoom. |
| public | toggleExpandedtoggleExpanded() as Boolean: |
Toggles the calendar popup. |