class documentation
A GUI component for selecting and rendering a date and time.
- Two-band layout:
- Top band: Month | Day | Year Bottom band: Hour | Min | Sec
Left/right navigates across all 6 fields, up/down changes the value. Returns False when the user is done (CENTER or BACK).
| Method | __del__ |
Clean up resources |
| Method | __init__ |
Initialize the date picker with position, size, and optional initial time. |
| Method | run |
Run one iteration of the date picker event loop. |
| Property | time |
Get the currently selected date and time as a tuple. |
| Method | __band |
Draw a single 3-column drum-roll band. |
| Method | __draw |
Render the date+time picker on the display. |
| Method | __max |
Return the number of days in the given month (1-indexed). |
| Constant | _DAYS |
Undocumented |
| Constant | _MONTHS |
Undocumented |
| Instance Variable | _field |
Undocumented |
| Instance Variable | _needs |
Undocumented |
| Instance Variable | _position |
Undocumented |
| Instance Variable | _size |
Undocumented |
| Instance Variable | _time |
Undocumented |
| Instance Variable | _view |
Undocumented |
Initialize the date picker with position, size, and optional initial time.
| Parameters | |
viewViewManager | View Manager context. |
position:Vector | Vector with position coordinates. |
size:Vector | Vector with size dimensions. |
time:tuple | Optional initial date and time (year, month, day of month, weekday, hour, minute, second, subseconds). Defaults to None. |
Run one iteration of the date picker event loop.
| Returns | |
bool | True to keep running, False when the user is done. |
def __band(self, draw, fg, bg, sel, band_y, band_h, col_w, start_x, labels, values, active_col, val_h, lbl_h, lbl_cw, val_font):
¶
Draw a single 3-column drum-roll band.
| Parameters | |
draw:Draw | Drawing context. |
fg:int | Foreground color. |
bg:int | Background color. |
sel:int | Selected column highlight color. |
bandint | Top Y position of the band. |
bandint | Height of the band. |
colint | Width of each column. |
startint | Left X position of the band. |
labels:tuple | Field labels for the three columns. |
values:tuple | Display strings for the three columns. |
activeint | Index of the active column, or -1. |
valint | Value text height. |
lblint | Label text height. |
lblint | Label character width. |
valint | Font size for the values. |
Return the number of days in the given month (1-indexed).
| Parameters | |
month:int | The month number, 1 to 12. |
| Returns | |
int | The number of days in the month. |