FLTK 1.3.11
Toggle main menu visibility
Loading...
Searching...
No Matches
Fl_Clock.H
1
//
2
// "$Id$"
3
//
4
// Clock header file for the Fast Light Tool Kit (FLTK).
5
//
6
// Copyright 1998-2010 by Bill Spitzak and others.
7
//
8
// This library is free software. Distribution and use rights are outlined in
9
// the file "COPYING" which should have been included with this file. If this
10
// file is missing or damaged, see the license at:
11
//
12
// http://www.fltk.org/COPYING.php
13
//
14
// Please report all bugs and problems on the following page:
15
//
16
// http://www.fltk.org/str.php
17
//
18
19
/* \file
20
Fl_Clock, Fl_Clock_Output widgets . */
21
22
#ifndef Fl_Clock_H
23
#define Fl_Clock_H
24
25
#ifndef Fl_Widget_H
26
#include "
Fl_Widget.H
"
27
#endif
28
29
// values for type:
30
#define FL_SQUARE_CLOCK 0
31
#define FL_ROUND_CLOCK 1
32
#define FL_ANALOG_CLOCK FL_SQUARE_CLOCK
33
#define FL_DIGITAL_CLOCK FL_SQUARE_CLOCK
34
35
// fabien: Please keep the horizontal formatting of both images in class desc,
36
// don't lose vert. space for nothing!
37
54
class
FL_EXPORT
Fl_Clock_Output
:
public
Fl_Widget {
55
int
hour_, minute_, second_;
56
ulong
value_;
57
void
drawhands(
Fl_Color
,
Fl_Color
);
// part of draw
58
protected
:
59
void
draw
();
60
void
draw
(
int
X,
int
Y,
int
W,
int
H);
61
public
:
62
63
Fl_Clock_Output
(
int
X,
int
Y,
int
W,
int
H,
const
char
*L = 0);
64
65
void
value
(
ulong
v);
// set to this Unix time
66
67
void
value
(
int
H,
int
m,
int
s);
68
74
ulong
value
()
const
{
return
value_;}
75
80
int
hour
()
const
{
return
hour_;}
81
86
int
minute
()
const
{
return
minute_;}
87
92
int
second
()
const
{
return
second_;}
93
};
94
95
// a Fl_Clock displays the current time always by using a timeout:
96
113
class
FL_EXPORT
Fl_Clock
:
public
Fl_Clock_Output
{
114
public
:
115
int
handle
(
int
);
116
117
Fl_Clock
(
int
X,
int
Y,
int
W,
int
H,
const
char
*L = 0);
118
119
Fl_Clock
(
uchar
t,
int
X,
int
Y,
int
W,
int
H,
const
char
*L);
120
121
~Fl_Clock
();
122
};
123
124
#endif
125
126
//
127
// End of "$Id$".
128
//
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition
Enumerations.H:941
Fl_Widget.H
Fl_Widget, Fl_Label classes .
Fl_Clock_Output::hour
int hour() const
Returns the displayed hour (0 to 23).
Definition
Fl_Clock.H:80
Fl_Clock_Output::Fl_Clock_Output
Fl_Clock_Output(int X, int Y, int W, int H, const char *L=0)
Create a new Fl_Clock_Output widget with the given position, size and label.
Definition
Fl_Clock.cxx:153
Fl_Clock_Output::minute
int minute() const
Returns the displayed minute (0 to 59).
Definition
Fl_Clock.H:86
Fl_Clock_Output::value
ulong value() const
Returns the displayed time.
Definition
Fl_Clock.H:74
Fl_Clock_Output::second
int second() const
Returns the displayed second (0 to 60, 60=leap second).
Definition
Fl_Clock.H:92
Fl_Clock_Output::value
void value(ulong v)
Set the displayed time.
Definition
Fl_Clock.cxx:138
Fl_Clock::Fl_Clock
Fl_Clock(int X, int Y, int W, int H, const char *L=0)
Create an Fl_Clock widget using the given position, size, and label string.
Definition
Fl_Clock.cxx:172
Fl_Widget::draw
virtual void draw()=0
Draws the widget.
Fl_Widget::handle
virtual int handle(int event)
Handles the specified event.
Definition
Fl_Widget.cxx:112
uchar
unsigned char uchar
unsigned char
Definition
fl_types.h:30
ulong
unsigned long ulong
unsigned long
Definition
fl_types.h:32
FL
Fl_Clock.H
Generated by
1.17.0