]> git.saurik.com Git - wxWidgets.git/commitdiff
wxRemotelyScrolledTreeCtrl now draws its own lines
authorRobin Dunn <robin@alldunn.com>
Mon, 3 Dec 2001 21:29:50 +0000 (21:29 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 3 Dec 2001 21:29:50 +0000 (21:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/SplitTree.py
wxPython/src/controls2.i
wxPython/src/msw/windows.cpp
wxPython/src/msw/windows.py
wxPython/src/windows.i

index c70802e8bb7e29c9fc5c06dc7b066449198db85b..ed3cc5e5fdcde6e0d79e64bad1cc7c7b2f76435d 100644 (file)
@@ -10,7 +10,6 @@ class TestTree(wxRemotelyScrolledTreeCtrl):
                  style=wxTR_HAS_BUTTONS):
         wxRemotelyScrolledTreeCtrl.__init__(self, parent, ID, pos, size, style)
         ##self.SetBackgroundColour("LIGHT BLUE")
-        EVT_PAINT(self, self.OnPaint)
 
         # make an image list
         im1 = im2 = -1
@@ -28,34 +27,6 @@ class TestTree(wxRemotelyScrolledTreeCtrl):
 
         self.Expand(root)
 
-    def OnPaint(self, evt):
-        dc = wxPaintDC(self)
-
-        wxTreeCtrl.OnPaint(self, evt)
-
-        # Reset the device origin since it may have been set
-        dc.SetDeviceOrigin(0, 0)
-
-        pen = wxPen(wxSystemSettings_GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID)
-        dc.SetPen(pen)
-        dc.SetBrush(wxTRANSPARENT_BRUSH)
-
-        clientSize = self.GetClientSize()
-        cy = 0
-        h = self.GetFirstVisibleItem()
-        while h.Ok():
-            rect = self.GetBoundingRect(h)
-            if rect is not None:
-                cy = rect.GetTop()
-                dc.DrawLine(0, cy, clientSize.x, cy)
-                lastH = h
-            h = self.GetNextVisible(h)
-
-        rect = self.GetBoundingRect(lastH)
-        if rect is not None:
-            cy = rect.GetBottom()
-            dc.DrawLine(0, cy, clientSize.x, cy)
-
 
 
 class TestValueWindow(wxTreeCompanionWindow):
@@ -99,7 +70,8 @@ class TestPanel(wxPanel):
                                       style=wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL)
         splitter = wxThinSplitterWindow(scroller, -1, style=wxSP_3DBORDER | wxCLIP_CHILDREN)
         splitter.SetSashSize(2)
-        self.tree = TestTree(splitter, -1, style=wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER)
+        self.tree = TestTree(splitter, -1, style =
+                             wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxTR_ROW_LINES | wxNO_BORDER )
         valueWindow = TestValueWindow(splitter, -1, style=wxNO_BORDER)
 
         splitter.SplitVertically(self.tree, valueWindow)
index a4ff7294a993be8ace2e72f9c1a78b526a5af899..265dcc0a608f1b5e973de2d7a2bfcd688b226283 100644 (file)
@@ -1274,8 +1274,6 @@ public:
         return (val1,val2)
 "
 
-    // This seems pretty bogus, but is currently needed for SplitTree
-    void OnPaint(wxPaintEvent& event);
 };
 
 
index e0951cff5259975e63b830147220c7e5c1c81a90..57f1aee73a9657251e19494469df9eb7e832f58a 100644 (file)
@@ -5787,8 +5787,8 @@ static PyObject *_wrap_wxWindow_GetAcceleratorTable(PyObject *self, PyObject *ar
     return _resultobj;
 }
 
