summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2006-01-15 02:21:19 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2006-01-15 02:21:19 +0000
commit2b293afe37ccf6a9698487ce676cf9fc5f8d6337 (patch)
tree6f4b869337dc1bd54ad7e0c13526030d27b9cf68 /src
parent31700097b32494693a818941932c354c21e6da84 (diff)
Pressing a Fl_Menu_Button widget now draws it pressed in (STR
#1140) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4746 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Menu_Button.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Fl_Menu_Button.cxx b/src/Fl_Menu_Button.cxx
index 9b06f5895..c90ed9c9d 100644
--- a/src/Fl_Menu_Button.cxx
+++ b/src/Fl_Menu_Button.cxx
@@ -29,9 +29,12 @@
#include <FL/Fl_Menu_Button.H>
#include <FL/fl_draw.H>
+
+static Fl_Menu_Button *pressed_menu_button_ = 0;
+
void Fl_Menu_Button::draw() {
if (!box() || type()) return;
- draw_box(box(), color());
+ draw_box(pressed_menu_button_ == this ? fl_down(box()) : box(), color());
draw_label();
if (Fl::focus() == this) draw_focus();
if (box() == FL_FLAT_BOX) return; // for XForms compatability
@@ -46,12 +49,16 @@ void Fl_Menu_Button::draw() {
const Fl_Menu_Item* Fl_Menu_Button::popup() {
const Fl_Menu_Item* m;
+ pressed_menu_button_ = this;
+ redraw();
if (!box() || type()) {
m = menu()->popup(Fl::event_x(), Fl::event_y(), label(), mvalue(), this);
} else {
m = menu()->pulldown(x(), y(), w(), h(), 0, this);
}
picked(m);
+ pressed_menu_button_ = 0;
+ redraw();
return m;
}