2 // "$Id: Fl_Tree_Prefs.cxx 8340 2011-01-30 20:22:06Z greg.ercolano $"
6 #include <FL/Fl_Pixmap.H>
7 #include <FL/Fl_Tree_Prefs.H>
10 //////////////////////
12 //////////////////////
14 // Fl_Tree -- This file is part of the Fl_Tree widget for FLTK
15 // Copyright (C) 2009-2010 by Greg Ercolano.
17 // This library is free software; you can redistribute it and/or
18 // modify it under the terms of the GNU Library General Public
19 // License as published by the Free Software Foundation; either
20 // version 2 of the License, or (at your option) any later version.
22 // This library is distributed in the hope that it will be useful,
23 // but WITHOUT ANY WARRANTY; without even the implied warranty of
24 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 // Library General Public License for more details.
27 // You should have received a copy of the GNU Library General Public
28 // License along with this library; if not, write to the Free Software
29 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
33 // INTERNAL: BUILT IN OPEN/STOW XPMS
34 // These can be replaced via prefs.openicon()/closeicon()
36 static const char *L_open_xpm
[] = {
70 static Fl_Pixmap
L_openpixmap(L_open_xpm
);
72 static const char *L_close_xpm
[] = {
106 static Fl_Pixmap
L_closepixmap(L_close_xpm
);
108 /// Sets the default icon to be used as the 'open' icon
109 /// when items are add()ed to the tree.
110 /// This overrides the built in default '[+]' icon.
112 /// \param[in] val -- The new image, or zero to use the default [+] icon.
114 void Fl_Tree_Prefs::openicon(Fl_Image
*val
) {
115 _openimage
= val
? val
: &L_openpixmap
;
118 /// Sets the icon to be used as the 'close' icon.
119 /// This overrides the built in default '[-]' icon.
121 /// \param[in] val -- The new image, or zero to use the default [-] icon.
123 void Fl_Tree_Prefs::closeicon(Fl_Image
*val
) {
124 _closeimage
= val
? val
: &L_closepixmap
;
127 /// Fl_Tree_Prefs constructor
128 Fl_Tree_Prefs::Fl_Tree_Prefs() {
129 _labelfont
= FL_HELVETICA
;
130 _labelsize
= FL_NORMAL_SIZE
;
135 _openchild_marginbottom
= 0;
136 _usericonmarginleft
= 3;
137 _labelmarginleft
= 3;
139 _labelfgcolor
= FL_BLACK
;
140 _labelbgcolor
= FL_WHITE
;
141 _connectorcolor
= Fl_Color(43);
143 _connectorstyle
= FL_TREE_CONNECTOR_NONE
;
145 _connectorstyle
= FL_TREE_CONNECTOR_DOTTED
;
147 _openimage
= &L_openpixmap
;
148 _closeimage
= &L_closepixmap
;
152 _connectorwidth
= 17;
153 _sortorder
= FL_TREE_SORT_NONE
;
154 _selectbox
= FL_FLAT_BOX
;
155 _selectmode
= FL_TREE_SELECT_SINGLE
;
159 // End of "$Id: Fl_Tree_Prefs.cxx 8340 2011-01-30 20:22:06Z greg.ercolano $".