Fl_Tree_Prefs.H
Go to the documentation of this file.
//
// "$Id: Fl_Tree_Prefs.H 9706 2012-11-06 20:46:14Z matt $"
//
#ifndef 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_Tree -- This file is part of the Fl_Tree widget for FLTK
// Copyright (C) 2009-2010 by Greg Ercolano.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
// http://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
enum Fl_Tree_Sort {
FL_TREE_SORT_NONE=0,
FL_TREE_SORT_ASCENDING=1,
FL_TREE_SORT_DESCENDING=2
};
enum Fl_Tree_Connector {
FL_TREE_CONNECTOR_NONE=0,
FL_TREE_CONNECTOR_DOTTED=1,
FL_TREE_CONNECTOR_SOLID=2
};
enum Fl_Tree_Select {
FL_TREE_SELECT_NONE=0,
FL_TREE_SELECT_SINGLE=1,
FL_TREE_SELECT_MULTI=2
};
#if FLTK_ABI_VERSION >= 10301
enum Fl_Tree_Item_Reselect_Mode {
FL_TREE_SELECTABLE_ONCE=0,
FL_TREE_SELECTABLE_ALWAYS,
};
enum Fl_Tree_Item_Draw_Mode {
FL_TREE_ITEM_DRAW_DEFAULT=0,
FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET=1,
FL_TREE_ITEM_HEIGHT_FROM_WIDGET=2
};
#endif /*FLTK_ABI_VERSION*/
class FL_EXPORT Fl_Tree_Prefs {
Fl_Font _labelfont; // label's font face
Fl_Fontsize _labelsize; // label's font size
int _margintop; // --
int _marginleft; // |- tree's controllable margins
#if FLTK_ABI_VERSION >= 10301
int _marginbottom; // --
#endif
int _openchild_marginbottom; // extra space below an open child tree
int _usericonmarginleft; // space to left of user icon (if any)
int _labelmarginleft; // space to left of label
#if FLTK_ABI_VERSION >= 10301
int _widgetmarginleft; // space to left of widget
#endif
int _connectorwidth; // connector width (right of open/close icon)
int _linespacing; // vertical space between lines
// Colors
Fl_Color _labelfgcolor; // label's foreground color
Fl_Color _labelbgcolor; // label's background color
Fl_Color _connectorcolor; // connector dotted line color
Fl_Tree_Connector _connectorstyle; // connector line style
Fl_Image *_openimage; // the 'open' icon [+]
Fl_Image *_closeimage; // the 'close' icon [-]
Fl_Image *_userimage; // user's own icon
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.
Fl_Boxtype _selectbox; // selection box type
Fl_Tree_Select _selectmode; // selection mode
#if FLTK_ABI_VERSION >= 10301
Fl_Tree_Item_Reselect_Mode _itemreselectmode; // controls item selection callback() behavior
Fl_Tree_Item_Draw_Mode _itemdrawmode; // controls how items draw label + widget()
#endif /*FLTK_ABI_VERSION*/
public:
Fl_Tree_Prefs();
// Labels
inline Fl_Font item_labelfont() const { return(_labelfont); }
inline void item_labelfont(Fl_Font val) { _labelfont = val; }
inline Fl_Fontsize item_labelsize() const { return(_labelsize); }
inline void item_labelsize(Fl_Fontsize val) { _labelsize = val; }
inline Fl_Color item_labelfgcolor() const { return(_labelfgcolor); }
inline void item_labelfgcolor(Fl_Color val) { _labelfgcolor = val; }
#if FLTK_ABI_VERSION >= 10301
inline Fl_Color item_labelbgcolor() const {
return _labelbgcolor;
}
inline void item_labelbgcolor(Fl_Color val) {
_labelbgcolor = val;
}
#else /*FLTK_ABI_VERSION*/
inline Fl_Color item_labelbgcolor() const {
return(_labelbgcolor);
}
inline void item_labelbgcolor(Fl_Color val) {
_labelbgcolor = val;
}
#endif /*FLTK_ABI_VERSION*/
// Obsolete names - for 1.3.0 backwards compat
inline Fl_Font labelfont() const { return(_labelfont); }
inline void labelfont(Fl_Font val) { _labelfont = val; }
inline Fl_Fontsize labelsize() const { return(_labelsize); }
inline void labelsize(Fl_Fontsize val) { _labelsize = val; }
inline Fl_Color labelfgcolor() const { return(_labelfgcolor); }
inline void labelfgcolor(Fl_Color val) { _labelfgcolor = val; }
inline Fl_Color labelbgcolor() const { return(item_labelbgcolor()); }
inline void labelbgcolor(Fl_Color val) { item_labelbgcolor(val); }
// Margins
inline int marginleft() const {
return(_marginleft);
}
inline void marginleft(int val) {
_marginleft = val;
}
inline int margintop() const {
return(_margintop);
}
inline void margintop(int val) {
_margintop = val;
}
#if FLTK_ABI_VERSION >= 10301
inline int marginbottom() const {
return(_marginbottom);
}
inline void marginbottom(int val) {
_marginbottom = val;
}
#endif /*FLTK_ABI_VERSION*/
inline int openchild_marginbottom() const {
return(_openchild_marginbottom);
}
inline void openchild_marginbottom(int val) {
_openchild_marginbottom = val;
}
inline int usericonmarginleft() const {
return(_usericonmarginleft);
}
inline void usericonmarginleft(int val) {
_usericonmarginleft = val;
}
inline int labelmarginleft() const {
return(_labelmarginleft);
}
inline void labelmarginleft(int val) {
_labelmarginleft = val;
}
#if FLTK_ABI_VERSION >= 10301
inline int widgetmarginleft() const {
return(_widgetmarginleft);
}
inline void widgetmarginleft(int val) {
_widgetmarginleft = val;
}
#endif /*FLTK_ABI_VERSION*/
inline int linespacing() const {
return(_linespacing);
}
inline void linespacing(int val) {
_linespacing = val;
}
// Colors and Styles
inline Fl_Color connectorcolor() const {
return(_connectorcolor);
}
inline void connectorcolor(Fl_Color val) {
_connectorcolor = val;
}
inline Fl_Tree_Connector connectorstyle() const {
return(_connectorstyle);
}
inline void connectorstyle(Fl_Tree_Connector val) {
_connectorstyle = val;
}
inline void connectorstyle(int val) {
_connectorstyle = Fl_Tree_Connector(val);
}
inline int connectorwidth() const {
return(_connectorwidth);
}
inline void connectorwidth(int val) {
_connectorwidth = val;
}
// Icons
inline Fl_Image *openicon() const {
return(_openimage);
}
void openicon(Fl_Image *val);
inline Fl_Image *closeicon() const {
return(_closeimage);
}
void closeicon(Fl_Image *val);
inline Fl_Image *usericon() const {
return(_userimage);
}
inline void usericon(Fl_Image *val) {
_userimage = val;
}
// Options
inline char showcollapse() const {
return(_showcollapse);
}
inline void showcollapse(int val) {
_showcollapse = val;
}
inline Fl_Tree_Sort sortorder() const {
return(_sortorder);
}
inline void sortorder(Fl_Tree_Sort val) {
_sortorder = val;
}
inline Fl_Boxtype selectbox() const {
return(_selectbox);
}
inline void selectbox(Fl_Boxtype val) {
_selectbox = val;
}
inline int showroot() const {
return(int(_showroot));
}
inline void showroot(int val) {
_showroot = char(val);
}
inline Fl_Tree_Select selectmode() const {
return(_selectmode);
}
inline void selectmode(Fl_Tree_Select val) {
_selectmode = val;
}
#if FLTK_ABI_VERSION >= 10301
Fl_Tree_Item_Reselect_Mode item_reselect_mode() const {
return _itemreselectmode;
}
void item_reselect_mode(Fl_Tree_Item_Reselect_Mode mode) {
_itemreselectmode = mode;
}
inline Fl_Tree_Item_Draw_Mode item_draw_mode() const {
return(_itemdrawmode);
}
inline void item_draw_mode(Fl_Tree_Item_Draw_Mode val) {
_itemdrawmode = val;
}
#endif /*FLTK_ABI_VERSION*/
};
#endif /*FL_TREE_PREFS_H*/
//
// End of "$Id: Fl_Tree_Prefs.H 9706 2012-11-06 20:46:14Z matt $".
//
- © 1998-2012 by Bill Spitzak and others.