fltk::ClockOutput Class Reference

Inherits fltk::Widget.

Inherited by fltk::Clock.

List of all members.

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)


Detailed Description

Base class of Clock, this one does not move, it just displays whatever time you set into it. The include file is <fltk/Clock.h>

type() may be set to SQUARE, ROUND, or DIGITAL (nyi).


Member Function Documentation

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().


Wed Jun 17 08:49:29 2009. FLTK ©2007 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.