diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-04 15:59:29 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-04 15:59:29 +0000 |
| commit | 8d552439c716ae15e1f392ca88f3bdebf85ae607 (patch) | |
| tree | ee1fc316f147e6c104c3ce832d68e155beb6c8f1 /src | |
| parent | 3a0dd9fe2342f500e28cb896b1ff29993606e606 (diff) | |
New Fl_Widget::redraw_label() method to cleanly redraw the label of a
widget (this should eliminate the extra flicker some users have complained
about...)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl.cxx | 11 | ||||
| -rw-r--r-- | src/Fl_Widget.cxx | 7 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index aa01b3251..ae635ba53 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl.cxx,v 1.24.2.41.2.53 2002/09/20 17:56:56 easysw Exp $" +// "$Id: Fl.cxx,v 1.24.2.41.2.54 2002/10/04 15:59:28 easysw Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -855,7 +855,9 @@ void Fl::paste(Fl_Widget &receiver) { void Fl_Widget::redraw() { damage(FL_DAMAGE_ALL); +} +void Fl_Widget::redraw_label() { if (window()) { if (box() == FL_NO_BOX) { // Widgets with the FL_NO_BOX boxtype need a parent to @@ -880,7 +882,12 @@ void Fl_Widget::redraw() { window()->damage(FL_DAMAGE_EXPOSE, x() - W, y(), W, h()); } else if (align() & FL_ALIGN_RIGHT) { window()->damage(FL_DAMAGE_EXPOSE, x() + w(), y(), W, h()); + } else { + damage(FL_DAMAGE_ALL); } + } else { + // The label is inside the widget, so just redraw the widget itself... + damage(FL_DAMAGE_ALL); } } } @@ -960,5 +967,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl.cxx,v 1.24.2.41.2.53 2002/09/20 17:56:56 easysw Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.41.2.54 2002/10/04 15:59:28 easysw Exp $". // diff --git a/src/Fl_Widget.cxx b/src/Fl_Widget.cxx index 7d396eac7..b237adb10 100644 --- a/src/Fl_Widget.cxx +++ b/src/Fl_Widget.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.19 2002/07/23 15:07:33 easysw Exp $" +// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.20 2002/10/04 15:59:29 easysw Exp $" // // Base widget class for the Fast Light Tool Kit (FLTK). // @@ -182,6 +182,7 @@ void Fl_Widget::activate() { clear_flag(INACTIVE); if (active_r()) { redraw(); + redraw_label(); handle(FL_ACTIVATE); if (inside(Fl::focus())) Fl::focus()->take_focus(); } @@ -192,6 +193,7 @@ void Fl_Widget::deactivate() { if (active_r()) { set_flag(INACTIVE); redraw(); + redraw_label(); handle(FL_DEACTIVATE); fl_throw_focus(this); } else { @@ -210,6 +212,7 @@ void Fl_Widget::show() { clear_flag(INVISIBLE); if (visible_r()) { redraw(); + redraw_label(); handle(FL_SHOW); if (inside(Fl::focus())) Fl::focus()->take_focus(); } @@ -242,5 +245,5 @@ int Fl_Widget::contains(const Fl_Widget *o) const { } // -// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.19 2002/07/23 15:07:33 easysw Exp $". +// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.20 2002/10/04 15:59:29 easysw Exp $". // |
