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
This commit is contained in:
Greg Ercolano 2012-04-22 14:21:08 +00:00
parent 67ea785bfd
commit 2ae607e8ba
5 changed files with 12 additions and 6 deletions

View File

@ -312,8 +312,10 @@ public:
void usericonmarginleft(int val); void usericonmarginleft(int val);
int labelmarginleft() const; int labelmarginleft() const;
void labelmarginleft(int val); void labelmarginleft(int val);
#if FLTK_ABI_VERSION >= 10302
int widgetmarginleft() const; int widgetmarginleft() const;
void widgetmarginleft(int val); void widgetmarginleft(int val);
#endif
int connectorwidth() const; int connectorwidth() const;
void connectorwidth(int val); void connectorwidth(int val);
Fl_Image* usericon() const; Fl_Image* usericon() const;

View File

@ -86,7 +86,7 @@ public:
int y() const { return(_xywh[1]); } int y() const { return(_xywh[1]); }
int w() const { return(_xywh[2]); } int w() const { return(_xywh[2]); }
int h() const { return(_xywh[3]); } 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 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 show_self(const char *indent = "") const;
void label(const char *val); void label(const char *val);

View File

@ -5,6 +5,8 @@
#ifndef FL_TREE_PREFS_H #ifndef FL_TREE_PREFS_H
#define FL_TREE_PREFS_H #define FL_TREE_PREFS_H
#include <FL/Fl.H> // needed for ABI version features (via Enumerations.H)
////////////////////// //////////////////////
// FL/Fl_Tree_Prefs.H // FL/Fl_Tree_Prefs.H
////////////////////// //////////////////////
@ -70,16 +72,16 @@ enum Fl_Tree_Select {
}; };
#if FLTK_ABI_VERSION >= 10302 #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. /// Defines the ways an item can be (re) selected.
/// ///
enum Fl_Tree_Item_Reselect_Mode { enum Fl_Tree_Item_Reselect_Mode {
FL_TREE_SELECTABLE_ONCE=0, ///< item can only be selected once (default) 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 /// \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 { enum Fl_Tree_Item_Draw_Mode {
FL_TREE_ITEM_DRAW_WIDGET_ONLY=0, ///< if widget() defined, draw it in place of the label (default) FL_TREE_ITEM_DRAW_WIDGET_ONLY=0, ///< if widget() defined, draw it in place of the label (default)

View File

@ -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_OPENED: ..item was opened..
/// case FL_TREE_REASON_CLOSED: ..item was closed.. /// case FL_TREE_REASON_CLOSED: ..item was closed..
/// case FL_TREE_REASON_SELECTED: ..item was selected.. /// 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.. /// case FL_TREE_REASON_DESELECTED: ..item was deselected..
/// } /// }
/// } /// }
/// \endcode /// \endcode
/// ///
/// \see item_reselect_mode() -- enables FL_TREE_REASON_RESELECTED events
///
Fl_Tree_Reason Fl_Tree::callback_reason() const { Fl_Tree_Reason Fl_Tree::callback_reason() const {
return(_callback_reason); return(_callback_reason);
} }

View File

@ -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 /// 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); if ( ! _visible ) return(0);
int H = 0; int H = 0;
if ( _label ) { if ( _label ) {