mirror of
https://github.com/fltk/fltk.git
synced 2026-06-04 15:32:12 +08:00
Complete fix for STR #3503 (Fl_Choice).
Fl_Choice::handle() needs to be fixed as well.
This commit is contained in:
@@ -173,6 +173,7 @@ int Fl_Choice::value(int v) {
|
|||||||
int Fl_Choice::handle(int e) {
|
int Fl_Choice::handle(int e) {
|
||||||
if (!menu() || !menu()->text) return 0;
|
if (!menu() || !menu()->text) return 0;
|
||||||
const Fl_Menu_Item* v;
|
const Fl_Menu_Item* v;
|
||||||
|
Fl_Widget_Tracker wp(this);
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case FL_ENTER:
|
case FL_ENTER:
|
||||||
case FL_LEAVE:
|
case FL_LEAVE:
|
||||||
@@ -187,12 +188,14 @@ int Fl_Choice::handle(int e) {
|
|||||||
if (Fl::scheme()
|
if (Fl::scheme()
|
||||||
|| fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) != textcolor()) {
|
|| fl_contrast(textcolor(), FL_BACKGROUND2_COLOR) != textcolor()) {
|
||||||
v = menu()->pulldown(x(), y(), w(), h(), mvalue(), this);
|
v = menu()->pulldown(x(), y(), w(), h(), mvalue(), this);
|
||||||
|
if (wp.deleted()) return 1;
|
||||||
} else {
|
} else {
|
||||||
// In order to preserve the old look-n-feel of "white" menus,
|
// In order to preserve the old look-n-feel of "white" menus,
|
||||||
// temporarily override the color() of this widget...
|
// temporarily override the color() of this widget...
|
||||||
Fl_Color c = color();
|
Fl_Color c = color();
|
||||||
color(FL_BACKGROUND2_COLOR);
|
color(FL_BACKGROUND2_COLOR);
|
||||||
v = menu()->pulldown(x(), y(), w(), h(), mvalue(), this);
|
v = menu()->pulldown(x(), y(), w(), h(), mvalue(), this);
|
||||||
|
if (wp.deleted()) return 1;
|
||||||
color(c);
|
color(c);
|
||||||
}
|
}
|
||||||
if (!v || v->submenu()) return 1;
|
if (!v || v->submenu()) return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user