FLTK 1.3.0
Fl_Tree_Prefs.H
Go to the documentation of this file.
1 //
2 // "$Id: Fl_Tree_Prefs.H 8340 2011-01-30 20:22:06Z greg.ercolano $"
3 //
4 
5 #ifndef FL_TREE_PREFS_H
6 #define FL_TREE_PREFS_H
7 
9 // FL/Fl_Tree_Prefs.H
11 //
12 // Fl_Tree -- This file is part of the Fl_Tree widget for FLTK
13 // Copyright (C) 2009-2010 by Greg Ercolano.
14 //
15 // This library is free software; you can redistribute it and/or
16 // modify it under the terms of the GNU Library General Public
17 // License as published by the Free Software Foundation; either
18 // version 2 of the License, or (at your option) any later version.
19 //
20 // This library is distributed in the hope that it will be useful,
21 // but WITHOUT ANY WARRANTY; without even the implied warranty of
22 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 // Library General Public License for more details.
24 //
25 // You should have received a copy of the GNU Library General Public
26 // License along with this library; if not, write to the Free Software
27 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
28 // USA.
29 //
30 
45 
48 
56 };
57 
65 };
66 
74 };
76 
85 class FL_EXPORT Fl_Tree_Prefs {
86  Fl_Font _labelfont; // label's font face
87  Fl_Fontsize _labelsize; // label's font size
88  int _margintop; // --
89  int _marginleft; // |- tree's margins
90  //int _marginright; // |
91  //int _marginbottom; // --
92  int _openchild_marginbottom; // extra space below an open child tree
93  int _usericonmarginleft; // space to left of user icon (if any)
94  int _labelmarginleft; // space to left of label
95  int _connectorwidth; // connector width (right of open/close icon)
96  int _linespacing; // vertical space between lines
97  // Colors
98  Fl_Color _labelfgcolor; // label's foreground color
99  Fl_Color _labelbgcolor; // background color
100  Fl_Color _connectorcolor; // connector dotted line color
101  Fl_Tree_Connector _connectorstyle; // connector line style
102  Fl_Image *_openimage; // the 'open' icon [+]
103  Fl_Image *_closeimage; // the 'close' icon [-]
104  Fl_Image *_userimage; // user's own icon
105  char _showcollapse; // 1=show collapse icons, 0=don't
106  char _showroot; // show the root item as part of the tree
107  Fl_Tree_Sort _sortorder; // none, ascening, descending, etc.
108  Fl_Boxtype _selectbox; // selection box type
109  Fl_Tree_Select _selectmode; // selection mode
110 public:
111  Fl_Tree_Prefs();
112 
114  // Labels
117  inline Fl_Font labelfont() const {
118  return(_labelfont);
119  }
121  inline void labelfont(Fl_Font val) {
122  _labelfont = val;
123  }
125  inline Fl_Fontsize labelsize() const {
126  return(_labelsize);
127  }
129  inline void labelsize(Fl_Fontsize val) {
130  _labelsize = val;
131  }
132 
134  // Margins
137  inline int marginleft() const {
138  return(_marginleft);
139  }
141  inline void marginleft(int val) {
142  _marginleft = val;
143  }
145  inline int margintop() const {
146  return(_margintop);
147  }
149  inline void margintop(int val) {
150  _margintop = val;
151  }
153  inline int openchild_marginbottom() const {
154  return(_openchild_marginbottom);
155  }
157  inline void openchild_marginbottom(int val) {
158  _openchild_marginbottom = val;
159  }
160 
161  /****** NOT IMPLEMENTED
162  inline int marginright() const {
163  return(_marginright);
164  }
165  inline void marginright(int val) {
166  _marginright = val;
167  }
168  inline int marginbottom() const {
169  return(_marginbottom);
170  }
171  inline void marginbottom(int val) {
172  _marginbottom = val;
173  }
174  *******/
175 
177  inline int usericonmarginleft() const {
178  return(_usericonmarginleft);
179  }
181  inline void usericonmarginleft(int val) {
182  _usericonmarginleft = val;
183  }
185  inline int labelmarginleft() const {
186  return(_labelmarginleft);
187  }
189  inline void labelmarginleft(int val) {
190  _labelmarginleft = val;
191  }
193  inline int linespacing() const {
194  return(_linespacing);
195  }
197  inline void linespacing(int val) {
198  _linespacing = val;
199  }
200 
202  // Colors and Styles
205  inline Fl_Color labelfgcolor() const {
206  return(_labelfgcolor);
207  }
209  inline void labelfgcolor(Fl_Color val) {
210  _labelfgcolor = val;
211  }
213  inline Fl_Color labelbgcolor() const {
214  return(_labelbgcolor);
215  }
217  inline void labelbgcolor(Fl_Color val) {
218  _labelbgcolor = val;
219  }
221  inline Fl_Color connectorcolor() const {
222  return(_connectorcolor);
223  }
225  inline void connectorcolor(Fl_Color val) {
226  _connectorcolor = val;
227  }
230  return(_connectorstyle);
231  }
234  _connectorstyle = val;
235  }
237  inline void connectorstyle(int val) {
238  _connectorstyle = Fl_Tree_Connector(val);
239  }
241  inline int connectorwidth() const {
242  return(_connectorwidth);
243  }
245  inline void connectorwidth(int val) {
246  _connectorwidth = val;
247  }
248 
250  // Icons
255  inline Fl_Image *openicon() const {
256  return(_openimage);
257  }
258  void openicon(Fl_Image *val);
262  inline Fl_Image *closeicon() const {
263  return(_closeimage);
264  }
265  void closeicon(Fl_Image *val);
267  inline Fl_Image *usericon() const {
268  return(_userimage);
269  }
273  inline void usericon(Fl_Image *val) {
274  _userimage = val;
275  }
276 
278  // Options
281  inline char showcollapse() const {
282  return(_showcollapse);
283  }
292  inline void showcollapse(int val) {
293  _showcollapse = val;
294  }
296  inline Fl_Tree_Sort sortorder() const {
297  return(_sortorder);
298  }
303  inline void sortorder(Fl_Tree_Sort val) {
304  _sortorder = val;
305  }
307  inline Fl_Boxtype selectbox() const {
308  return(_selectbox);
309  }
311  inline void selectbox(Fl_Boxtype val) {
312  _selectbox = val;
313  }
315  inline int showroot() const {
316  return(int(_showroot));
317  }
322  inline void showroot(int val) {
323  _showroot = char(val);
324  }
326  inline Fl_Tree_Select selectmode() const {
327  return(_selectmode);
328  }
334  inline void selectmode(Fl_Tree_Select val) {
335  _selectmode = val;
336  }
337 };
338 
339 #endif /*FL_TREE_PREFS_H*/
340 
341 //
342 // End of "$Id: Fl_Tree_Prefs.H 8340 2011-01-30 20:22:06Z greg.ercolano $".
343 //