From 78e8819c2e3e35d6a7383af683e8d14b295462a2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 3 Dec 2001 20:41:03 +0000 Subject: [PATCH] Added SplitTree sample to the demo Fixes for wxEditor and its FrogEdit sample Misc. other stuff git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/CHANGES.txt | 10 +- wxPython/contrib/ogl/oglbasic.cpp | 77 ----------- wxPython/contrib/ogl/oglbasic.py | 15 ++- wxPython/demo/Main.py | 2 + wxPython/demo/SplitTree.py | 47 ++++++- wxPython/demo/bmp_source/file1.bmp | Bin 0 -> 246 bytes wxPython/demo/bmp_source/file1.ico | Bin 1078 -> 0 bytes wxPython/demo/bmp_source/file2.bmp | Bin 0 -> 246 bytes wxPython/demo/bmp_source/folder1.bmp | Bin 0 -> 246 bytes wxPython/demo/bmp_source/folder1.ico | Bin 1078 -> 0 bytes wxPython/demo/bmp_source/folder2.bmp | Bin 0 -> 246 bytes wxPython/demo/bmp_source/folder2.ico | Bin 318 -> 0 bytes wxPython/demo/bmp_source/folder3.bmp | Bin 0 -> 246 bytes wxPython/demo/encode_bitmaps.py | 8 +- wxPython/demo/images.py | 170 +++++++------------------ wxPython/demo/wxEditor.py | 4 +- wxPython/samples/frogedit/FrogEdit.py | 41 +++--- wxPython/setup.py | 5 +- wxPython/src/.cvsignore | 3 +- wxPython/src/__version__.py | 2 +- wxPython/src/_defs.i | 1 + wxPython/src/controls2.i | 1 + wxPython/src/msw/controls2.py | 1 + wxPython/src/msw/windows.cpp | 38 ++++++ wxPython/src/msw/windows.py | 3 + wxPython/src/msw/wx.cpp | 1 + wxPython/src/msw/wx.py | 1 + wxPython/src/windows.i | 3 + wxPython/wxPython/lib/editor/editor.py | 66 +++++----- 29 files changed, 224 insertions(+), 275 deletions(-) create mode 100644 wxPython/demo/bmp_source/file1.bmp delete mode 100644 wxPython/demo/bmp_source/file1.ico create mode 100644 wxPython/demo/bmp_source/file2.bmp create mode 100644 wxPython/demo/bmp_source/folder1.bmp delete mode 100644 wxPython/demo/bmp_source/folder1.ico create mode 100644 wxPython/demo/bmp_source/folder2.bmp delete mode 100644 wxPython/demo/bmp_source/folder2.ico create mode 100644 wxPython/demo/bmp_source/folder3.bmp diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 87dffdbac0..c3afe48498 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -95,7 +95,15 @@ same document. Added wxEditableListBox gizmo. -Added a greatly enhanced wxEditor from Steve Howell and Adam Feuer. +Updated wxEditor with lots of enhancements from Steve Howell and Adam +Feuer. + +Added the "SplitTree gizmos" which are a collection of classes that +were designed to operate together and provide a tree control with +additional columns for each item. The classes are +wxRemotelyScrolledTreeCtrl, wxTreeCompanionWindow, +wxThinSplitterWindow, and wxSplitterScrolledWindow, some of which may +also be useful by themselves. diff --git a/wxPython/contrib/ogl/oglbasic.cpp b/wxPython/contrib/ogl/oglbasic.cpp index 24965a42ae..e7b77d1fa0 100644 --- a/wxPython/contrib/ogl/oglbasic.cpp +++ b/wxPython/contrib/ogl/oglbasic.cpp @@ -4355,81 +4355,6 @@ static PyObject *_wrap_wxPyShape_SetBrush(PyObject *self, PyObject *args, PyObje return _resultobj; } -static void wxPyShape_SetClientData(wxPyShape *self,PyObject * userData) { - wxPyUserData* data = NULL; - if (userData) - data = new wxPyUserData(userData); - self->SetClientData(data); - } -static PyObject *_wrap_wxPyShape_SetClientData(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxPyShape * _arg0; - PyObject * _arg1; - PyObject * _argo0 = 0; - PyObject * _obj1 = 0; - char *_kwnames[] = { "self","userData", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyShape_SetClientData",_kwnames,&_argo0,&_obj1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyShape_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyShape_SetClientData. Expected _wxPyShape_p."); - return NULL; - } - } -{ - _arg1 = _obj1; -} -{ - wxPy_BEGIN_ALLOW_THREADS; - wxPyShape_SetClientData(_arg0,_arg1); - - wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject * wxPyShape_GetClientData(wxPyShape *self) { - wxPyUserData* data = (wxPyUserData*)self->GetClientData(); - if (data) { - Py_INCREF(data->m_obj); - return data->m_obj; - } else { - Py_INCREF(Py_None); - return Py_None; - } - } -static PyObject *_wrap_wxPyShape_GetClientData(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - PyObject * _result; - wxPyShape * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPyShape_GetClientData",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyShape_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPyShape_GetClientData. Expected _wxPyShape_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (PyObject *)wxPyShape_GetClientData(_arg0); - - wxPy_END_ALLOW_THREADS; -}{ - _resultobj = _result; -} - return _resultobj; -} - #define wxPyShape_Show(_swigobj,_swigarg0) (_swigobj->Show(_swigarg0)) static PyObject *_wrap_wxPyShape_Show(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -8280,8 +8205,6 @@ static PyMethodDef oglbasiccMethods[] = { { "wxPyShape_Move", (PyCFunction) _wrap_wxPyShape_Move, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_IsShown", (PyCFunction) _wrap_wxPyShape_IsShown, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_Show", (PyCFunction) _wrap_wxPyShape_Show, METH_VARARGS | METH_KEYWORDS }, - { "wxPyShape_GetClientData", (PyCFunction) _wrap_wxPyShape_GetClientData, METH_VARARGS | METH_KEYWORDS }, - { "wxPyShape_SetClientData", (PyCFunction) _wrap_wxPyShape_SetClientData, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_SetBrush", (PyCFunction) _wrap_wxPyShape_SetBrush, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_SetPen", (PyCFunction) _wrap_wxPyShape_SetPen, METH_VARARGS | METH_KEYWORDS }, { "wxPyShape_GetId", (PyCFunction) _wrap_wxPyShape_GetId, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/contrib/ogl/oglbasic.py b/wxPython/contrib/ogl/oglbasic.py index 7e23386ead..86ae9a5d85 100644 --- a/wxPython/contrib/ogl/oglbasic.py +++ b/wxPython/contrib/ogl/oglbasic.py @@ -451,12 +451,6 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr): def SetBrush(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShape_SetBrush,(self,) + _args, _kwargs) return val - def SetClientData(self, *_args, **_kwargs): - val = apply(oglbasicc.wxPyShape_SetClientData,(self,) + _args, _kwargs) - return val - def GetClientData(self, *_args, **_kwargs): - val = apply(oglbasicc.wxPyShape_GetClientData,(self,) + _args, _kwargs) - return val def Show(self, *_args, **_kwargs): val = apply(oglbasicc.wxPyShape_Show,(self,) + _args, _kwargs) return val @@ -781,6 +775,15 @@ class wxPyShapePtr(wxPyShapeEvtHandlerPtr): return val def __repr__(self): return "" % (self.this,) + + def SetClientData(self, data): + self.clientData = data + def GetClientData(self): + if hasattr(self, 'clientData'): + return self.clientData + else: + return None + class wxPyShape(wxPyShapePtr): def __init__(self,this): self.this = this diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index a3b065e521..3d72ac519f 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -38,6 +38,7 @@ _treeList = [ 'wxPopupWindow', 'wxDynamicSashWindow', 'wxEditableListBox', + 'SplitTree', ]), ('Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame', @@ -74,6 +75,7 @@ _treeList = [ 'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE', 'wxDragImage', "wxProcess", "FancyText", "OOR", "wxWave", 'wxJoystick', 'DrawXXXList', 'ErrorDialogs', 'wxMimeTypesManager', + 'SplitTree', ]), ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog', diff --git a/wxPython/demo/SplitTree.py b/wxPython/demo/SplitTree.py index b87f9912a5..5de68027e4 100644 --- a/wxPython/demo/SplitTree.py +++ b/wxPython/demo/SplitTree.py @@ -10,29 +10,62 @@ 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 - ##self.il = wxImageList(16, 16) - ##im1 = self.il.Add(images.getFolder1Bitmap()) - ##im2 = self.il.Add(images.getFile1Bitmap()) - ##self.SetImageList(self.il) + self.il = wxImageList(16, 16) + im1 = self.il.Add(images.getFolder1Bitmap()) + im2 = self.il.Add(images.getFile1Bitmap()) + self.SetImageList(self.il) # Add some items root = self.AddRoot("Root") for i in range(30): item = self.AppendItem(root, "Item %d" % i, im1) for j in range(10): - self.AppendItem(item, "Child %d" % j, im2) + child = self.AppendItem(item, "Child %d" % j, im2) self.Expand(root) + def OnPaint(self, evt): + dc = wxPaintDC(self) + + self.base_OnPaint(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): def __init__(self, parent, ID, pos=wxDefaultPosition, size=wxDefaultSize, style=0): wxTreeCompanionWindow.__init__(self, parent, ID, pos, size, style) self.SetBackgroundColour("WHITE") + EVT_ERASE_BACKGROUND(self, self.OEB) + + def OEB(self, evt): + pass # This method is called to draw each item in the value window def DrawItem(self, dc, itemId, rect): @@ -44,6 +77,10 @@ class TestValueWindow(wxTreeCompanionWindow): ptext = tree.GetItemText(parent) text = text + ptext + " --> " text = text + tree.GetItemText(itemId) + pen = wxPen(wxSystemSettings_GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID) + dc.SetPen(pen) + dc.SetBrush(wxBrush(self.GetBackgroundColour(), wxSOLID)) + dc.DrawRectangle(rect.x, rect.y, rect.width+1, rect.height) dc.SetTextForeground("BLACK") dc.SetBackgroundMode(wxTRANSPARENT) tw, th = dc.GetTextExtent(text) diff --git a/wxPython/demo/bmp_source/file1.bmp b/wxPython/demo/bmp_source/file1.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9a0544b232721e18b22e955fb09d0aecf303084e GIT binary patch literal 246 zcmb76u@Qhk2#a_2IEHiByN)%Z{YX@{F~Hl{nTJ5geU9@+pG+w28v8D8A}#Qhy;IFj7@ygx{{^%n>1}SM$DOtv2 zlCJoiN4_NKe2^Au1>RxO5exWt8zC_iF&vgqwN|_*S|4i75#)2p=8vDg0W|PcSm#!L zfiIm0@iqdDGlQnP!xDa`^V!E|&DpTupO3!QR@&UZI-tMjuDxNrH}-nkN%m4N@aA_a FJpqxL*3JL` diff --git a/wxPython/demo/bmp_source/file2.bmp b/wxPython/demo/bmp_source/file2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e812d6925f40c96dd60a70391dffcc325671aabf GIT binary patch literal 246 zcmb77u?>JQ3^Ni-#Q@?8?qKH~=AO{C-}EFV)?gPQ|vY5syfFq)-GNQHlM{HwKiPD_E1e*gdg literal 0 HcmV?d00001 diff --git a/wxPython/demo/bmp_source/folder1.bmp b/wxPython/demo/bmp_source/folder1.bmp new file mode 100644 index 0000000000000000000000000000000000000000..dada286b64daeafc29cbe1abb95401624b3db837 GIT binary patch literal 246 zcmZ?r{l)+RWk5;;hy|dSk%0v)(EuhP1WXRX1IhpqLqh|E0+K)`!+`?_fHX+rKNvCm z{|{mTF%W`;Kzwunlm~$y9bnM#<99U(H2nC!9R!HyL(FaX0o1gkqoe?vfUP&SZtvm{`_HB2qB-9 zf(GTBYc(nu}C6AaoD0pBjeB)ZJH5J^>QMSWswUDMPn`8aB-=0Ml-AgfD*@PpCja_E+ T_r_T%*c$R5s2Azc-l_Bfjgso2 diff --git a/wxPython/demo/bmp_source/folder2.bmp b/wxPython/demo/bmp_source/folder2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..35fedba962e0accf24a09879b654eafe8a6e0380 GIT binary patch literal 246 zcmZ?r{l)+RWk5;;hy|dSk%0v)(EuccxFHxO2bN#}%77#r8Xy#q1Tq;895?`^K@$JL z2t)u`VDdjm2uJ`iDgerZz>f|vX!!BF8Uz}CeBTZN#PcDhHv9l;+R@R`|G&Gsx*sG4 IG#J@J0LHU(N&o-= literal 0 HcmV?d00001 diff --git a/wxPython/demo/bmp_source/folder2.ico b/wxPython/demo/bmp_source/folder2.ico deleted file mode 100644 index 98b6d3f9203d9dfca90df76cc972478ea45e33b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmZ`zI}XAy41JXtGG=0C>@Bz!QigiW)~m1uiGduYM_{88gLy9vQU|d8p1-mU4AdAS z`G9c%jsQj?5+_1+Np1X#44}bmb7Y37wbHBM&ET$xpsFPLCm}aMc$HG_hB-+BW~QZt z@K$=wflJ);rH|iwpFX9@eO3P8CU9_Vw{o`K&Fv51$=cFU=>^+C`4`KX^OODuKB+QQ A&j0`b diff --git a/wxPython/demo/bmp_source/folder3.bmp b/wxPython/demo/bmp_source/folder3.bmp new file mode 100644 index 0000000000000000000000000000000000000000..dfc3c4fb8c25a53a71e724cbd31a45969fa80e69 GIT binary patch literal 246 zcmZ{cF%Ezr6hkpOFnSC}6BcK8ujAbDABV(|d%0r!F;3W|eLz2dKkm?U5(_=Q9>U}W zJbS@LCD6d+kw&PsvY;KcfvIP8_9LweY>}jB7{$$SiK`)t$xxgT#Xpb|=Ral^ylYuU E4~Mx*tN;K2 literal 0 HcmV?d00001 diff --git a/wxPython/demo/encode_bitmaps.py b/wxPython/demo/encode_bitmaps.py index 65d89dc118..31e09bb9a2 100644 --- a/wxPython/demo/encode_bitmaps.py +++ b/wxPython/demo/encode_bitmaps.py @@ -51,9 +51,11 @@ command_lines = [ "-a -n SmallUpArrow -m #0000FF bmp_source/sm_up.bmp images.py", "-a -n SmallDnArrow -m #0000FF bmp_source/sm_down.bmp images.py", - "-a -n Folder1 bmp_source/folder1.ico images.py", - "-a -n Folder2 bmp_source/folder2.ico images.py", - "-a -n File1 bmp_source/file1.ico images.py", + "-a -n Folder1 -m #FFFFFF bmp_source/folder1.bmp images.py", + "-a -n Folder2 -m #FFFFFF bmp_source/folder2.bmp images.py", + "-a -n Folder3 -m #FFFFFF bmp_source/folder3.bmp images.py", + "-a -n File1 -m #FFFFFF bmp_source/file1.bmp images.py", + "-a -n File2 -m #FFFFFF bmp_source/file2.bmp images.py", ] diff --git a/wxPython/demo/images.py b/wxPython/demo/images.py index 90d2a5750d..9aaa3c3392 100644 --- a/wxPython/demo/images.py +++ b/wxPython/demo/images.py @@ -1937,8 +1937,11 @@ def getSmallDnArrowImage(): #---------------------------------------------------------------------- def getFolder1Data(): return cPickle.loads(zlib.decompress( -'x\xda\xd3\xc8)0\xe4\nV76R\x00"C\x05Cu\xae\xc4`u\x05\x85d\x05\xbf\xfc\xbcT(\ -\x07?\x18U4\xaahT\xd1\xa8\xa2\x81Q\xa4\x07\x00jB\xa8\xe5' )) +'x\xda\xd3\xc8)0\xe4\nV74S\x00"S\x05Cu\xae\xc4`u\x7f\x85d\x05\xa7\x9c\xc4\ +\xe4l0/\x1f\xc8Sv6\x00A0_\x0f\xc4\xb70\x00A0_\x01\xc8\xf7\xcb\xcfK\x05s"@\ +\x92n@`\x00\x93D\x050A=\x10@\x13\xd4\x8b\xc8\x07B=\x14A\x88\x18P\x14\xa2\x01\ +*\x88l\xa2\x9e?L\x10\xaa\x14\xac\x1c.\x88\x10\xcb\xa7\xbfJ\x14\x00\x15T\xf0G\ +\x01xC\t]P\x0f\x00\xbc\x8fdr' )) def getFolder1Bitmap(): return wxBitmapFromXPMData(getFolder1Data()) @@ -1949,129 +1952,11 @@ def getFolder1Image(): #---------------------------------------------------------------------- def getFolder2Data(): return cPickle.loads(zlib.decompress( -'x\xda\xcdYkS\x14K\x12\xfd~\x7fE"o\xd0\xb4g\xbagz\xda\x07A?UDFD1\xd5\x10AT@\ -\xc1\xc27\xa0\xf2\xdb\xb7\xbaNV\xb5z\x8d\x8dkll\xecN\xfa\xc5cUV\xe6\xc9Ge\ -\xb5s\x87\xc7\xbd\xbf6f\xe3>\xb5\x7f\xd2\x01\xf5g\xff\xda\xd9\x98]\x1e\xd3.\ -\x15\x87;\xbbo\xdc_\xaf\x91\xfd\xebd3l\x86y\xee\x80+\xdc\x02uY\x97\x83\xd2\ -\x01\xcf\x1d\xd0\xe4M\x1e%\x0eX1-P\xf6\xca^6t\xc0e\xa7\xa3\xca\xaa,\x8b\x1dp\ -\xe2\xb6\x14eQ\xa6\xd8r\xcf\x01\xa3\xd2\n\xb6<\x0b\xc7\x16\x99\x03\xee8\xa5y\ -\xd6\x8a\x03f\x1cP\xa7u\x9a@\xe9\x14\x07\x00J\'\xc5mI\xf2d\x84-\xb7\x1cP%U\ -\x92\xc2\xf4\x1b\x14\x80\xca\x01\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14\ +\x85h\x80\n"\x9b\xa8\xe7\x0f\x13\x84*\x05+\x87\x0b"\xc4\xf2\xe9\xaf\x12\x05@\ +\x05\x15\xfcQ\x00\xdePB\x17\xd4\x03\x00x\x93dF' )) def getFolder2Bitmap(): return wxBitmapFromXPMData(getFolder2Data()) @@ -2079,11 +1964,28 @@ def getFolder2Bitmap(): def getFolder2Image(): return wxImageFromBitmap(getFolder2Bitmap()) +#---------------------------------------------------------------------- +def getFolder3Data(): + return cPickle.loads(zlib.decompress( +'x\xda\xd3\xc8)0\xe4\nV74S\x00"\x13\x05Cu\xae\xc4`u=\x85d\x05\xa7\x9c\xc4\ +\xe4l0/\x1f\xc8S\xb60\xb0000\x00\xf3\x15\x80|\xbf\xfc\xbcT0\'\x02$\xe9\x06\ +\x04pIT\x80GP\x0f\x040\x04#""\xf4\xa0\x00E\x10\n\x08\x0b\xea!\x00B0\x1f\x0e\ +\x10\x82z\x08A\x84vd\x85pw"+\x84\t\xa2(D\xf6\x11\xdc\xed\n\xa4\x06\x08\xa6\ +\xa0\x1e\x00\xc9\xbd[\x89' )) + +def getFolder3Bitmap(): + return wxBitmapFromXPMData(getFolder3Data()) + +def getFolder3Image(): + return wxImageFromBitmap(getFolder3Bitmap()) + #---------------------------------------------------------------------- def getFile1Data(): return cPickle.loads(zlib.decompress( -'x\xda\xd3\xc8)0\xe4\nV76R\x00"C\x05Cu\xae\xc4`u\x05\x85d\x05\xbf\xfc\xbcT(\ -\x07?\x18U4\xaahT\xd1\xa8\xa2\x81Q\xa4\x07\x00jB\xa8\xe5' )) +'x\xda\xd3\xc8)0\xe4\nV74S\x00"#\x05Cu\xae\xc4`u=\x85d\x05\xa7\x9c\xc4\xe4l0\ +O\x01\xc8\xf3\xcb\xcfK\x85rP\x01TP\x0f\nP\x05!<\xa8(\\\x10\x04!\x04\xa6J\xb0\ +ZT\x95\n\x10iT\x95\xe8\x82\x088\x00*\x11\x00!\x885\x940\x04\xf5\x00\x08\x9a?\ +H' )) def getFile1Bitmap(): return wxBitmapFromXPMData(getFile1Data()) @@ -2091,3 +1993,17 @@ def getFile1Bitmap(): def getFile1Image(): return wxImageFromBitmap(getFile1Bitmap()) +#---------------------------------------------------------------------- +def getFile2Data(): + return cPickle.loads(zlib.decompress( +'x\xda\xd3\xc8)0\xe4\nV74S\x00"c\x05Cu\xae\xc4`u=\x85d\x05\xa7\x9c\xc4\xe4l0\ +/\x02\xc8Svs3\x00\x020_\x01\xc8\xf7\xcb\xcfK\x85rP\x01TP\x0f\nP\x05#\xc0\x00\ +*\n\x17\x04\xc1\x08=\x05=l*\xc1jQU\x82\xc41T\xa2\x0b\xc2\xe1@\xa8D\x00\x84 \ +\xd6P\xc2\x10\xd4\x03\x00f\xa3R\xef' )) + +def getFile2Bitmap(): + return wxBitmapFromXPMData(getFile2Data()) + +def getFile2Image(): + return wxImageFromBitmap(getFile2Bitmap()) + diff --git a/wxPython/demo/wxEditor.py b/wxPython/demo/wxEditor.py index 756b46e3f7..d3bbd08785 100644 --- a/wxPython/demo/wxEditor.py +++ b/wxPython/demo/wxEditor.py @@ -8,7 +8,7 @@ def runTest(frame, nb, log): win = wxPanel(nb, -1) ed = wxEditor(win, -1, style=wxSUNKEN_BORDER) box = wxBoxSizer(wxVERTICAL) - box.Add(ed, 1, wxALL|wxGROW, 5) + box.Add(ed, 1, wxALL|wxGROW, 1) win.SetSizer(box) win.SetAutoLayout(true) @@ -38,7 +38,7 @@ def runTest(frame, nb, log): overview = """ The wxEditor class implements a simple text editor using wxPython. You can create a custom editor by subclassing wxEditor. Even though much of -the editor is implemented in Python, it runs surprisingly smoothly on +the editor is implemented in Python, it runs surprisingly smoothly on normal hardware with small files. How to use it diff --git a/wxPython/samples/frogedit/FrogEdit.py b/wxPython/samples/frogedit/FrogEdit.py index 68f3e27a04..5e2d11d1c6 100644 --- a/wxPython/samples/frogedit/FrogEdit.py +++ b/wxPython/samples/frogedit/FrogEdit.py @@ -36,7 +36,7 @@ class OutlinerPanel(wxPanel): wxPanel.Close(self) ##---------------------------------------------------------------------- - + class FrogEditFrame(wxFrame): def __init__(self, parent, ID, title, pos=wxDefaultPosition, @@ -48,7 +48,7 @@ class FrogEditFrame(wxFrame): win = OutlinerPanel(splitter, -1, style=wxCLIP_CHILDREN) win.parent = self log = self.MakeLogWindow(splitter) - + self.MakeStatusbar() self.MakeEditorWindow(win, log) self.SetUpSplitter(splitter, win, log) @@ -57,6 +57,8 @@ class FrogEditFrame(wxFrame): self.RegisterEventHandlers() self.InitVariables() + win.Layout() + ##------------- Init Misc @@ -66,7 +68,7 @@ class FrogEditFrame(wxFrame): def InitVariables(self): self.fileName = None self.edl.UnTouchBuffer() - + def MakeMenus(self): self.MainMenu = wxMenuBar() self.AddMenus(self.MainMenu) @@ -172,7 +174,7 @@ class FrogEditFrame(wxFrame): messageDialog = wxMessageDialog(self, text, title, wxOK | wxICON_INFORMATION) messageDialog.ShowModal() messageDialog.Destroy() - + def OkCancelDialog(self, text, title): dialog = wxMessageDialog(self, text, title, wxOK | wxCANCEL | wxICON_INFORMATION) result = dialog.ShowModal() @@ -191,11 +193,11 @@ class FrogEditFrame(wxFrame): wildCard = "*.*" fileName = None fileDialog = wxFileDialog(self, "Choose a file", defaultDir, defaultFile, wildCard, wxOPEN|wxMULTIPLE) - result = fileDialog.ShowModal() + result = fileDialog.ShowModal() if result == wxID_OK: fileName = fileDialog.GetPath() wxLogMessage('You selected: %s\n' % fileName) - fileDialog.Destroy() + fileDialog.Destroy() return fileName def OpenFileError(self, fileName): @@ -220,13 +222,13 @@ class FrogEditFrame(wxFrame): def SetAltFuncs(self, action): FrogEditor.SetAltFuncs(self.edl, action) - action['x'] = self.OnFileExit + action['x'] = self.OnFileExit def GetCurrentDir(self): if self.fileName is not None: return os.path.split(self.fileName)[0] return "." - + def GetFileName(self): if self.fileName is not None: return os.path.split(self.fileName)[1] @@ -263,7 +265,7 @@ class FrogEditFrame(wxFrame): return TRUE except: return FALSE - + ##---------------- Event handlers @@ -279,7 +281,7 @@ class FrogEditFrame(wxFrame): return self.NewFile() self.edl.SetFocus() - + def OnOpenFile(self, event): if self.edl.BufferWasTouched(): if not self.OkCancelDialog("Open file - abandon changes?", "Open File"): @@ -289,7 +291,7 @@ class FrogEditFrame(wxFrame): if self.OpenFile(fileName) is FALSE: self.OpenFileError(fileName) self.edl.SetFocus() - + def OnSaveFile(self, event): if self.fileName is None: return self.OnSaveFileAs(event) @@ -297,7 +299,7 @@ class FrogEditFrame(wxFrame): if self.SaveFile(self.fileName) is not TRUE: self.SaveFileError(self.fileName) self.edl.SetFocus() - + def OnSaveFileAs(self, event): fileName = self.SelectFileDialog(self.GetCurrentDir(),self.GetFileName()) if fileName is not None: @@ -306,8 +308,8 @@ class FrogEditFrame(wxFrame): if self.SaveFile(self.fileName) is not TRUE: self.SaveFileError(self.fileName) self.edl.SetFocus() - - def OnFileExit(self, event): + + def OnFileExit(self, event): if self.edl.BufferWasTouched(): if not self.OkCancelDialog("Exit program - abandon changes?", "Exit"): return @@ -316,11 +318,11 @@ class FrogEditFrame(wxFrame): def OnEditPreferences(self, event): self.MessageDialog("Edit preferences is not implemented yet.", "Not implemented.") pass - + def OnHelpAbout(self, event): self.MessageDialog(ABOUT_TEXT, "About FrogEdit") pass - + def Show(self, show): wxFrame.Show(self, show) self.edl.SetFocus() @@ -330,7 +332,7 @@ class FrogEditFrame(wxFrame): def LoadInitialFile(self, fileName): if fileName is not None: if self.OpenFile(fileName) is FALSE: - self.OpenFileError(fileName) + self.OpenFileError(fileName) @@ -341,7 +343,8 @@ class FrogEditLauncher: def MakeAppFrame(self): return FrogEditFrame(None, -1, "FrogEdit", size=(640, 480), - style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE) + style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE) + def GetArgvFilename(self): if len(sys.argv) > 1: return sys.argv[1] @@ -349,8 +352,8 @@ class FrogEditLauncher: return None def Main(self): - win = self.MakeAppFrame() app = wxPySimpleApp() + win = self.MakeAppFrame() win.Show(true) win.LoadInitialFile(self.GetArgvFilename()) app.MainLoop() diff --git a/wxPython/setup.py b/wxPython/setup.py index ed41eb4ba1..96ecf34550 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree # flags and values that affect this script #---------------------------------------------------------------------- -VERSION = "2.3.2b7" +VERSION = "2.3.2b7+" DESCRIPTION = "Cross platform GUI toolkit for Python" AUTHOR = "Robin Dunn" AUTHOR_EMAIL = "Robin Dunn " @@ -31,10 +31,11 @@ on. BUILD_GLCANVAS = 1 # If true, build the contrib/glcanvas extension module BUILD_OGL = 1 # If true, build the contrib/ogl extension module BUILD_STC = 1 # If true, build the contrib/stc extension module -BUILD_IEWIN = 0 # Internet Explorer wrapper (experimental) BUILD_XRC = 1 # XML based resource system BUILD_GIZMOS = 1 # Build a module for the gizmos contrib library +BUILD_IEWIN = 0 # Internet Explorer wrapper (experimental) + CORE_ONLY = 0 # if true, don't build any of the above GL_ONLY = 0 # Only used when making the -gl RPM. See the "b" script diff --git a/wxPython/src/.cvsignore b/wxPython/src/.cvsignore index 7e68c2a590..d7e8d6a963 100644 --- a/wxPython/src/.cvsignore +++ b/wxPython/src/.cvsignore @@ -1,3 +1,4 @@ +*.dsp .emacs.desktop Makefile Makefile.pre @@ -32,6 +33,7 @@ wxPython.dsp wxPython.dsw wxPython.ncb wxPython.opt +wxSamples wxc.exp wxc.ilk wxc.lib @@ -43,4 +45,3 @@ wxpc.exp wxpc.lib wxpc.res wxpc.res.save -*.dsp \ No newline at end of file diff --git a/wxPython/src/__version__.py b/wxPython/src/__version__.py index b9d8802174..1265b0ba70 100644 --- a/wxPython/src/__version__.py +++ b/wxPython/src/__version__.py @@ -1 +1 @@ -ver = '2.3.2b7' +ver = '2.3.2b7+' diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index 4e393463b1..cd743b007d 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -475,6 +475,7 @@ enum { wxWS_EX_VALIDATE_RECURSIVELY, wxWS_EX_BLOCK_EVENTS, + wxWS_EX_TRANSIENT, // Mapping modes (as per Windows) wxMM_TEXT, diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 298d605502..12990e015c 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -919,6 +919,7 @@ public: wxTreeItemId(); ~wxTreeItemId(); bool IsOk(); + %pragma(python) addtoclass = "Ok = IsOk" %addmethods { int __cmp__(wxTreeItemId* other) { diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index 5fc5037570..1470b4b076 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -780,6 +780,7 @@ class wxTreeItemIdPtr : return val def __repr__(self): return "" % (self.this,) + Ok = IsOk class wxTreeItemId(wxTreeItemIdPtr): def __init__(self,*_args,**_kwargs): self.this = apply(controls2c.new_wxTreeItemId,_args,_kwargs) diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index b0950603db..e0951cff52 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -5787,6 +5787,43 @@ 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) { + PyObject * _resultobj; + wxWindow * _arg0; + wxPaintEvent * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","event", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxWindow_base_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."); + 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."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_base_OnPaint(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxPanelTowxWindow(void *ptr) { wxPanel *src; wxWindow *dest; @@ -10562,6 +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_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 }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index d702a31a85..21add562c6 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -556,6 +556,9 @@ 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) + return val def __repr__(self): return "" % (self.this,) # replaces broken shadow method diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 11a4f295bb..87bedd78cd 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -2177,6 +2177,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxJOY_BUTTON_ANY", PyInt_FromLong((long) wxJOY_BUTTON_ANY)); PyDict_SetItemString(d,"wxWS_EX_VALIDATE_RECURSIVELY", PyInt_FromLong((long) wxWS_EX_VALIDATE_RECURSIVELY)); PyDict_SetItemString(d,"wxWS_EX_BLOCK_EVENTS", PyInt_FromLong((long) wxWS_EX_BLOCK_EVENTS)); + PyDict_SetItemString(d,"wxWS_EX_TRANSIENT", PyInt_FromLong((long) wxWS_EX_TRANSIENT)); PyDict_SetItemString(d,"wxMM_TEXT", PyInt_FromLong((long) wxMM_TEXT)); PyDict_SetItemString(d,"wxMM_LOMETRIC", PyInt_FromLong((long) wxMM_LOMETRIC)); PyDict_SetItemString(d,"wxMM_HIMETRIC", PyInt_FromLong((long) wxMM_HIMETRIC)); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 365158fa2a..e65da8df1c 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -440,6 +440,7 @@ wxJOY_BUTTON4 = wxc.wxJOY_BUTTON4 wxJOY_BUTTON_ANY = wxc.wxJOY_BUTTON_ANY wxWS_EX_VALIDATE_RECURSIVELY = wxc.wxWS_EX_VALIDATE_RECURSIVELY wxWS_EX_BLOCK_EVENTS = wxc.wxWS_EX_BLOCK_EVENTS +wxWS_EX_TRANSIENT = wxc.wxWS_EX_TRANSIENT wxMM_TEXT = wxc.wxMM_TEXT wxMM_LOMETRIC = wxc.wxMM_LOMETRIC wxMM_HIMETRIC = wxc.wxMM_HIMETRIC diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index a4bee153e1..1aab58d1da 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -400,6 +400,9 @@ public: void SetAcceleratorTable(const wxAcceleratorTable& accel); wxAcceleratorTable *GetAcceleratorTable(); + + + %name(base_OnPaint)void OnPaint(wxPaintEvent& event); }; diff --git a/wxPython/wxPython/lib/editor/editor.py b/wxPython/wxPython/lib/editor/editor.py index e531bff7ff..833d7678e5 100644 --- a/wxPython/wxPython/lib/editor/editor.py +++ b/wxPython/wxPython/lib/editor/editor.py @@ -13,7 +13,7 @@ # syntax coloring and outliner collapse mode. Adam and Steve # inherited the code, and added a lot of basic editor # functionality that had not been there before, such as cut-and-paste. -# +# # # Created: 15-Dec-1999 # RCS-ID: $Id$ @@ -31,7 +31,7 @@ import images #---------------------------- -def ForceBetween(min, val, max): +def ForceBetween(min, val, max): if val > max: return max if val < min: @@ -103,6 +103,7 @@ class wxEditor(wxScrolledWindow): EVT_PAINT(self, self.OnPaint) EVT_SIZE(self, self.OnSize) EVT_WINDOW_DESTROY(self, self.OnDestroy) + EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) ##------------------- Platform-specific stuff @@ -111,7 +112,7 @@ class wxEditor(wxScrolledWindow): return wxFont(10, wxMODERN, wxNORMAL, wxNORMAL) else: return wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, false) - + def UnixKeyHack(self, key): # this will be obsolete when we get the new wxWindows patch if key <= 26: @@ -151,12 +152,15 @@ class wxEditor(wxScrolledWindow): self.KeepCursorOnScreen() self.DrawSimpleCursor(0,0,dc, true) self.Draw(dc) - + def OnPaint(self, event): dc = wxPaintDC(self) self.UpdateView(dc) self.AdjustScrollbars() + def OnEraseBackground(self, evt): + pass + ##-------------------- Drawing code def InitFonts(self): @@ -272,7 +276,7 @@ class wxEditor(wxScrolledWindow): self.sy = ForceBetween(max(0, self.cy-self.sh), self.sy, self.cy) self.sx = ForceBetween(max(0, self.cx-self.sw), self.sx, self.cx) self.AdjustScrollbars() - + def HorizBoundaries(self): self.SetCharDimensions() maxLineLen = self.CalcMaxLineLen() @@ -283,11 +287,11 @@ class wxEditor(wxScrolledWindow): self.SetCharDimensions() self.sy = ForceBetween(0, self.sy, max(self.sh, self.LinesInFile() - self.sh + 1)) self.cy = ForceBetween(self.sy, self.cy, self.sy + self.sh - 1) - + def cVert(self, num): self.cy = self.cy + num self.cy = ForceBetween(0, self.cy, self.LinesInFile() - 1) - self.sy = ForceBetween(self.cy - self.sh + 1, self.sy, self.cy) + self.sy = ForceBetween(self.cy - self.sh + 1, self.sy, self.cy) self.cx = min(self.cx, self.CurrentLineLength()) def cHoriz(self, num): @@ -346,7 +350,7 @@ class wxEditor(wxScrolledWindow): def TouchBuffer(self): self.bufferTouched = TRUE - + ##-------------------------- Mouse scroll timing functions @@ -393,7 +397,7 @@ class wxEditor(wxScrolledWindow): row = self.sy + self.sh row = min(row, self.LinesInFile() - 1) self.cy = row - + def HandleLeftOfScreen(self, col): self.SetScrollTimer() if self.CanScroll(): @@ -407,7 +411,7 @@ class wxEditor(wxScrolledWindow): col = self.sx + self.sw col = min(col, self.CurrentLineLength()) self.cx = col - + ##------------------------ mousing functions def MouseToRow(self, mouseY): @@ -430,14 +434,14 @@ class wxEditor(wxScrolledWindow): def MouseToCursor(self, event): self.MouseToRow(event.GetY()) - self.MouseToCol(event.GetX()) + self.MouseToCol(event.GetX()) def OnMotion(self, event): if event.LeftIsDown(): self.Selecting = true self.MouseToCursor(event) self.SelectUpdate() - + def OnLeftDown(self, event): self.MouseToCursor(event) self.SelectBegin = (self.cy, self.cx) @@ -454,7 +458,7 @@ class wxEditor(wxScrolledWindow): self.ReleaseMouse() self.scrollTimer.Stop() - + #------------------------- Scrolling @@ -495,7 +499,7 @@ class wxEditor(wxScrolledWindow): self.cy = self.LinesInFile() else: self.sy = event.GetPosition() - + self.VertBoundaries() def OnScroll(self, event): @@ -514,7 +518,7 @@ class wxEditor(wxScrolledWindow): self.scroller.SetScrollbars( self.fw, self.fh, self.CalcMaxLineLen()+3, max(self.LinesInFile()+1, self.sh), - self.sx, self.sy) + self.sx, self.sy) #------------ backspace, delete, return @@ -540,11 +544,11 @@ class wxEditor(wxScrolledWindow): self.cx = len(t1) self.lines = self.lines[:self.cy] + [t1 + t2] + self.lines[self.cy+2:] self.TouchBuffer() - + def DeleteChar(self,x,y,oldtext): newtext = oldtext[:x] + oldtext[x+1:] - self.SetTextLine(y, newtext) + self.SetTextLine(y, newtext) self.TouchBuffer() @@ -561,7 +565,7 @@ class wxEditor(wxScrolledWindow): self.TouchBuffer() else: wxBell() - + def Delete(self, event): t = self.GetTextLine(self.cy) if self.cx