STR 748: Fl_Clock_Output::value(ulong) does not change value_

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4109 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2005-03-12 23:18:48 +00:00
parent fb820bcf23
commit 23f90b2301
2 changed files with 9 additions and 13 deletions
+7 -4
View File
@@ -1,11 +1,14 @@
CHANGES IN FLTK 1.1.7
- Added Comment Type to Fluid. This is useful to generate
Copyright notices in the source and header files.
- Fl_Valuator would not format text output with decimal
point when the step value was fractional, but above 1
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745)
- Fl_Clock_Output::value() did not return the previously
set value (STR #748)
- Added comment type to FLUID. This is useful for
generating copyright notices in the source and header
files.
- Fl_Valuator would not format text output with decimal
point when the step value was fractional, but above 1.
- fl_filename_relative() didn't compare drive letters in
a case-insensitive way (STR #741)
- Fixed menu item width calculations with symbols (STR
+2 -9
View File
@@ -107,11 +107,13 @@ void Fl_Clock_Output::draw() {
void Fl_Clock_Output::value(int H, int m, int s) {
if (H!=hour_ || m!=minute_ || s!=second_) {
hour_ = H; minute_ = m; second_ = s;
value_ = (H * 60 + m) * 60 + s;
damage(FL_DAMAGE_CHILD);
}
}
void Fl_Clock_Output::value(ulong v) {
value_ = v;
struct tm *timeofday;
timeofday = localtime((const time_t *)&v);
value(timeofday->tm_hour, timeofday->tm_min, timeofday->tm_sec);
@@ -140,17 +142,8 @@ Fl_Clock::Fl_Clock(uchar t, int X, int Y, int W, int H, const char *l)
}
static void tick(void *v) {
#ifdef WIN32
((Fl_Clock*)v)->value(time(0));
Fl::add_timeout(1.0, tick, v);
#else
struct timeval t;
gettimeofday(&t, 0);
((Fl_Clock*)v)->value(t.tv_sec);
double delay = 1.0-t.tv_usec*.000001;
if (delay < .1 || delay > .9) delay = 1.0;
Fl::add_timeout(delay, tick, v);
#endif
}
int Fl_Clock::handle(int event) {