summaryrefslogtreecommitdiff
path: root/FL/Fl_Tree_Item.H
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2015-04-28 19:39:53 +0000
committerGreg Ercolano <erco@seriss.com>2015-04-28 19:39:53 +0000
commit81654d15ebabd1f4f62df70ddb1de05d6860b5a4 (patch)
treed1600be93fcb3457ab8d7e606f05a16b8d2d117f /FL/Fl_Tree_Item.H
parente4f645d60f6cc6197674f913bd52b4032c91aa45 (diff)
Fl_Tree: improved draw() behavior when deactivated;
icons draw deactivated now. test/tree: Added 'deactivate tree' button to test deactivating entire widget. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10723 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Tree_Item.H')
-rw-r--r--FL/Fl_Tree_Item.H20
1 files changed, 20 insertions, 0 deletions
diff --git a/FL/Fl_Tree_Item.H b/FL/Fl_Tree_Item.H
index 23ce1d543..72bf619b0 100644
--- a/FL/Fl_Tree_Item.H
+++ b/FL/Fl_Tree_Item.H
@@ -100,6 +100,9 @@ class FL_EXPORT Fl_Tree_Item {
int _label_xywh[4]; // xywh of label
Fl_Widget *_widget; // item's label widget (optional)
Fl_Image *_usericon; // item's user-specific icon (optional)
+#if FLTK_ABI_VERSION >= 10304
+ Fl_Image *_userdeicon; // deactivated usericon
+#endif
Fl_Tree_Item_Array _children; // array of child items
Fl_Tree_Item *_parent; // parent item (=0 if root)
void *_userdata; // user data that can be associated with an item
@@ -425,12 +428,29 @@ public:
/// Set the item's user icon to an Fl_Image. '0' will disable.
void usericon(Fl_Image *val) {
_usericon = val;
+#if FLTK_ABI_VERSION >= 10304
+ // Update deactivated version of icon..
+ if ( _userdeicon ) delete _userdeicon;
+ if ( _usericon ) {
+ _userdeicon = _usericon->copy();
+ _userdeicon->inactive();
+ } else {
+ _userdeicon = 0;
+ }
+#endif
recalc_tree(); // may change tree geometry
}
/// Get the item's user icon as an Fl_Image. Returns '0' if disabled.
Fl_Image *usericon() const {
return(_usericon);
}
+#if FLTK_ABI_VERSION >= 10304
+ /// Return the deactivated version of the user icon, if any.
+ /// Returns 0 if none.
+ Fl_Image* userdeicon() const {
+ return _userdeicon;
+ }
+#endif
//////////////////
// Events
//////////////////