Inherited by fltk::Clock.
Public Types | |
enum | { SQUARE, ANALOG, ROUND, DIGITAL } |
Public Member Functions | |
ClockOutput (int x, int y, int w, int h, const char *l=0) | |
int | hour () const |
int | minute () const |
int | second () const |
unsigned long | value () const |
void | value (int, int, int) |
void | value (unsigned long v) |
Protected Member Functions | |
void | draw () |
void | draw (int, int, int, int) |
type() may be set to SQUARE, ROUND, or DIGITAL (nyi).
void ClockOutput::value | ( | unsigned long | v | ) |
Set the clock to a Unix timestamp. The value is passed through the localtime() library function and used to get the hour, minute, and second.
References value().
void ClockOutput::value | ( | int | h, | |
int | m, | |||
int | s | |||
) |
Set the hour, minute, and second to display. The hour is effectively taken modulus 12 and the minute and second modulus 60 to figure out where to place the hands. Redraw happens only if different.
This does not set the unsigned long value() member, as it can't because it does not know the date.
References fltk::DAMAGE_CHILD, and fltk::Widget::redraw().
unsigned long ClockOutput::value | ( | ) | const [inline] |
Return the last Unix timestamp the clock was set to.
Referenced by value().
int ClockOutput::hour | ( | ) | const [inline] |
Return the hour sent to the last call to value().
int ClockOutput::minute | ( | ) | const [inline] |
Return the minute sent to the last call to value().
int ClockOutput::second | ( | ) | const [inline] |
Return the second sent to the last call to value().