-#define wxWindow_base_OnPaint(_swigobj,_swigarg0)  (_swigobj->OnPaint(_swigarg0))
-static PyObject *_wrap_wxWindow_base_OnPaint(PyObject *self, PyObject *args, PyObject *kwargs) {
+#define wxWindow_OnPaint(_swigobj,_swigarg0)  (_swigobj->OnPaint(_swigarg0))
+static PyObject *_wrap_wxWindow_OnPaint(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     wxWindow * _arg0;
     wxPaintEvent * _arg1;
@@ -5797,25 +5797,25 @@ static PyObject *_wrap_wxWindow_base_OnPaint(PyObject *self, PyObject *args, PyO
     char *_kwnames[] = { "self","event", NULL };
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_base_OnPaint",_kwnames,&_argo0,&_argo1)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_OnPaint",_kwnames,&_argo0,&_argo1)) 
         return NULL;
     if (_argo0) {
         if (_argo0 == Py_None) { _arg0 = NULL; }
         else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_base_OnPaint. Expected _wxWindow_p.");
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_OnPaint. Expected _wxWindow_p.");
         return NULL;
         }
     }
     if (_argo1) {
         if (_argo1 == Py_None) { _arg1 = NULL; }
         else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPaintEvent_p")) {
-            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_base_OnPaint. Expected _wxPaintEvent_p.");
+            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxWindow_OnPaint. Expected _wxPaintEvent_p.");
         return NULL;
         }
     }
 {
     wxPy_BEGIN_ALLOW_THREADS;
-        wxWindow_base_OnPaint(_arg0,*_arg1);
+        wxWindow_OnPaint(_arg0,*_arg1);
 
     wxPy_END_ALLOW_THREADS;
     if (PyErr_Occurred()) return NULL;
@@ -10599,7 +10599,7 @@ static PyMethodDef windowscMethods[] = {
         { "wxPanel_Create", (PyCFunction) _wrap_wxPanel_Create, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPrePanel", (PyCFunction) _wrap_new_wxPrePanel, METH_VARARGS | METH_KEYWORDS },
         { "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS },
-        { "wxWindow_base_OnPaint", (PyCFunction) _wrap_wxWindow_base_OnPaint, METH_VARARGS | METH_KEYWORDS },
+        { "wxWindow_OnPaint", (PyCFunction) _wrap_wxWindow_OnPaint, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_GetAcceleratorTable", (PyCFunction) _wrap_wxWindow_GetAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_SetAcceleratorTable", (PyCFunction) _wrap_wxWindow_SetAcceleratorTable, METH_VARARGS | METH_KEYWORDS },
         { "wxWindow_PrevControlId", (PyCFunction) _wrap_wxWindow_PrevControlId, METH_VARARGS | METH_KEYWORDS },
index 21add562c64965c62187cc6fd03e6ae509ba66ea..1f950d9e82c48604d2ddd046fb55df8c01047083 100644 (file)
@@ -556,8 +556,8 @@ class wxWindowPtr(wxEvtHandlerPtr):
         val = apply(windowsc.wxWindow_GetAcceleratorTable,(self,) + _args, _kwargs)
         if val: val = wxAcceleratorTablePtr(val) 
         return val
-    def base_OnPaint(self, *_args, **_kwargs):
-        val = apply(windowsc.wxWindow_base_OnPaint,(self,) + _args, _kwargs)
+    def OnPaint(self, *_args, **_kwargs):
+        val = apply(windowsc.wxWindow_OnPaint,(self,) + _args, _kwargs)
         return val
     def __repr__(self):
         return "<C wxWindow instance at %s>" % (self.this,)
index f164ac73482345af9f33f4ae4af2f458e67bef4a..bd9e38110ef46652a1f4ade8e59c6bb0cbc50c7c 100644 (file)
@@ -402,7 +402,7 @@ public:
     wxAcceleratorTable *GetAcceleratorTable();
 
 #ifdef __WXMSW__
-    // This seems pretty bogus, but is currently needed for SplitTree
+    // A way to do the native draw first...  Too bad it isn't in wxGTK too.
     void OnPaint(wxPaintEvent& event);
 #endif
 };