|
|
// must do shortcuts first or the scrollbar
will get them...
if (event == FL_ENTER || event == FL_LEAVE) return
1;
if (event == FL_KEYBOARD && type()
>= FL_HOLD_BROWSER) {
void* l1 = selection_;
void* l = l1; if (!l) l = top_; if (!l) l =
item_first();
if (l) {
if (type()==FL_HOLD_BROWSER) {
switch (Fl::event_key()) {
case FL_Down:
while ((l = item_next(l))) {
if (item_height(l)>0) {select_only(l,
when()); break;}
}
return 1;
case FL_Up:
while ((l = item_prev(l))) {
if (item_height(l)>0) {
select_only(l, when());
break; // no need to test wp (return 1)
}
}
return 1;
}
} else {
switch (Fl::event_key()) {
case FL_Enter:
case FL_KP_Enter:
select_only(l, when() &
~FL_WHEN_ENTER_KEY);
if (wp.deleted()) return 1;
if (when() & FL_WHEN_ENTER_KEY) {
set_changed();
do_callback();
}
The line "if (event == FL_ENTER || event ==
FL_LEAVE) return 1;
prohibits the execution of the later
do_callback when FL_WHEN_ENTER_KEY
This prevents using the FL_Enter key in a
user callback.
David
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/a98687dc-d139-4bff-e5e6-19e4d17eab59%40bellsouth.net.
[ Direct Link to Message ] | |
|
| |