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 "" % (self.this,) class wxDC(wxDCPtr): diff --git a/wxPython/src/msw/html.cpp b/wxPython/src/msw/html.cpp index e9f82170b2..e421cf73a8 100644 --- a/wxPython/src/msw/html.cpp +++ b/wxPython/src/msw/html.cpp @@ -5888,6 +5888,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxMDIParentFrame","_class_wxMDIParentFrame",0}, { "_class_wxTreeEvent","_wxTreeEvent",0}, { "_class_wxDirDialog","_wxDirDialog",0}, + { "_wxTimeSpan","_class_wxTimeSpan",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, { "_wxMaximizeEvent","_class_wxMaximizeEvent",0}, { "_class_wxTimerEvent","_wxTimerEvent",0}, @@ -5940,6 +5941,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxWindow","_wxPyHtmlWindow",SwigwxPyHtmlWindowTowxWindow}, { "_class_wxWindow","_wxWindow",0}, { "_wxSplitterWindow","_class_wxSplitterWindow",0}, + { "_wxDateSpan","_class_wxDateSpan",0}, { "_class_wxStaticText","_wxStaticText",0}, { "_wxPrintDialogData","_class_wxPrintDialogData",0}, { "_class_wxFont","_wxFont",0}, @@ -6069,6 +6071,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, + { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_wxHtmlDCRenderer","_class_wxHtmlDCRenderer",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, @@ -6108,6 +6111,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSplitterWindow","_wxSplitterWindow",0}, { "_wxPreviewFrame","_class_wxPreviewFrame",0}, { "_wxSizer","_class_wxSizer",0}, + { "_class_wxDateSpan","_wxDateSpan",0}, { "_class_wxShowEvent","_wxShowEvent",0}, { "_class_wxPyTipProvider","_wxPyTipProvider",0}, { "_class_wxPCXHandler","_wxPCXHandler",0}, diff --git a/wxPython/src/msw/html.py b/wxPython/src/msw/html.py index ce1b7e33aa..ebda9bbf3b 100644 --- a/wxPython/src/msw/html.py +++ b/wxPython/src/msw/html.py @@ -570,8 +570,8 @@ class wxHtmlWindow(wxHtmlWindowPtr): self.this = apply(htmlc.new_wxHtmlWindow,_args,_kwargs) self.thisown = 1 self._setSelf(self, wxHtmlWindow) - wx._StdWindowCallbacks(self) - wx._StdOnScrollCallbacks(self) + #wx._StdWindowCallbacks(self) + #wx._StdOnScrollCallbacks(self) diff --git a/wxPython/src/msw/htmlhelp.cpp b/wxPython/src/msw/htmlhelp.cpp index 28ce939188..845df7c18e 100644 --- a/wxPython/src/msw/htmlhelp.cpp +++ b/wxPython/src/msw/htmlhelp.cpp @@ -2871,6 +2871,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxMDIParentFrame","_class_wxMDIParentFrame",0}, { "_class_wxTreeEvent","_wxTreeEvent",0}, { "_class_wxDirDialog","_wxDirDialog",0}, + { "_wxTimeSpan","_class_wxTimeSpan",0}, { "_wxFocusEvent","_class_wxFocusEvent",0}, { "_wxMaximizeEvent","_class_wxMaximizeEvent",0}, { "_class_wxTimerEvent","_wxTimerEvent",0}, @@ -2921,6 +2922,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxWindow","_wxHtmlHelpFrame",SwigwxHtmlHelpFrameTowxWindow}, { "_class_wxWindow","_wxWindow",0}, { "_wxSplitterWindow","_class_wxSplitterWindow",0}, + { "_wxDateSpan","_class_wxDateSpan",0}, { "_class_wxStaticText","_wxStaticText",0}, { "_wxPrintDialogData","_class_wxPrintDialogData",0}, { "_class_wxFont","_wxFont",0}, @@ -3049,6 +3051,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, + { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_wxHtmlDCRenderer","_class_wxHtmlDCRenderer",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, @@ -3089,6 +3092,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSplitterWindow","_wxSplitterWindow",0}, { "_wxPreviewFrame","_class_wxPreviewFrame",0}, { "_wxSizer","_class_wxSizer",0}, + { "_class_wxDateSpan","_wxDateSpan",0}, { "_class_wxShowEvent","_wxShowEvent",0}, { "_class_wxPyTipProvider","_wxPyTipProvider",0}, { "_class_wxPCXHandler","_wxPCXHandler",0}, diff --git a/wxPython/src/msw/mdi.py b/wxPython/src/msw/mdi.py index c9d1600d24..0569d10921 100644 --- a/wxPython/src/msw/mdi.py +++ b/wxPython/src/msw/mdi.py @@ -57,7 +57,7 @@ class wxMDIParentFrame(wxMDIParentFramePtr): def __init__(self,*_args,**_kwargs): self.this = apply(mdic.new_wxMDIParentFrame,_args,_kwargs) self.thisown = 1 - wx._StdFrameCallbacks(self) + #wx._StdFrameCallbacks(self) @@ -81,7 +81,7 @@ class wxMDIChildFrame(wxMDIChildFramePtr): def __init__(self,*_args,**_kwargs): self.this = apply(mdic.new_wxMDIChildFrame,_args,_kwargs) self.thisown = 1 - wx._StdFrameCallbacks(self) + #wx._StdFrameCallbacks(self) @@ -96,8 +96,8 @@ class wxMDIClientWindow(wxMDIClientWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(mdic.new_wxMDIClientWindow,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) - wx._StdOnScrollCallbacks(self) + #wx._StdWindowCallbacks(self) + #wx._StdOnScrollCallbacks(self) diff --git a/wxPython/src/msw/printfw.py b/wxPython/src/msw/printfw.py index bd253625f1..793dc118bb 100644 --- a/wxPython/src/msw/printfw.py +++ b/wxPython/src/msw/printfw.py @@ -215,7 +215,7 @@ class wxPageSetupDialog(wxPageSetupDialogPtr): def __init__(self,*_args,**_kwargs): self.this = apply(printfwc.new_wxPageSetupDialog,_args,_kwargs) self.thisown = 1 - wx._StdDialogCallbacks(self) + #wx._StdDialogCallbacks(self) @@ -325,7 +325,7 @@ class wxPrintDialog(wxPrintDialogPtr): def __init__(self,*_args,**_kwargs): self.this = apply(printfwc.new_wxPrintDialog,_args,_kwargs) self.thisown = 1 - wx._StdDialogCallbacks(self) + #wx._StdDialogCallbacks(self) @@ -508,7 +508,7 @@ class wxPreviewFrame(wxPreviewFramePtr): def __init__(self,*_args,**_kwargs): self.this = apply(printfwc.new_wxPreviewFrame,_args,_kwargs) self.thisown = 1 - wx._StdFrameCallbacks(self) + #wx._StdFrameCallbacks(self) diff --git a/wxPython/src/msw/stattool.py b/wxPython/src/msw/stattool.py index f9cc36b5f9..0b423d7f46 100644 --- a/wxPython/src/msw/stattool.py +++ b/wxPython/src/msw/stattool.py @@ -51,7 +51,7 @@ class wxStatusBar(wxStatusBarPtr): def __init__(self,*_args,**_kwargs): self.this = apply(stattoolc.new_wxStatusBar,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) @@ -308,7 +308,7 @@ class wxToolBar(wxToolBarPtr): def __init__(self,*_args,**_kwargs): self.this = apply(stattoolc.new_wxToolBar,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) @@ -327,7 +327,7 @@ class wxToolBarSimple(wxToolBarSimplePtr): def __init__(self,*_args,**_kwargs): self.this = apply(stattoolc.new_wxToolBarSimple,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) diff --git a/wxPython/src/msw/utils.cpp b/wxPython/src/msw/utils.cpp index f464def613..ae1b4ec7f5 100644 --- a/wxPython/src/msw/utils.cpp +++ b/wxPython/src/msw/utils.cpp @@ -6795,6 +6795,94 @@ static PyObject *_wrap_wxDateSpan_GetTotalDays(PyObject *self, PyObject *args, P return _resultobj; } +#define wxDateSpan_Add(_swigobj,_swigarg0) (_swigobj->Add(_swigarg0)) +static PyObject *_wrap_wxDateSpan_Add(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDateSpan * _result; + wxDateSpan * _arg0; + wxDateSpan * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","other", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateSpan_Add",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDateSpan_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDateSpan_Add. Expected _wxDateSpan_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan_Add. Expected _wxDateSpan_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxDateSpan & _result_ref = wxDateSpan_Add(_arg0,*_arg1); + _result = (wxDateSpan *) &_result_ref; + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxDateSpan_Subtract(_swigobj,_swigarg0) (_swigobj->Subtract(_swigarg0)) +static PyObject *_wrap_wxDateSpan_Subtract(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDateSpan * _result; + wxDateSpan * _arg0; + wxDateSpan * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","other", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateSpan_Subtract",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDateSpan_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDateSpan_Subtract. Expected _wxDateSpan_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan_Subtract. Expected _wxDateSpan_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxDateSpan & _result_ref = wxDateSpan_Subtract(_arg0,*_arg1); + _result = (wxDateSpan *) &_result_ref; + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define wxDateSpan_Neg(_swigobj) (_swigobj->Neg()) static PyObject *_wrap_wxDateSpan_Neg(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7039,6 +7127,8 @@ static PyMethodDef utilscMethods[] = { { "wxDateSpan___add__", (PyCFunction) _wrap_wxDateSpan___add__, METH_VARARGS | METH_KEYWORDS }, { "wxDateSpan_Multiply", (PyCFunction) _wrap_wxDateSpan_Multiply, METH_VARARGS | METH_KEYWORDS }, { "wxDateSpan_Neg", (PyCFunction) _wrap_wxDateSpan_Neg, METH_VARARGS | METH_KEYWORDS }, + { "wxDateSpan_Subtract", (PyCFunction) _wrap_wxDateSpan_Subtract, METH_VARARGS | METH_KEYWORDS }, + { "wxDateSpan_Add", (PyCFunction) _wrap_wxDateSpan_Add, METH_VARARGS | METH_KEYWORDS }, { "wxDateSpan_GetTotalDays", (PyCFunction) _wrap_wxDateSpan_GetTotalDays, METH_VARARGS | METH_KEYWORDS }, { "wxDateSpan_GetDays", (PyCFunction) _wrap_wxDateSpan_GetDays, METH_VARARGS | METH_KEYWORDS }, { "wxDateSpan_GetWeeks", (PyCFunction) _wrap_wxDateSpan_GetWeeks, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/utils.py b/wxPython/src/msw/utils.py index 4296e4e7f7..87d8880369 100644 --- a/wxPython/src/msw/utils.py +++ b/wxPython/src/msw/utils.py @@ -737,6 +737,14 @@ class wxDateSpanPtr : def GetTotalDays(self, *_args, **_kwargs): val = apply(utilsc.wxDateSpan_GetTotalDays,(self,) + _args, _kwargs) return val + def Add(self, *_args, **_kwargs): + val = apply(utilsc.wxDateSpan_Add,(self,) + _args, _kwargs) + if val: val = wxDateSpanPtr(val) + return val + def Subtract(self, *_args, **_kwargs): + val = apply(utilsc.wxDateSpan_Subtract,(self,) + _args, _kwargs) + if val: val = wxDateSpanPtr(val) + return val def Neg(self, *_args, **_kwargs): val = apply(utilsc.wxDateSpan_Neg,(self,) + _args, _kwargs) if val: val = wxDateSpanPtr(val) diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 3dbca73cda..99718ba8b7 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -505,7 +505,7 @@ class wxWindow(wxWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxWindow,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) @@ -537,7 +537,7 @@ class wxPanel(wxPanelPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxPanel,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) @@ -588,7 +588,7 @@ class wxDialog(wxDialogPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxDialog,_args,_kwargs) self.thisown = 1 - wx._StdDialogCallbacks(self) + #wx._StdDialogCallbacks(self) @@ -649,8 +649,8 @@ class wxScrolledWindow(wxScrolledWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windowsc.new_wxScrolledWindow,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) - wx._StdOnScrollCallbacks(self) + #wx._StdWindowCallbacks(self) + #wx._StdOnScrollCallbacks(self) diff --git a/wxPython/src/msw/windows2.py b/wxPython/src/msw/windows2.py index 7e1f51ca00..f6996924e4 100644 --- a/wxPython/src/msw/windows2.py +++ b/wxPython/src/msw/windows2.py @@ -104,7 +104,7 @@ class wxNotebook(wxNotebookPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windows2c.new_wxNotebook,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) @@ -204,7 +204,7 @@ class wxSplitterWindow(wxSplitterWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windows2c.new_wxSplitterWindow,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) diff --git a/wxPython/src/msw/windows3.py b/wxPython/src/msw/windows3.py index bd38484999..33b2785627 100644 --- a/wxPython/src/msw/windows3.py +++ b/wxPython/src/msw/windows3.py @@ -114,7 +114,7 @@ class wxSashWindow(wxSashWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windows3c.new_wxSashWindow,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) + #wx._StdWindowCallbacks(self) @@ -214,9 +214,9 @@ class wxSashLayoutWindow(wxSashLayoutWindowPtr): def __init__(self,*_args,**_kwargs): self.this = apply(windows3c.new_wxSashLayoutWindow,_args,_kwargs) self.thisown = 1 - wx._StdWindowCallbacks(self) - wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT) - wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO) + #wx._StdWindowCallbacks(self) + #wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT) + #wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO) diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index aed36a9c83..73eef5b12f 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -858,41 +858,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) @@ -1360,15 +1360,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/printfw.i b/wxPython/src/printfw.i index a71bd7541e..c10fad5b2c 100644 --- a/wxPython/src/printfw.i +++ b/wxPython/src/printfw.i @@ -142,7 +142,7 @@ class wxPageSetupDialog : public wxDialog { public: wxPageSetupDialog(wxWindow* parent, wxPageSetupDialogData* data = NULL); - %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)" wxPageSetupDialogData& GetPageSetupData(); int ShowModal(); @@ -189,7 +189,7 @@ class wxPrintDialog : public wxDialog { public: wxPrintDialog(wxWindow* parent, wxPrintDialogData* data = NULL); - %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)" wxPrintDialogData& GetPrintDialogData(); %new wxDC* GetPrintDC(); @@ -339,7 +339,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 Initialize(); diff --git a/wxPython/src/stattool.i b/wxPython/src/stattool.i index 575f8880b5..37702d31f4 100644 --- a/wxPython/src/stattool.i +++ b/wxPython/src/stattool.i @@ -42,7 +42,7 @@ public: long style = wxST_SIZEGRIP, char* name = "statusBar"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" %addmethods { %new wxRect* GetFieldRect(long item) { @@ -278,7 +278,7 @@ public: long style = wxNO_BORDER | wxTB_HORIZONTAL, const char* name = wxToolBarNameStr); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y); }; @@ -295,7 +295,7 @@ public: long style = wxNO_BORDER | wxTB_HORIZONTAL, const char* name = wxToolBarNameStr); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y); }; @@ -347,7 +347,7 @@ public: long style = wxTB_HORIZONTAL | wxNO_BORDER, char* name = "toolBar"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" bool AddControl(wxControl * control); diff --git a/wxPython/src/utils.i b/wxPython/src/utils.i index dc72b54a44..be31e0e0ce 100644 --- a/wxPython/src/utils.i +++ b/wxPython/src/utils.i @@ -993,13 +993,13 @@ public: // ------------------------------------------------------------------------ -#ifdef MISSING + // add another wxDateSpan to us inline wxDateSpan& Add(const wxDateSpan& other); // subtract another wxDateSpan from us inline wxDateSpan& Subtract(const wxDateSpan& other); -#endif + // inverse the sign of this timespan inline wxDateSpan& Neg(); diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 139d4f0c4f..1ce31f6a8b 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -165,7 +165,7 @@ public: long style = 0, char* name = "panel"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" void CaptureMouse(); void Center(int direction = wxBOTH); @@ -399,7 +399,7 @@ public: long style = wxTAB_TRAVERSAL, const char* name = "panel"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" void InitDialog(); wxButton* GetDefaultItem(); @@ -427,7 +427,7 @@ public: long style = wxDEFAULT_DIALOG_STYLE, const char* name = "dialogBox"); - %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)" void Centre(int direction = wxBOTH); void EndModal(int retCode); @@ -455,8 +455,8 @@ public: long style = wxHSCROLL | wxVSCROLL, char* name = "scrolledWindow"); - %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 EnableScrolling(bool xScrolling, bool yScrolling); int GetScrollPageSize(int orient); diff --git a/wxPython/src/windows2.i b/wxPython/src/windows2.i index 64b27e3893..31d5da09b3 100644 --- a/wxPython/src/windows2.i +++ b/wxPython/src/windows2.i @@ -80,16 +80,16 @@ public: long style=0, char* name="grid"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK)" void AdjustScrollbars(); @@ -261,7 +261,7 @@ public: long style = 0, char* name = "notebook"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" int GetPageCount(); int SetSelection(int nPage); @@ -325,7 +325,7 @@ public: long style=wxSP_3D|wxCLIP_CHILDREN, char* name = "splitterWindow"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" int GetBorderSize(); int GetMinimumPaneSize(); diff --git a/wxPython/src/windows3.i b/wxPython/src/windows3.i index b5c64af864..c51028773b 100644 --- a/wxPython/src/windows3.i +++ b/wxPython/src/windows3.i @@ -76,7 +76,7 @@ public: long style = wxCLIP_CHILDREN | wxSW_3D, const char* name = "sashWindow"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" bool GetSashVisible(wxSashEdgePosition edge); int GetDefaultBorderSize(); @@ -155,9 +155,9 @@ public: long style = wxCLIP_CHILDREN | wxSW_3D, const char* name = "layoutWindow"); - %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT)" - %pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO)" + %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT)" + %pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO)" wxLayoutAlignment GetAlignment(); diff --git a/wxPython/wxPython/lib/buttons.py b/wxPython/wxPython/lib/buttons.py index e478b2def7..1657983b85 100644 --- a/wxPython/wxPython/lib/buttons.py +++ b/wxPython/wxPython/lib/buttons.py @@ -77,13 +77,15 @@ class wxGenButton(wxControl): self.SetBestSize(size) self.InitColours() - EVT_LEFT_DOWN(self, self.OnLeftDown) - EVT_LEFT_UP(self, self.OnLeftUp) - EVT_MOTION(self, self.OnMotion) - EVT_SET_FOCUS(self, self.OnGainFocus) - EVT_KILL_FOCUS(self, self.OnLoseFocus) - EVT_KEY_DOWN(self, self.OnKeyDown) - EVT_KEY_UP(self, self.OnKeyUp) + EVT_LEFT_DOWN(self, self.OnLeftDown) + EVT_LEFT_UP(self, self.OnLeftUp) + EVT_MOTION(self, self.OnMotion) + EVT_SET_FOCUS(self, self.OnGainFocus) + EVT_KILL_FOCUS(self, self.OnLoseFocus) + EVT_KEY_DOWN(self, self.OnKeyDown) + EVT_KEY_UP(self, self.OnKeyUp) + EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) + EVT_PAINT(self, self.OnPaint) def SetBestSize(self, size=None): diff --git a/wxPython/wxPython/lib/calendar.py b/wxPython/wxPython/lib/calendar.py index a6f2610fbc..a4e2ed352e 100644 --- a/wxPython/wxPython/lib/calendar.py +++ b/wxPython/wxPython/lib/calendar.py @@ -394,6 +394,9 @@ class wxCalendar(wxWindow): self.size = None self.set_day = None + EVT_PAINT(self, self.OnPaint) + + # control some of the main calendar attributes def HideTitle(self): @@ -523,7 +526,7 @@ class wxCalendar(wxWindow): for key in self.rg.keys(): val = self.rg[key] ms_rect = wxRect(mx, my, 1, 1) - if wxIntersectRect(ms_rect, val) != None: + if wxIntersectRect(ms_rect, val) is not None: result = self.TestDay(key) return result return None diff --git a/wxPython/wxPython/lib/dialogs.py b/wxPython/wxPython/lib/dialogs.py index 27584d516d..e517f105b3 100644 --- a/wxPython/wxPython/lib/dialogs.py +++ b/wxPython/wxPython/lib/dialogs.py @@ -48,6 +48,7 @@ class wxMultipleChoiceDialog(wxDialog): self.SetAutoLayout(TRUE) self.lst = lst self.Layout() + EVT_SIZE(self, self.OnSize) def OnSize(self, event): self.Layout() diff --git a/wxPython/wxPython/lib/editor/editor.py b/wxPython/wxPython/lib/editor/editor.py index b34d724798..bfae392817 100644 --- a/wxPython/wxPython/lib/editor/editor.py +++ b/wxPython/wxPython/lib/editor/editor.py @@ -111,6 +111,8 @@ class wxEditor(wxScrolledWindow): EVT_LEFT_DOWN(self, self.OnMouseClick) EVT_RIGHT_DOWN(self, self.OnMouseClick) EVT_SCROLLWIN(self, self.OnScroll) + EVT_CHAR(self, self.OnChar) + EVT_PAINT(self, self.OnPaint) self.o_cx = self.cx self.o_cy = self.cy diff --git a/wxPython/wxPython/lib/filebrowsebutton.py b/wxPython/wxPython/lib/filebrowsebutton.py index d357fd461c..a09e82fe15 100644 --- a/wxPython/wxPython/lib/filebrowsebutton.py +++ b/wxPython/wxPython/lib/filebrowsebutton.py @@ -319,6 +319,7 @@ if __name__ == "__main__": class DemoFrame( wxFrame ): def __init__(self, parent): wxFrame.__init__(self, parent, 2400, "File entry with browse", size=(500,260) ) + EVT_CLOSE(self, self.OnCloseWindow) panel = wxPanel (self,-1) innerbox = wxBoxSizer(wxVERTICAL) control = FileBrowseButton( diff --git a/wxPython/wxPython/lib/layoutf.py b/wxPython/wxPython/lib/layoutf.py index cbbd7edd9e..c0f90b2083 100644 --- a/wxPython/wxPython/lib/layoutf.py +++ b/wxPython/wxPython/lib/layoutf.py @@ -200,6 +200,7 @@ if __name__=='__main__': def __init__(self, parent): wxFrame.__init__(self, parent, -1, 'Test Layout Constraints', wxPyDefaultPosition, wxSize(500, 300)) + EVT_CLOSE(self, self.OnCloseWindow) self.SetAutoLayout(true) EVT_BUTTON(self, 100, self.OnButton) diff --git a/wxPython/wxPython/lib/mvctree.py b/wxPython/wxPython/lib/mvctree.py index 699b1b9566..9a8703e4cd 100644 --- a/wxPython/wxPython/lib/mvctree.py +++ b/wxPython/wxPython/lib/mvctree.py @@ -769,6 +769,9 @@ class wxMVCTree(wxScrolledWindow): EVT_MOUSE_EVENTS(self, self.OnMouse) EVT_KEY_DOWN(self, self.OnKeyDown) self.doubleBuffered = true + EVT_SIZE(self, self.OnSize) + EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) + EVT_PAINT(self, self.OnPaint) def Refresh(self): diff --git a/wxPython/wxPython/lib/shell.py b/wxPython/wxPython/lib/shell.py index 2ed16650f3..b919213c42 100644 --- a/wxPython/wxPython/lib/shell.py +++ b/wxPython/wxPython/lib/shell.py @@ -155,7 +155,8 @@ class PyShellOutput(wxPanel): # refreshes are annoying self.in_batch =0 self.dirty =0 - + EVT_SIZE(self, self.OnSize) + EVT_IDLE(self, self.OnIdle) def OnSize(self, event): self.client.SetSize(self.GetClientSize()) @@ -248,6 +249,7 @@ class PyShell(wxPanel): splitter.SetMinimumPaneSize(20) self.splitter =splitter EVT_SET_FOCUS(self, self.OnSetFocus) + EVT_SIZE(self, self.OnSize) def OnSetFocus(self, event): self.input.SetFocus() diff --git a/wxPython/wxPython/lib/splashscreen.py b/wxPython/wxPython/lib/splashscreen.py index fc8c04dc86..d1b83e932e 100644 --- a/wxPython/wxPython/lib/splashscreen.py +++ b/wxPython/wxPython/lib/splashscreen.py @@ -74,6 +74,8 @@ class SplashScreen(wxFrame): self.timer = SplashTimer(callback) self.timer.Start(duration, 1) # one-shot only EVT_LEFT_DOWN(self, self.OnMouseClick) + EVT_CLOSE(self, self.OnCloseWindow) + EVT_PAINT(self, self.OnPaint) def OnPaint(self, event): dc = wxPaintDC(self) diff --git a/wxPython/wxPython/lib/vtk.py b/wxPython/wxPython/lib/vtk.py index eab82b5dc0..7977b6c450 100644 --- a/wxPython/wxPython/lib/vtk.py +++ b/wxPython/wxPython/lib/vtk.py @@ -55,6 +55,9 @@ class wxVTKRenderWindow(wxScrolledWindow): EVT_RIGHT_UP (self, self.Release) EVT_MOTION (self, self.MouseMotion) + EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) + EVT_PAINT(self, self.OnPaint) + def GetRenderer(self): self.renderWindow.GetRenderers().InitTraversal() diff --git a/wxPython/wxPython/lib/wxPlotCanvas.py b/wxPython/wxPython/lib/wxPlotCanvas.py index 569473ef22..e302cb1010 100644 --- a/wxPython/wxPython/lib/wxPlotCanvas.py +++ b/wxPython/wxPython/lib/wxPlotCanvas.py @@ -176,6 +176,7 @@ class PlotCanvas(wx.wxWindow): self.SetBackgroundColour(wx.wxNamedColour("white")) wx.EVT_SIZE(self,self.reconfigure) + wx.EVT_PAINT(self, self.OnPaint) self._setsize() self.last_draw = None # self.font = self._testFont(font) @@ -446,8 +447,6 @@ Are you sure you want to do this?""", "Danger!", wx.wxYES_NO) about = wx.wxMessageDialog(self, __doc__, "About...", wx.wxOK) about.ShowModal() - def OnCloseWindow(self, event): - self.Destroy() class MyApp(wx.wxApp):