From fd3f2efe791cf99c2e4944cd615f02a5502ed93e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 22 Nov 2003 22:57:49 +0000 Subject: [PATCH] Lots of little bug fixes, API updates, etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/ColourDB.py | 7 ++++--- wxPython/demo/ContextHelp.py | 9 ++++----- wxPython/demo/CustomDragAndDrop.py | 8 ++++---- wxPython/demo/DrawXXXList.py | 2 +- wxPython/demo/EventManager.py | 24 ++++++++++++------------ wxPython/demo/Layoutf.py | 8 ++++---- wxPython/demo/Main.py | 1 + wxPython/demo/PrintFramework.py | 2 +- wxPython/demo/Sizers.py | 6 +++--- wxPython/demo/Threads.py | 8 ++++---- wxPython/demo/URLDragAndDrop.py | 6 +++--- wxPython/demo/run.py | 2 +- wxPython/demo/wxArtProvider.py | 6 +++--- wxPython/demo/wxCalendar.py | 20 +++++++++----------- wxPython/demo/wxCalendarCtrl.py | 2 +- wxPython/demo/wxDragImage.py | 10 +++++----- wxPython/demo/wxHtmlWindow.py | 2 ++ wxPython/demo/wxIntCtrl.py | 10 +++++----- wxPython/demo/wxMask.py | 22 +++++++++++----------- wxPython/demo/wxScrolledPanel.py | 10 +++++----- wxPython/demo/wxTimeCtrl.py | 12 ++++++------ wxPython/src/_artprov.i | 2 +- wxPython/src/_combobox.i | 1 + wxPython/src/_dc.i | 4 ++-- wxPython/src/_dnd.i | 4 +++- wxPython/src/_printfw.i | 6 +++--- wxPython/src/_tipwin.i | 5 ++--- wxPython/src/_window.i | 4 ++-- wxPython/src/drawlist.cpp | 2 +- wxPython/src/gtk/controls.py | 4 ++++ wxPython/src/gtk/controls_wrap.cpp | 26 ++++++++++++++++++++++++++ wxPython/src/gtk/core.py | 4 ++-- wxPython/src/gtk/gdi.py | 4 ++-- wxPython/src/gtk/html_wrap.cpp | 12 +++++++----- wxPython/src/gtk/misc.py | 9 ++------- wxPython/src/gtk/misc_wrap.cpp | 25 ------------------------- wxPython/src/gtk/windows.py | 6 +++--- wxPython/src/gtk/windows_wrap.cpp | 24 ++++++++++++++++++------ wxPython/wx/lib/anchors.py | 4 ++-- wxPython/wx/lib/calendar.py | 26 +++++++++++++------------- wxPython/wx/lib/evtmgr.py | 4 ++-- wxPython/wx/lib/rcsizer.py | 2 +- wxPython/wx/lib/throbber.py | 11 ++++++----- wxPython/wx/lib/timectrl.py | 2 +- wxPython/wxPython/lib/calendar.py | 18 ++++++++++++++++++ wxPython/wxPython/lib/evtmgr.py | 1 + 46 files changed, 212 insertions(+), 175 deletions(-) diff --git a/wxPython/demo/ColourDB.py b/wxPython/demo/ColourDB.py index e4995cfefa..e07a27bf27 100644 --- a/wxPython/demo/ColourDB.py +++ b/wxPython/demo/ColourDB.py @@ -47,7 +47,7 @@ class TestWindow(wxScrolledWindow): while x < sz.width: y = -dy while y < sz.height: - dc.DrawBitmap(self.bg_bmp, x, y) + dc.DrawBitmap(self.bg_bmp, (x, y)) y = y + h x = x + w @@ -89,11 +89,12 @@ class TestWindow(wxScrolledWindow): for line in range(max(0,start), min(stop,numColours)): clr = colours[line] y = (line+1) * self.lineHeight + 2 - dc.DrawText(clr, self.cellWidth, y) + dc.DrawText(clr, (self.cellWidth, y)) brush = wxBrush(clr, wxSOLID) dc.SetBrush(brush) - dc.DrawRectangle(12 * self.cellWidth, y, 6 * self.cellWidth, self.textHeight) + dc.DrawRectangle((12 * self.cellWidth, y), + (6 * self.cellWidth, self.textHeight)) dc.EndDrawing() diff --git a/wxPython/demo/ContextHelp.py b/wxPython/demo/ContextHelp.py index 044e36dbe6..505d2130f8 100644 --- a/wxPython/demo/ContextHelp.py +++ b/wxPython/demo/ContextHelp.py @@ -1,6 +1,5 @@ from wxPython.wx import * -from wxPython.help import * #---------------------------------------------------------------------- # We first have to set an application-wide help provider. Normally you @@ -27,25 +26,25 @@ class TestPanel(wxPanel): s = wxBoxSizer(wxHORIZONTAL) s.Add(cBtn, 0, wxALL, 5) s.Add(cBtnText, 0, wxALL, 5) - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(s) text = wxTextCtrl(self, -1, "Each sub-window can have its own help message", size=(240, 60), style = wxTE_MULTILINE) text.SetHelpText("This is my very own help message. This is a really long long long long long long long long long long long long long long long long long long long long message!") - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(text) text = wxTextCtrl(self, -1, "You can also intercept the help event if you like. Watch the log window when you click here...", size=(240, 60), style = wxTE_MULTILINE) text.SetHelpText("Yet another context help message.") - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(text) EVT_HELP(text, text.GetId(), self.OnCtxHelp) text = wxTextCtrl(self, -1, "This one displays the tip itself...", size=(240, 60), style = wxTE_MULTILINE) - sizer.Add(20,20) + sizer.Add((20,20)) sizer.Add(text) EVT_HELP(text, text.GetId(), self.OnCtxHelp2) diff --git a/wxPython/demo/CustomDragAndDrop.py b/wxPython/demo/CustomDragAndDrop.py index 3fb49e5d02..eb8ffa3472 100644 --- a/wxPython/demo/CustomDragAndDrop.py +++ b/wxPython/demo/CustomDragAndDrop.py @@ -39,7 +39,7 @@ class DoodlePad(wxWindow): dc.SetPen(wxPen(wxBLUE, 3)) for line in self.lines: for coords in line: - apply(dc.DrawLine, coords) + dc.DrawLineXY(*coords) dc.EndDrawing() @@ -71,7 +71,7 @@ class DoodlePad(wxWindow): dc.SetPen(wxPen(wxBLUE, 3)) coords = (self.x, self.y) + event.GetPositionTuple() self.curLine.append(coords) - apply(dc.DrawLine, coords) + dc.DrawLineXY(*coords) self.x, self.y = event.GetPositionTuple() dc.EndDrawing() @@ -197,7 +197,7 @@ class DoodleViewer(wxWindow): dc.SetPen(wxPen(wxRED, 3)) for line in self.lines: for coords in line: - apply(dc.DrawLine, coords) + dc.DrawLineXY(*coords) dc.EndDrawing() #---------------------------------------------------------------------- @@ -239,7 +239,7 @@ class CustomDnDPanel(wxPanel): rbox.Add(rb2) box.Add(text1, 0, wxALL, 10) box.Add(rbox, 0, wxALIGN_CENTER) - box.Add(10,90) + box.Add((10,90)) box.Add(text2, 0, wxALL, 10) sizer.Add(box) diff --git a/wxPython/demo/DrawXXXList.py b/wxPython/demo/DrawXXXList.py index f22ec2e2d2..0091b68c2a 100644 --- a/wxPython/demo/DrawXXXList.py +++ b/wxPython/demo/DrawXXXList.py @@ -108,7 +108,7 @@ def makeRandomColors(num): colors = [] for i in range(num): c = whrandom.choice(colours) - colors.append(wxNamedColor(c)) + colors.append(wxNamedColour(c)) return colors diff --git a/wxPython/demo/EventManager.py b/wxPython/demo/EventManager.py index 25da54f2cb..0e99c94b47 100644 --- a/wxPython/demo/EventManager.py +++ b/wxPython/demo/EventManager.py @@ -52,17 +52,17 @@ class TestPanel(wxPanel): message2 = wxStaticText(self, -1, txt) message2.SetFont(f1) - targetPanel = Tile(self, log, bgColor=wxColor(80,10,10), active=0) + targetPanel = Tile(self, log, bgColor=wxColour(80,10,10), active=0) buttonPanel = wxPanel(self ,-1) sizer = wxBoxSizer(wxHORIZONTAL) target = targetPanel.tile - sizer.Add(0,0,1) + sizer.Add((0,0), 1) for factor in [0.2, 0.3, 0.4, 0.5, 0.6, 0.7]: sizer.Add(Tile(buttonPanel, log, factor-0.05, target), 0, wxALIGN_CENTER) - sizer.Add(0,0,1) + sizer.Add((0,0),1) sizer.Add(Tile(buttonPanel, log, factor, target), 0, wxALIGN_CENTER) - sizer.Add(0,0,1) + sizer.Add((0,0),1) buttonPanel.SetAutoLayout(1) buttonPanel.SetSizer(sizer) @@ -88,9 +88,9 @@ class Tile(wxPanel): its border color in response to certain mouse events over its contained 'InnerTile'. """ - normal = wxColor(150,150,150) - active = wxColor(250,245,245) - hover = wxColor(210,220,210) + normal = wxColour(150,150,150) + active = wxColour(250,245,245) + hover = wxColour(210,220,210) def __init__(self, parent, log, factor=1, thingToWatch=None, bgColor=None, active=1, size=(38,38), borderWidth=3): wxPanel.__init__(self, parent, -1, size=size, style=wxCLIP_CHILDREN) @@ -128,10 +128,10 @@ class Tile(wxPanel): class InnerTile(wxPanel): - IDLE_COLOR = wxColor( 80, 10, 10) - START_COLOR = wxColor(200, 70, 50) - FINAL_COLOR = wxColor( 20, 80,240) - OFF_COLOR = wxColor(185,190,185) + IDLE_COLOR = wxColour( 80, 10, 10) + START_COLOR = wxColour(200, 70, 50) + FINAL_COLOR = wxColour( 20, 80,240) + OFF_COLOR = wxColour(185,190,185) # Some pre-computation. DELTAS = map(lambda a,b: b-a, START_COLOR.Get(), FINAL_COLOR.Get()) START_COLOR_TUPLE = START_COLOR.Get() @@ -188,7 +188,7 @@ class InnerTile(wxPanel): r = InnerTile.START_COLOR_TUPLE[0] + (InnerTile.DELTAS[0] * percent) g = InnerTile.START_COLOR_TUPLE[1] + (InnerTile.DELTAS[1] * percent) b = InnerTile.START_COLOR_TUPLE[2] + (InnerTile.DELTAS[2] * percent) - self.setColor(wxColor(int(r), int(g), int(b))) + self.setColor(wxColour(int(r), int(g), int(b))) diff --git a/wxPython/demo/Layoutf.py b/wxPython/demo/Layoutf.py index b92faffeda..8a80e8a34f 100644 --- a/wxPython/demo/Layoutf.py +++ b/wxPython/demo/Layoutf.py @@ -11,15 +11,15 @@ class TestLayoutf(wxPanel): self.SetAutoLayout(True) EVT_BUTTON(self, 100, self.OnButton) - self.panelA = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER) + self.panelA = wxWindow(self, -1, style=wxSIMPLE_BORDER) self.panelA.SetBackgroundColour(wxBLUE) self.panelA.SetConstraints(Layoutf('t=t10#1;l=l10#1;b=b10#1;r%r50#1',(self,))) - self.panelB = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER) + self.panelB = wxWindow(self, -1, style=wxSIMPLE_BORDER) self.panelB.SetBackgroundColour(wxRED) self.panelB.SetConstraints(Layoutf('t=t10#1;r=r10#1;b%b30#1;l>10#2', (self,self.panelA))) - self.panelC = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER) + self.panelC = wxWindow(self, -1, style=wxSIMPLE_BORDER) self.panelC.SetBackgroundColour(wxWHITE) self.panelC.SetConstraints(Layoutf('t_10#3;r=r10#1;b=b10#1;l>10#2', (self,self.panelA,self.panelB))) @@ -29,7 +29,7 @@ class TestLayoutf(wxPanel): b = wxButton(self.panelB, 100, ' Panel B ') b.SetConstraints(Layoutf('t=t2#1;r=r4#1;h*;w*', (self.panelB,))) - self.panelD = wxWindow(self.panelC, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER) + self.panelD = wxWindow(self.panelC, -1, style=wxSIMPLE_BORDER) self.panelD.SetBackgroundColour(wxGREEN) self.panelD.SetConstraints(Layoutf('b%h50#1;r%w50#1;h=h#2;w=w#2', (self.panelC, b))) diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 70fdd3f0d1..d7c11064b9 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -143,6 +143,7 @@ _treeList = [ 'wxIntCtrl', 'wxMimeTypesManager', 'wxMaskedNumCtrl', + 'wxScrolledPanel', 'wxStyledTextCtrl_1', 'wxStyledTextCtrl_2', 'wxTimeCtrl', diff --git a/wxPython/demo/PrintFramework.py b/wxPython/demo/PrintFramework.py index e0fdd41aa9..58e40f8dab 100644 --- a/wxPython/demo/PrintFramework.py +++ b/wxPython/demo/PrintFramework.py @@ -80,7 +80,7 @@ class MyPrintout(wxPrintout): #------------------------------------------- self.canvas.DoDrawing(dc, True) - dc.DrawText("Page: %d" % page, marginX/2, maxY-marginY) + dc.DrawText("Page: %d" % page, (marginX/2, maxY-marginY)) return True diff --git a/wxPython/demo/Sizers.py b/wxPython/demo/Sizers.py index 5bdcd38b3d..609a13f043 100644 --- a/wxPython/demo/Sizers.py +++ b/wxPython/demo/Sizers.py @@ -82,7 +82,7 @@ def makeSimpleBox7(win): box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND) box.Add(wxButton(win, 1010, "two"), 0, wxEXPAND) box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND) - box.Add(60, 20, 0, wxEXPAND) + box.Add((60, 20), 0, wxEXPAND) box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND) return box @@ -92,9 +92,9 @@ def makeSimpleBox7(win): def makeSimpleBox8(win): box = wxBoxSizer(wxVERTICAL) box.Add(wxButton(win, 1010, "one"), 0, wxEXPAND) - box.Add(0,0, 1) + box.Add((0,0), 1) box.Add(wxButton(win, 1010, "two"), 0, wxALIGN_CENTER) - box.Add(0,0, 1) + box.Add((0,0), 1) box.Add(wxButton(win, 1010, "three"), 0, wxEXPAND) box.Add(wxButton(win, 1010, "four"), 0, wxEXPAND) # box.Add(wxButton(win, 1010, "five"), 1, wxEXPAND) diff --git a/wxPython/demo/Threads.py b/wxPython/demo/Threads.py index 25440e5106..7da3ac6b5c 100644 --- a/wxPython/demo/Threads.py +++ b/wxPython/demo/Threads.py @@ -98,18 +98,18 @@ class GraphWindow(wxWindow): dc.SetBackground(wxBrush(self.GetBackgroundColour())) dc.Clear() dc.SetPen(wxPen(wxBLACK, 3, wxSOLID)) - dc.DrawLine(self.linePos, 0, self.linePos, size.height-10) + dc.DrawLine((self.linePos, 0), (self.linePos, size.height-10)) bh = ypos = self.barHeight for x in range(len(self.values)): label, val = self.values[x] - dc.DrawText(label, 5, ypos) + dc.DrawText(label, (5, ypos)) if val: color = self.colors[ x % len(self.colors) ] dc.SetPen(wxPen(color)) dc.SetBrush(wxBrush(color)) - dc.DrawRectangle(self.linePos+3, ypos, val, bh) + dc.DrawRectangle((self.linePos+3, ypos), (val, bh)) ypos = ypos + 2*bh if ypos > size.height-10: @@ -125,7 +125,7 @@ class GraphWindow(wxWindow): wdc = wxPaintDC(self) wdc.BeginDrawing() - wdc.Blit(0,0, size.width, size.height, dc, 0,0) + wdc.Blit((0,0), size, dc, (0,0)) wdc.EndDrawing() dc.SelectObject(wxNullBitmap) diff --git a/wxPython/demo/URLDragAndDrop.py b/wxPython/demo/URLDragAndDrop.py index 51c1a340ad..bb93b95e12 100644 --- a/wxPython/demo/URLDragAndDrop.py +++ b/wxPython/demo/URLDragAndDrop.py @@ -42,15 +42,15 @@ class TestPanel(wxPanel): text.SetForegroundColour(wxBLUE) outsideSizer.Add(text, 0, wxEXPAND|wxALL, 5) outsideSizer.Add(wxStaticLine(self, -1), 0, wxEXPAND) - outsideSizer.Add(20,20) + outsideSizer.Add((20,20)) self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False)) inSizer = wxFlexGridSizer(2, 2, 5, 5) inSizer.AddGrowableCol(0) - inSizer.Add(20,20) - inSizer.Add(20,20) + inSizer.Add((20,20)) + inSizer.Add((20,20)) inSizer.Add(wxStaticText(self, -1, "Drag URLs from your browser to\nthis window:", style = wxALIGN_RIGHT), diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py index 5ab8598928..c3de97bec5 100755 --- a/wxPython/demo/run.py +++ b/wxPython/demo/run.py @@ -48,7 +48,7 @@ class RunDemoApp(wx.App): self.SetAssertMode(assertMode) - frame = wx.Frame(None, -1, "RunDemo: " + self.name, pos=(50,50), size=(0,0), + frame = wx.Frame(None, -1, "RunDemo: " + self.name, pos=(50,50), size=(200,100), style=wx.NO_FULL_REPAINT_ON_RESIZE|wx.DEFAULT_FRAME_STYLE) frame.CreateStatusBar() menuBar = wx.MenuBar() diff --git a/wxPython/demo/wxArtProvider.py b/wxPython/demo/wxArtProvider.py index 5edd83d3a3..3f0c02d75a 100644 --- a/wxPython/demo/wxArtProvider.py +++ b/wxPython/demo/wxArtProvider.py @@ -126,9 +126,9 @@ class TestPanel(wxPanel): fgs.AddWindow(cb, 0, wxALIGN_CENTRE|wxALL, 5) EVT_CHECKBOX(self, cb.GetId(), self.OnUseCustom) - fgs.AddSpacer(10, 10, 0, wxALIGN_CENTRE|wxALL, 5) - fgs.AddSpacer(10, 10, 0, wxALIGN_CENTRE|wxALL, 5) - fgs.AddSpacer(10, 10, 0, wxALIGN_CENTRE|wxALL, 5) + fgs.Add((10, 10), 0, wxALIGN_CENTRE|wxALL, 5) + fgs.Add((10, 10), 0, wxALIGN_CENTRE|wxALL, 5) + fgs.Add((10, 10), 0, wxALIGN_CENTRE|wxALL, 5) box = wxBoxSizer(wxVERTICAL) bmp = wxEmptyBitmap(16,16) diff --git a/wxPython/demo/wxCalendar.py b/wxPython/demo/wxCalendar.py index 501e02c71c..f2d5c7057a 100644 --- a/wxPython/demo/wxCalendar.py +++ b/wxPython/demo/wxCalendar.py @@ -612,17 +612,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 @@ -640,3 +629,12 @@ See example for various methods used to set display month, year, and highlighted by Lorne White """ + + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) + diff --git a/wxPython/demo/wxCalendarCtrl.py b/wxPython/demo/wxCalendarCtrl.py index 21f1d9434f..59d3cec76e 100644 --- a/wxPython/demo/wxCalendarCtrl.py +++ b/wxPython/demo/wxCalendarCtrl.py @@ -1,7 +1,7 @@ from wxPython.wx import * from wxPython.calendar import * -from wxPython.utils import * + #---------------------------------------------------------------------- diff --git a/wxPython/demo/wxDragImage.py b/wxPython/demo/wxDragImage.py index 74ade7e0ea..8506fb7200 100644 --- a/wxPython/demo/wxDragImage.py +++ b/wxPython/demo/wxDragImage.py @@ -29,9 +29,9 @@ class DragShape: memDC = wxMemoryDC() memDC.SelectObject(self.bmp) - dc.Blit(self.pos.x, self.pos.y, - self.bmp.GetWidth(), self.bmp.GetHeight(), - memDC, 0, 0, op, True) + dc.Blit((self.pos.x, self.pos.y), + (self.bmp.GetWidth(), self.bmp.GetHeight()), + memDC, (0, 0), op, True) return True else: @@ -74,7 +74,7 @@ class DragCanvas(wxScrolledWindow): dc.Clear() dc.SetTextForeground(wxRED) dc.SetFont(font) - dc.DrawText(text, 0, 0) + dc.DrawText(text, (0, 0)) dc.SelectObject(wxNullBitmap) mask = wxMaskColour(bmp, bg_colour) bmp.SetMask(mask) @@ -117,7 +117,7 @@ class DragCanvas(wxScrolledWindow): while x < sz.width: y = 0 while y < sz.height: - dc.DrawBitmap(self.bg_bmp, x, y) + dc.DrawBitmap(self.bg_bmp, (x, y)) y = y + h x = x + w diff --git a/wxPython/demo/wxHtmlWindow.py b/wxPython/demo/wxHtmlWindow.py index dc87749b14..dd2819545b 100644 --- a/wxPython/demo/wxHtmlWindow.py +++ b/wxPython/demo/wxHtmlWindow.py @@ -7,6 +7,8 @@ import wxPython.lib.wxpTag from Main import opj +##wxTrap() + #---------------------------------------------------------------------- # This shows how to catch the OnLinkClicked non-event. (It's a virtual diff --git a/wxPython/demo/wxIntCtrl.py b/wxPython/demo/wxIntCtrl.py index 8e86487d97..d4c48a1cd3 100644 --- a/wxPython/demo/wxIntCtrl.py +++ b/wxPython/demo/wxIntCtrl.py @@ -33,14 +33,14 @@ class TestPanel( wxPanel ): grid.AddWindow( self.max, 0, wxALIGN_LEFT|wxALL, 5 ) grid.AddWindow( self.limit_target, 0, wxALIGN_LEFT|wxALL, 5 ) - grid.AddSpacer( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) + grid.AddSpacer( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) grid.AddWindow( self.allow_none, 0, wxALIGN_LEFT|wxALL, 5 ) - grid.AddSpacer( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) + grid.AddSpacer( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) grid.AddWindow( self.allow_long, 0, wxALIGN_LEFT|wxALL, 5 ) - grid.AddSpacer( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) + grid.AddSpacer( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) - grid.AddSpacer( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) - grid.AddSpacer( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) + grid.AddSpacer( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) + grid.AddSpacer( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) grid.AddWindow( label, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5 ) grid.AddWindow( self.target_ctl, 0, wxALIGN_LEFT|wxALL, 5 ) diff --git a/wxPython/demo/wxMask.py b/wxPython/demo/wxMask.py index 68b8468a86..fb4f453497 100644 --- a/wxPython/demo/wxMask.py +++ b/wxPython/demo/wxMask.py @@ -65,17 +65,17 @@ class TestMaskWindow(wxScrolledWindow): # make an interesting background... dc.SetPen(wxMEDIUM_GREY_PEN) for i in range(100): - dc.DrawLine(0,i*10,i*10,0) + dc.DrawLine((0,i*10), (i*10,0)) # draw raw image, mask, and masked images - dc.DrawText('original image', 0,0) - dc.DrawBitmap(self.bmp_nomask, 0,20, 0) - dc.DrawText('with colour mask', 0,100) - dc.DrawBitmap(self.bmp_withcolourmask, 0,120, 1) - dc.DrawText('the mask image', 0,200) - dc.DrawBitmap(self.bmp_themask, 0,220, 0) - dc.DrawText('masked image', 0,300) - dc.DrawBitmap(self.bmp_withmask, 0,320, 1) + dc.DrawText('original image', (0,0)) + dc.DrawBitmap(self.bmp_nomask, (0,20), 0) + dc.DrawText('with colour mask', (0,100)) + dc.DrawBitmap(self.bmp_withcolourmask, (0,120), 1) + dc.DrawText('the mask image', (0,200)) + dc.DrawBitmap(self.bmp_themask, (0,220), 0) + dc.DrawText('masked image', (0,300)) + dc.DrawBitmap(self.bmp_withmask, (0,320), 1) cx,cy = self.bmp_themask.GetWidth(), self.bmp_themask.GetHeight() @@ -84,9 +84,9 @@ class TestMaskWindow(wxScrolledWindow): i = 0 for text, code in logicList: x,y = 120+150*(i%4), 20+100*(i/4) - dc.DrawText(text, x, y-20) + dc.DrawText(text, (x, y-20)) mdc.SelectObject(self.bmp_withcolourmask) - dc.Blit(x,y, cx,cy, mdc, 0,0, code, True) + dc.Blit((x,y), (cx,cy), mdc, (0,0), code, True) i = i + 1 diff --git a/wxPython/demo/wxScrolledPanel.py b/wxPython/demo/wxScrolledPanel.py index c6b14bcca9..a0e89ae421 100644 --- a/wxPython/demo/wxScrolledPanel.py +++ b/wxPython/demo/wxScrolledPanel.py @@ -23,7 +23,7 @@ class TestPanel(wxScrolledPanel): desc.SetForegroundColour("Blue") vbox.Add(desc, 0, wxALIGN_LEFT|wxALL, 5) vbox.Add(wxStaticLine(self, -1, size=(1024,-1)), 0, wxALL, 5) - vbox.AddSpacer(20,20) + vbox.Add((20,20)) words = text.split() @@ -71,16 +71,16 @@ class TestPanel(wxScrolledPanel): panel3.SetupScrolling() hbox = wxBoxSizer(wxHORIZONTAL) - hbox.AddSpacer(20,20) + hbox.Add((20,20)) hbox.Add(panel1, 0) - hbox.AddSpacer(40, 10) + hbox.Add((40, 10)) vbox2 = wxBoxSizer(wxVERTICAL) vbox2.Add(panel2, 0) - vbox2.AddSpacer(20, 50) + vbox2.Add((20, 50)) vbox2.Add(panel3, 0) - vbox2.AddSpacer(20, 10) + vbox2.Add((20, 10)) hbox.Add(vbox2) vbox.AddSizer(hbox, 0) diff --git a/wxPython/demo/wxTimeCtrl.py b/wxPython/demo/wxTimeCtrl.py index e6a5aeed2f..c92640c1d0 100644 --- a/wxPython/demo/wxTimeCtrl.py +++ b/wxPython/demo/wxTimeCtrl.py @@ -81,8 +81,8 @@ class TestPanel( wxScrolledPanel ): self.target_ctrl = wxTimeCtrl( self, -1, name="new" ) grid2 = wxFlexGridSizer( 0, 2, 0, 0 ) - grid2.Add( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) - grid2.Add( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) + grid2.Add( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) + grid2.Add( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) grid2.Add( self.set_bounds, 0, wxALIGN_LEFT|wxALL, 5 ) grid3 = wxFlexGridSizer( 0, 2, 5, 5 ) @@ -93,16 +93,16 @@ class TestPanel( wxScrolledPanel ): grid2.Add(grid3, 0, wxALIGN_LEFT ) grid2.Add( self.limit_check, 0, wxALIGN_LEFT|wxALL, 5 ) - grid2.Add( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) + grid2.Add( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) - grid2.Add( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) - grid2.Add( 20, 0, 0, wxALIGN_LEFT|wxALL, 5 ) + grid2.Add( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) + grid2.Add( (20, 0), 0, wxALIGN_LEFT|wxALL, 5 ) grid2.Add( label, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5 ) grid2.Add( self.target_ctrl, 0, wxALIGN_LEFT|wxALL, 5 ) boundsbox.Add(grid2, 0, wxALIGN_CENTER|wxEXPAND|wxALL, 5) vbox = wxBoxSizer( wxVERTICAL ) - vbox.AddSpacer(20, 20) + vbox.Add( (20, 20) ) vbox.Add( hbox, 0, wxALIGN_LEFT|wxALL, 5) vbox.Add( boundsbox, 0, wxALIGN_LEFT|wxALL, 5 ) diff --git a/wxPython/src/_artprov.i b/wxPython/src/_artprov.i index b8e9bbdd80..70f1de40a9 100644 --- a/wxPython/src/_artprov.i +++ b/wxPython/src/_artprov.i @@ -108,7 +108,7 @@ public: %addtofunc wxPyArtProvider "self._setCallbackInfo(self, ArtProvider)" wxPyArtProvider(); - ~wxPyArtProvider(); +// ~wxPyArtProvider(); void _setCallbackInfo(PyObject* self, PyObject* _class); diff --git a/wxPython/src/_combobox.i b/wxPython/src/_combobox.i index 22aba5bff2..1cc6d1c0d9 100644 --- a/wxPython/src/_combobox.i +++ b/wxPython/src/_combobox.i @@ -64,6 +64,7 @@ public: virtual long GetInsertionPoint() const; virtual long GetLastPosition() const; virtual void Replace(long from, long to, const wxString& value); + void SetSelection(int n); %name(SetMark) virtual void SetSelection(long from, long to); virtual void SetEditable(bool editable); diff --git a/wxPython/src/_dc.i b/wxPython/src/_dc.i index b2ddce26ea..da92e4ada9 100644 --- a/wxPython/src/_dc.i +++ b/wxPython/src/_dc.i @@ -513,13 +513,13 @@ public: raise ValueError('textlist and coords must have same length') if foregrounds is None: foregrounds = [] - elif isinstance(foregrounds, wxColour): + elif isinstance(foregrounds, wx.Colour): foregrounds = [foregrounds] elif len(foregrounds) != len(coords): raise ValueError('foregrounds and coords must have same length') if backgrounds is None: backgrounds = [] - elif isinstance(backgrounds, wxColour): + elif isinstance(backgrounds, wx.Colour): backgrounds = [backgrounds] elif len(backgrounds) != len(coords): raise ValueError('backgrounds and coords must have same length') diff --git a/wxPython/src/_dnd.i b/wxPython/src/_dnd.i index 8e2ce47ab7..15f0f18777 100644 --- a/wxPython/src/_dnd.i +++ b/wxPython/src/_dnd.i @@ -121,7 +121,9 @@ IMP_PYCALLBACK_BOOL_INTINT(wxPyDropTarget, wxDropTarget, OnDrop); %name(DropTarget) class wxPyDropTarget // : public wxDropTarget { public: - %addtofunc wxPyDropTarget "if args: args[1].thisown = 0; self._setCallbackInfo(self, DropTarget)" + %addtofunc wxPyDropTarget + "if args: args[0].thisown = 0; + self._setCallbackInfo(self, DropTarget)" wxPyDropTarget(wxDataObject *dataObject = NULL); void _setCallbackInfo(PyObject* self, PyObject* _class); diff --git a/wxPython/src/_printfw.i b/wxPython/src/_printfw.i index f91b876a0b..81365330a0 100644 --- a/wxPython/src/_printfw.i +++ b/wxPython/src/_printfw.i @@ -376,7 +376,7 @@ public: class wxPreviewCanvas: public wxScrolledWindow { public: - %addtofunc wxPreviewCanvas "self._self._setOORInfo(self)" + %addtofunc wxPreviewCanvas "self._setOORInfo(self)" wxPreviewCanvas(wxPrintPreview *preview, wxWindow *parent, @@ -389,7 +389,7 @@ public: class wxPreviewFrame : public wxFrame { public: - %addtofunc wxPreviewFrame "self._self._setOORInfo(self)" + %addtofunc wxPreviewFrame "self._setOORInfo(self)" wxPreviewFrame(wxPrintPreview* preview, wxFrame* parent, const wxString& title, const wxPoint& pos = wxDefaultPosition, @@ -429,7 +429,7 @@ enum { class wxPreviewControlBar: public wxPanel { public: - %addtofunc wxPreviewControlBar "self._self._setOORInfo(self)" + %addtofunc wxPreviewControlBar "self._setOORInfo(self)" wxPreviewControlBar(wxPrintPreview *preview, long buttons, diff --git a/wxPython/src/_tipwin.i b/wxPython/src/_tipwin.i index 5c908e2587..cb9b941879 100644 --- a/wxPython/src/_tipwin.i +++ b/wxPython/src/_tipwin.i @@ -35,11 +35,10 @@ public: %extend { wxTipWindow(wxWindow *parent, - const wxString* text, + const wxString& text, wxCoord maxLength = 100, wxRect* rectBound = NULL) { - wxString tmp = *text; - return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound); + return new wxTipWindow(parent, text, maxLength, NULL, rectBound); } } diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index 5c0cf3a0e1..6bd8cd5264 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -762,13 +762,13 @@ def DLG_PNT(win, point_or_x, y=None): if y is None: return win.ConvertDialogPointToPixels(point_or_x) else: - return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y)) + return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) def DLG_SZE(win, size_width, height=None): if height is None: return win.ConvertDialogSizeToPixels(size_width) else: - return win.ConvertDialogSizeToPixels(wxSize(size_width, height)) + return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) } diff --git a/wxPython/src/drawlist.cpp b/wxPython/src/drawlist.cpp index 0ec57b0ec5..b0516571e9 100644 --- a/wxPython/src/drawlist.cpp +++ b/wxPython/src/drawlist.cpp @@ -274,7 +274,7 @@ PyObject* wxPyDrawTextList(wxDC& dc, PyObject* textList, PyObject* pyPoints, PyO else { obj = PySequence_GetItem(foregroundList, i); } - if (! wxPyConvertSwigPtr(obj, (void **) &color, wxT("wxColour_p"))) { + if (! wxPyConvertSwigPtr(obj, (void **) &color, wxT("wxColour"))) { if (!isFastForeground) Py_DECREF(obj); goto err2; diff --git a/wxPython/src/gtk/controls.py b/wxPython/src/gtk/controls.py index 179008b47c..92991f3e06 100644 --- a/wxPython/src/gtk/controls.py +++ b/wxPython/src/gtk/controls.py @@ -334,6 +334,10 @@ class ComboBox(core.Control,core.ItemContainer): """Replace(long from, long to, wxString value)""" return _controls.ComboBox_Replace(*args, **kwargs) + def SetSelection(*args, **kwargs): + """SetSelection(int n)""" + return _controls.ComboBox_SetSelection(*args, **kwargs) + def SetMark(*args, **kwargs): """SetMark(long from, long to)""" return _controls.ComboBox_SetMark(*args, **kwargs) diff --git a/wxPython/src/gtk/controls_wrap.cpp b/wxPython/src/gtk/controls_wrap.cpp index 1754287510..742edaf82e 100644 --- a/wxPython/src/gtk/controls_wrap.cpp +++ b/wxPython/src/gtk/controls_wrap.cpp @@ -2855,6 +2855,31 @@ static PyObject *_wrap_ComboBox_Replace(PyObject *self, PyObject *args, PyObject } +static PyObject *_wrap_ComboBox_SetSelection(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxComboBox *arg1 = (wxComboBox *) 0 ; + int arg2 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "n", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"Oi:ComboBox_SetSelection",kwnames,&obj0,&arg2)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxComboBox,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetSelection(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_ComboBox_SetMark(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxComboBox *arg1 = (wxComboBox *) 0 ; @@ -25790,6 +25815,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"ComboBox_GetInsertionPoint", (PyCFunction) _wrap_ComboBox_GetInsertionPoint, METH_VARARGS | METH_KEYWORDS }, { (char *)"ComboBox_GetLastPosition", (PyCFunction) _wrap_ComboBox_GetLastPosition, METH_VARARGS | METH_KEYWORDS }, { (char *)"ComboBox_Replace", (PyCFunction) _wrap_ComboBox_Replace, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ComboBox_SetSelection", (PyCFunction) _wrap_ComboBox_SetSelection, METH_VARARGS | METH_KEYWORDS }, { (char *)"ComboBox_SetMark", (PyCFunction) _wrap_ComboBox_SetMark, METH_VARARGS | METH_KEYWORDS }, { (char *)"ComboBox_SetEditable", (PyCFunction) _wrap_ComboBox_SetEditable, METH_VARARGS | METH_KEYWORDS }, { (char *)"ComboBox_SetInsertionPointEnd", (PyCFunction) _wrap_ComboBox_SetInsertionPointEnd, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/core.py b/wxPython/src/gtk/core.py index 4c89e589a6..93006e547c 100644 --- a/wxPython/src/gtk/core.py +++ b/wxPython/src/gtk/core.py @@ -5827,13 +5827,13 @@ def DLG_PNT(win, point_or_x, y=None): if y is None: return win.ConvertDialogPointToPixels(point_or_x) else: - return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y)) + return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) def DLG_SZE(win, size_width, height=None): if height is None: return win.ConvertDialogSizeToPixels(size_width) else: - return win.ConvertDialogSizeToPixels(wxSize(size_width, height)) + return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) def FindWindowById(*args, **kwargs): diff --git a/wxPython/src/gtk/gdi.py b/wxPython/src/gtk/gdi.py index 12c7400274..ed359ec5b6 100644 --- a/wxPython/src/gtk/gdi.py +++ b/wxPython/src/gtk/gdi.py @@ -2584,13 +2584,13 @@ Get the DC size in milimeters.""" raise ValueError('textlist and coords must have same length') if foregrounds is None: foregrounds = [] - elif isinstance(foregrounds, wxColour): + elif isinstance(foregrounds, wx.Colour): foregrounds = [foregrounds] elif len(foregrounds) != len(coords): raise ValueError('foregrounds and coords must have same length') if backgrounds is None: backgrounds = [] - elif isinstance(backgrounds, wxColour): + elif isinstance(backgrounds, wx.Colour): backgrounds = [backgrounds] elif len(backgrounds) != len(coords): raise ValueError('backgrounds and coords must have same length') diff --git a/wxPython/src/gtk/html_wrap.cpp b/wxPython/src/gtk/html_wrap.cpp index a2f15dc94a..ad01de3dec 100644 --- a/wxPython/src/gtk/html_wrap.cpp +++ b/wxPython/src/gtk/html_wrap.cpp @@ -372,15 +372,17 @@ public: // First, make a new instance of the tag handler wxPyBeginBlockThreads(); - PyObject* arg = Py_BuildValue("()"); - PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL); + PyObject* arg = PyTuple_New(0); + PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg); Py_DECREF(arg); - wxPyEndBlockThreads(); - + // now figure out where it's C++ object is... wxPyHtmlWinTagHandler* thPtr; - if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) + if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) { + wxPyEndBlockThreads(); return; + } + wxPyEndBlockThreads(); // add it, parser->AddTagHandler(thPtr); diff --git a/wxPython/src/gtk/misc.py b/wxPython/src/gtk/misc.py index 07acb98b3b..5b449c7568 100644 --- a/wxPython/src/gtk/misc.py +++ b/wxPython/src/gtk/misc.py @@ -2302,12 +2302,6 @@ class ArtProvider(object): del newobj.thisown self._setCallbackInfo(self, ArtProvider) - def __del__(self, destroy=_misc.delete_ArtProvider): - """__del__()""" - try: - if self.thisown: destroy(self) - except: pass - def _setCallbackInfo(*args, **kwargs): """_setCallbackInfo(PyObject self, PyObject _class)""" return _misc.ArtProvider__setCallbackInfo(*args, **kwargs) @@ -4372,7 +4366,8 @@ class DropTarget(object): self.this = newobj.this self.thisown = 1 del newobj.thisown - if args: args[1].thisown = 0; self._setCallbackInfo(self, DropTarget) + if args: args[0].thisown = 0; + self._setCallbackInfo(self, DropTarget) def _setCallbackInfo(*args, **kwargs): """_setCallbackInfo(PyObject self, PyObject _class)""" diff --git a/wxPython/src/gtk/misc_wrap.cpp b/wxPython/src/gtk/misc_wrap.cpp index 6233be06a9..f4335042da 100644 --- a/wxPython/src/gtk/misc_wrap.cpp +++ b/wxPython/src/gtk/misc_wrap.cpp @@ -12840,30 +12840,6 @@ static PyObject *_wrap_new_ArtProvider(PyObject *self, PyObject *args, PyObject } -static PyObject *_wrap_delete_ArtProvider(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxPyArtProvider *arg1 = (wxPyArtProvider *) 0 ; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_ArtProvider",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPyArtProvider,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - delete arg1; - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_ArtProvider__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxPyArtProvider *arg1 = (wxPyArtProvider *) 0 ; @@ -24689,7 +24665,6 @@ static PyMethodDef SwigMethods[] = { { (char *)"delete_MimeTypesManager", (PyCFunction) _wrap_delete_MimeTypesManager, METH_VARARGS | METH_KEYWORDS }, { (char *)"MimeTypesManager_swigregister", MimeTypesManager_swigregister, METH_VARARGS }, { (char *)"new_ArtProvider", (PyCFunction) _wrap_new_ArtProvider, METH_VARARGS | METH_KEYWORDS }, - { (char *)"delete_ArtProvider", (PyCFunction) _wrap_delete_ArtProvider, METH_VARARGS | METH_KEYWORDS }, { (char *)"ArtProvider__setCallbackInfo", (PyCFunction) _wrap_ArtProvider__setCallbackInfo, METH_VARARGS | METH_KEYWORDS }, { (char *)"ArtProvider_PushProvider", (PyCFunction) _wrap_ArtProvider_PushProvider, METH_VARARGS | METH_KEYWORDS }, { (char *)"ArtProvider_PopProvider", (PyCFunction) _wrap_ArtProvider_PopProvider, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/gtk/windows.py b/wxPython/src/gtk/windows.py index 3688c79ea9..e3b968406c 100644 --- a/wxPython/src/gtk/windows.py +++ b/wxPython/src/gtk/windows.py @@ -3388,7 +3388,7 @@ class PreviewCanvas(ScrolledWindow): self.this = newobj.this self.thisown = 1 del newobj.thisown - self._self._setOORInfo(self) + self._setOORInfo(self) class PreviewCanvasPtr(PreviewCanvas): @@ -3410,7 +3410,7 @@ class PreviewFrame(Frame): self.this = newobj.this self.thisown = 1 del newobj.thisown - self._self._setOORInfo(self) + self._setOORInfo(self) def Initialize(*args, **kwargs): """Initialize()""" @@ -3464,7 +3464,7 @@ class PreviewControlBar(Panel): self.this = newobj.this self.thisown = 1 del newobj.thisown - self._self._setOORInfo(self) + self._setOORInfo(self) def GetZoomControl(*args, **kwargs): """GetZoomControl() -> int""" diff --git a/wxPython/src/gtk/windows_wrap.cpp b/wxPython/src/gtk/windows_wrap.cpp index b8f0ec3dd9..683ab69f9b 100644 --- a/wxPython/src/gtk/windows_wrap.cpp +++ b/wxPython/src/gtk/windows_wrap.cpp @@ -405,9 +405,8 @@ IMP_PYCALLBACK_BOOL_(wxPyPopupTransientWindow, wxPopupTransientWindow, CanDismis #include -wxTipWindow *new_wxTipWindow(wxWindow *parent,wxString const *text,int maxLength,wxRect *rectBound){ - wxString tmp = *text; - return new wxTipWindow(parent, tmp, maxLength, NULL, rectBound); +wxTipWindow *new_wxTipWindow(wxWindow *parent,wxString const &text,int maxLength,wxRect *rectBound){ + return new wxTipWindow(parent, text, maxLength, NULL, rectBound); } #include @@ -7862,10 +7861,11 @@ static PyObject * PopupTransientWindow_swigregister(PyObject *self, PyObject *ar static PyObject *_wrap_new_TipWindow(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; - wxString *arg2 = (wxString *) 0 ; + wxString *arg2 = 0 ; int arg3 = (int) 100 ; wxRect *arg4 = (wxRect *) NULL ; wxTipWindow *result; + bool temp2 = False ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj3 = 0 ; @@ -7875,20 +7875,32 @@ static PyObject *_wrap_new_TipWindow(PyObject *self, PyObject *args, PyObject *k if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|iO:new_TipWindow",kwnames,&obj0,&obj1,&arg3,&obj3)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxString,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } if (obj3) { if ((SWIG_ConvertPtr(obj3,(void **) &arg4, SWIGTYPE_p_wxRect,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxTipWindow *)new_wxTipWindow(arg1,(wxString const *)arg2,arg3,arg4); + result = (wxTipWindow *)new_wxTipWindow(arg1,(wxString const &)*arg2,arg3,arg4); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxTipWindow, 1); + { + if (temp2) + delete arg2; + } return resultobj; fail: + { + if (temp2) + delete arg2; + } return NULL; } diff --git a/wxPython/wx/lib/anchors.py b/wxPython/wx/lib/anchors.py index c2e52c433d..1553f2701a 100644 --- a/wxPython/wx/lib/anchors.py +++ b/wxPython/wx/lib/anchors.py @@ -67,12 +67,12 @@ class LayoutAnchors(wxLayoutConstraints): self.setConstraintSides(self.left, wxLeft, left, self.right, wxRight, right, self.width, wxWidth, self.centreX, - cPos.x, cSize.x, pSize.x, parent) + cPos.x, cSize.width, pSize.width, parent) self.setConstraintSides(self.top, wxTop, top, self.bottom, wxBottom, bottom, self.height, wxHeight, self.centreY, - cPos.y, cSize.y, pSize.y, parent) + cPos.y, cSize.height, pSize.height, parent) def setConstraintSides(self, side1, side1Edge, side1Anchor, side2, side2Edge, side2Anchor, diff --git a/wxPython/wx/lib/calendar.py b/wxPython/wx/lib/calendar.py index f5247dc2be..c7b02089ab 100644 --- a/wxPython/wx/lib/calendar.py +++ b/wxPython/wx/lib/calendar.py @@ -155,7 +155,7 @@ class CalDraw: if self.outer_border is True: rect = wxRect(self.cx_st, self.cy_st, self.sizew, self.sizeh) # full display window area - self.DC.DrawRectangle(rect.x, rect.y, rect.width, rect.height) + self.DC.DrawRectangleRect(rect) def DrawNumVal(self): self.DrawNum() @@ -226,7 +226,7 @@ class CalDraw: tw,th = self.DC.GetTextExtent(month) adjust = self.cx_st + (self.sizew-tw)/2 - self.DC.DrawText(month, adjust, self.cy_st + th) + self.DC.DrawText(month, (adjust, self.cy_st + th)) year = str(self.year) tw,th = self.DC.GetTextExtent(year) @@ -236,7 +236,7 @@ class CalDraw: f = wxFont(sizef, self.font, wxNORMAL, self.bold) self.DC.SetFont(f) - self.DC.DrawText(year, self.cx_st + adjust, self.cy_st + th) + self.DC.DrawText(year, (self.cx_st + adjust, self.cy_st + th)) def DrawWeek(self): # draw the week days width = self.gridx[1]-self.gridx[0] @@ -265,7 +265,7 @@ class CalDraw: brush = wxBrush(wxNamedColour(self.week_color), wxSOLID) self.DC.SetBrush(brush) -# self.DC.DrawRectangle(self.gridx[0], self.gridy[0], rect_w+1, height) +# self.DC.DrawRectangle((self.gridx[0], self.gridy[0]), (rect_w+1, height)) if self.cal_type == "NORMAL": cal_days = CalDays @@ -282,8 +282,8 @@ class CalDraw: x = self.gridx[cnt_x] y = self.gridy[cnt_y] - self.DC.DrawRectangle(self.gridx[cnt_x], self.gridy[0], width+1, height) - self.DC.DrawText(day, x+diffx, y+diffy) + self.DC.DrawRectangle((self.gridx[cnt_x], self.gridy[0]), (width+1, height)) + self.DC.DrawText(day, (x+diffx, y+diffy)) cnt_x = cnt_x + 1 def DrawNum(self): # draw the day numbers @@ -337,7 +337,7 @@ class CalDraw: adj_v = adj_v + self.num_indent_vert - self.DC.DrawText(val, x+adj_h, y+adj_v) + self.DC.DrawText(val, (x+adj_h, y+adj_v)) if cnt_x < 6: cnt_x = cnt_x + 1 else: @@ -367,7 +367,7 @@ class CalDraw: self.DC.SetPen(wxPen(wxNamedColour(self.back_color), 0)) nkey = key + self.st_pos -1 rect = self.rg[nkey] - self.DC.DrawRectangle(rect.x, rect.y, rect.width+1, rect.height+1) + self.DC.DrawRectangle((rect.x, rect.y), (rect.width+1, rect.height+1)) def DrawGrid(self): # calculate and draw the grid lines self.DC.SetPen(wxPen(wxNamedColour(self.grid_color), 0)) @@ -384,7 +384,7 @@ class CalDraw: y2 = y1 + self.cheight for i in range(8): if self.hide_grid is False: - self.DC.DrawLine(x1, y1, x1, y2) + self.DC.DrawLine((x1, y1), (x1, y2)) self.gridx.append(x1) x1 = x1 + self.dl_w @@ -394,7 +394,7 @@ class CalDraw: x2 = x1 + self.cwidth for i in range(8): if self.hide_grid is False: - self.DC.DrawLine(x1, y1, x2, y1) + self.DC.DrawLine((x1, y1), (x2, y1)) self.gridy.append(y1) if i == 0: y1 = y1 + self.dl_th @@ -439,7 +439,7 @@ class wxCalendar(wxWindow): self.select_list = [] - self.SetBackgroundColour(wxNamedColor(self.back_color)) + self.SetBackgroundColour(wxNamedColour(self.back_color)) self.Connect(-1, -1, wxEVT_LEFT_DOWN, self.OnLeftEvent) self.Connect(-1, -1, wxEVT_LEFT_DCLICK, self.OnLeftDEvent) self.Connect(-1, -1, wxEVT_RIGHT_DOWN, self.OnRightEvent) @@ -671,7 +671,7 @@ class wxCalendar(wxWindow): DC.SetPen(wxPen(wxNamedColour(color), width)) rect = self.rg[key] - DC.DrawRectangle(rect.x, rect.y, rect.width+1, rect.height+1) + DC.DrawRectangle((rect.x, rect.y), (rect.width+1, rect.height+1)) DC.EndDrawing() @@ -696,7 +696,7 @@ class wxCalendar(wxWindow): class CalenDlg(wxDialog): def __init__(self, parent, month=None, day = None, year=None): - wxDialog.__init__(self, parent, -1, "Event Calendar", wxPyDefaultPosition, wxSize(280, 360)) + wxDialog.__init__(self, parent, -1, "Event Calendar", wxDefaultPosition, wxSize(280, 360)) # set the calendar and attributes self.calend = wxCalendar(self, -1, wxPoint(20, 60), wxSize(240, 200)) diff --git a/wxPython/wx/lib/evtmgr.py b/wxPython/wx/lib/evtmgr.py index 4ea2795342..236c37f5fc 100644 --- a/wxPython/wx/lib/evtmgr.py +++ b/wxPython/wx/lib/evtmgr.py @@ -316,7 +316,7 @@ class EventMacroInfo: win = FakeWindow() try: eventMacro(win, None, None) - except TypeError: + except (TypeError, AssertionError): eventMacro(win, None) self.lookupTable[eventMacro] = win.eventTypes return win.eventTypes @@ -406,7 +406,7 @@ class EventAdapter: try: func(win, id, self.handleEvent) self.callStyle = 3 - except TypeError: + except (TypeError, AssertionError): func(win, self.handleEvent) self.callStyle = 2 diff --git a/wxPython/wx/lib/rcsizer.py b/wxPython/wx/lib/rcsizer.py index 482e4a7066..752f3203fc 100644 --- a/wxPython/wx/lib/rcsizer.py +++ b/wxPython/wx/lib/rcsizer.py @@ -85,7 +85,7 @@ class RowColSizer(wxPySizer): assert row != -1, "Row must be specified" assert col != -1, "Column must be specified" - wxPySizer.AddSpacer(self, width, height, option, flag, border, + wxPySizer.AddSpacer(self, (width, height), option, flag, border, userData=(row, col, row+rowspan, col+colspan)) #-------------------------------------------------- diff --git a/wxPython/wx/lib/throbber.py b/wxPython/wx/lib/throbber.py index d1a8695235..a4063d4be5 100644 --- a/wxPython/wx/lib/throbber.py +++ b/wxPython/wx/lib/throbber.py @@ -21,6 +21,7 @@ import os import wx # ------------------------------------------------------------------------------ + THROBBER_EVENT = wx.NewEventType() def EVT_UPDATE_THROBBER(win, func): win.Connect(-1, -1, THROBBER_EVENT, func) @@ -134,13 +135,13 @@ class Throbber(wx.Panel): def Draw(self, dc): - dc.DrawBitmap(self.submaps[self.sequence[self.current]], 0, 0, True) + dc.DrawBitmap(self.submaps[self.sequence[self.current]], (0, 0), True) if self.overlay and self.showOverlay: - dc.DrawBitmap(self.overlay, self.overlayX, self.overlayY, True) + dc.DrawBitmap(self.overlay, (self.overlayX, self.overlayY), True) if self.label and self.showLabel: - dc.DrawText(self.label, self.labelX, self.labelY) + dc.DrawText(self.label, (self.labelX, self.labelY)) dc.SetTextForeground(wx.WHITE) - dc.DrawText(self.label, self.labelX-1, self.labelY-1) + dc.DrawText(self.label, (self.labelX-1, self.labelY-1)) def OnPaint(self, event): @@ -194,7 +195,7 @@ class Throbber(wx.Panel): """Start the animation""" if not self.running: self.running = not self.running - self.timer.Start(self.frameDelay * 1000) + self.timer.Start(int(self.frameDelay * 1000)) def Stop(self): diff --git a/wxPython/wx/lib/timectrl.py b/wxPython/wx/lib/timectrl.py index e0d52116b2..8a0384476e 100644 --- a/wxPython/wx/lib/timectrl.py +++ b/wxPython/wx/lib/timectrl.py @@ -239,7 +239,7 @@ value to fall within the current bounds. """ -import string, copy +import string, copy, types from wxPython.wx import * from wxPython.tools.dbg import Logger from wxPython.lib.maskededit import wxMaskedTextCtrl, Field diff --git a/wxPython/wxPython/lib/calendar.py b/wxPython/wxPython/lib/calendar.py index d36356367d..931feb3bf0 100644 --- a/wxPython/wxPython/lib/calendar.py +++ b/wxPython/wxPython/lib/calendar.py @@ -6,8 +6,26 @@ import wx.lib.calendar __doc__ = wx.lib.calendar.__doc__ +Date = wx.lib.calendar.Date +FillDate = wx.lib.calendar.FillDate +FormatDay = wx.lib.calendar.FormatDay +FromJulian = wx.lib.calendar.FromJulian +TodayDay = wx.lib.calendar.TodayDay +dayOfWeek = wx.lib.calendar.dayOfWeek +daysPerMonth = wx.lib.calendar.daysPerMonth +isleap = wx.lib.calendar.isleap +julianDay = wx.lib.calendar.julianDay +leapdays = wx.lib.calendar.leapdays +now = wx.lib.calendar.now +Month = wx.lib.calendar.Month +mdays = wx.lib.calendar.mdays +day_name = wx.lib.calendar.day_name +day_abbr = wx.lib.calendar.day_abbr + + CalDraw = wx.lib.calendar.CalDraw CalenDlg = wx.lib.calendar.CalenDlg GetMonthList = wx.lib.calendar.GetMonthList PrtCalDraw = wx.lib.calendar.PrtCalDraw wxCalendar = wx.lib.calendar.wxCalendar + diff --git a/wxPython/wxPython/lib/evtmgr.py b/wxPython/wxPython/lib/evtmgr.py index b999958b56..d0799b04ec 100644 --- a/wxPython/wxPython/lib/evtmgr.py +++ b/wxPython/wxPython/lib/evtmgr.py @@ -11,3 +11,4 @@ EventMacroInfo = wx.lib.evtmgr.EventMacroInfo EventManager = wx.lib.evtmgr.EventManager FakeWindow = wx.lib.evtmgr.FakeWindow MessageAdapter = wx.lib.evtmgr.MessageAdapter +eventManager = wx.lib.evtmgr.eventManager -- 2.45.2