diff options
| author | Greg Ercolano <erco@seriss.com> | 2015-04-28 19:39:53 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2015-04-28 19:39:53 +0000 |
| commit | 81654d15ebabd1f4f62df70ddb1de05d6860b5a4 (patch) | |
| tree | d1600be93fcb3457ab8d7e606f05a16b8d2d117f /FL/Fl_Tree_Prefs.H | |
| parent | e4f645d60f6cc6197674f913bd52b4032c91aa45 (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_Prefs.H')
| -rw-r--r-- | FL/Fl_Tree_Prefs.H | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/FL/Fl_Tree_Prefs.H b/FL/Fl_Tree_Prefs.H index ba6e7b0d0..7c080a310 100644 --- a/FL/Fl_Tree_Prefs.H +++ b/FL/Fl_Tree_Prefs.H @@ -132,6 +132,11 @@ class FL_EXPORT Fl_Tree_Prefs { Fl_Image *_openimage; // the 'open' icon [+] Fl_Image *_closeimage; // the 'close' icon [-] Fl_Image *_userimage; // user's own icon +#if FLTK_ABI_VERSION >= 10304 + Fl_Image *_opendeimage; // deactivated 'open' icon + Fl_Image *_closedeimage; // deactivated 'close' icon + Fl_Image *_userdeimage; // deactivated user icon +#endif char _showcollapse; // 1=show collapse icons, 0=don't char _showroot; // show the root item as part of the tree Fl_Tree_Sort _sortorder; // none, ascening, descending, etc. @@ -147,6 +152,9 @@ class FL_EXPORT Fl_Tree_Prefs { #endif public: Fl_Tree_Prefs(); +#if FLTK_ABI_VERSION >= 10304 + ~Fl_Tree_Prefs(); +#endif //////////////////////////// // Labels @@ -340,7 +348,35 @@ public: /// inline void usericon(Fl_Image *val) { _userimage = val; +#if FLTK_ABI_VERSION >= 10304 + // Update deactivated version of icon.. + if ( _userdeimage ) delete _userdeimage; + if ( _userimage ) { + _userdeimage = _userimage->copy(); + _userdeimage->inactive(); + } else { + _userdeimage = 0; + } +#endif } + +#if FLTK_ABI_VERSION >= 10304 + /// Return the deactivated version of the open icon, if any. + /// Returns 0 if none. + inline Fl_Image *opendeicon() const { + return _opendeimage; + } + /// Return the deactivated version of the close icon, if any. + /// Returns 0 if none. + inline Fl_Image *closedeicon() const { + return _closedeimage; + } + /// Return the deactivated version of the user icon, if any. + /// Returns 0 if none. + inline Fl_Image *userdeicon() const { + return _userdeimage; + } +#endif //////////////////////////// // Options |
