]> git.saurik.com Git - wxWidgets.git/commitdiff
use TWIST buttons by default on the Mac, but also make it possible to
authorRobin Dunn <robin@alldunn.com>
Tue, 29 Jun 2004 02:58:19 +0000 (02:58 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 29 Jun 2004 02:58:19 +0000 (02:58 +0000)
skip the style adjustments so the programmer can do what they want too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/contrib/gizmos/_gizmos_rename.i
wxPython/contrib/gizmos/gizmos.i
wxPython/contrib/gizmos/wxCode/include/wx/treelistctrl.h
wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp
wxPython/demo/TreeListCtrl.py
wxPython/wxPython/gizmos.py

index 1fc7fcc7908abe4b74c0fb11a117fced71eecdf3..b01e44ad3db21b14df7c90e6190be9457ebfeb34 100644 (file)
@@ -30,6 +30,7 @@
 %rename(TL_SEARCH_FULL)                     wxTL_SEARCH_FULL;
 %rename(TL_SEARCH_PARTIAL)                  wxTL_SEARCH_PARTIAL;
 %rename(TL_SEARCH_NOCASE)                   wxTL_SEARCH_NOCASE;
+%rename(TR_DONT_ADJUST_MAC)                 wxTR_DONT_ADJUST_MAC;
 %rename(TreeListColumnInfo)                 wxTreeListColumnInfo;
 
 #endif
index 5e7044221c55328f63b80dc9742796570920b4c2..fea136cb3b58b2a88411ce24f3f67d13fe9c75fd 100644 (file)
@@ -40,8 +40,8 @@
 
 %import windows.i
 %import controls.i
-%pythoncode { wx = _core }
-%pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
+%pythoncode { import wx }
+%pythoncode { __docfilter__ = wx._core.__DocFilter(globals()) }
 
 
 MAKE_CONST_WXSTRING2(DynamicSashNameStr,     wxT("dynamicSashWindow"));
@@ -443,6 +443,11 @@ enum {
     wxTL_SEARCH_NOCASE
 };
 
+enum {
+    // extra tree styles
+    wxTR_DONT_ADJUST_MAC
+};
+%pythoncode { wx.TR_DONT_ADJUST_MAC = TR_DONT_ADJUST_MAC }
 
 
 class wxTreeListColumnInfo: public wxObject {
index 0600984616b30a7fb9293d73a16ccec5d00d6647..d92dc7c3b927ae61e7895594cf89795d7af54285 100644 (file)
@@ -44,6 +44,9 @@ typedef void *wxTreeItemIdValue;
 #endif
 #endif
 
+
+#define wxTR_DONT_ADJUST_MAC    0x0100          // Don't adjust the style for the Mac
+
 //-----------------------------------------------------------------------------
 // wxTreeListColumnAttrs
 //-----------------------------------------------------------------------------
index 1fc734921080c63efe9e5c928211664a68c5a2ed..e56bb68aa4f80546e89f41ff495c396f2e001927 100644 (file)
@@ -1868,17 +1868,20 @@ bool wxTreeListMainWindow::Create(wxTreeListCtrl *parent,
                                   const wxString& name )
 {
 #ifdef __WXMAC__
-    int major,minor;
-    wxGetOsVersion( &major, &minor );
-
-    if (style & wxTR_HAS_BUTTONS) style |= wxTR_MAC_BUTTONS;
-    if (style & wxTR_HAS_BUTTONS) style &= ~wxTR_HAS_BUTTONS;
-    style &= ~wxTR_LINES_AT_ROOT;
-    style |= wxTR_NO_LINES;
-    if (major < 10)
-        style |= wxTR_ROW_LINES;
+    if ( !(style & wxTR_DONT_ADJUST_MAC))
+    {
+        int major,minor;
+        wxGetOsVersion( &major, &minor );
+
+        if (style & wxTR_HAS_BUTTONS) style |= wxTR_TWIST_BUTTONS;
+        if (style & wxTR_HAS_BUTTONS) style &= ~wxTR_HAS_BUTTONS;
+        style &= ~wxTR_LINES_AT_ROOT;
+        style |= wxTR_NO_LINES;
+        if (major < 10)
+            style |= wxTR_ROW_LINES;
+    }
 #endif
-
+    
     wxScrolledWindow::Create( parent, id, pos, size,
                               style|wxHSCROLL|wxVSCROLL, name );
 
index 327a238b7c0210ad53b8bbc01b0278ef87e230b7..6580c07d5af75e29d4be4f78cfe991d6c900f7bb 100644 (file)
@@ -17,8 +17,15 @@ class TestPanel(wx.Panel):
                                         #wx.TR_TWIST_BUTTONS
                                         #| wx.TR_ROW_LINES
                                         #| wx.TR_NO_LINES 
-                                        | wx.TR_FULL_ROW_HIGHLIGHT     
+                                        | wx.TR_FULL_ROW_HIGHLIGHT
+
+                                        # By default the style will be adjusted on
+                                        # Mac to use twisty buttons and no lines.  If
+                                        # you would rather control this yourself then
+                                        # add this style.
+                                        #| wx.TR_DONT_ADJUST_MAC
                                    )
+
         isz = (16,16)
         il = wx.ImageList(isz[0], isz[1])
         fldridx     = il.Add(wx.ArtProvider_GetBitmap(wx.ART_FOLDER,      wx.ART_OTHER, isz))
index fd6c08664a6f798a0068ec5e328ff6e1cd086e50..3709e0d7888d0db7758013fddb173195a26d7e84 100644 (file)
@@ -63,6 +63,7 @@ wxTL_SEARCH_LEVEL = wx.gizmos.TL_SEARCH_LEVEL
 wxTL_SEARCH_FULL = wx.gizmos.TL_SEARCH_FULL
 wxTL_SEARCH_PARTIAL = wx.gizmos.TL_SEARCH_PARTIAL
 wxTL_SEARCH_NOCASE = wx.gizmos.TL_SEARCH_NOCASE
+wxTR_DONT_ADJUST_MAC = wx.gizmos.TR_DONT_ADJUST_MAC
 wxTreeListColumnInfo = wx.gizmos.TreeListColumnInfo
 wxTreeListColumnInfoPtr = wx.gizmos.TreeListColumnInfoPtr
 wxTreeListCtrl = wx.gizmos.TreeListCtrl