diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 36cc730257..9fb17b511e 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -21,6 +21,28 @@ Added wxDateTime, wxTimeSpan, and wxDateSpan to wxPython.utils. Added wxCalendarCtrl. +WARNING: A while back I asked what should be done about the Magic +Method Names. (Methods that are automatically turned into event +handlers by virtue of their name.) The consensus was that it is more +confusing to have them than to try and expand them to have greater +coverage. I am finally getting around to removing the code that +generates the event binding. This means that if you are using any of +the following method names without a EVT_* call that you need to +modify your code to add the EVT_* to hook the event to the method. + + OnChar + OnSize + OnEraseBackground + OnSysColourChanged + OnInitDialog + OnPaint + OnIdle + OnActivate + OnMenuHighlight + OnCloseWindow + OnScroll + + @@ -47,11 +69,11 @@ consistent with each other now so you may be able to guess pretty good...) Updated filebrowsebutton.py and calendar.py with changes from their -authors. There is now a FileBrowseButtonWithhistory class (what a +authors. There is now a FileBrowseButtonWithHistory class (what a mouthful!) and wxCalendar has printing support. Added ActiveXWrapper to the library, and some good demos of it too. -It works great for embedding a COM (a.k.a OCX, a.k.a Activex) control +It works great for embedding a COM (a.k.a OCX, a.k.a ActiveX) control in a window and calling its methods. It actually creates a new class on the fly that derives from wxWindow, the COM CoClass and others needed to make it all work. The resulting class can be instantiated diff --git a/wxPython/contrib/glcanvas/glcanvas.i b/wxPython/contrib/glcanvas/glcanvas.i index c1c3c0665d..b4d789ab94 100644 --- a/wxPython/contrib/glcanvas/glcanvas.i +++ b/wxPython/contrib/glcanvas/glcanvas.i @@ -85,7 +85,7 @@ public: int *attribList = 0, const wxPalette& palette = wxNullPalette); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" void SetCurrent(); void SetColour(const char *colour); diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.cpp b/wxPython/contrib/glcanvas/msw/glcanvas.cpp index 6032837bfc..ded3a3bb19 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas.cpp @@ -580,9 +580,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxIndividualLayoutConstraint","_class_wxIndividualLayoutConstraint",0}, { "_wxCursor","_class_wxCursor",0}, { "_wxNotifyEvent","_class_wxNotifyEvent",0}, + { "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0}, { "_wxImageHandler","_class_wxImageHandler",0}, { "_class_wxToolBarBase","_wxToolBarBase",0}, - { "_class_wxTreeCtrl","_wxTreeCtrl",0}, { "_wxMask","_class_wxMask",0}, { "_wxToolTip","_class_wxToolTip",0}, { "_wxPNGHandler","_class_wxPNGHandler",0}, @@ -651,6 +651,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, + { "_class_wxPyTreeCtrl","_wxPyTreeCtrl",0}, { "_wxPyEvent","_class_wxPyEvent",0}, { "_wxTextCtrl","_class_wxTextCtrl",0}, { "_class_wxMask","_wxMask",0}, @@ -685,6 +686,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_unsigned_int",0}, { "_uint","_int",0}, { "_uint","_wxWindowID",0}, + { "_wxChar","_char",0}, { "_wxPyValidator","_class_wxPyValidator",0}, { "_class_wxEvent","_wxEvent",0}, { "_wxCheckListBox","_class_wxCheckListBox",0}, @@ -700,11 +702,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxFontData","_wxFontData",0}, { "_class_wxPNMHandler","_wxPNMHandler",0}, { "_wxBoxSizer","_class_wxBoxSizer",0}, + { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, - { "_wxPyTimer","_class_wxPyTimer",0}, { "_wxWindowDC","_class_wxWindowDC",0}, + { "_wxTimerEvent","_class_wxTimerEvent",0}, + { "_wxPyTimer","_class_wxPyTimer",0}, { "_wxScrollBar","_class_wxScrollBar",0}, { "_wxSpinButton","_class_wxSpinButton",0}, { "_wxColourDialog","_class_wxColourDialog",0}, @@ -755,9 +759,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxMDIParentFrame","_class_wxMDIParentFrame",0}, { "_class_wxTreeEvent","_wxTreeEvent",0}, { "_class_wxDirDialog","_wxDirDialog",0}, - { "_class_wxPyTimer","_wxPyTimer",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, { "_wxMaximizeEvent","_class_wxMaximizeEvent",0}, + { "_class_wxTimerEvent","_wxTimerEvent",0}, + { "_class_wxPyTimer","_wxPyTimer",0}, { "_class_wxSpinButton","_wxSpinButton",0}, { "_wxAcceleratorEntry","_class_wxAcceleratorEntry",0}, { "_class_wxPanel","_class_wxGLCanvas",SwigwxGLCanvasTowxPanel}, @@ -920,7 +925,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxValidator","_class_wxValidator",0}, { "_wxToolBarBase","_class_wxToolBarBase",0}, { "_class_wxTreeItemId","_wxTreeItemId",0}, - { "_wxTreeCtrl","_class_wxTreeCtrl",0}, { "_class_wxLayoutConstraints","_wxLayoutConstraints",0}, { "_wxIconizeEvent","_class_wxIconizeEvent",0}, { "_class_wxControl","_wxControl",0}, diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.py b/wxPython/contrib/glcanvas/msw/glcanvas.py index 49cf2b0415..11d46f9612 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.py +++ b/wxPython/contrib/glcanvas/msw/glcanvas.py @@ -88,7 +88,7 @@ class wxGLCanvas(wxGLCanvasPtr): def __init__(self,*_args,**_kwargs): self.this = apply(glcanvasc.new_wxGLCanvas,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) diff --git a/wxPython/contrib/ogl/oglcanvas.cpp b/wxPython/contrib/ogl/oglcanvas.cpp index 2e6a2ada72..22bfb6bffd 100644 --- a/wxPython/contrib/ogl/oglcanvas.cpp +++ b/wxPython/contrib/ogl/oglcanvas.cpp @@ -2014,9 +2014,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxIndividualLayoutConstraint","_class_wxIndividualLayoutConstraint",0}, { "_wxCursor","_class_wxCursor",0}, { "_wxNotifyEvent","_class_wxNotifyEvent",0}, + { "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0}, { "_wxImageHandler","_class_wxImageHandler",0}, { "_class_wxToolBarBase","_wxToolBarBase",0}, - { "_class_wxTreeCtrl","_wxTreeCtrl",0}, { "_wxMask","_class_wxMask",0}, { "_wxToolTip","_class_wxToolTip",0}, { "_wxPNGHandler","_class_wxPNGHandler",0}, @@ -2086,6 +2086,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, + { "_class_wxPyTreeCtrl","_wxPyTreeCtrl",0}, { "_wxPyEvent","_class_wxPyEvent",0}, { "_wxTextCtrl","_class_wxTextCtrl",0}, { "_class_wxMask","_wxMask",0}, @@ -2120,6 +2121,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_unsigned_int",0}, { "_uint","_int",0}, { "_uint","_wxWindowID",0}, + { "_wxChar","_char",0}, { "_wxPyValidator","_class_wxPyValidator",0}, { "_class_wxEvent","_wxEvent",0}, { "_wxCheckListBox","_class_wxCheckListBox",0}, @@ -2136,10 +2138,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxFontData","_wxFontData",0}, { "_class_wxPNMHandler","_wxPNMHandler",0}, { "_wxBoxSizer","_class_wxBoxSizer",0}, + { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, - { "_wxPyTimer","_class_wxPyTimer",0}, { "_wxWindowDC","_class_wxWindowDC",0}, + { "_wxTimerEvent","_class_wxTimerEvent",0}, + { "_wxPyTimer","_class_wxPyTimer",0}, { "_wxScrollBar","_class_wxScrollBar",0}, { "_wxSpinButton","_class_wxSpinButton",0}, { "_wxColourDialog","_class_wxColourDialog",0}, @@ -2192,9 +2196,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxMDIParentFrame","_class_wxMDIParentFrame",0}, { "_class_wxTreeEvent","_wxTreeEvent",0}, { "_class_wxDirDialog","_wxDirDialog",0}, - { "_class_wxPyTimer","_wxPyTimer",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, { "_wxMaximizeEvent","_class_wxMaximizeEvent",0}, + { "_class_wxTimerEvent","_wxTimerEvent",0}, + { "_class_wxPyTimer","_wxPyTimer",0}, { "_class_wxSpinButton","_wxSpinButton",0}, { "_wxAcceleratorEntry","_class_wxAcceleratorEntry",0}, { "_class_wxPanel","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel}, @@ -2354,7 +2359,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxValidator","_class_wxValidator",0}, { "_wxToolBarBase","_class_wxToolBarBase",0}, { "_class_wxTreeItemId","_wxTreeItemId",0}, - { "_wxTreeCtrl","_class_wxTreeCtrl",0}, { "_class_wxLayoutConstraints","_wxLayoutConstraints",0}, { "_wxIconizeEvent","_class_wxIconizeEvent",0}, { "_class_wxControl","_wxControl",0}, diff --git a/wxPython/contrib/ogl/oglcanvas.i b/wxPython/contrib/ogl/oglcanvas.i index a5dc253567..bf96d849c0 100644 --- a/wxPython/contrib/ogl/oglcanvas.i +++ b/wxPython/contrib/ogl/oglcanvas.i @@ -119,8 +119,8 @@ public: void _setSelf(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShapeCanvas)" - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" - %pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)" void AddShape(wxPyShape *shape, wxPyShape *addAfter = NULL); diff --git a/wxPython/contrib/ogl/oglcanvas.py b/wxPython/contrib/ogl/oglcanvas.py index 4c3411e242..60c19d8980 100644 --- a/wxPython/contrib/ogl/oglcanvas.py +++ b/wxPython/contrib/ogl/oglcanvas.py @@ -210,8 +210,8 @@ class wxPyShapeCanvas(wxPyShapeCanvasPtr): self.this = apply(oglcanvasc.new_wxPyShapeCanvas,_args,_kwargs) self.thisown = 1 self._setSelf(self, wxPyShapeCanvas) - wx._StdWindowCallbacks(self) - wx._StdOnScrollCallbacks(self) + #wx._StdWindowCallbacks(self) + #wx._StdOnScrollCallbacks(self) diff --git a/wxPython/contrib/stc/stc_.cpp b/wxPython/contrib/stc/stc_.cpp index 93269ff6a3..9a3b048735 100644 --- a/wxPython/contrib/stc/stc_.cpp +++ b/wxPython/contrib/stc/stc_.cpp @@ -140,7 +140,7 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) 0; - char * _arg5; + char * _arg5 = (char *) "styledtext"; PyObject * _argo0 = 0; wxPoint temp; PyObject * _obj2 = 0; @@ -150,7 +150,7 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|Ols:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -159,6 +159,7 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb return NULL; } } + if (_obj2) { _arg2 = &temp; if (! wxPoint_helper(_obj2, &_arg2)) diff --git a/wxPython/demo/ActiveXWrapper_Acrobat.py b/wxPython/demo/ActiveXWrapper_Acrobat.py index e8c1bca10b..5eedf1d55b 100644 --- a/wxPython/demo/ActiveXWrapper_Acrobat.py +++ b/wxPython/demo/ActiveXWrapper_Acrobat.py @@ -32,6 +32,7 @@ class TestPanel(wxPanel): def __init__(self, parent, log): wxPanel.__init__(self, parent, -1) self.log = log + self.pdf = None sizer = wxBoxSizer(wxVERTICAL) btnSizer = wxBoxSizer(wxHORIZONTAL) @@ -65,8 +66,10 @@ class TestPanel(wxPanel): self.SetAutoLayout(true) def __del__(self): - self.pdf.Cleanup() - self.pdf = None + if self.pdf: + self.pdf.Cleanup() + self.pdf = None + def OnOpenButton(self, event): @@ -112,6 +115,7 @@ if __name__ == '__main__': wxFrame.__init__(self, None, -1, "ActiveX test -- Acrobat", size=(640, 480), style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE) self.tp = TestPanel(self, sys.stdout) + EVT_CLOSE(self, self.OnCloseWindow) def OnCloseWindow(self, event): self.tp.pdf.Cleanup() diff --git a/wxPython/demo/ActiveXWrapper_IE.py b/wxPython/demo/ActiveXWrapper_IE.py index a30ad632b3..3cfd0ac559 100644 --- a/wxPython/demo/ActiveXWrapper_IE.py +++ b/wxPython/demo/ActiveXWrapper_IE.py @@ -1,15 +1,20 @@ """
-This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.) +This demo shows how to embed an ActiveX control in a wxPython +application, (Win32 only.) +-The MakeActiveXClass function dynamically builds a new Class on the fly, that has the -same signature and semantics as wxWindow. This means that when you call the function -you get back a new class that you can use just like wxWindow, (set the size and position, -use in a sizer, etc.) except its contents will be the COM control. +The MakeActiveXClass function dynamically builds a new Class on the +fly, that has the same signature and semantics as wxWindow. This +means that when you call the function you get back a new class that +you can use just like wxWindow, (set the size and position, use in a +sizer, etc.) except its contents will be the COM control. +
-This demo embeds the Internet Exploer WebBrowser control, and shows how to receive events
-from the COM control. (The title bar and status bar are updated as pages change, in addition
-to the log messages being shown.)
+This demo embeds the Internet Exploer WebBrowser control, and shows
+how to receive events from the COM control. (The title bar and status
+bar are updated as pages change, in addition to the log messages being
+shown.)
"""
@@ -30,6 +35,7 @@ if wxPlatform == '__WXMSW__':
class TestPanel(wxWindow):
def __init__(self, parent, log, frame=None):
wxWindow.__init__(self, parent, -1)#, style=wxCLIP_CHILDREN)
+ self.ie = None
self.log = log
self.current = "http://alldunn.com/"
self.frame = frame
@@ -83,14 +89,16 @@ class TestPanel(wxWindow):
self.SetSizer(sizer)
self.SetAutoLayout(true)
+ EVT_SIZE(self, self.OnSize)
def OnSize(self, evt):
self.Layout()
def __del__(self):
- self.ie.Cleanup()
- self.ie = None
+ if self.ie:
+ self.ie.Cleanup()
+ self.ie = None
def OnLocationSelect(self, evt):
url = self.location.GetStringSelection()
@@ -181,6 +189,7 @@ if __name__ == '__main__':
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.CreateStatusBar()
self.tp = TestPanel(self, sys.stdout, self)
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.tp.ie.Cleanup()
diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py
index 8a2eccd53c..eb33d57f3d 100644
--- a/wxPython/demo/CustomDragAndDrop.py
+++ b/wxPython/demo/CustomDragAndDrop.py
@@ -19,6 +19,7 @@ class DoodlePad(wxWindow):
EVT_LEFT_UP(self, self.OnLeftUp)
EVT_RIGHT_UP(self, self.OnRightUp)
EVT_MOTION(self, self.OnMotion)
+ EVT_PAINT(self, self.OnPaint)
def OnPaint(self, event):
@@ -153,6 +154,7 @@ class DoodleViewer(wxWindow):
self.x = self.y = 0
dt = DoodleDropTarget(self, log)
self.SetDropTarget(dt)
+ EVT_PAINT(self, self.OnPaint)
def SetLines(self, lines):
self.lines = lines
diff --git a/wxPython/demo/DialogUnits.py b/wxPython/demo/DialogUnits.py
index aba492715f..7f369dd40f 100644
--- a/wxPython/demo/DialogUnits.py
+++ b/wxPython/demo/DialogUnits.py
@@ -29,6 +29,7 @@ class MyFrame(wxFrame):
# Associate some events with methods of this class
EVT_SIZE(self, self.OnSize)
EVT_MOVE(self, self.OnMove)
+ EVT_CLOSE(self, self.OnCloseWindow)
# Add a panel and some controls to display the size and position
panel = wxPanel(self, -1)
diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py
index 4021dd9862..c15a3a70c5 100644
--- a/wxPython/demo/Main.py
+++ b/wxPython/demo/Main.py
@@ -78,6 +78,7 @@ class wxPythonDemo(wxFrame):
self.otherWin = None
EVT_IDLE(self, self.OnIdle)
+ EVT_CLOSE(self, self.OnCloseWindow)
self.Centre(wxBOTH)
self.CreateStatusBar(1, wxST_SIZEGRIP)
diff --git a/wxPython/demo/OldSizers.py b/wxPython/demo/OldSizers.py
index 308bcec7c4..cf24093eb7 100644
--- a/wxPython/demo/OldSizers.py
+++ b/wxPython/demo/OldSizers.py
@@ -292,6 +292,8 @@ class TestFrame(wxFrame):
self.CreateStatusBar()
self.SetStatusText("Resize this frame to see how the sizers respond...")
self.sizer.FitWindow(self)
+ EVT_CLOSE(self, self.OnCloseWindow)
+ EVT_SIZE(self, self.OnSize)
def OnSize(self, event):
@@ -378,6 +380,7 @@ if __name__ == '__main__':
EVT_MENU(self, 200, self.OnExit)
self.panel = TestSelectionPanel(self, self)
self.SetSize(wxSize(400, 380))
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.Destroy()
diff --git a/wxPython/demo/Sizers.py b/wxPython/demo/Sizers.py
index 24545c108d..c200aa1fbf 100644
--- a/wxPython/demo/Sizers.py
+++ b/wxPython/demo/Sizers.py
@@ -481,6 +481,7 @@ class TestFrame(wxFrame):
self.SetAutoLayout(true)
self.SetSizer(self.sizer)
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.MakeModal(false)
@@ -563,6 +564,7 @@ if __name__ == '__main__':
EVT_MENU(self, 200, self.OnExit)
self.panel = TestSelectionPanel(self, self)
self.SetSize(wxSize(400, 380))
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.Destroy()
diff --git a/wxPython/demo/SlashDot.py b/wxPython/demo/SlashDot.py
index bacf005620..cebe1438c5 100644
--- a/wxPython/demo/SlashDot.py
+++ b/wxPython/demo/SlashDot.py
@@ -43,6 +43,7 @@ class HTMLTextView(wxFrame):
wxFrame.__init__(self, parent, id, title, wxPyDefaultPosition,
wxSize(600,400))
+ EVT_CLOSE(self, self.OnCloseWindow)
self.mainmenu = wxMenuBar()
menu = wxMenu()
@@ -155,6 +156,7 @@ class AppStatusBar(wxStatusBar):
self.SetStatusWidths([-1, 100])
self.but = wxButton(self, 1001, "Refresh")
EVT_BUTTON(self, 1001, parent.OnViewRefresh)
+ EVT_SIZE(self, self.OnSize)
self.OnSize(None)
def logprint(self,x):
diff --git a/wxPython/demo/Threads.py b/wxPython/demo/Threads.py
index 2dabc263b8..19b759aece 100644
--- a/wxPython/demo/Threads.py
+++ b/wxPython/demo/Threads.py
@@ -77,6 +77,9 @@ class GraphWindow(wxWindow):
self.colors = [ wxRED, wxGREEN, wxBLUE, wxCYAN,
wxNamedColour("Yellow"), wxNamedColor("Navy") ]
+ EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
+ EVT_PAINT(self, self.OnPaint)
+
def SetValue(self, index, value):
assert index < len(self.values)
@@ -185,6 +188,7 @@ class TestFrame(wxFrame):
for t in self.threads:
t.Start()
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnUpdate(self, evt):
diff --git a/wxPython/demo/hangman.py b/wxPython/demo/hangman.py
index 3f2c6da5c6..31c7c72fb3 100644
--- a/wxPython/demo/hangman.py
+++ b/wxPython/demo/hangman.py
@@ -124,6 +124,8 @@ class HangmanWnd(wxWindow):
else:
self.font = wxFont(10, wxMODERN, wxNORMAL, wxNORMAL)
self.SetFocus()
+ EVT_PAINT(self, self.OnPaint)
+
def StartGame(self, word):
self.word = word
@@ -252,6 +254,7 @@ class HangmanDemoFrame(wxFrame):
def __init__(self, wf, parent, id, pos, size):
wxFrame.__init__(self, parent, id, "Hangman demo", pos, size)
self.demo = HangmanDemo(wf, self, -1, wxDefaultPosition, wxDefaultSize)
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.demo.timer.Stop()
diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py
index 46db9ccdc9..18c192c885 100755
--- a/wxPython/demo/run.py
+++ b/wxPython/demo/run.py
@@ -37,7 +37,8 @@ class RunDemoApp(wxApp):
def OnInit(self):
wxInitAllImageHandlers()
- frame = wxFrame(None, -1, "RunDemo: " + self.name, size=(0,0))
+ frame = wxFrame(None, -1, "RunDemo: " + self.name, size=(0,0),
+ style=wxNO_FULL_REPAINT_ON_RESIZE|wxDEFAULT_FRAME_STYLE)
frame.CreateStatusBar()
frame.Show(true)
win = self.demoModule.runTest(frame, frame, Log())
@@ -80,7 +81,6 @@ def main(argv):
name = argv[1]
if name[-3:] == '.py':
name = name[:-3]
- print name
module = __import__(name)
diff --git a/wxPython/demo/wxCalendar.py b/wxPython/demo/wxCalendar.py
index 27e6f631c2..ca61fa2091 100644
--- a/wxPython/demo/wxCalendar.py
+++ b/wxPython/demo/wxCalendar.py
@@ -175,8 +175,6 @@ class TestPanel(wxPanel):
text = '%s CLICK %02d/%02d/%d' % (evt.click, evt.day, evt.month, evt.year) # format date
self.log.WriteText('Date Selected: ' + text + '\n')
- def OnCloseWindow(self, event):
- self.Destroy()
# set the highlighted days for the calendar
@@ -317,6 +315,7 @@ class CalenDlg(wxDialog):
class CalendFrame(wxFrame):
def __init__(self, parent, id, title, log):
wxFrame.__init__(self, parent, id, title, wxPyDefaultPosition, wxSize(400, 400))
+ EVT_CLOSE(self, self.OnCloseWindow)
self.log = log
self.CreateStatusBar()
@@ -574,9 +573,6 @@ class PrintCalend:
return year, month
- def OnCloseWindow(self, event):
- self.Destroy()
-
def GetTotalPages(self):
self.pg_cnt = 1
return self.pg_cnt
diff --git a/wxPython/demo/wxFloatBar.py b/wxPython/demo/wxFloatBar.py
index 0936ac224d..4d0547bd51 100644
--- a/wxPython/demo/wxFloatBar.py
+++ b/wxPython/demo/wxFloatBar.py
@@ -49,6 +49,7 @@ class TestFloatBar(wxFrame):
tb.Realize()
self.tb = tb
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
diff --git a/wxPython/demo/wxFrame.py b/wxPython/demo/wxFrame.py
index e0fc080954..9b96b2b7ba 100644
--- a/wxPython/demo/wxFrame.py
+++ b/wxPython/demo/wxFrame.py
@@ -11,6 +11,8 @@ class MyFrame(wxFrame):
button = wxButton(panel, 1003, "Close Me")
button.SetPosition(wxPoint(15, 15))
EVT_BUTTON(self, 1003, self.OnCloseMe)
+ EVT_CLOSE(self, self.OnCloseWindow)
+
def OnCloseMe(self, event):
self.Close(true)
diff --git a/wxPython/demo/wxGLCanvas.py b/wxPython/demo/wxGLCanvas.py
index 2da77bfa2a..d6266f5814 100644
--- a/wxPython/demo/wxGLCanvas.py
+++ b/wxPython/demo/wxGLCanvas.py
@@ -59,6 +59,8 @@ else:
def __init__(self, parent):
wxGLCanvas.__init__(self, parent, -1)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
+ EVT_SIZE(self, self.OnSize)
+ EVT_PAINT(self, self.OnPaint)
self.init = false
def OnEraseBackground(self, event):
@@ -148,6 +150,8 @@ else:
def __init__(self, parent):
wxGLCanvas.__init__(self, parent, -1)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
+ EVT_SIZE(self, self.OnSize)
+ EVT_PAINT(self, self.OnPaint)
self.init = false
def OnEraseBackground(self, event):
diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py
index fd521a8bb5..89776e2da6 100644
--- a/wxPython/demo/wxListCtrl.py
+++ b/wxPython/demo/wxListCtrl.py
@@ -93,6 +93,7 @@ class TestListCtrlPanel(wxPanel):
self.list.SetItemState(5, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED)
self.currentItem = 0
+ EVT_SIZE(self, self.OnSize)
EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)
EVT_LIST_DELETE_ITEM(self, tID, self.OnItemDelete)
EVT_LIST_COL_CLICK(self, tID, self.OnColClick)
diff --git a/wxPython/demo/wxMask.py b/wxPython/demo/wxMask.py
index 80d340474a..7f93f01901 100644
--- a/wxPython/demo/wxMask.py
+++ b/wxPython/demo/wxMask.py
@@ -53,6 +53,7 @@ class TestMaskWindow(wxScrolledWindow):
self.SetScrollbars(20, 20, 700/20, 460/20)
+ EVT_PAINT(self, self.OnPaint)
def OnPaint (self, e):
diff --git a/wxPython/demo/wxMiniFrame.py b/wxPython/demo/wxMiniFrame.py
index ba9d7e527b..f3cd53a40a 100644
--- a/wxPython/demo/wxMiniFrame.py
+++ b/wxPython/demo/wxMiniFrame.py
@@ -10,6 +10,7 @@ class MyMiniFrame(wxMiniFrame):
button = wxButton(panel, 1003, "Close Me")
button.SetPosition(wxPoint(15, 15))
EVT_BUTTON(self, 1003, self.OnCloseMe)
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseMe(self, event):
self.Close(true)
diff --git a/wxPython/demo/wxSashWindow.py b/wxPython/demo/wxSashWindow.py
index 446ffce9e4..93b8b98417 100644
--- a/wxPython/demo/wxSashWindow.py
+++ b/wxPython/demo/wxSashWindow.py
@@ -17,6 +17,7 @@ class TestSashWindow(wxPanel):
EVT_SASH_DRAGGED_RANGE(self, self.ID_WINDOW_TOP,
self.ID_WINDOW_BOTTOM, self.OnSashDrag)
+ EVT_SIZE(self, self.OnSize)
# Create some layout windows
diff --git a/wxPython/demo/wxScrolledWindow.py b/wxPython/demo/wxScrolledWindow.py
index 44b5f9fd93..8c9d2713ed 100644
--- a/wxPython/demo/wxScrolledWindow.py
+++ b/wxPython/demo/wxScrolledWindow.py
@@ -12,9 +12,12 @@ class MyCanvas(wxScrolledWindow):
self.maxHeight = 1000
self.SetBackgroundColour(wxNamedColor("WHITE"))
- self.Connect(-1, -1, wxEVT_LEFT_DOWN, self.OnLeftButtonEvent)
- self.Connect(-1, -1, wxEVT_LEFT_UP, self.OnLeftButtonEvent)
- self.Connect(-1, -1, wxEVT_MOTION, self.OnLeftButtonEvent)
+ EVT_LEFT_DOWN(self, self.OnLeftButtonEvent)
+ EVT_LEFT_UP(self, self.OnLeftButtonEvent)
+ EVT_MOTION(self, self.OnLeftButtonEvent)
+
+ EVT_PAINT(self, self.OnPaint)
+
self.SetCursor(wxStockCursor(wxCURSOR_PENCIL))
bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
@@ -109,7 +112,6 @@ class MyCanvas(wxScrolledWindow):
self.CaptureMouse()
elif event.Dragging():
- print event.GetPosition()
dc = wxClientDC(self)
self.PrepareDC(dc)
dc.BeginDrawing()
diff --git a/wxPython/demo/wxStatusBar.py b/wxPython/demo/wxStatusBar.py
index 97c32980eb..bdb016a1fa 100644
--- a/wxPython/demo/wxStatusBar.py
+++ b/wxPython/demo/wxStatusBar.py
@@ -10,6 +10,7 @@ class CustomStatusBar(wxStatusBar):
wxStatusBar.__init__(self, parent, -1)
self.SetFieldsCount(3)
self.log = log
+ EVT_SIZE(self, self.OnSize)
self.SetStatusText("A Custom StatusBar...", 0)
@@ -62,6 +63,7 @@ class TestCustomStatusBar(wxFrame):
self.sb = CustomStatusBar(self, log)
self.SetStatusBar(self.sb)
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.sb.timer.Stop()
diff --git a/wxPython/demo/wxTextCtrl.py b/wxPython/demo/wxTextCtrl.py
index 49eaa00e75..98f0a25a66 100644
--- a/wxPython/demo/wxTextCtrl.py
+++ b/wxPython/demo/wxTextCtrl.py
@@ -9,7 +9,8 @@ class TestPanel(wxPanel):
self.log = log
wxStaticText(self, -1, "wxTextCtrl", wxPoint(5, 25), wxSize(75, 20))
- wxTextCtrl(self, 10, "", wxPoint(80, 25), wxSize(150, 20))
+ t = wxTextCtrl(self, 10, "Test it out and see", wxPoint(80, 25), wxSize(150, 20))
+ t.SetInsertionPoint(0)
EVT_TEXT(self, 10, self.EvtText)
wxStaticText(self, -1, "Passsword", wxPoint(5, 50), wxSize(75, 20))
@@ -17,7 +18,8 @@ class TestPanel(wxPanel):
EVT_TEXT(self, 20, self.EvtText)
wxStaticText(self, -1, "Multi-line", wxPoint(5, 75), wxSize(75, 20))
- wxTextCtrl(self, 30, "", wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
+ t = wxTextCtrl(self, 30, "How does it work with a long line of text set in the control", wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
+ t.SetInsertionPoint(0)
EVT_TEXT(self, 30, self.EvtText)
def EvtText(self, event):
diff --git a/wxPython/demo/wxToolBar.py b/wxPython/demo/wxToolBar.py
index e4926741b8..19a806d94f 100644
--- a/wxPython/demo/wxToolBar.py
+++ b/wxPython/demo/wxToolBar.py
@@ -55,6 +55,7 @@ class TestToolBar(wxFrame):
size=(150,-1), style=wxCB_DROPDOWN))
tb.Realize()
+ EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
diff --git a/wxPython/demo/wxTreeCtrl.py b/wxPython/demo/wxTreeCtrl.py
index 2ff45973ef..8c46448325 100644
--- a/wxPython/demo/wxTreeCtrl.py
+++ b/wxPython/demo/wxTreeCtrl.py
@@ -22,6 +22,7 @@ class MyTreeCtrl(wxTreeCtrl):
class TestTreeCtrlPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
+ EVT_SIZE(self, self.OnSize)
self.log = log
tID = NewId()
diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py
index a92ab3fe76..5e35de7a4e 100644
--- a/wxPython/src/_extras.py
+++ b/wxPython/src/_extras.py
@@ -24,41 +24,41 @@ _wxSetDictionary(vars())
# Helper function to link python methods to wxWindows virtual
# functions by name.
-def _checkForCallback(obj, name, event, theID=-1):
- try: cb = getattr(obj, name)
- except: pass
- else: obj.Connect(theID, -1, event, cb)
+## def _checkForCallback(obj, name, event, theID=-1):
+## try: cb = getattr(obj, name)
+## except: pass
+## else: obj.Connect(theID, -1, event, cb)
-def _StdWindowCallbacks(win):
- _checkForCallback(win, "OnChar", wxEVT_CHAR)
- _checkForCallback(win, "OnSize", wxEVT_SIZE)
- _checkForCallback(win, "OnEraseBackground", wxEVT_ERASE_BACKGROUND)
- _checkForCallback(win, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED)
- _checkForCallback(win, "OnInitDialog", wxEVT_INIT_DIALOG)
- _checkForCallback(win, "OnPaint", wxEVT_PAINT)
- _checkForCallback(win, "OnIdle", wxEVT_IDLE)
+## def _StdWindowCallbacks(win):
+## _checkForCallback(win, "OnChar", wxEVT_CHAR)
+## _checkForCallback(win, "OnSize", wxEVT_SIZE)
+## _checkForCallback(win, "OnEraseBackground", wxEVT_ERASE_BACKGROUND)
+## _checkForCallback(win, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED)
+## _checkForCallback(win, "OnInitDialog", wxEVT_INIT_DIALOG)
+## _checkForCallback(win, "OnPaint", wxEVT_PAINT)
+## _checkForCallback(win, "OnIdle", wxEVT_IDLE)
-def _StdFrameCallbacks(win):
- _StdWindowCallbacks(win)
- _checkForCallback(win, "OnActivate", wxEVT_ACTIVATE)
- _checkForCallback(win, "OnMenuHighlight", wxEVT_MENU_HIGHLIGHT)
- _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
+## def _StdFrameCallbacks(win):
+## _StdWindowCallbacks(win)
+## _checkForCallback(win, "OnActivate", wxEVT_ACTIVATE)
+## _checkForCallback(win, "OnMenuHighlight", wxEVT_MENU_HIGHLIGHT)
+## _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
-def _StdDialogCallbacks(win):
- _StdWindowCallbacks(win)
- _checkForCallback(win, "OnOk", wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK)
- _checkForCallback(win, "OnApply", wxEVT_COMMAND_BUTTON_CLICKED, wxID_APPLY)
- _checkForCallback(win, "OnCancel", wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL)
- _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
- _checkForCallback(win, "OnCharHook", wxEVT_CHAR_HOOK)
+## def _StdDialogCallbacks(win):
+## _StdWindowCallbacks(win)
+## _checkForCallback(win, "OnOk", wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK)
+## _checkForCallback(win, "OnApply", wxEVT_COMMAND_BUTTON_CLICKED, wxID_APPLY)
+## _checkForCallback(win, "OnCancel", wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL)
+## _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
+## _checkForCallback(win, "OnCharHook", wxEVT_CHAR_HOOK)
-def _StdOnScrollCallbacks(win):
- try: cb = getattr(win, "OnScroll")
- except: pass
- else: EVT_SCROLL(win, cb)
+## def _StdOnScrollCallbacks(win):
+## try: cb = getattr(win, "OnScroll")
+## except: pass
+## else: EVT_SCROLL(win, cb)
@@ -526,15 +526,9 @@ def EVT_SPIN_UP(win, id, func):
win.Connect(id, -1, wxEVT_SCROLL_LINEUP, func)
def EVT_SPIN_DOWN(win, id, func):
- win.Connect(id, -1,wxEVT_SCROLL_LINEDOWN, func)
+ win.Connect(id, -1, wxEVT_SCROLL_LINEDOWN, func)
def EVT_SPIN(win, id, func):
- win.Connect(id, -1, wxEVT_SCROLL_TOP, func)
- win.Connect(id, -1, wxEVT_SCROLL_BOTTOM, func)
- win.Connect(id, -1, wxEVT_SCROLL_LINEUP, func)
- win.Connect(id, -1, wxEVT_SCROLL_LINEDOWN, func)
- win.Connect(id, -1, wxEVT_SCROLL_PAGEUP, func)
- win.Connect(id, -1, wxEVT_SCROLL_PAGEDOWN, func)
win.Connect(id, -1, wxEVT_SCROLL_THUMBTRACK,func)
diff --git a/wxPython/src/cmndlgs.i b/wxPython/src/cmndlgs.i
index b3839982c4..088e509085 100644
--- a/wxPython/src/cmndlgs.i
+++ b/wxPython/src/cmndlgs.i
@@ -54,7 +54,7 @@ class wxColourDialog : public wxDialog {
public:
wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
- %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxColourData& GetColourData();
int ShowModal();
@@ -71,7 +71,7 @@ public:
long style = 0,
const wxPoint& pos = wxPyDefaultPosition);
- %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxString GetPath();
wxString GetMessage();
@@ -93,7 +93,7 @@ public:
long style = 0,
const wxPoint& pos = wxPyDefaultPosition);
- %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxString GetDirectory();
wxString GetFilename();
@@ -162,7 +162,7 @@ public:
}
}
- %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
int GetSelection();
wxString GetStringSelection();
@@ -182,7 +182,7 @@ public:
long style = wxOK | wxCANCEL | wxCENTRE,
const wxPoint& pos = wxPyDefaultPosition);
- %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxString GetValue();
void SetValue(const wxString& value);
@@ -216,7 +216,7 @@ class wxFontDialog : public wxDialog {
public:
wxFontDialog(wxWindow* parent, wxFontData* data);
- %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxFontData& GetFontData();
int ShowModal();
@@ -233,7 +233,7 @@ public:
long style = wxOK | wxCANCEL | wxCENTRE,
const wxPoint& pos = wxPyDefaultPosition);
- %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
int ShowModal();
};
diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i
index 129a23b1d3..5c8e592e12 100644
--- a/wxPython/src/controls.i
+++ b/wxPython/src/controls.i
@@ -68,7 +68,7 @@ public:
const wxValidator& validator=wxPyDefaultValidator,
const char* name="control");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Command(wxCommandEvent& event);
wxString GetLabel();
@@ -87,7 +87,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "button");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void SetDefault();
void SetBackgroundColour(const wxColour& colour);
@@ -112,7 +112,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "button");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
wxBitmap& GetBitmapLabel();
wxBitmap& GetBitmapDisabled();
@@ -161,7 +161,7 @@ public:
const wxValidator& val = wxPyDefaultValidator,
char* name = "checkBox");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool GetValue();
void SetValue(const bool state);
@@ -179,7 +179,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "choice");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Append(const wxString& item);
void Clear();
@@ -206,7 +206,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "comboBox");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Append(const wxString& item);
// TODO: void Append(const wxString& item, char* clientData);
@@ -246,7 +246,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "gauge");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
int GetBezelFace();
int GetRange();
@@ -293,7 +293,7 @@ public:
long style = 0,
char* name = "staticText");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
wxString GetLabel();
void SetLabel(const wxString& label);
@@ -311,7 +311,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listBox");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Append(const wxString& item);
// TODO: void Append(const wxString& item, char* clientData);
@@ -364,7 +364,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listBox");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool IsChecked(int uiIndex);
void Check(int uiIndex, int bCheck = TRUE);
@@ -384,7 +384,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "text");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Clear();
void Copy();
@@ -441,7 +441,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "scrollBar");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
int GetRange();
int GetPageSize();
@@ -482,7 +482,7 @@ public:
long style = 0,
char* name = "staticBitmap");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
const wxBitmap& GetBitmap();
void SetBitmap(const wxBitmap& bitmap);
@@ -503,7 +503,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "radioBox");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Enable(bool enable);
%name(EnableItem)void Enable(int n, bool enable);
@@ -536,7 +536,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "radioButton");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool GetValue();
void SetValue(bool value);
@@ -554,7 +554,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "slider");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void ClearSel();
void ClearTicks();
diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i
index ac05ca939a..c645835d42 100644
--- a/wxPython/src/controls2.i
+++ b/wxPython/src/controls2.i
@@ -220,7 +220,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listCtrl");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
bool DeleteItem(long item);
@@ -491,7 +491,7 @@ public:
char* name = "wxTreeCtrl");
void _setSelf(PyObject* self, PyObject* _class);
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxTreeCtrl)"
size_t GetCount();
@@ -710,7 +710,7 @@ public:
long style = 0,
char* name = "tabCtrl");
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool DeleteAllItems();
bool DeleteItem(int item);
diff --git a/wxPython/src/frames.i b/wxPython/src/frames.i
index eee3aa780c..faaf6655ae 100644
--- a/wxPython/src/frames.i
+++ b/wxPython/src/frames.i
@@ -42,7 +42,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE,
char* name = "frame");
- %pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
void Centre(int direction = wxBOTH);
wxStatusBar* CreateStatusBar(int number = 1,
@@ -87,7 +87,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE,
char* name = "frame");
- %pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
};
diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i
index afb97c931a..a91b317b75 100644
--- a/wxPython/src/gdi.i
+++ b/wxPython/src/gdi.i
@@ -523,6 +523,8 @@ public:
void GetDeviceOrigin(int *OUTPUT, int *OUTPUT);
void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
+ void CalcBoundingBox(int x, int y);
+ void ResetBoundingBox();
};
diff --git a/wxPython/src/html.i b/wxPython/src/html.i
index 1c83621d34..17db361382 100644
--- a/wxPython/src/html.i
+++ b/wxPython/src/html.i
@@ -456,8 +456,8 @@ public:
void _setSelf(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxHtmlWindow)"
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
- %pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)"
bool SetPage(const char* source);
diff --git a/wxPython/src/mdi.i b/wxPython/src/mdi.i
index 41de685303..6fc5ed554a 100644
--- a/wxPython/src/mdi.i
+++ b/wxPython/src/mdi.i
@@ -42,7 +42,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const char* name = "frame");
- %pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
void ActivateNext();
void ActivatePrevious();
@@ -73,7 +73,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE,
const char* name = "frame");
- %pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
void Activate();
void Maximize(bool maximize);
@@ -87,8 +87,8 @@ public:
class wxMDIClientWindow : public wxWindow {
public:
wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0);
- %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
- %pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
+ %pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)"
};
//---------------------------------------------------------------------------
diff --git a/wxPython/src/msw/cmndlgs.py b/wxPython/src/msw/cmndlgs.py
index 1000cc3848..0947274149 100644
--- a/wxPython/src/msw/cmndlgs.py
+++ b/wxPython/src/msw/cmndlgs.py
@@ -71,7 +71,7 @@ class wxColourDialog(wxColourDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxColourDialog,_args,_kwargs)
self.thisown = 1
- wx._StdDialogCallbacks(self)
+ #wx._StdDialogCallbacks(self)
@@ -104,7 +104,7 @@ class wxDirDialog(wxDirDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxDirDialog,_args,_kwargs)
self.thisown = 1
- wx._StdDialogCallbacks(self)
+ #wx._StdDialogCallbacks(self)
@@ -170,7 +170,7 @@ class wxFileDialog(wxFileDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxFileDialog,_args,_kwargs)
self.thisown = 1
- wx._StdDialogCallbacks(self)
+ #wx._StdDialogCallbacks(self)
@@ -197,7 +197,7 @@ class wxSingleChoiceDialog(wxSingleChoiceDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxSingleChoiceDialog,_args,_kwargs)
self.thisown = 1
- wx._StdDialogCallbacks(self)
+ #wx._StdDialogCallbacks(self)
@@ -221,7 +221,7 @@ class wxTextEntryDialog(wxTextEntryDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxTextEntryDialog,_args,_kwargs)
self.thisown = 1
- wx._StdDialogCallbacks(self)
+ #wx._StdDialogCallbacks(self)
@@ -302,7 +302,7 @@ class wxFontDialog(wxFontDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxFontDialog,_args,_kwargs)
self.thisown = 1
- wx._StdDialogCallbacks(self)
+ #wx._StdDialogCallbacks(self)
@@ -320,7 +320,7 @@ class wxMessageDialog(wxMessageDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxMessageDialog,_args,_kwargs)
self.thisown = 1
- wx._StdDialogCallbacks(self)
+ #wx._StdDialogCallbacks(self)
diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py
index f0c8a8c0de..017e344f3f 100644
--- a/wxPython/src/msw/controls.py
+++ b/wxPython/src/msw/controls.py
@@ -30,7 +30,7 @@ class wxControl(wxControlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxControl,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -54,7 +54,7 @@ class wxButton(wxButtonPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxButton,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -97,7 +97,7 @@ class wxBitmapButton(wxBitmapButtonPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxBitmapButton,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -118,7 +118,7 @@ class wxCheckBox(wxCheckBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxCheckBox,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -166,7 +166,7 @@ class wxChoice(wxChoicePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxChoice,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -244,7 +244,7 @@ class wxComboBox(wxComboBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxComboBox,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -283,7 +283,7 @@ class wxGauge(wxGaugePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxGauge,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -332,7 +332,7 @@ class wxStaticText(wxStaticTextPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxStaticText,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -401,7 +401,7 @@ class wxListBox(wxListBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxListBox,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -428,7 +428,7 @@ class wxCheckListBox(wxCheckListBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxCheckListBox,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -551,7 +551,7 @@ class wxTextCtrl(wxTextCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxTextCtrl,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -587,7 +587,7 @@ class wxScrollBar(wxScrollBarPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxScrollBar,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -641,7 +641,7 @@ class wxStaticBitmap(wxStaticBitmapPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxStaticBitmap,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -695,7 +695,7 @@ class wxRadioBox(wxRadioBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxRadioBox,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -716,7 +716,7 @@ class wxRadioButton(wxRadioButtonPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxRadioButton,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -788,7 +788,7 @@ class wxSlider(wxSliderPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxSlider,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py
index 1a2c5c3144..2feebd2b0f 100644
--- a/wxPython/src/msw/controls2.py
+++ b/wxPython/src/msw/controls2.py
@@ -485,7 +485,7 @@ class wxListCtrl(wxListCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controls2c.new_wxListCtrl,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
@@ -814,7 +814,7 @@ class wxTreeCtrl(wxTreeCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controls2c.new_wxTreeCtrl,_args,_kwargs)
self.thisown = 1
- wx._StdWindowCallbacks(self)
+ #wx._StdWindowCallbacks(self)
self._setSelf(self, wxTreeCtrl)
diff --git a/wxPython/src/msw/frames.py b/wxPython/src/msw/frames.py
index 1d73ee3746..e97dd119a9 100644
--- a/wxPython/src/msw/frames.py
+++ b/wxPython/src/msw/frames.py
@@ -107,7 +107,7 @@ class wxFrame(wxFramePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(framesc.new_wxFrame,_args,_kwargs)
self.thisown = 1
- wx._StdFrameCallbacks(self)
+ #wx._StdFrameCallbacks(self)
@@ -122,7 +122,7 @@ class wxMiniFrame(wxMiniFramePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(framesc.new_wxMiniFrame,_args,_kwargs)
self.thisown = 1
- wx._StdFrameCallbacks(self)
+ #wx._StdFrameCallbacks(self)
diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp
index bfe9255d0d..c15ccdb0b5 100644
--- a/wxPython/src/msw/gdi.cpp
+++ b/wxPython/src/msw/gdi.cpp
@@ -6991,6 +6991,62 @@ static PyObject *_wrap_wxDC_SetAxisOrientation(PyObject *self, PyObject *args, P
return _resultobj;
}
+#define wxDC_CalcBoundingBox(_swigobj,_swigarg0,_swigarg1) (_swigobj->CalcBoundingBox(_swigarg0,_swigarg1))
+static PyObject *_wrap_wxDC_CalcBoundingBox(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxDC * _arg0;
+ int _arg1;
+ int _arg2;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self","x","y", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxDC_CalcBoundingBox",_kwnames,&_argo0,&_arg1,&_arg2))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDC_CalcBoundingBox. Expected _wxDC_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxDC_CalcBoundingBox(_arg0,_arg1,_arg2);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
+#define wxDC_ResetBoundingBox(_swigobj) (_swigobj->ResetBoundingBox())
+static PyObject *_wrap_wxDC_ResetBoundingBox(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ wxDC * _arg0;
+ PyObject * _argo0 = 0;
+ char *_kwnames[] = { "self", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDC_ResetBoundingBox",_kwnames,&_argo0))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDC_ResetBoundingBox. Expected _wxDC_p.");
+ return NULL;
+ }
+ }
+{
+ wxPy_BEGIN_ALLOW_THREADS;
+ wxDC_ResetBoundingBox(_arg0);
+
+ wxPy_END_ALLOW_THREADS;
+} Py_INCREF(Py_None);
+ _resultobj = Py_None;
+ return _resultobj;
+}
+
static void *SwigwxMemoryDCTowxDC(void *ptr) {
wxMemoryDC *src;
wxDC *dest;
@@ -8100,6 +8156,8 @@ static PyMethodDef gdicMethods[] = {
{ "new_wxScreenDC", (PyCFunction) _wrap_new_wxScreenDC, METH_VARARGS | METH_KEYWORDS },
{ "wxMemoryDC_SelectObject", (PyCFunction) _wrap_wxMemoryDC_SelectObject, METH_VARARGS | METH_KEYWORDS },
{ "new_wxMemoryDC", (PyCFunction) _wrap_new_wxMemoryDC, METH_VARARGS | METH_KEYWORDS },
+ { "wxDC_ResetBoundingBox", (PyCFunction) _wrap_wxDC_ResetBoundingBox, METH_VARARGS | METH_KEYWORDS },
+ { "wxDC_CalcBoundingBox", (PyCFunction) _wrap_wxDC_CalcBoundingBox, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_SetAxisOrientation", (PyCFunction) _wrap_wxDC_SetAxisOrientation, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_GetDeviceOrigin", (PyCFunction) _wrap_wxDC_GetDeviceOrigin, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_SetLogicalOrigin", (PyCFunction) _wrap_wxDC_SetLogicalOrigin, METH_VARARGS | METH_KEYWORDS },
diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py
index 9b00110ccf..f609ab6ea8 100644
--- a/wxPython/src/msw/gdi.py
+++ b/wxPython/src/msw/gdi.py
@@ -682,6 +682,12 @@ class wxDCPtr :
def SetAxisOrientation(self, *_args, **_kwargs):
val = apply(gdic.wxDC_SetAxisOrientation,(self,) + _args, _kwargs)
return val
+ def CalcBoundingBox(self, *_args, **_kwargs):
+ val = apply(gdic.wxDC_CalcBoundingBox,(self,) + _args, _kwargs)
+ return val
+ def ResetBoundingBox(self, *_args, **_kwargs):
+ val = apply(gdic.wxDC_ResetBoundingBox,(self,) + _args, _kwargs)
+ return val
def __repr__(self):
return "