Author: greg.ercolano
Date: 2012-04-30 14:22:57 -0700 (Mon, 30 Apr 2012)
New Revision: 9413
Log:
Fixes focus issues:
o Nav keys were being used even if widget didn't have focus
o When Fl_Input was used as immediate child, wasn't redrawing properly
when typing into input fields. (noticed problem with test program in
STR# 2832)
Modified:
branches/branch-1.3/src/Fl_Tree.cxx
branches/branch-1.3/src/Fl_Tree_Item.cxx
Modified: branches/branch-1.3/src/Fl_Tree.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Tree.cxx 2012-04-30 19:25:46 UTC (rev 9412)
+++ branches/branch-1.3/src/Fl_Tree.cxx 2012-04-30 21:22:57 UTC (rev 9413)
@@ -193,7 +193,8 @@
}
case FL_KEYBOARD: { // keyboard shortcut
// Do shortcuts first or scrollbar will get them...
- if (_prefs.selectmode() > FL_TREE_SELECT_NONE ) {
+ if ( (Fl::focus() == this) && // tree has
focus?
+ _prefs.selectmode() > FL_TREE_SELECT_NONE ) { // select mode
that supports kb events?
if ( !_item_focus ) {
set_item_focus(first());
}
Modified: branches/branch-1.3/src/Fl_Tree_Item.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Tree_Item.cxx 2012-04-30 19:25:46 UTC (rev
9412)
+++ branches/branch-1.3/src/Fl_Tree_Item.cxx 2012-04-30 21:22:57 UTC (rev
9413)
@@ -729,10 +729,11 @@
#if FLTK_ABI_VERSION >= 10302
if ( _label &&
( !widget() ||
- (prefs.item_draw_mode() & FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET) )
) {
+ (prefs.item_draw_mode() & FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET) ) )
#else
- if ( _label && !widget() ) { // back compat: don't draw label if
widget() present
+ if ( _label && !widget() ) // back compat: don't draw label if
widget() present
#endif
+ {
fl_color(fg);
fl_font(_labelfont, _labelsize);
int label_y = Y+(H/2)+(_labelsize/2)-fl_descent()/2;
@@ -740,9 +741,8 @@
}
} // end non-child damage
// Draw child FLTK widget?
- if ( widget() && widget()->damage() ) {
- widget()->draw();
- ((Fl_Tree*)tree)->draw_outside_label(*widget());
+ if ( widget() ) {
+ ((Fl_Tree*)tree)->update_child(*widget()); // let group handle
drawing child
}
// Draw focus box around item's bg last
if ( this == itemfocus &&
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit