Complete rewriting of Fl_Tree_Prefs.cxx under the driver model.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11606 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-04-14 20:58:20 +00:00
parent 0e0ad95b22
commit 03e87bb270
3 changed files with 12 additions and 5 deletions

View File

@ -189,6 +189,8 @@ public:
virtual Fl_Pixmap *tree_closepixmap();
static const char *const tree_open_xpm[]; // used by tree_openpixmap()
static const char * const tree_close_xpm[]; // used by tree_closepixmap()
// the default implementation of tree_connector_style() is in Fl_Tree_Prefs.cxx and can be enough
virtual int tree_connector_style();
};
#endif // FL_SYSTEM_DRIVER_H

View File

@ -81,6 +81,10 @@ Fl_Pixmap *Fl_Darwin_System_Driver::tree_closepixmap() {
return pixmap;
}
int Fl_Darwin_System_Driver::tree_connector_style() {
return FL_TREE_CONNECTOR_NONE;
}
#endif // FL_CFG_WIN_COCOA
const char * const Fl_System_Driver::tree_open_xpm[] = {
@ -130,6 +134,10 @@ Fl_Pixmap *Fl_System_Driver::tree_closepixmap() {
return pixmap;
}
int Fl_System_Driver::tree_connector_style() {
return FL_TREE_CONNECTOR_DOTTED;
}
/// Sets the default icon to be used as the 'open' icon
/// when items are add()ed to the tree.
@ -181,11 +189,7 @@ Fl_Tree_Prefs::Fl_Tree_Prefs() {
_labelfgcolor = FL_BLACK;
_labelbgcolor = 0xffffffff; // we use this as 'transparent'
_connectorcolor = Fl_Color(43);
#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform look and feel
_connectorstyle = FL_TREE_CONNECTOR_NONE;
#else /* __APPLE__ */
_connectorstyle = FL_TREE_CONNECTOR_DOTTED;
#endif /* __APPLE__ */
_connectorstyle = (Fl_Tree_Connector)Fl::system_driver()->tree_connector_style();
_openimage = Fl::system_driver()->tree_openpixmap();
_closeimage = Fl::system_driver()->tree_closepixmap();
_userimage = 0;

View File

@ -67,6 +67,7 @@ public:
static const char * const tree_open_xpm_darwin[]; // used by tree_openpixmap()
virtual Fl_Pixmap *tree_closepixmap();
static const char * const tree_close_xpm_darwin[]; // used by tree_closepixmap()
virtual int tree_connector_style();
};
#endif // FL_DARWIN_SYSTEM_DRIVER_H