diff --git a/wxPython/demo/wxCalendar.py b/wxPython/demo/wxCalendar.py index 501e02c71c..38f6d771fa 100644 --- a/wxPython/demo/wxCalendar.py +++ b/wxPython/demo/wxCalendar.py @@ -598,7 +598,8 @@ class SetPrintout(wxPrintout): class MyApp(wxApp): def OnInit(self): - frame = CalendFrame(None, -1, "Test Calendar") + wxInitAllImageHandlers() + frame = CalendFrame(None, -1, "Test Calendar", sys.stdout) frame.Show(True) self.SetTopWindow(frame) return True @@ -612,17 +613,6 @@ def MessageDlg(self, message, type = 'Message'): #--------------------------------------------------------------------------- -def main(): - app = MyApp(0) - app.MainLoop() - - -if __name__ == '__main__': - main() - - -#--------------------------------------------------------------------------- - def runTest(frame, nb, log): win = TestPanel(nb, log, frame) return win @@ -630,6 +620,14 @@ def runTest(frame, nb, log): #--------------------------------------------------------------------------- +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) + + + + overview = """\ This control provides a calendar control class for displaying and selecting dates. In addition, the class is extended and can now be used for printing/previewing. diff --git a/wxPython/demo/wxGLCanvas.py b/wxPython/demo/wxGLCanvas.py index a4d0194cb0..62f410a548 100644 --- a/wxPython/demo/wxGLCanvas.py +++ b/wxPython/demo/wxGLCanvas.py @@ -96,14 +96,18 @@ else: EVT_LEFT_UP(self, self.OnMouseUp) EVT_MOTION(self, self.OnMouseMotion) + def OnEraseBackground(self, event): pass # Do nothing, to avoid flashing on MSW. + def OnSize(self, event): size = self.GetClientSize() if self.GetContext(): self.SetCurrent() glViewport(0, 0, size.width, size.height) + event.Skip() + def OnPaint(self, event): dc = wxPaintDC(self) @@ -113,12 +117,15 @@ else: self.init = True self.OnDraw() + def OnMouseDown(self, evt): self.CaptureMouse() + def OnMouseUp(self, evt): self.ReleaseMouse() + def OnMouseMotion(self, evt): if evt.Dragging() and evt.LeftIsDown(): self.x, self.y = self.lastx, self.lasty diff --git a/wxPython/demo/wxTimeCtrl.py b/wxPython/demo/wxTimeCtrl.py index e6a5aeed2f..e3b568a336 100644 --- a/wxPython/demo/wxTimeCtrl.py +++ b/wxPython/demo/wxTimeCtrl.py @@ -19,10 +19,10 @@ class TestPanel( wxScrolledPanel ): text2 = wxStaticText( self, -1, "24-hour format:") spin2 = wxSpinButton( self, -1, wxDefaultPosition, wxSize(-1,20), 0 ) - self.time24 = wxTimeCtrl( self, -1, name="24 hour control", fmt24hr=True, spinButton = spin2 ) + self.time24 = wxTimeCtrl( self, -1, name="24 hour control", fmt24hr=True, spinButton=spin2 ) text3 = wxStaticText( self, -1, "No seconds\nor spin button:") - self.spinless_ctrl = wxTimeCtrl( self, -1, name="spinless control", display_seconds = False ) + self.spinless_ctrl = wxTimeCtrl( self, -1, name="spinless control", displaySeconds=False ) grid = wxFlexGridSizer( 0, 2, 10, 5 ) grid.Add( text1, 0, wxALIGN_RIGHT ) @@ -68,11 +68,12 @@ class TestPanel( wxScrolledPanel ): self.set_bounds = wxCheckBox( self, -1, "Set time bounds:" ) minlabel = wxStaticText( self, -1, "minimum time:" ) - self.min = wxTimeCtrl( self, -1, name="min", display_seconds = False ) + # (Show use of format parameter to alternatively specify format of control:) + self.min = wxTimeCtrl( self, -1, name="min", format="HHMM" ) self.min.Enable( False ) maxlabel = wxStaticText( self, -1, "maximum time:" ) - self.max = wxTimeCtrl( self, -1, name="max", display_seconds = False ) + self.max = wxTimeCtrl( self, -1, name="max", format="HHMM" ) self.max.Enable( False ) self.limit_check = wxCheckBox( self, -1, "Limit control" ) diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 735e3bf9c6..b74f31d75e 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -535,7 +535,7 @@ def EVT_SPLITTER_UNSPLIT(win, id, func): def EVT_SPLITTER_DOUBLECLICKED(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, func) - +EVT_SPLITTER_DCLICK = EVT_SPLITTER_DOUBLECLICKED # wxTimer def EVT_TIMER(win, id, func): diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index 96add9859b..0f9b5e2ce5 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -114,7 +114,7 @@ class wxCalendarEvent : public wxCommandEvent public: wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type); - const wxDateTime& GetDate() const; + const wxDateTime GetDate() const; wxDateTime::WeekDay GetWeekDay() const; }; diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 5c9208f07f..e5edda5cee 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -350,12 +350,12 @@ class wxListEvent: public wxNotifyEvent { public: wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); -%readonly int m_code; long m_oldItemIndex; long m_itemIndex; int m_col; wxPoint m_pointDrag; +%readonly wxListItem m_item; %readwrite diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 18b3377e1b..e3089b2bed 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -941,7 +941,7 @@ public: class wxGridCellFloatEditor : public wxGridCellTextEditor { public: - wxGridCellFloatEditor(); + wxGridCellFloatEditor(int width = -1, int precision = -1); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" }; diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index a37519962a..8e976e5707 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -1193,9 +1193,8 @@ off_t wxPyCBInputStream::OnSysTell() const { if (PyLong_Check(result)) o = PyLong_AsLongLong(result); else -#else - o = PyInt_AsLong(result); #endif + o = PyInt_AsLong(result); Py_DECREF(result); }; wxPyEndBlockThreads();