From 2ae607e8bafc7561f42f642ee0479221e917ef5a Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Sun, 22 Apr 2012 14:21:08 +0000 Subject: [PATCH] o doc fixes o new calc_item_height() -> const o Added a needed ABI ifdef git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9380 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Tree.H | 2 ++ FL/Fl_Tree_Item.H | 2 +- FL/Fl_Tree_Prefs.H | 8 +++++--- src/Fl_Tree.cxx | 4 +++- src/Fl_Tree_Item.cxx | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H index 1b8dbd758..453841007 100644 --- a/FL/Fl_Tree.H +++ b/FL/Fl_Tree.H @@ -312,8 +312,10 @@ public: void usericonmarginleft(int val); int labelmarginleft() const; void labelmarginleft(int val); +#if FLTK_ABI_VERSION >= 10302 int widgetmarginleft() const; void widgetmarginleft(int val); +#endif int connectorwidth() const; void connectorwidth(int val); Fl_Image* usericon() const; diff --git a/FL/Fl_Tree_Item.H b/FL/Fl_Tree_Item.H index 9b7a7d56b..ff6e5c50a 100644 --- a/FL/Fl_Tree_Item.H +++ b/FL/Fl_Tree_Item.H @@ -86,7 +86,7 @@ public: int y() const { return(_xywh[1]); } int w() const { return(_xywh[2]); } int h() const { return(_xywh[3]); } - int calc_item_height(const Fl_Tree_Prefs &prefs); + int calc_item_height(const Fl_Tree_Prefs &prefs) const; void draw(int X, int &Y, int W, Fl_Widget *tree, Fl_Tree_Item *itemfocus, const Fl_Tree_Prefs &prefs, int lastchild=1); void show_self(const char *indent = "") const; void label(const char *val); diff --git a/FL/Fl_Tree_Prefs.H b/FL/Fl_Tree_Prefs.H index 58eed4044..f396b80ce 100644 --- a/FL/Fl_Tree_Prefs.H +++ b/FL/Fl_Tree_Prefs.H @@ -5,6 +5,8 @@ #ifndef FL_TREE_PREFS_H #define FL_TREE_PREFS_H +#include // needed for ABI version features (via Enumerations.H) + ////////////////////// // FL/Fl_Tree_Prefs.H ////////////////////// @@ -70,16 +72,16 @@ enum Fl_Tree_Select { }; #if FLTK_ABI_VERSION >= 10302 -/// \enum Fl_Tree_Item_Select_Mode +/// \enum Fl_Tree_Item_Reselect_Mode /// Defines the ways an item can be (re) selected. /// enum Fl_Tree_Item_Reselect_Mode { FL_TREE_SELECTABLE_ONCE=0, ///< item can only be selected once (default) - FL_TREE_SELECTABLE_ALWAYS, ///< needed for new RESELECT feature + FL_TREE_SELECTABLE_ALWAYS, ///< enables FL_TREE_REASON_RESELECTED events for callbacks }; /// \enum Fl_Tree_Item_Draw_Mode -/// Tree display style for items. +/// Controls how item's labels and widget()s are drawn in the tree. /// enum Fl_Tree_Item_Draw_Mode { FL_TREE_ITEM_DRAW_WIDGET_ONLY=0, ///< if widget() defined, draw it in place of the label (default) diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx index 8769578cc..72770f03f 100644 --- a/src/Fl_Tree.cxx +++ b/src/Fl_Tree.cxx @@ -1857,12 +1857,14 @@ void Fl_Tree::callback_reason(Fl_Tree_Reason reason) { /// case FL_TREE_REASON_OPENED: ..item was opened.. /// case FL_TREE_REASON_CLOSED: ..item was closed.. /// case FL_TREE_REASON_SELECTED: ..item was selected.. -/// case FL_TREE_REASON_RELECTED: ..item was reselected (double-clicked, etc).. +/// case FL_TREE_REASON_RESELECTED: ..item was reselected (double-clicked, etc).. /// case FL_TREE_REASON_DESELECTED: ..item was deselected.. /// } /// } /// \endcode /// +/// \see item_reselect_mode() -- enables FL_TREE_REASON_RESELECTED events +/// Fl_Tree_Reason Fl_Tree::callback_reason() const { return(_callback_reason); } diff --git a/src/Fl_Tree_Item.cxx b/src/Fl_Tree_Item.cxx index ea91092fb..f4293f8da 100644 --- a/src/Fl_Tree_Item.cxx +++ b/src/Fl_Tree_Item.cxx @@ -558,7 +558,7 @@ static void draw_item_focus(Fl_Boxtype B, Fl_Color C, int X, int Y, int W, int H } /// Return the item's 'visible' height -int Fl_Tree_Item::calc_item_height(const Fl_Tree_Prefs &prefs) { +int Fl_Tree_Item::calc_item_height(const Fl_Tree_Prefs &prefs) const { if ( ! _visible ) return(0); int H = 0; if ( _label ) {