DatePicker
classin packageklyn.gui.windows
public class DatePicker extends Widget
└ DatePicker

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 as Object): print(value))
Properties
Modifier and Type Member Description
public property buttonAreaWidth
buttonAreaWidth as Int = 42
Width reserved for the calendar button at the right side of the field.
public property isExpanded
isExpanded as Boolean = false
Whether the popup is currently visible.
public property paddingX
paddingX as Int = 12
Horizontal text padding inside the collapsed field.
public property quickEditMode
quickEditMode as Boolean = false
Enables the three-click picker: year, month, then day.
Inherited Properties
propertyInherited Properties from Widget: accentColor, acceptFileDrops, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Signals
Modifier and Type Member Description
public signal property value
value as DateTime
Selected date.
Events
Modifier and Type Member Description
public event dateChanged
dateChanged as ActionEvent
Event emitted after the selected date changes.
Inherited Events
eventInherited Events from Widget: filesDropped, focusGained, focusLost, keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public DatePicker
DatePicker(value as DateTime = DateTime.now)
Creates a date picker.
Methods
Modifier and Type Member Description
public override applyThemeMetrics
applyThemeMetrics(fontPixelSize as Int, paddingLeft as Int, paddingTop as Int, paddingRight as Int, paddingBottom as Int) as Void
No summary.
public collapse
collapse() as Boolean
Closes the calendar popup.
public expand
expand() as Boolean
Opens the calendar popup.
public override paint
paint(painter as Painter) as Void
Paints the collapsed field.
public override paintOverlay
paintOverlay(painter as Painter) as Void
Paints the calendar popup above the regular widget tree.
public popupContainsPoint
popupContainsPoint(x as Int, y as Int) as Boolean
Returns true when a point falls inside the open popup.
public override preferredSizeIncludesContentZoom
preferredSizeIncludesContentZoom() as Boolean
No summary.
public override resolvePreferredHeight
resolvePreferredHeight() as Int
Resolved preferred height after runtime content zoom.
public override resolvePreferredWidth
resolvePreferredWidth() as Int
Resolved preferred width after runtime content zoom.
public toggleExpanded
toggleExpanded() as Boolean
Toggles the calendar popup.
Inherited Methods
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFilesDropped, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintForeground, paintOverlay, preferredSizeIncludesContentZoom, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds