summaryrefslogtreecommitdiff
path: root/FL/Fl_Clock.H
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2008-04-08 00:09:16 +0000
committerMatthias Melcher <fltk@matthiasm.com>2008-04-08 00:09:16 +0000
commit97b806e5800da62734ba2913881d96a353e3e313 (patch)
treef6bb73185bdbfa63ff151f99782e9396ca3a6e68 /FL/Fl_Clock.H
parent7d013249f7456d4568a39679c3cad948e1000353 (diff)
Added two UTF-8 support headers which can not be used just yet. Added sample implementation of Doxygen documentation, including a Doxygen config file, two copied doc pages documentation/index.do and documentation/preface.dox, and sample headers fro Fl_Preferences and Fl_Clock.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6089 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Clock.H')
-rw-r--r--FL/Fl_Clock.H93
1 files changed, 92 insertions, 1 deletions
diff --git a/FL/Fl_Clock.H b/FL/Fl_Clock.H
index 56962a2f5..da98bdcf8 100644
--- a/FL/Fl_Clock.H
+++ b/FL/Fl_Clock.H
@@ -25,6 +25,10 @@
// http://www.fltk.org/str.php
//
+/** \file
+ * Fl_Clock widget definitions for the Fast Light Tool Kit (FLTK).
+ */
+
#ifndef Fl_Clock_H
#define Fl_Clock_H
@@ -40,6 +44,15 @@
// a Fl_Clock_Output can be used to display a program-supplied time:
+/**
+ * This widget can be used to display a program-supplied time.
+ * The time shown on the clock is not updated.
+ * To display the current time, use <TT>Fl_Clock</A></TT> instead.
+ *
+ * \image html clock.gif
+ *
+ * \image html round_clock.gif
+ */
class FL_EXPORT Fl_Clock_Output : public Fl_Widget {
int hour_, minute_, second_;
ulong value_;
@@ -48,23 +61,101 @@ protected:
void draw(int, int, int, int);
void draw();
public:
+
+ /**
+ * Creates a new <tt>Fl_Clock_Output</tt> widget.
+ * Create an <tt>Fl_Clock_Output</tt> widget using the given position,
+ * size, and label string. The default boxtype is <tt>FL_NO_BOX</tt>.
+ *
+ * \param[in] x, y, w, h position and size of the widget
+ * \param[in] label widget label, default is no label
+ */
Fl_Clock_Output(int x,int y,int w,int h, const char *l = 0);
+
+ /**
+ * Set the displayed time.
+ * Set the time in seconds since the UNIX epoch (January 1, 1970).
+ * \see value()
+ */
void value(ulong v); // set to this Unix time
- void value(int,int,int); // set hour, minute, second
+
+ /**
+ * Set the displayed time.
+ * Set the time in hours, minutes, and seconds.
+ * \param[in] hour, minute, second displayed time
+ * \see hour(), minute(), second()
+ */
+ void value(int hour, int minute, int second);
+
+ /**
+ * Returns the displayed time.
+ * Returns the time in seconds since the UNIX epoch (January 1, 1970).
+ * \see value(ulong)
+ */
ulong value() const {return value_;}
+
+ /**
+ * Returns the displayed time.
+ * Returns the displayed hour (0 to 23).
+ * \see value(), minute(), second()
+ */
int hour() const {return hour_;}
+
+ /**
+ * Returns the displayed time.
+ * Returns the displayed minute (0 to 59).
+ * \see value(), hour(), second()
+ */
int minute() const {return minute_;}
+
+ /**
+ * Returns the displayed time.
+ * Returns the displayed second (0 to 60, 60=leap second).
+ * \see value(), hour(), minute()
+ */
int second() const {return second_;}
};
// a Fl_Clock displays the current time always by using a timeout:
+/**
+ * This widget provides a round analog clock display.
+ * <tt>Fl_Clock</tt> is provided for Forms compatibility.
+ * It installs a 1-second timeout callback using <tt>Fl::add_timeout()</tt>.
+ *
+ * \image html clock.gif
+ *
+ * \image html round_clock.gif
+ */
class FL_EXPORT Fl_Clock : public Fl_Clock_Output {
public:
int handle(int);
void update();
+
+ /**
+ * Creates a new <tt>Fl_Clock</tt> widget.
+ * Create an <tt>Fl_Clock</tt> widget using the given position,
+ * size, and label string. The default boxtype is <tt>FL_NO_BOX</tt>.
+ *
+ * \param[in] x, y, w, h position and size of the widget
+ * \param[in] label widget label, default is no label
+ */
Fl_Clock(int x,int y,int w,int h, const char *l = 0);
+
+ /**
+ * Creates a new <tt>Fl_Clock</tt> widget.
+ * Create an <tt>Fl_Clock</tt> widget using the given position,
+ * size, and label string.
+ *
+ * \param[in] t boxtype
+ * \param[in] x, y, w, h position and size of the widget
+ * \param[in] label widget label, default is no label
+ */
Fl_Clock(uchar t,int x,int y,int w,int h, const char *l);
+
+ /**
+ * The destructor removes the clock.
+ */
~Fl_Clock();
};