From 3cac153c5b19520bd5f8c73b1d38e152f7ed7469 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 27 Jun 2009 09:29:36 +0000 Subject: Fixed documentation for Fl_Progress (STR #2209) and changed deprecated color2() calls to selection_color(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6794 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 1 + src/Fl_Progress.cxx | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 4cddc8a63..6d18700da 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ CHANGES IN FLTK 1.3.0 + - Fixed documentation for Fl_Progress (STR #2209) - Fluid printing used wrong colors under Windows (STR #2195) - Updated documentation for Fl_Input_ - Fixed fl_draw_image to obey the alpha channel, hoping that diff --git a/src/Fl_Progress.cxx b/src/Fl_Progress.cxx index 588d2530a..07a3b5f15 100644 --- a/src/Fl_Progress.cxx +++ b/src/Fl_Progress.cxx @@ -47,7 +47,7 @@ // -// 'Fl_Progress::draw()' - Draw the check button. +// 'Fl_Progress::draw()' - Draw the progress bar. // /** Draws the progress bar. */ @@ -76,10 +76,10 @@ void Fl_Progress::draw() // Draw the box and label... if (progress > 0) { Fl_Color c = labelcolor(); - labelcolor(fl_contrast(labelcolor(), color2())); + labelcolor(fl_contrast(labelcolor(), selection_color())); fl_push_clip(x(), y(), progress + bx, h()); - draw_box(box(), x(), y(), w(), h(), active_r() ? color2() : fl_inactive(color2())); + draw_box(box(), x(), y(), w(), h(), active_r() ? selection_color() : fl_inactive(selection_color())); draw_label(tx, y() + by, tw, h() - bh); fl_pop_clip(); @@ -99,12 +99,16 @@ void Fl_Progress::draw() /** - The constructor creates the progress bar using the position, - size, and label. -

The inherited destructor removes the progress bar. + The constructor creates the progress bar using the position, size, and label. + + You can set the background color with color() and the + progress bar color with selection_color(), or you can set both colors + together with color(unsigned bg, unsigned sel). + + The default colors are FL_BACKGROUND2_COLOR and FL_YELLOW, resp. */ -Fl_Progress::Fl_Progress(int X, int Y, int W, int H, const char* l) -: Fl_Widget(X, Y, W, H, l) { +Fl_Progress::Fl_Progress(int X, int Y, int W, int H, const char* L) +: Fl_Widget(X, Y, W, H, L) { align(FL_ALIGN_INSIDE); box(FL_DOWN_BOX); color(FL_BACKGROUND2_COLOR, FL_YELLOW); -- cgit v1.2.3