use platform-specific styles in xTR_DEFAULT_STYLE but don't impose them forcefully in wxGenericTreeCtrl ctor as this prevents people from using them even if they explicitly want to do it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -175,8 +175,13 @@ enum wxTreeItemIcon
|
||||
|
||||
#define wxTR_FULL_ROW_HIGHLIGHT 0x2000 // highlight full horz space
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
// make the default control appearance look more native-like depending on the
|
||||
// platform
|
||||
#if defined(__WXGTK20__)
|
||||
#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_NO_LINES)
|
||||
#elif defined(__WXMAC__)
|
||||
#define wxTR_DEFAULT_STYLE \
|
||||
(wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxTR_FULL_ROW_HIGHLIGHT)
|
||||
#else
|
||||
#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT)
|
||||
#endif
|
||||
|
@@ -805,18 +805,9 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
|
||||
int major, minor;
|
||||
wxGetOsVersion(&major, &minor);
|
||||
|
||||
style &= ~wxTR_LINES_AT_ROOT;
|
||||
style |= wxTR_NO_LINES;
|
||||
if (major < 10)
|
||||
style |= wxTR_ROW_LINES;
|
||||
|
||||
if (style == 0 || style & wxTR_DEFAULT_STYLE)
|
||||
style |= wxTR_FULL_ROW_HIGHLIGHT;
|
||||
|
||||
#endif // __WXMAC__
|
||||
#ifdef __WXGTK20__
|
||||
style |= wxTR_NO_LINES;
|
||||
#endif
|
||||
|
||||
if ( !wxControl::Create( parent, id, pos, size,
|
||||
style|wxHSCROLL|wxVSCROLL,
|
||||
|
Reference in New Issue
Block a user