[better progress bar with better colored label
Andreas Röver <roever@users.sourceforge.net>**20060208120206] {
hunk ./src/gui/MainWindow.cpp 2512
-    SolvingProgress = new Fl_Progress(x, y, w, SZ_BUTTON_Y, 0);
+    SolvingProgress = new ProgressBar(x, y, w, SZ_BUTTON_Y);
hunk ./src/gui/MainWindow.h 91
-  Fl_Progress *SolvingProgress;
+  ProgressBar *SolvingProgress;
hunk ./src/gui/WindowWidgets.cpp 737
+void ProgressBar::draw(void) {
+  int	progress;	// Size of progress bar...
+  int	bx, by, bw, bh;	// Box areas...
+  int	tx, tw;		// Temporary X + width
+
+
+  // Get the box borders...
+  bx = Fl::box_dx(box());
+  by = Fl::box_dy(box());
+  bw = Fl::box_dw(box());
+  bh = Fl::box_dh(box());
+
+  tx = x() + bx;
+  tw = w() - bw;
+
+  // Draw the progress bar...
+  if (maximum() > minimum())
+    progress = (int)(tw * (value() - minimum()) / (maximum() - minimum()) + 0.5f);
+  else
+    progress = 0;
+
+  // Draw the box...
+
+  if (progress > 0)
+  {
+    fl_clip(x(), y(), progress + bx, h());
+    draw_box(box(), x(), y(), w(), h(), active_r() ? color2() : fl_inactive(color2()));
+    // Finally, the label...
+    labelcolor(color());
+    draw_label(tx, y() + by, tw, h() - bh);
+    fl_pop_clip();
+
+    fl_clip(tx + progress, y(), w() - progress, h());
+    draw_box(box(), x(), y(), w(), h(), active_r() ? color() : fl_inactive(color()));
+    // Finally, the label...
+    labelcolor(color2());
+    draw_label(tx, y() + by, tw, h() - bh);
+    fl_pop_clip();
+  }
+  else {
+    draw_box(box(), x(), y(), w(), h(), color());
+    labelcolor(color2());
+    draw_label(tx, y() + by, tw, h() - bh);
+  }
+}
+
+
hunk ./src/gui/WindowWidgets.h 41
+#include <FL/Fl_Progress.H>
hunk ./src/gui/WindowWidgets.h 425
+
+class ProgressBar : public Fl_Progress {
+  public:
+
+    ProgressBar(int x, int y, int w, int h) : Fl_Progress(x, y, w, h) {}
+
+    void draw(void);
+};
}
