diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2008-09-16 06:49:08 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2008-09-16 06:49:08 +0000 |
| commit | e20eeb65413d0cf1a94d682c51d781314beeda6d (patch) | |
| tree | 8d2c124fb6f409a024a8c9a11785d8fdc5008a64 /src/Fl_Clock.cxx | |
| parent | 5da1c0f71f3fd299c5bf50df911fc4cdb3ac96c0 (diff) | |
applied Duncan Gibson's documentation patch (WP3).
Docs look good, compiles okay.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6264 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Clock.cxx')
| -rw-r--r-- | src/Fl_Clock.cxx | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/src/Fl_Clock.cxx b/src/Fl_Clock.cxx index 7d724402e..b13223c5e 100644 --- a/src/Fl_Clock.cxx +++ b/src/Fl_Clock.cxx @@ -3,7 +3,7 @@ // // Clock widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2006 by Bill Spitzak and others. +// Copyright 1998-2008 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -112,6 +112,12 @@ void Fl_Clock_Output::draw() { draw_label(); } +/** + Set the displayed time. + Set the time in hours, minutes, and seconds. + \param[in] H, m, s displayed time + \see hour(), minute(), second() + */ void Fl_Clock_Output::value(int H, int m, int s) { if (H!=hour_ || m!=minute_ || s!=second_) { hour_ = H; minute_ = m; second_ = s; @@ -120,6 +126,12 @@ void Fl_Clock_Output::value(int H, int m, int s) { } } +/** + Set the displayed time. + Set the time in seconds since the UNIX epoch (January 1, 1970). + \param[in] v seconds since epoch + \see value() + */ void Fl_Clock_Output::value(ulong v) { value_ = v; struct tm *timeofday; @@ -129,8 +141,14 @@ void Fl_Clock_Output::value(ulong v) { value(timeofday->tm_hour, timeofday->tm_min, timeofday->tm_sec); } -Fl_Clock_Output::Fl_Clock_Output(int X, int Y, int W, int H, const char *l) -: Fl_Widget(X, Y, W, H, l) { +/** + Create a new Fl_Clock_Output widget with the given position, size and label. + The default boxtype is \c FL_NO_BOX. + \param[in] X, Y, W, H position and size of the widget + \param[in] L widget label, default is no label + */ +Fl_Clock_Output::Fl_Clock_Output(int X, int Y, int W, int H, const char *L) +: Fl_Widget(X, Y, W, H, L) { box(FL_UP_BOX); selection_color(fl_gray_ramp(5)); align(FL_ALIGN_BOTTOM); @@ -142,11 +160,24 @@ Fl_Clock_Output::Fl_Clock_Output(int X, int Y, int W, int H, const char *l) //////////////////////////////////////////////////////////////// -Fl_Clock::Fl_Clock(int X, int Y, int W, int H, const char *l) - : Fl_Clock_Output(X, Y, W, H, l) {} - -Fl_Clock::Fl_Clock(uchar t, int X, int Y, int W, int H, const char *l) - : Fl_Clock_Output(X, Y, W, H, l) { +/** + Create an Fl_Clock widget using the given position, size, and label string. + The default boxtype is \c FL_NO_BOX. + \param[in] X, Y, W, H position and size of the widget + \param[in] L widget label, default is no label + */ +Fl_Clock::Fl_Clock(int X, int Y, int W, int H, const char *L) + : Fl_Clock_Output(X, Y, W, H, L) {} + +/** + Create an Fl_Clock widget using the given boxtype, position, size, and + label string. + \param[in] t boxtype + \param[in] X, Y, W, H position and size of the widget + \param[in] L widget label, default is no label + */ +Fl_Clock::Fl_Clock(uchar t, int X, int Y, int W, int H, const char *L) + : Fl_Clock_Output(X, Y, W, H, L) { type(t); box(t==FL_ROUND_CLOCK ? FL_NO_BOX : FL_UP_BOX); } @@ -168,6 +199,9 @@ int Fl_Clock::handle(int event) { return Fl_Clock_Output::handle(event); } +/** + The destructor removes the clock. + */ Fl_Clock::~Fl_Clock() { Fl::remove_timeout(tick, this); } |
