Module: reefvision.widgets.clock
Source: ./reefvision/widgets/clock.reef
Overview
reefvision.widgets.clock — live date + HH:MM:SS with blinking colons.
Date style 0 = YYYY-MM-DD, 1 = MM-DD-YY. Time style 0 = 24-hour, 1 = 12-hour AM/PM. TZ style 0 = UTC, 1 = host timezone (TZ / /etc/localtime, including DST). Colons are shown when (subsec_millis / 500) is even, spaces when odd. The host app should mark the desktop dirty about twice a second so the colon blinks and seconds tick.
Objects
Clock
Extends: view.View
Fields:
| Name | Type |
|---|---|
date_style |
int |
time_style |
int |
tz_style |
int |
proc init(bounds: cell.Rect, date_style: int, time_style: int, tz_style: int)
Methods:
override shared fn wants_focus(): bool
exclusive proc set_date_style(date_style: int)
exclusive proc set_time_style(time_style: int)
exclusive proc set_tz_style(tz_style: int)
override exclusive proc draw(buf: cell.CellBuffer, abs: cell.Rect, clip: cell.Rect, focused: bool, th: theme.Theme)
Functions
fn DATE_YMD(): int
fn DATE_MDY(): int
fn TIME_24(): int
fn TIME_12(): int
fn TZ_UTC(): int
fn TZ_LOCAL(): int
fn pad2(n: int): string
fn clock_now_text(date_style: int, time_style: int, tz_style: int): string
fn clock_format(unix_seconds: int, subsec_millis: int, date_style: int, time_style: int, tz_style: int): string
Generated by reefc doc