From 6999b0d8e9740918ed66bff0ee6fe147b6367a97 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 11 Dec 1999 07:59:23 +0000 Subject: [PATCH] Added rotated text support Added Some generic button and toggle button classes Lots of little fixes, additions, etc. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/wxPython/CHANGES.txt | 7 + utils/wxPython/demo/GenericButtons.py | 90 ++ utils/wxPython/demo/Main.py | 11 +- utils/wxPython/demo/bitmaps/lb1.bmp | Bin 0 -> 2678 bytes utils/wxPython/demo/bitmaps/lb2.bmp | Bin 0 -> 4854 bytes utils/wxPython/demo/wxButton.py | 4 +- utils/wxPython/demo/wxScrolledWindow.py | 6 + utils/wxPython/demo/wxSplitterWindow.py | 13 +- utils/wxPython/distrib/build.py | 2 +- utils/wxPython/distrib/wxPython.wse | 4 +- utils/wxPython/distrib/wxPython.wsm | Bin 33 -> 33 bytes utils/wxPython/lib/buttons.py | 340 ++++++++ utils/wxPython/lib/grids.py | 2 - utils/wxPython/modules/html/build.cfg | 2 +- utils/wxPython/src/__version__.py | 2 +- utils/wxPython/src/_extras.py | 12 +- utils/wxPython/src/clip_dnd.i | 1 + utils/wxPython/src/controls.i | 64 ++ utils/wxPython/src/events.i | 4 + utils/wxPython/src/gdi.i | 67 +- utils/wxPython/src/helpers.cpp | 2 +- utils/wxPython/src/msw/clip_dnd.cpp | 3 + utils/wxPython/src/msw/controls.cpp | 53 ++ utils/wxPython/src/msw/controls.py | 10 +- utils/wxPython/src/msw/controls2.cpp | 2 + utils/wxPython/src/msw/events.cpp | 99 +++ utils/wxPython/src/msw/events.py | 9 + utils/wxPython/src/msw/gdi.cpp | 1000 ++++++++++------------- utils/wxPython/src/msw/gdi.py | 109 ++- utils/wxPython/src/msw/stattool.cpp | 256 +++++- utils/wxPython/src/msw/stattool.py | 26 + utils/wxPython/src/msw/windows.cpp | 37 + utils/wxPython/src/msw/windows.py | 3 + utils/wxPython/src/stattool.i | 28 +- utils/wxPython/src/windows.i | 8 + 35 files changed, 1577 insertions(+), 699 deletions(-) create mode 100644 utils/wxPython/demo/GenericButtons.py create mode 100644 utils/wxPython/demo/bitmaps/lb1.bmp create mode 100644 utils/wxPython/demo/bitmaps/lb2.bmp create mode 100644 utils/wxPython/lib/buttons.py diff --git a/utils/wxPython/CHANGES.txt b/utils/wxPython/CHANGES.txt index e7ea923628..a32a1f28ab 100644 --- a/utils/wxPython/CHANGES.txt +++ b/utils/wxPython/CHANGES.txt @@ -30,6 +30,13 @@ rectangle representing the intersection is returned. Some bug fixes for Clipboard and Drag-n-Drop. +Rotated text!!! WooHoo! (See wxDC.DrawRotatedtext()) + +Added a set of Generic Buttons to the library. These are simple +window classes that look and act like native buttons, but you can have +a bit more control over them. The bezel width can be set in addition +to colours, fonts, etc. There is a ToggleButton as well as Bitmap +versions too. diff --git a/utils/wxPython/demo/GenericButtons.py b/utils/wxPython/demo/GenericButtons.py new file mode 100644 index 0000000000..e069d7ec52 --- /dev/null +++ b/utils/wxPython/demo/GenericButtons.py @@ -0,0 +1,90 @@ + +from wxPython.wx import * +from wxPython.lib.buttons import wxGenButton, wxGenBitmapButton, \ + wxGenToggleButton, wxGenBitmapToggleButton + +#---------------------------------------------------------------------- + + +class TestPanel(wxPanel): + def __init__(self, parent, log): + wxPanel.__init__(self, parent, -1) + self.log = log + + b = wxButton(self, -1, "A real button", (10,10)) + b.SetDefault() + EVT_BUTTON(self, b.GetId(), self.OnButton) + b = wxButton(self, -1, "non-default", (100, 10)) + EVT_BUTTON(self, b.GetId(), self.OnButton) + #wxTextCtrl(self, -1, "", (10,40)) + + b = wxGenButton(self, -1, 'Hello', (10,65)) + EVT_BUTTON(self, b.GetId(), self.OnButton) + b = wxGenButton(self, -1, 'disabled', (100,65)) + EVT_BUTTON(self, b.GetId(), self.OnButton) + b.Enable(false) + + b = wxGenButton(self, -1, 'bigger', (195,50), (120, 55)) + EVT_BUTTON(self, b.GetId(), self.OnButton) + b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false)) + b.SetBezelWidth(5) + b.SetBackgroundColour(wxBLUE) + b.SetForegroundColour(wxWHITE) + #b.SetUseFocusIndicator(false) + + bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP) + b = wxGenBitmapButton(self, -1, bmp, (10, 130), + (bmp.GetWidth()+16, bmp.GetHeight()+16)) + EVT_BUTTON(self, b.GetId(), self.OnButton) + + + b = wxGenBitmapButton(self, -1, None, (100, 130), (48,48)) + EVT_BUTTON(self, b.GetId(), self.OnButton) + bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP) + mask = wxMaskColour(bmp, wxBLUE) + bmp.SetMask(mask) + b.SetBitmapLabel(bmp) + bmp = wxBitmap('bitmaps/lb2.bmp', wxBITMAP_TYPE_BMP) + mask = wxMaskColour(bmp, wxBLUE) + bmp.SetMask(mask) + b.SetBitmapSelected(bmp) + + + b = wxGenToggleButton(self, -1, "Toggle Button", (10, 230), (85, 26)) + EVT_BUTTON(self, b.GetId(), self.OnToggleButton) + + + b = wxGenBitmapToggleButton(self, -1, None, (100, 230), (48,48)) + EVT_BUTTON(self, b.GetId(), self.OnToggleButton) + bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP) + mask = wxMaskColour(bmp, wxBLUE) + bmp.SetMask(mask) + b.SetBitmapLabel(bmp) + bmp = wxBitmap('bitmaps/lb2.bmp', wxBITMAP_TYPE_BMP) + mask = wxMaskColour(bmp, wxBLUE) + bmp.SetMask(mask) + b.SetBitmapSelected(bmp) + + + def OnButton(self, event): + self.log.WriteText("Button Clicked: %d\n" % event.GetId()) + + def OnToggleButton(self, event): + msg = (event.GetIsDown() and "on") or "off" + self.log.WriteText("Button %d Toggled: %s\n" % (event.GetId(), msg)) + + + +#---------------------------------------------------------------------- + + +def runTest(frame, nb, log): + win = TestPanel(nb, log) + return win + + +#---------------------------------------------------------------------- + + +import wxPython.lib.buttons +overview = wxPython.lib.buttons.__doc__ diff --git a/utils/wxPython/demo/Main.py b/utils/wxPython/demo/Main.py index aa3d1776da..d9483a9e51 100644 --- a/utils/wxPython/demo/Main.py +++ b/utils/wxPython/demo/Main.py @@ -22,7 +22,8 @@ _useNestedSplitter = true _treeList = [ ('New since last release', ['wxMVCTree', 'wxVTKRenderWindow', - 'FileBrowseButton']), + 'FileBrowseButton', #'wxToggleButton', + 'GenericButtons']), ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']), @@ -39,7 +40,8 @@ _treeList = [ ('Controls', ['wxButton', 'wxCheckBox', 'wxCheckListBox', 'wxChoice', 'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl', 'wxTreeCtrl', 'wxSpinButton', 'wxStaticText', 'wxStaticBitmap', - 'wxRadioBox', 'wxSlider']), + 'wxRadioBox', 'wxSlider', #'wxToggleButton' + ]), ('Window Layout', ['wxLayoutConstraints', 'Sizers', 'OldSizers']), @@ -51,7 +53,7 @@ _treeList = [ ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog', 'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar', 'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow', - 'FileBrowseButton',]), + 'FileBrowseButton', 'GenericButtons']), ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']), @@ -136,13 +138,16 @@ class wxPythonDemo(wxFrame): self.treeMap = {} self.tree = wxTreeCtrl(splitter, tID) root = self.tree.AddRoot("Overview") + firstChild = None for item in _treeList: child = self.tree.AppendItem(root, item[0]) + if not firstChild: firstChild = child for childItem in item[1]: theDemo = self.tree.AppendItem(child, childItem) self.treeMap[childItem] = theDemo self.tree.Expand(root) + self.tree.Expand(firstChild) EVT_TREE_ITEM_EXPANDED (self.tree, tID, self.OnItemExpanded) EVT_TREE_ITEM_COLLAPSED (self.tree, tID, self.OnItemCollapsed) EVT_TREE_SEL_CHANGED (self.tree, tID, self.OnSelChanged) diff --git a/utils/wxPython/demo/bitmaps/lb1.bmp b/utils/wxPython/demo/bitmaps/lb1.bmp new file mode 100644 index 0000000000000000000000000000000000000000..515efa03f7698fe1e1c357da86d759f23262e3af GIT binary patch literal 2678 zcmeH{+X{dn42EY!L{HKabRFIII=#Nlsg!w`P|(RAHl#lOF`1j@r32DX1N3;ZA)ux2 zW26657MN9_qzWlZlshOh@Us~ZZxd}STwR=?Qp(`8A!jFU^ULickJD|i7h^F7+^{6L z#}c56MZqH$125)$yKv#Bb7qohTuchT62FmioL4w(hcD5s9K~EPf$hO0hM=yUvtZQX JVAsaiffani0e=7h literal 0 HcmV?d00001 diff --git a/utils/wxPython/demo/bitmaps/lb2.bmp b/utils/wxPython/demo/bitmaps/lb2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..79664791d2525f5b46bd32304fb06475b7e8ee7d GIT binary patch literal 4854 zcmeH_v2nvN3`La{TxEnz-~rrg=d6?_O$z&4@Zr7z5`-v9abX>;13y3U0LYj5_cSff z8SgLpeN3N={{1*#HjmeJn%?U@0iFQ=Jv3&+PBB>5=jX2MzqCgVj^RGH3+AwX=f9s? z3*4s0HFJkvLxY7QUIY6@ox{1cgnlMPXGgy>9G}0Yc&>*^&S2C&iNO^OEY_d_ny(ui zZzTgO8pqHgItf*T_h+C*wB}3(l0?jT=n!-tbQF4RvoFO(G0E?{Wyq%GwNRk@hHSXa zPQ}l*W4J67IO+fnA>$s?~4?0fc oD~yPpwbP_-Z1I+>D#qrzdc1BFv&BUyUettp2mgrPyS26XZxPAZmH+?% literal 0 HcmV?d00001 diff --git a/utils/wxPython/demo/wxButton.py b/utils/wxPython/demo/wxButton.py index 2ec66651a6..3abf46f483 100644 --- a/utils/wxPython/demo/wxButton.py +++ b/utils/wxPython/demo/wxButton.py @@ -18,8 +18,8 @@ class TestPanel(wxPanel): EVT_BUTTON(self, 20, self.OnClick) bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP) - mask = wxMaskColour(bmp, wxBLUE) - bmp.SetMask(mask) + #mask = wxMaskColour(bmp, wxBLUE) + #bmp.SetMask(mask) wxBitmapButton(self, 30, bmp, wxPoint(140, 20), wxSize(bmp.GetWidth()+10, bmp.GetHeight()+10)) EVT_BUTTON(self, 30, self.OnClick) diff --git a/utils/wxPython/demo/wxScrolledWindow.py b/utils/wxPython/demo/wxScrolledWindow.py index 9cd5bea955..b51757f6c2 100644 --- a/utils/wxPython/demo/wxScrolledWindow.py +++ b/utils/wxPython/demo/wxScrolledWindow.py @@ -67,6 +67,12 @@ class MyCanvas(wxScrolledWindow): dc.SetTextForeground(wxColour(0, 0xFF, 0x80)) dc.DrawText("a bitmap", 200, 85) + font = wxFont(20, wxSWISS, wxNORMAL, wxNORMAL) + dc.SetFont(font) + dc.SetTextForeground(wxBLACK) + for a in range(0, 360, 45): + dc.DrawRotatedText("Rotated text...", 300, 300, a) + self.DrawSavedLines(dc) dc.EndDrawing() diff --git a/utils/wxPython/demo/wxSplitterWindow.py b/utils/wxPython/demo/wxSplitterWindow.py index 4a4b9b9af6..662975b5f8 100644 --- a/utils/wxPython/demo/wxSplitterWindow.py +++ b/utils/wxPython/demo/wxSplitterWindow.py @@ -2,10 +2,21 @@ from wxPython.wx import * +#--------------------------------------------------------------------------- + +class MySplitter(wxSplitterWindow): + def __init__(self, parent, ID, log): + wxSplitterWindow.__init__(self, parent, ID) + self.log = log + EVT_SPLITTER_SASH_POS_CHANGED(self, self.GetId(), self.OnSashChanged) + + def OnSashChanged(self, evt): + self.log.WriteText("sash changed to " + str(evt.GetSashPosition())) + #--------------------------------------------------------------------------- def runTest(frame, nb, log): - splitter = wxSplitterWindow(nb, -1) + splitter = MySplitter(nb, -1, log) p1 = wxWindow(splitter, -1) p1.SetBackgroundColour(wxRED) diff --git a/utils/wxPython/distrib/build.py b/utils/wxPython/distrib/build.py index b020b9b621..234d5a8cae 100755 --- a/utils/wxPython/distrib/build.py +++ b/utils/wxPython/distrib/build.py @@ -119,7 +119,7 @@ import sys, os, string, getopt # This is really the wxPython version number, and will be placed in the # Makefiles for use with the distribution related targets. -__version__ = '2.1.11' +__version__ = '2.1.12' #---------------------------------------------------------------------------- diff --git a/utils/wxPython/distrib/wxPython.wse b/utils/wxPython/distrib/wxPython.wse index 7fa5cc81ce..f090501d39 100644 --- a/utils/wxPython/distrib/wxPython.wse +++ b/utils/wxPython/distrib/wxPython.wse @@ -832,8 +832,8 @@ item: Install File Flags=0000000010000010 end item: Install File - Source=e:\Projects\wx\utils\wxPython\README.txt - Destination=%MAINDIR%\wxPython\README.txt + Source=e:\Projects\wx\utils\wxPython\*.txt + Destination=%MAINDIR%\wxPython Description=README file Flags=0000000010000010 end diff --git a/utils/wxPython/distrib/wxPython.wsm b/utils/wxPython/distrib/wxPython.wsm index 696935aed00cdc79f49e55f670403efad337915a..66a1c6507b27db63f819c871db6ea050d8a00f27 100644 GIT binary patch literal 33 lcmWF!_B9jGU|?Wm$XA~m-Eh^6Ay9^i0R$LB%T*Fx831+u28I9t literal 33 lcmWF!_B9jGU|?Wm$Ww36`*YQdp;(5A0R$LB%T*Fx832IC2Ot0d diff --git a/utils/wxPython/lib/buttons.py b/utils/wxPython/lib/buttons.py new file mode 100644 index 0000000000..e9864d1137 --- /dev/null +++ b/utils/wxPython/lib/buttons.py @@ -0,0 +1,340 @@ +#---------------------------------------------------------------------- +# Name: wxPython.lib.buttons +# Purpose: Various kinds of generic buttons, (not native controls but +# self-drawn.) +# +# Author: Robin Dunn +# +# Created: 9-Dec-1999 +# RCS-ID: $Id$ +# Copyright: (c) 1999 by Total Control Software +# Licence: wxWindows license +#---------------------------------------------------------------------- + +""" +This module implements various forms of generic buttons, meaning that +they are not built on native controls but are self-drawn. + +The wxGenButton is the base. It acts like a normal button but you +are able to better control how it looks, bevel width, colours, etc. + +wxGenBitmapButton is a button with one or more bitmaps that show +the various states the button can be in. + +wxGenToggleButton stays depressed when clicked, until clicked again. + +wxGenBitmapToggleButton the same but with bitmaps. + +""" + +from wxPython.wx import * + +#---------------------------------------------------------------------- + +class wxGenButtonEvent(wxPyCommandEvent): + def __init__(self, eventType, ID): + wxPyCommandEvent.__init__(self, eventType, ID) + self.isDown = false + + def SetIsDown(self, isDown): + self.isDown = isDown + + def GetIsDown(self): + return self.isDown + + +#---------------------------------------------------------------------- + +class wxGenButton(wxWindow): + def __init__(self, parent, ID, label, + pos = wxDefaultPosition, size = wxDefaultSize, + style = 0, validator = wxDefaultValidator, + name = "genbutton"): + wxWindow.__init__(self, parent, ID, pos, size, style, name) + self.SetValidator(validator) + + self.up = true + self.bezelWidth = 2 + self.hasFocus = false + self.useFocusInd = true + + self.SetLabel(label) + self.SetPosition(pos) + if type(size) == type(()): + size = wxSize(size[0], size[1]) + w = size.width + h = size.height + dsize = wxSize(75,23) ### wxButton_GetDefaultSize() + if self.bezelWidth > 2: + dsize.width = dsize.width + self.bezelWidth - 2 + dsize.height = dsize.height + self.bezelWidth - 2 + if w == -1: w = dsize.width + if h == -1: h = dsize.height + self.SetSize(wxSize(w,h)) + font = parent.GetFont() + if not font.Ok(): + font = wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT) + self.SetFont(font) + 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) + + + + + def SetBezelWidth(self, width): + """Set the width of the 3D effect""" + self.bezelWidth = width + + def GetBezelWidth(self): + """Return the width of the 3D effect""" + return self.bezelWidth + + def SetUseFocusIndicator(self, flag): + """Specifiy if a focus indicator (dotted line) should be used""" + self.useFocusInd = flag + + def GetUseFocusIndicator(self): + """Return focus indicator flag""" + return self.useFocusInd + + + def InitColours(self): + faceClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE) + textClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNTEXT) + self.SetBackgroundColour(faceClr) + self.SetForegroundColour(textClr) + + shadowClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNSHADOW) + highlightClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNHIGHLIGHT) + self.shadowPen = wxPen(shadowClr, 1, wxSOLID) + self.highlightPen = wxPen(highlightClr, 1, wxSOLID) + + self.focusIndPen = wxPen(textClr, 1, wxUSER_DASH) + + + def Notify(self): + evt = wxGenButtonEvent(wxEVT_COMMAND_BUTTON_CLICKED, self.GetId()) + evt.SetIsDown(not self.up) + self.GetEventHandler().ProcessEvent(evt) + + + def DrawBezel(self, dc, x1, y1, x2, y2): + # draw the upper left sides + if self.up: + dc.SetPen(self.highlightPen) + else: + dc.SetPen(self.shadowPen) + for i in range(self.bezelWidth): + dc.DrawLine(x1+i, y1, x1+i, y2-i) + dc.DrawLine(x1, y1+i, x2-i, y1+i) + + # draw the lower right sides + if self.up: + dc.SetPen(self.shadowPen) + else: + dc.SetPen(self.highlightPen) + for i in range(self.bezelWidth): + dc.DrawLine(x1+i, y2-i, x2+1, y2-i) + dc.DrawLine(x2-i, y1+i, x2-i, y2) + + + def DrawLabel(self, dc, width, height, dw=0, dy=0): + dc.SetFont(self.GetFont()) + if self.IsEnabled(): + dc.SetTextForeground(self.GetForegroundColour()) + else: + dc.SetTextForeground(wxSystemSettings_GetSystemColour(wxSYS_COLOUR_GRAYTEXT)) + label = self.GetLabel() + tw, th = dc.GetTextExtent(label) + if not self.up: + dw = dy = 1 + dc.DrawText(label, (width-tw)/2+dw, (height-th)/2+dy) + + + def DrawFocusIndicator(self, dc, w, h): + bw = self.bezelWidth + dc.SetLogicalFunction(wxINVERT) + self.focusIndPen.SetColour(self.GetForegroundColour()) + self.focusIndPen.SetDashes([1,2,1,2]) # This isn't quite working the way I expected... + dc.SetPen(self.focusIndPen) + dc.SetBrush(wxTRANSPARENT_BRUSH) + dc.DrawRectangle(bw+2,bw+2, w-bw*2-4, h-bw*2-4) + + + def OnPaint(self, event): + (width, height) = self.GetClientSizeTuple() + x1 = y1 = 0 + x2 = width-1 + y2 = height-1 + dc = wxPaintDC(self) + dc.SetBackground(wxBrush(self.GetBackgroundColour(), wxSOLID)) + dc.Clear() + self.DrawBezel(dc, x1, y1, x2, y2) + self.DrawLabel(dc, width, height) + if self.hasFocus and self.useFocusInd: + self.DrawFocusIndicator(dc, width, height) + + def OnEraseBackground(self, event): + pass + + + def OnLeftDown(self, event): + if not self.IsEnabled(): + return + self.up = false + self.CaptureMouse() + self.SetFocus() + self.Refresh() + + + def OnLeftUp(self, event): + if not self.IsEnabled(): + return + if not self.up: # if the button was down when the mouse was released... + self.Notify() + self.up = true + self.ReleaseMouse() + self.Refresh() + + + def OnMotion(self, event): + if not self.IsEnabled(): + return + if event.LeftIsDown(): + x,y = event.GetPositionTuple() + w,h = self.GetClientSizeTuple() + if self.up and x=0 and y=0: + self.up = false + self.Refresh() + return + if not self.up and (x<0 or y<0 or x>=w or y>=h): + self.up = true + self.Refresh() + return + + + def OnGainFocus(self, event): + self.hasFocus = true + dc = wxClientDC(self) + w, h = self.GetClientSizeTuple() + if self.useFocusInd: + self.DrawFocusIndicator(dc, w, h) + + + def OnLoseFocus(self, event): + self.hasFocus = false + dc = wxClientDC(self) + w, h = self.GetClientSizeTuple() + if self.useFocusInd: + self.DrawFocusIndicator(dc, w, h) + + + def OnKeyDown(self, event): + if self.hasFocus and event.KeyCode() == ord(" "): + self.up = false + self.Refresh() + event.Skip() + + def OnKeyUp(self, event): + if self.hasFocus and event.KeyCode() == ord(" "): + self.up = true + self.Notify() + self.Refresh() + event.Skip() + + +#---------------------------------------------------------------------- + +class wxGenBitmapButton(wxGenButton): + def __init__(self, parent, ID, bitmap, + pos = wxDefaultPosition, size = wxDefaultSize, + style = 0, validator = wxDefaultValidator, + name = "genbutton"): + wxGenButton.__init__(self, parent, ID, "", pos, size, style, validator, name) + + self.bmpLabel = bitmap + self.bmpDisabled = None + self.bmpFocus = None + self.bmpSelected = None + + def GetBitmapLabel(self): + return self.bmpLabel + def GetBitmapDisabled(self): + return self.bmpDisabled + def GetBitmapFocus(self): + return self.bmpFocus + def GetBitmapSelected(self): + return self.bmpSelected + + def SetBitmapDisabled(self, bitmap): + self.bmpDisabled = bitmap + def SetBitmapFocus(self, bitmap): + self.bmpFocus = bitmap + self.SetUseFocusIndicator(false) + def SetBitmapSelected(self, bitmap): + self.bmpSelected = bitmap + def SetBitmapLabel(self, bitmap): + self.bmpLabel = bitmap + + + def DrawLabel(self, dc, width, height, dw=0, dy=0): + bmp = self.bmpLabel + if self.bmpDisabled and not self.IsEnabled(): + bmp = self.bmpDisabled + if self.bmpFocus and self.hasFocus: + bmp = self.bmpFocus + if self.bmpSelected and not self.up: + bmp = self.bmpSelected + bw,bh = bmp.GetWidth(), bmp.GetHeight() + if not self.up: + dw = dy = 1 + dc.DrawBitmap(bmp, (width-bw)/2+dw, (height-bh)/2+dy, true) + + + +#---------------------------------------------------------------------- + + +class __ToggleMixin: + def OnLeftDown(self, event): + if not self.IsEnabled(): + return + self.up = not self.up + self.CaptureMouse() + self.SetFocus() + self.Refresh() + + def OnLeftUp(self, event): + if not self.IsEnabled(): + return + self.Notify() + self.ReleaseMouse() + self.Refresh() + + def OnKeyDown(self, event): + event.Skip() + + def OnKeyUp(self, event): + if self.hasFocus and event.KeyCode() == ord(" "): + self.up = not self.up + self.Notify() + self.Refresh() + event.Skip() + + +class wxGenToggleButton(__ToggleMixin, wxGenButton): + pass + +class wxGenBitmapToggleButton(__ToggleMixin, wxGenBitmapButton): + pass + +#---------------------------------------------------------------------- + + diff --git a/utils/wxPython/lib/grids.py b/utils/wxPython/lib/grids.py index 2a8d58c80c..12f866e427 100644 --- a/utils/wxPython/lib/grids.py +++ b/utils/wxPython/lib/grids.py @@ -12,13 +12,11 @@ #---------------------------------------------------------------------- """ - In this module you will find wxGridSizer and wxFlexGridSizer. wxGridSizer arrainges its items in a grid in which all the widths and heights are the same. wxFlexgridSizer allows different widths and heights, and you can also specify rows and/or columns that are growable. See the demo for a couple examples for how to use them. - """ diff --git a/utils/wxPython/modules/html/build.cfg b/utils/wxPython/modules/html/build.cfg index ecf970e3cf..2ce9a59263 100644 --- a/utils/wxPython/modules/html/build.cfg +++ b/utils/wxPython/modules/html/build.cfg @@ -9,7 +9,7 @@ SWIGFILES = ['html.i', 'htmlhelp.i' ] OTHERSWIGFLAGS = '-I../utils' # include path for htmlhelp's xpm bitmaps -OTHERCFLAGS = "-I%s/src/html" % (WXDIR,) +#OTHERCFLAGS = "-I%s/src/html" % (WXDIR,) # There are no platform differences so we don't need separate code directories GENCODEDIR='.' diff --git a/utils/wxPython/src/__version__.py b/utils/wxPython/src/__version__.py index ca01871b35..3f1ed215a5 100644 --- a/utils/wxPython/src/__version__.py +++ b/utils/wxPython/src/__version__.py @@ -1 +1 @@ -ver = '2.1.11' +ver = '2.1.12' diff --git a/utils/wxPython/src/_extras.py b/utils/wxPython/src/_extras.py index a8a378d381..aa94aefeed 100644 --- a/utils/wxPython/src/_extras.py +++ b/utils/wxPython/src/_extras.py @@ -666,6 +666,8 @@ wxPyDefaultSize.Set(-1,-1) wxDefaultPosition = wxPyDefaultPosition wxDefaultSize = wxPyDefaultSize +# backwards compatibility +wxNoRefBitmap = wxBitmap #---------------------------------------------------------------------- # This helper function will take a wxPython object and convert it to @@ -695,7 +697,8 @@ def wxPyTypeCast(obj, typeStr): newPtr = ptrcast(obj, typeStr+"_p") theClass = globals()[typeStr+"Ptr"] theObj = theClass(newPtr) - theObj.thisown = obj.thisown + if hasattr(obj, "this"): + theObj.thisown = obj.thisown return theObj @@ -780,6 +783,13 @@ class wxApp(wxPyApp): if self.stdioWin != None: self.stdioWin.close() +#---------------------------------------------------------------------------- + +class wxPySimpleApp(wxApp): + def __init__(self): + wxApp.__init__(self, 0) + def OnInit(self): + return true #---------------------------------------------------------------------------- diff --git a/utils/wxPython/src/clip_dnd.i b/utils/wxPython/src/clip_dnd.i index 96c2a3e19d..e054bedf24 100644 --- a/utils/wxPython/src/clip_dnd.i +++ b/utils/wxPython/src/clip_dnd.i @@ -376,6 +376,7 @@ public: }; %{ + // See below in the init function... wxClipboard* wxPyTheClipboard; %} %readonly diff --git a/utils/wxPython/src/controls.i b/utils/wxPython/src/controls.i index 5504ddf43b..59c98cb7a9 100644 --- a/utils/wxPython/src/controls.i +++ b/utils/wxPython/src/controls.i @@ -18,6 +18,7 @@ #include #include #include +//#include #ifdef __WXMSW__ #if wxUSE_OWNER_DRAWN @@ -59,6 +60,8 @@ wxValidator wxDefaultValidator; class wxControl : public wxWindow { public: + wxControl(); + #ifdef __WXMSW__ void Command(wxCommandEvent& event); #endif @@ -66,6 +69,35 @@ public: void SetLabel(const wxString& label); }; + +// %{ +// class wxPyControl : public wxControl { +// public: +// wxPyControl(wxWindow *parent, +// wxWindowID id, +// const wxPoint& pos, +// const wxSize& size, +// long style, +// const wxValidator& validator, +// const wxString& name) +// : wxControl() { +// CreateControl(parent, id, pos, size, style, validator, name); +// } +// }; +// %} + + +// class wxPyControl : public wxControl { +// public: +// wxPyControl(wxWindow* parent, wxWindowID id, +// const wxPoint& pos = wxPyDefaultPosition, +// const wxSize& size = wxPyDefaultSize, +// long style = 0, +// const wxValidator& validator = wxPyDefaultValidator, +// char* name = "control"); +// }; + + //---------------------------------------------------------------------- class wxButton : public wxControl { @@ -82,6 +114,13 @@ public: void SetDefault(); }; + +%inline %{ + wxSize wxButton_GetDefaultSize() { + return wxButton::GetDefaultSize(); + } +%} + //---------------------------------------------------------------------- class wxBitmapButton : public wxButton { @@ -106,6 +145,31 @@ public: }; +//---------------------------------------------------------------------- + +// class wxToggleButton : public wxControl { +// public: +// wxToggleButton(wxWindow *parent, wxWindowID id, const wxString& label, +// const wxPoint& pos = wxPyDefaultPosition, +// const wxSize& size = wxPyDefaultSize, long style = 0, +// const wxValidator& validator = wxPyDefaultValidator, +// const char* name = "toggle"); +// void SetValue(bool value); +// bool GetValue() const ; +// void SetLabel(const wxString& label); +// }; + +// class wxBitmapToggleButton : public wxToggleButton { +// public: +// wxBitmapToggleButton(wxWindow *parent, wxWindowID id, const wxBitmap *label, +// const wxPoint& pos = wxPyDefaultPosition, +// const wxSize& size = wxPyDefaultSize, long style = 0, +// const wxValidator& validator = wxPyDefaultValidator, +// const char *name = "toggle"); +// void SetLabel(const wxBitmap& bitmap); +// }; + + //---------------------------------------------------------------------- class wxCheckBox : public wxControl { diff --git a/utils/wxPython/src/events.i b/utils/wxPython/src/events.i index a5f08b2eec..64613178d5 100644 --- a/utils/wxPython/src/events.i +++ b/utils/wxPython/src/events.i @@ -80,6 +80,10 @@ public: int GetSelection(); wxString GetString(); bool IsSelection(); + void SetString(const wxString& s); + void SetExtraLong(long extraLong); + void SetInt(int i); + }; diff --git a/utils/wxPython/src/gdi.i b/utils/wxPython/src/gdi.i index 51591c96ed..4d8ed63f08 100644 --- a/utils/wxPython/src/gdi.i +++ b/utils/wxPython/src/gdi.i @@ -33,33 +33,43 @@ //--------------------------------------------------------------------------- -class wxBitmap { +class wxGDIImage { +public: + long GetHandle(); + void SetHandle(long handle); + + bool Ok(); + + int GetWidth(); + int GetHeight(); + int GetDepth(); + + void SetWidth(int w); + void SetHeight(int h); + void SetDepth(int d); + + void SetSize(const wxSize& size); + +}; + +//--------------------------------------------------------------------------- + +class wxBitmap : public wxGDIImage { public: wxBitmap(const wxString& name, long type); ~wxBitmap(); -#ifdef __WXMSW__ - void Create(int width, int height, int depth = -1); -#endif - int GetDepth(); - int GetHeight(); wxPalette* GetPalette(); wxMask* GetMask(); - int GetWidth(); bool LoadFile(const wxString& name, long flags); - bool Ok(); bool SaveFile(const wxString& name, int type, wxPalette* palette = NULL); - void SetDepth(int depth); - void SetHeight(int height); void SetMask(wxMask* mask); #ifdef __WXMSW__ void SetPalette(wxPalette& palette); #endif - void SetWidth(int width); }; %new wxBitmap* wxEmptyBitmap(int width, int height, int depth=-1); -wxBitmap* wxNoRefBitmap(char* name, long flags); #ifdef __WXMSW__ %new wxBitmap* wxBitmapFromData(char* data, long type, @@ -71,14 +81,6 @@ wxBitmap* wxNoRefBitmap(char* name, long flags); return new wxBitmap(width, height, depth); } - // This one won't own the reference, so Python - // won't call the dtor, this is good for - // toolbars and such where the parent will - // manage the bitmap. - wxBitmap* wxNoRefBitmap(char* name, long flags) { - return new wxBitmap(name, flags); - } - #ifdef __WXMSW__ wxBitmap* wxBitmapFromData(char* data, long type, int width, int height, int depth = 1) { @@ -106,32 +108,24 @@ public: //--------------------------------------------------------------------------- -class wxIcon : public wxBitmap { +class wxIcon : public wxGDIImage { public: wxIcon(const wxString& name, long flags, int desiredWidth = -1, int desiredHeight = -1); ~wxIcon(); - int GetDepth(); - int GetHeight(); - int GetWidth(); bool LoadFile(const wxString& name, long flags); - bool Ok(); - void SetDepth(int depth); - void SetHeight(int height); - void SetWidth(int width); }; //--------------------------------------------------------------------------- -class wxCursor : public wxBitmap { +class wxCursor : public wxGDIImage { public: #ifdef __WXMSW__ wxCursor(const wxString& cursorName, long flags, int hotSpotX=0, int hotSpotY=0); #endif ~wxCursor(); - bool Ok(); }; %name(wxStockCursor) %new wxCursor* wxPyStockCursor(int id); @@ -269,7 +263,12 @@ public: //---------------------------------------------------------------------- +#ifdef __WXMSW__ typedef unsigned long wxDash; +#else +typedef byte wxDash; +#endif + class wxPen { public: @@ -295,11 +294,12 @@ public: void SetStyle(int style); void SetWidth(int width); -#ifdef __WXMSW__ // **** This one needs to return a list of ints (wxDash) int GetDashes(wxDash **dashes); - wxBitmap* GetStipple(); void SetDashes(int LCOUNT, wxDash* LIST); + +#ifdef __WXMSW__ + wxBitmap* GetStipple(); void SetStipple(wxBitmap& stipple); #endif }; @@ -363,6 +363,7 @@ public: int fill_style=wxODDEVEN_RULE); void DrawPoint(long x, long y); void DrawRectangle(long x, long y, long width, long height); + void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); void DrawRoundedRectangle(long x, long y, long width, long height, long radius=20); void DrawSpline(int LCOUNT, wxPoint* LIST); void DrawText(const wxString& text, long x, long y); @@ -611,7 +612,7 @@ enum { class wxImageList { public: - wxImageList(int width, int height, const bool mask=TRUE, int initialCount=1); + wxImageList(int width, int height, int mask=TRUE, int initialCount=1); ~wxImageList(); #ifdef __WXMSW__ diff --git a/utils/wxPython/src/helpers.cpp b/utils/wxPython/src/helpers.cpp index 7333d3ebad..863718df74 100644 --- a/utils/wxPython/src/helpers.cpp +++ b/utils/wxPython/src/helpers.cpp @@ -75,7 +75,7 @@ wxPyApp::~wxPyApp() { // This one isn't acutally called... See __wxStart() bool wxPyApp::OnInit(void) { - return false; + return FALSE; } int wxPyApp::MainLoop(void) { diff --git a/utils/wxPython/src/msw/clip_dnd.cpp b/utils/wxPython/src/msw/clip_dnd.cpp index 2a75d1ccbd..7cf9c48083 100644 --- a/utils/wxPython/src/msw/clip_dnd.cpp +++ b/utils/wxPython/src/msw/clip_dnd.cpp @@ -208,6 +208,7 @@ void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { wxPySaveThread(doSave); } + // See below in the init function... wxClipboard* wxPyTheClipboard; class wxPyDropSource : public wxDropSource { @@ -3444,6 +3445,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_EBool","_wxWindowID",0}, { "_class_wxRegion","_wxRegion",0}, { "_class_wxDataFormat","_wxDataFormat",0}, + { "_wxGDIImage","_class_wxGDIImage",0}, { "_wxFont","_class_wxFont",0}, { "_class_wxPyDropTarget","_class_wxPyFileDropTarget",SwigwxPyFileDropTargetTowxPyDropTarget}, { "_class_wxPyDropTarget","_wxPyFileDropTarget",SwigwxPyFileDropTargetTowxPyDropTarget}, @@ -3512,6 +3514,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyDataObjectSimple","_wxPyDataObjectSimple",0}, { "_class_wxPyDropSource","_wxPyDropSource",0}, { "_class_wxImageList","_wxImageList",0}, + { "_class_wxGDIImage","_wxGDIImage",0}, { "_wxWindowID","_wxCoord",0}, { "_wxWindowID","_wxPrintQuality",0}, { "_wxWindowID","_size_t",0}, diff --git a/utils/wxPython/src/msw/controls.cpp b/utils/wxPython/src/msw/controls.cpp index ee50c44961..1b48d449dc 100644 --- a/utils/wxPython/src/msw/controls.cpp +++ b/utils/wxPython/src/msw/controls.cpp @@ -58,6 +58,7 @@ extern PyObject *SWIG_newvarlink(void); #include #include #include +//#include #ifdef __WXMSW__ #if wxUSE_OWNER_DRAWN @@ -120,6 +121,10 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { static char* wxStringErrorMsg = "string type is required for parameter"; wxValidator wxPyDefaultValidator; // Non-const default because of SWIG + + wxSize wxButton_GetDefaultSize() { + return wxButton::GetDefaultSize(); + } #ifdef __cplusplus extern "C" { #endif @@ -138,6 +143,25 @@ static PyObject *_wrap_wxDefaultValidator_get() { return pyobj; } +static PyObject *_wrap_wxButton_GetDefaultSize(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSize * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxButton_GetDefaultSize",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxSize (wxButton_GetDefaultSize()); + + wxPy_END_ALLOW_THREADS; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + static void *SwigwxControlTowxWindow(void *ptr) { wxControl *src; wxWindow *dest; @@ -154,6 +178,31 @@ static void *SwigwxControlTowxEvtHandler(void *ptr) { return (void *) dest; } +#define new_wxControl() (new wxControl()) +static PyObject *_wrap_new_wxControl(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxControl * _result; + char *_kwnames[] = { NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxControl",_kwnames)) + return NULL; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxControl *)new_wxControl(); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxControl_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define wxControl_Command(_swigobj,_swigarg0) (_swigobj->Command(_swigarg0)) static PyObject *_wrap_wxControl_Command(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7175,6 +7224,8 @@ static PyMethodDef controlscMethods[] = { { "wxControl_SetLabel", (PyCFunction) _wrap_wxControl_SetLabel, METH_VARARGS | METH_KEYWORDS }, { "wxControl_GetLabel", (PyCFunction) _wrap_wxControl_GetLabel, METH_VARARGS | METH_KEYWORDS }, { "wxControl_Command", (PyCFunction) _wrap_wxControl_Command, METH_VARARGS | METH_KEYWORDS }, + { "new_wxControl", (PyCFunction) _wrap_new_wxControl, METH_VARARGS | METH_KEYWORDS }, + { "wxButton_GetDefaultSize", (PyCFunction) _wrap_wxButton_GetDefaultSize, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } }; #ifdef __cplusplus @@ -7344,6 +7395,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxDataFormat","_wxDataFormat",0}, { "_class_wxDropFilesEvent","_wxDropFilesEvent",0}, { "_wxWindowDestroyEvent","_class_wxWindowDestroyEvent",0}, + { "_wxGDIImage","_class_wxGDIImage",0}, { "_wxStaticText","_class_wxStaticText",0}, { "_wxFont","_class_wxFont",0}, { "_class_wxPyDropTarget","_wxPyDropTarget",0}, @@ -7517,6 +7569,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSlider","_wxSlider",0}, { "_class_wxImageList","_wxImageList",0}, { "_class_wxBitmapButton","_wxBitmapButton",0}, + { "_class_wxGDIImage","_wxGDIImage",0}, { "_class_wxPaletteChangedEvent","_wxPaletteChangedEvent",0}, { "_wxWindowID","_wxCoord",0}, { "_wxWindowID","_wxPrintQuality",0}, diff --git a/utils/wxPython/src/msw/controls.py b/utils/wxPython/src/msw/controls.py index 6029fc3844..c38fcaf063 100644 --- a/utils/wxPython/src/msw/controls.py +++ b/utils/wxPython/src/msw/controls.py @@ -27,8 +27,9 @@ class wxControlPtr(wxWindowPtr): def __repr__(self): return "" % (self.this,) class wxControl(wxControlPtr): - def __init__(self,this): - self.this = this + def __init__(self,*_args,**_kwargs): + self.this = apply(controlsc.new_wxControl,_args,_kwargs) + self.thisown = 1 @@ -786,6 +787,11 @@ class wxSlider(wxSliderPtr): #-------------- FUNCTION WRAPPERS ------------------ +def wxButton_GetDefaultSize(*_args, **_kwargs): + val = apply(controlsc.wxButton_GetDefaultSize,_args,_kwargs) + if val: val = wxSizePtr(val); val.thisown = 1 + return val + #-------------- VARIABLE WRAPPERS ------------------ diff --git a/utils/wxPython/src/msw/controls2.cpp b/utils/wxPython/src/msw/controls2.cpp index 9b7cb275af..74b6409d4f 100644 --- a/utils/wxPython/src/msw/controls2.cpp +++ b/utils/wxPython/src/msw/controls2.cpp @@ -6178,6 +6178,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxDataFormat","_wxDataFormat",0}, { "_class_wxDropFilesEvent","_wxDropFilesEvent",0}, { "_wxWindowDestroyEvent","_class_wxWindowDestroyEvent",0}, + { "_wxGDIImage","_class_wxGDIImage",0}, { "_wxStaticText","_class_wxStaticText",0}, { "_wxFont","_class_wxFont",0}, { "_class_wxPyDropTarget","_wxPyDropTarget",0}, @@ -6283,6 +6284,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSlider","_wxSlider",0}, { "_class_wxImageList","_wxImageList",0}, { "_class_wxBitmapButton","_wxBitmapButton",0}, + { "_class_wxGDIImage","_wxGDIImage",0}, { "_class_wxPaletteChangedEvent","_wxPaletteChangedEvent",0}, { "_wxWindowID","_wxCoord",0}, { "_wxWindowID","_wxPrintQuality",0}, diff --git a/utils/wxPython/src/msw/events.cpp b/utils/wxPython/src/msw/events.cpp index 6a6bfef5df..12504fd095 100644 --- a/utils/wxPython/src/msw/events.cpp +++ b/utils/wxPython/src/msw/events.cpp @@ -931,6 +931,102 @@ static PyObject *_wrap_wxCommandEvent_IsSelection(PyObject *self, PyObject *args return _resultobj; } +#define wxCommandEvent_SetString(_swigobj,_swigarg0) (_swigobj->SetString(_swigarg0)) +static PyObject *_wrap_wxCommandEvent_SetString(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCommandEvent * _arg0; + wxString * _arg1; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","s", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxCommandEvent_SetString",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_SetString. Expected _wxCommandEvent_p."); + return NULL; + } + } +{ + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxCommandEvent_SetString(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxCommandEvent_SetExtraLong(_swigobj,_swigarg0) (_swigobj->SetExtraLong(_swigarg0)) +static PyObject *_wrap_wxCommandEvent_SetExtraLong(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCommandEvent * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","extraLong", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxCommandEvent_SetExtraLong",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_SetExtraLong. Expected _wxCommandEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxCommandEvent_SetExtraLong(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxCommandEvent_SetInt(_swigobj,_swigarg0) (_swigobj->SetInt(_swigarg0)) +static PyObject *_wrap_wxCommandEvent_SetInt(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxCommandEvent * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","i", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxCommandEvent_SetInt",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCommandEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCommandEvent_SetInt. Expected _wxCommandEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxCommandEvent_SetInt(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static void *SwigwxScrollEventTowxCommandEvent(void *ptr) { wxScrollEvent *src; wxCommandEvent *dest; @@ -4982,6 +5078,9 @@ static PyMethodDef eventscMethods[] = { { "wxScrollEvent_GetPosition", (PyCFunction) _wrap_wxScrollEvent_GetPosition, METH_VARARGS | METH_KEYWORDS }, { "wxScrollEvent_GetOrientation", (PyCFunction) _wrap_wxScrollEvent_GetOrientation, METH_VARARGS | METH_KEYWORDS }, { "new_wxScrollEvent", (PyCFunction) _wrap_new_wxScrollEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxCommandEvent_SetInt", (PyCFunction) _wrap_wxCommandEvent_SetInt, METH_VARARGS | METH_KEYWORDS }, + { "wxCommandEvent_SetExtraLong", (PyCFunction) _wrap_wxCommandEvent_SetExtraLong, METH_VARARGS | METH_KEYWORDS }, + { "wxCommandEvent_SetString", (PyCFunction) _wrap_wxCommandEvent_SetString, METH_VARARGS | METH_KEYWORDS }, { "wxCommandEvent_IsSelection", (PyCFunction) _wrap_wxCommandEvent_IsSelection, METH_VARARGS | METH_KEYWORDS }, { "wxCommandEvent_GetString", (PyCFunction) _wrap_wxCommandEvent_GetString, METH_VARARGS | METH_KEYWORDS }, { "wxCommandEvent_GetSelection", (PyCFunction) _wrap_wxCommandEvent_GetSelection, METH_VARARGS | METH_KEYWORDS }, diff --git a/utils/wxPython/src/msw/events.py b/utils/wxPython/src/msw/events.py index 7b79ed6b06..d579ec5e18 100644 --- a/utils/wxPython/src/msw/events.py +++ b/utils/wxPython/src/msw/events.py @@ -121,6 +121,15 @@ class wxCommandEventPtr(wxEventPtr): def IsSelection(self, *_args, **_kwargs): val = apply(eventsc.wxCommandEvent_IsSelection,(self,) + _args, _kwargs) return val + def SetString(self, *_args, **_kwargs): + val = apply(eventsc.wxCommandEvent_SetString,(self,) + _args, _kwargs) + return val + def SetExtraLong(self, *_args, **_kwargs): + val = apply(eventsc.wxCommandEvent_SetExtraLong,(self,) + _args, _kwargs) + return val + def SetInt(self, *_args, **_kwargs): + val = apply(eventsc.wxCommandEvent_SetInt,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxCommandEvent(wxCommandEventPtr): diff --git a/utils/wxPython/src/msw/gdi.cpp b/utils/wxPython/src/msw/gdi.cpp index 97727aa6f0..feceba62d6 100644 --- a/utils/wxPython/src/msw/gdi.cpp +++ b/utils/wxPython/src/msw/gdi.cpp @@ -113,14 +113,6 @@ static char* wxStringErrorMsg = "string type is required for parameter"; return new wxBitmap(width, height, depth); } - // This one won't own the reference, so Python - // won't call the dtor, this is good for - // toolbars and such where the parent will - // manage the bitmap. - wxBitmap* wxNoRefBitmap(char* name, long flags) { - return new wxBitmap(name, flags); - } - #ifdef __WXMSW__ wxBitmap* wxBitmapFromData(char* data, long type, int width, int height, int depth = 1) { @@ -227,32 +219,6 @@ static PyObject *_wrap_wxEmptyBitmap(PyObject *self, PyObject *args, PyObject *k return _resultobj; } -static PyObject *_wrap_wxNoRefBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxBitmap * _result; - char * _arg0; - long _arg1; - char *_kwnames[] = { "name","flags", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"sl:wxNoRefBitmap",_kwnames,&_arg0,&_arg1)) - return NULL; -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxBitmap *)wxNoRefBitmap(_arg0,_arg1); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - static PyObject *_wrap_wxBitmapFromData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxBitmap * _result; @@ -1084,95 +1050,54 @@ static PyObject *_wrap_wxNullColour_get() { return pyobj; } -#define new_wxBitmap(_swigarg0,_swigarg1) (new wxBitmap(_swigarg0,_swigarg1)) -static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_GetHandle(_swigobj) (_swigobj->GetHandle()) +static PyObject *_wrap_wxGDIImage_GetHandle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxBitmap * _result; - wxString * _arg0; - long _arg1; - PyObject * _obj0 = 0; - char *_kwnames[] = { "name","type", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:new_wxBitmap",_kwnames,&_obj0,&_arg1)) - return NULL; -{ - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); -} -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxBitmap *)new_wxBitmap(*_arg0,_arg1); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } -{ - if (_obj0) - delete _arg0; -} - return _resultobj; -} - -#define delete_wxBitmap(_swigobj) (delete _swigobj) -static PyObject *_wrap_delete_wxBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxBitmap * _arg0; + long _result; + wxGDIImage * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxBitmap",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGDIImage_GetHandle",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxBitmap. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_GetHandle. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - delete_wxBitmap(_arg0); + _result = (long )wxGDIImage_GetHandle(_arg0); wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("l",_result); return _resultobj; } -#define wxBitmap_Create(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->Create(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxBitmap_Create(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_SetHandle(_swigobj,_swigarg0) (_swigobj->SetHandle(_swigarg0)) +static PyObject *_wrap_wxGDIImage_SetHandle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxBitmap * _arg0; - int _arg1; - int _arg2; - int _arg3 = (int ) -1; + wxGDIImage * _arg0; + long _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","width","height","depth", NULL }; + char *_kwnames[] = { "self","handle", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii|i:wxBitmap_Create",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxGDIImage_SetHandle",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_Create. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_SetHandle. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxBitmap_Create(_arg0,_arg1,_arg2,_arg3); + wxGDIImage_SetHandle(_arg0,_arg1); wxPy_END_ALLOW_THREADS; } Py_INCREF(Py_None); @@ -1180,294 +1105,226 @@ static PyObject *_wrap_wxBitmap_Create(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxBitmap_GetDepth(_swigobj) (_swigobj->GetDepth()) -static PyObject *_wrap_wxBitmap_GetDepth(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_Ok(_swigobj) (_swigobj->Ok()) +static PyObject *_wrap_wxGDIImage_Ok(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxBitmap * _arg0; + bool _result; + wxGDIImage * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_GetDepth",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGDIImage_Ok",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_GetDepth. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_Ok. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxBitmap_GetDepth(_arg0); + _result = (bool )wxGDIImage_Ok(_arg0); wxPy_END_ALLOW_THREADS; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxBitmap_GetHeight(_swigobj) (_swigobj->GetHeight()) -static PyObject *_wrap_wxBitmap_GetHeight(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_GetWidth(_swigobj) (_swigobj->GetWidth()) +static PyObject *_wrap_wxGDIImage_GetWidth(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; int _result; - wxBitmap * _arg0; + wxGDIImage * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_GetHeight",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGDIImage_GetWidth",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_GetHeight. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_GetWidth. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxBitmap_GetHeight(_arg0); + _result = (int )wxGDIImage_GetWidth(_arg0); wxPy_END_ALLOW_THREADS; } _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxBitmap_GetPalette(_swigobj) (_swigobj->GetPalette()) -static PyObject *_wrap_wxBitmap_GetPalette(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_GetHeight(_swigobj) (_swigobj->GetHeight()) +static PyObject *_wrap_wxGDIImage_GetHeight(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxPalette * _result; - wxBitmap * _arg0; + int _result; + wxGDIImage * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_GetPalette",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGDIImage_GetHeight",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_GetPalette. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_GetHeight. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPalette *)wxBitmap_GetPalette(_arg0); + _result = (int )wxGDIImage_GetHeight(_arg0); wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxBitmap_GetMask(_swigobj) (_swigobj->GetMask()) -static PyObject *_wrap_wxBitmap_GetMask(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_GetDepth(_swigobj) (_swigobj->GetDepth()) +static PyObject *_wrap_wxGDIImage_GetDepth(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxMask * _result; - wxBitmap * _arg0; + int _result; + wxGDIImage * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_GetMask",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxGDIImage_GetDepth",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_GetMask. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_GetDepth. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxMask *)wxBitmap_GetMask(_arg0); + _result = (int )wxGDIImage_GetDepth(_arg0); wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxBitmap_GetWidth(_swigobj) (_swigobj->GetWidth()) -static PyObject *_wrap_wxBitmap_GetWidth(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_SetWidth(_swigobj,_swigarg0) (_swigobj->SetWidth(_swigarg0)) +static PyObject *_wrap_wxGDIImage_SetWidth(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxBitmap * _arg0; + wxGDIImage * _arg0; + int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "self","w", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_GetWidth",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxGDIImage_SetWidth",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_GetWidth. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_SetWidth. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxBitmap_GetWidth(_arg0); + wxGDIImage_SetWidth(_arg0,_arg1); wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxBitmap_LoadFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->LoadFile(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_SetHeight(_swigobj,_swigarg0) (_swigobj->SetHeight(_swigarg0)) +static PyObject *_wrap_wxGDIImage_SetHeight(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxBitmap * _arg0; - wxString * _arg1; - long _arg2; + wxGDIImage * _arg0; + int _arg1; PyObject * _argo0 = 0; - PyObject * _obj1 = 0; - char *_kwnames[] = { "self","name","flags", NULL }; + char *_kwnames[] = { "self","h", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:wxBitmap_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxGDIImage_SetHeight",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_LoadFile. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_SetHeight. Expected _wxGDIImage_p."); return NULL; } } -{ - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); -} { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxBitmap_LoadFile(_arg0,*_arg1,_arg2); + wxGDIImage_SetHeight(_arg0,_arg1); wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); -{ - if (_obj1) - delete _arg1; -} +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxBitmap_Ok(_swigobj) (_swigobj->Ok()) -static PyObject *_wrap_wxBitmap_Ok(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_SetDepth(_swigobj,_swigarg0) (_swigobj->SetDepth(_swigarg0)) +static PyObject *_wrap_wxGDIImage_SetDepth(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxBitmap * _arg0; + wxGDIImage * _arg0; + int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "self","d", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_Ok",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxGDIImage_SetDepth",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_Ok. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_SetDepth. Expected _wxGDIImage_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxBitmap_Ok(_arg0); + wxGDIImage_SetDepth(_arg0,_arg1); wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxBitmap_SaveFile(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SaveFile(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxGDIImage_SetSize(_swigobj,_swigarg0) (_swigobj->SetSize(_swigarg0)) +static PyObject *_wrap_wxGDIImage_SetSize(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxBitmap * _arg0; - wxString * _arg1; - int _arg2; - wxPalette * _arg3 = (wxPalette *) NULL; + wxGDIImage * _arg0; + wxSize * _arg1; PyObject * _argo0 = 0; + wxSize temp; PyObject * _obj1 = 0; - PyObject * _argo3 = 0; - char *_kwnames[] = { "self","name","type","palette", NULL }; + char *_kwnames[] = { "self","size", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|O:wxBitmap_SaveFile",_kwnames,&_argo0,&_obj1,&_arg2,&_argo3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxGDIImage_SetSize",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SaveFile. Expected _wxBitmap_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxGDIImage_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxGDIImage_SetSize. Expected _wxGDIImage_p."); return NULL; } } { - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); -} - if (_argo3) { - if (_argo3 == Py_None) { _arg3 = NULL; } - else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxPalette_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxBitmap_SaveFile. Expected _wxPalette_p."); + _arg1 = &temp; + if (! wxSize_helper(_obj1, &_arg1)) return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxBitmap_SaveFile(_arg0,*_arg1,_arg2,_arg3); - - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); -{ - if (_obj1) - delete _arg1; } - return _resultobj; -} - -#define wxBitmap_SetDepth(_swigobj,_swigarg0) (_swigobj->SetDepth(_swigarg0)) -static PyObject *_wrap_wxBitmap_SetDepth(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxBitmap * _arg0; - int _arg1; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","depth", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxBitmap_SetDepth",_kwnames,&_argo0,&_arg1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SetDepth. Expected _wxBitmap_p."); - return NULL; - } - } { wxPy_BEGIN_ALLOW_THREADS; - wxBitmap_SetDepth(_arg0,_arg1); + wxGDIImage_SetSize(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; } Py_INCREF(Py_None); @@ -1475,99 +1332,73 @@ static PyObject *_wrap_wxBitmap_SetDepth(PyObject *self, PyObject *args, PyObjec return _resultobj; } -#define wxBitmap_SetHeight(_swigobj,_swigarg0) (_swigobj->SetHeight(_swigarg0)) -static PyObject *_wrap_wxBitmap_SetHeight(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxBitmap * _arg0; - int _arg1; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","height", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxBitmap_SetHeight",_kwnames,&_argo0,&_arg1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SetHeight. Expected _wxBitmap_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - wxBitmap_SetHeight(_arg0,_arg1); - - wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; +static void *SwigwxBitmapTowxGDIImage(void *ptr) { + wxBitmap *src; + wxGDIImage *dest; + src = (wxBitmap *) ptr; + dest = (wxGDIImage *) src; + return (void *) dest; } -#define wxBitmap_SetMask(_swigobj,_swigarg0) (_swigobj->SetMask(_swigarg0)) -static PyObject *_wrap_wxBitmap_SetMask(PyObject *self, PyObject *args, PyObject *kwargs) { +#define new_wxBitmap(_swigarg0,_swigarg1) (new wxBitmap(_swigarg0,_swigarg1)) +static PyObject *_wrap_new_wxBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxBitmap * _arg0; - wxMask * _arg1; - PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","mask", NULL }; + wxBitmap * _result; + wxString * _arg0; + long _arg1; + PyObject * _obj0 = 0; + char *_kwnames[] = { "name","type", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxBitmap_SetMask",_kwnames,&_argo0,&_argo1)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SetMask. Expected _wxBitmap_p."); + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:new_wxBitmap",_kwnames,&_obj0,&_arg1)) return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxMask_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxBitmap_SetMask. Expected _wxMask_p."); +{ + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; - } } + _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); +} { wxPy_BEGIN_ALLOW_THREADS; - wxBitmap_SetMask(_arg0,_arg1); + _result = (wxBitmap *)new_wxBitmap(*_arg0,_arg1); wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} return _resultobj; } -#define wxBitmap_SetPalette(_swigobj,_swigarg0) (_swigobj->SetPalette(_swigarg0)) -static PyObject *_wrap_wxBitmap_SetPalette(PyObject *self, PyObject *args, PyObject *kwargs) { +#define delete_wxBitmap(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxBitmap(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxBitmap * _arg0; - wxPalette * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","palette", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxBitmap_SetPalette",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxBitmap",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SetPalette. Expected _wxBitmap_p."); - return NULL; - } - } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxBitmap_SetPalette. Expected _wxPalette_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxBitmap. Expected _wxBitmap_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxBitmap_SetPalette(_arg0,*_arg1); + delete_wxBitmap(_arg0); wxPy_END_ALLOW_THREADS; } Py_INCREF(Py_None); @@ -1575,56 +1406,62 @@ static PyObject *_wrap_wxBitmap_SetPalette(PyObject *self, PyObject *args, PyObj return _resultobj; } -#define wxBitmap_SetWidth(_swigobj,_swigarg0) (_swigobj->SetWidth(_swigarg0)) -static PyObject *_wrap_wxBitmap_SetWidth(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxBitmap_GetPalette(_swigobj) (_swigobj->GetPalette()) +static PyObject *_wrap_wxBitmap_GetPalette(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; + wxPalette * _result; wxBitmap * _arg0; - int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","width", NULL }; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxBitmap_SetWidth",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_GetPalette",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SetWidth. Expected _wxBitmap_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_GetPalette. Expected _wxBitmap_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxBitmap_SetWidth(_arg0,_arg1); + _result = (wxPalette *)wxBitmap_GetPalette(_arg0); wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxPalette_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } -#define new_wxMask(_swigarg0) (new wxMask(_swigarg0)) -static PyObject *_wrap_new_wxMask(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxBitmap_GetMask(_swigobj) (_swigobj->GetMask()) +static PyObject *_wrap_wxBitmap_GetMask(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxMask * _result; wxBitmap * _arg0; PyObject * _argo0 = 0; - char *_kwnames[] = { "bitmap", NULL }; + char *_kwnames[] = { "self", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxMask",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxBitmap_GetMask",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxMask. Expected _wxBitmap_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_GetMask. Expected _wxBitmap_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxMask *)new_wxMask(*_arg0); + _result = (wxMask *)wxBitmap_GetMask(_arg0); wxPy_END_ALLOW_THREADS; } if (_result) { @@ -1637,280 +1474,272 @@ static PyObject *_wrap_new_wxMask(PyObject *self, PyObject *args, PyObject *kwar return _resultobj; } -static void *SwigwxIconTowxBitmap(void *ptr) { - wxIcon *src; - wxBitmap *dest; - src = (wxIcon *) ptr; - dest = (wxBitmap *) src; - return (void *) dest; -} - -#define new_wxIcon(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxIcon(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_new_wxIcon(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxBitmap_LoadFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->LoadFile(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxBitmap_LoadFile(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxIcon * _result; - wxString * _arg0; - long _arg1; - int _arg2 = (int ) -1; - int _arg3 = (int ) -1; - PyObject * _obj0 = 0; - char *_kwnames[] = { "name","flags","desiredWidth","desiredHeight", NULL }; - char _ptemp[128]; + bool _result; + wxBitmap * _arg0; + wxString * _arg1; + long _arg2; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","name","flags", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:new_wxIcon",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:wxBitmap_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_LoadFile. Expected _wxBitmap_p."); return NULL; + } + } { - if (!PyString_Check(_obj0)) { + if (!PyString_Check(_obj1)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); + _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxIcon *)new_wxIcon(*_arg0,_arg1,_arg2,_arg3); + _result = (bool )wxBitmap_LoadFile(_arg0,*_arg1,_arg2); wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxIcon_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } +} _resultobj = Py_BuildValue("i",_result); { - if (_obj0) - delete _arg0; + if (_obj1) + delete _arg1; } return _resultobj; } -#define delete_wxIcon(_swigobj) (delete _swigobj) -static PyObject *_wrap_delete_wxIcon(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxBitmap_SaveFile(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SaveFile(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxBitmap_SaveFile(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxIcon * _arg0; + bool _result; + wxBitmap * _arg0; + wxString * _arg1; + int _arg2; + wxPalette * _arg3 = (wxPalette *) NULL; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _obj1 = 0; + PyObject * _argo3 = 0; + char *_kwnames[] = { "self","name","type","palette", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxIcon",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi|O:wxBitmap_SaveFile",_kwnames,&_argo0,&_obj1,&_arg2,&_argo3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxIcon. Expected _wxIcon_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SaveFile. Expected _wxBitmap_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - delete_wxIcon(_arg0); - - wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -#define wxIcon_GetDepth(_swigobj) (_swigobj->GetDepth()) -static PyObject *_wrap_wxIcon_GetDepth(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - int _result; - wxIcon * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIcon_GetDepth",_kwnames,&_argo0)) + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_GetDepth. Expected _wxIcon_p."); + } + _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); +} + if (_argo3) { + if (_argo3 == Py_None) { _arg3 = NULL; } + else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxPalette_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxBitmap_SaveFile. Expected _wxPalette_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxIcon_GetDepth(_arg0); + _result = (bool )wxBitmap_SaveFile(_arg0,*_arg1,_arg2,_arg3); wxPy_END_ALLOW_THREADS; } _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } -#define wxIcon_GetHeight(_swigobj) (_swigobj->GetHeight()) -static PyObject *_wrap_wxIcon_GetHeight(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxBitmap_SetMask(_swigobj,_swigarg0) (_swigobj->SetMask(_swigarg0)) +static PyObject *_wrap_wxBitmap_SetMask(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxIcon * _arg0; + wxBitmap * _arg0; + wxMask * _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","mask", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIcon_GetHeight",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxBitmap_SetMask",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_GetHeight. Expected _wxIcon_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SetMask. Expected _wxBitmap_p."); return NULL; } } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxIcon_GetHeight(_arg0); - - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define wxIcon_GetWidth(_swigobj) (_swigobj->GetWidth()) -static PyObject *_wrap_wxIcon_GetWidth(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - int _result; - wxIcon * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIcon_GetWidth",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_GetWidth. Expected _wxIcon_p."); + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxMask_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxBitmap_SetMask. Expected _wxMask_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxIcon_GetWidth(_arg0); + wxBitmap_SetMask(_arg0,_arg1); wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxIcon_LoadFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->LoadFile(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxIcon_LoadFile(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - bool _result; - wxIcon * _arg0; - wxString * _arg1; - long _arg2; +#define wxBitmap_SetPalette(_swigobj,_swigarg0) (_swigobj->SetPalette(_swigarg0)) +static PyObject *_wrap_wxBitmap_SetPalette(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmap * _arg0; + wxPalette * _arg1; PyObject * _argo0 = 0; - PyObject * _obj1 = 0; - char *_kwnames[] = { "self","name","flags", NULL }; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","palette", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:wxIcon_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxBitmap_SetPalette",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_LoadFile. Expected _wxIcon_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxBitmap_SetPalette. Expected _wxBitmap_p."); return NULL; } } -{ - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPalette_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxBitmap_SetPalette. Expected _wxPalette_p."); return NULL; + } } - _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); -} { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxIcon_LoadFile(_arg0,*_arg1,_arg2); + wxBitmap_SetPalette(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); -{ - if (_obj1) - delete _arg1; -} +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxIcon_Ok(_swigobj) (_swigobj->Ok()) -static PyObject *_wrap_wxIcon_Ok(PyObject *self, PyObject *args, PyObject *kwargs) { +#define new_wxMask(_swigarg0) (new wxMask(_swigarg0)) +static PyObject *_wrap_new_wxMask(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxIcon * _arg0; + wxMask * _result; + wxBitmap * _arg0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "bitmap", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxIcon_Ok",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxMask",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_Ok. Expected _wxIcon_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxBitmap_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxMask. Expected _wxBitmap_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxIcon_Ok(_arg0); + _result = (wxMask *)new_wxMask(*_arg0); wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxMask_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } return _resultobj; } -#define wxIcon_SetDepth(_swigobj,_swigarg0) (_swigobj->SetDepth(_swigarg0)) -static PyObject *_wrap_wxIcon_SetDepth(PyObject *self, PyObject *args, PyObject *kwargs) { +static void *SwigwxIconTowxGDIImage(void *ptr) { + wxIcon *src; + wxGDIImage *dest; + src = (wxIcon *) ptr; + dest = (wxGDIImage *) src; + return (void *) dest; +} + +#define new_wxIcon(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxIcon(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_new_wxIcon(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxIcon * _arg0; - int _arg1; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","depth", NULL }; + wxIcon * _result; + wxString * _arg0; + long _arg1; + int _arg2 = (int ) -1; + int _arg3 = (int ) -1; + PyObject * _obj0 = 0; + char *_kwnames[] = { "name","flags","desiredWidth","desiredHeight", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIcon_SetDepth",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:new_wxIcon",_kwnames,&_obj0,&_arg1,&_arg2,&_arg3)) return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_SetDepth. Expected _wxIcon_p."); +{ + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; - } } + _arg0 = new wxString(PyString_AsString(_obj0), PyString_Size(_obj0)); +} { wxPy_BEGIN_ALLOW_THREADS; - wxIcon_SetDepth(_arg0,_arg1); + _result = (wxIcon *)new_wxIcon(*_arg0,_arg1,_arg2,_arg3); wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxIcon_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} return _resultobj; } -#define wxIcon_SetHeight(_swigobj,_swigarg0) (_swigobj->SetHeight(_swigarg0)) -static PyObject *_wrap_wxIcon_SetHeight(PyObject *self, PyObject *args, PyObject *kwargs) { +#define delete_wxIcon(_swigobj) (delete _swigobj) +static PyObject *_wrap_delete_wxIcon(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxIcon * _arg0; - int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","height", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIcon_SetHeight",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxIcon",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_SetHeight. Expected _wxIcon_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxIcon. Expected _wxIcon_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxIcon_SetHeight(_arg0,_arg1); + delete_wxIcon(_arg0); wxPy_END_ALLOW_THREADS; } Py_INCREF(Py_None); @@ -1918,39 +1747,52 @@ static PyObject *_wrap_wxIcon_SetHeight(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxIcon_SetWidth(_swigobj,_swigarg0) (_swigobj->SetWidth(_swigarg0)) -static PyObject *_wrap_wxIcon_SetWidth(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxIcon_LoadFile(_swigobj,_swigarg0,_swigarg1) (_swigobj->LoadFile(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxIcon_LoadFile(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; + bool _result; wxIcon * _arg0; - int _arg1; + wxString * _arg1; + long _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","width", NULL }; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","name","flags", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIcon_SetWidth",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOl:wxIcon_LoadFile",_kwnames,&_argo0,&_obj1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIcon_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_SetWidth. Expected _wxIcon_p."); + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIcon_LoadFile. Expected _wxIcon_p."); return NULL; } } +{ + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); +} { wxPy_BEGIN_ALLOW_THREADS; - wxIcon_SetWidth(_arg0,_arg1); + _result = (bool )wxIcon_LoadFile(_arg0,*_arg1,_arg2); wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); +{ + if (_obj1) + delete _arg1; +} return _resultobj; } -static void *SwigwxCursorTowxBitmap(void *ptr) { +static void *SwigwxCursorTowxGDIImage(void *ptr) { wxCursor *src; - wxBitmap *dest; + wxGDIImage *dest; src = (wxCursor *) ptr; - dest = (wxBitmap *) src; + dest = (wxGDIImage *) src; return (void *) dest; } @@ -2022,33 +1864,6 @@ static PyObject *_wrap_delete_wxCursor(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxCursor_Ok(_swigobj) (_swigobj->Ok()) -static PyObject *_wrap_wxCursor_Ok(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - bool _result; - wxCursor * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxCursor_Ok",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxCursor_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxCursor_Ok. Expected _wxCursor_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxCursor_Ok(_arg0); - - wxPy_END_ALLOW_THREADS; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - static wxFont *new_wxFont(int pointSize,int family,int style,int weight,int underline,char *faceName,wxFontEncoding encoding) { return wxTheFontList->FindOrCreateFont(pointSize, family, style, weight, @@ -3261,40 +3076,6 @@ static PyObject *_wrap_wxPen_GetDashes(PyObject *self, PyObject *args, PyObject return _resultobj; } -#define wxPen_GetStipple(_swigobj) (_swigobj->GetStipple()) -static PyObject *_wrap_wxPen_GetStipple(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxBitmap * _result; - wxPen * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPen_GetStipple",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPen_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPen_GetStipple. Expected _wxPen_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxBitmap *)wxPen_GetStipple(_arg0); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } - return _resultobj; -} - #define wxPen_SetDashes(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetDashes(_swigarg0,_swigarg1)) static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -3343,6 +3124,40 @@ static PyObject *_wrap_wxPen_SetDashes(PyObject *self, PyObject *args, PyObject return _resultobj; } +#define wxPen_GetStipple(_swigobj) (_swigobj->GetStipple()) +static PyObject *_wrap_wxPen_GetStipple(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxBitmap * _result; + wxPen * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPen_GetStipple",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPen_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxPen_GetStipple. Expected _wxPen_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxBitmap *)wxPen_GetStipple(_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxBitmap_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define wxPen_SetStipple(_swigobj,_swigarg0) (_swigobj->SetStipple(_swigarg0)) static PyObject *_wrap_wxPen_SetStipple(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4290,6 +4105,49 @@ static PyObject *_wrap_wxDC_DrawRectangle(PyObject *self, PyObject *args, PyObje return _resultobj; } +#define wxDC_DrawRotatedText(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->DrawRotatedText(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxDC_DrawRotatedText(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxDC * _arg0; + wxString * _arg1; + wxCoord _arg2; + wxCoord _arg3; + double _arg4; + PyObject * _argo0 = 0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","text","x","y","angle", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOiid:wxDC_DrawRotatedText",_kwnames,&_argo0,&_obj1,&_arg2,&_arg3,&_arg4)) + 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_DrawRotatedText. Expected _wxDC_p."); + return NULL; + } + } +{ + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AsString(_obj1), PyString_Size(_obj1)); +} +{ + wxPy_BEGIN_ALLOW_THREADS; + wxDC_DrawRotatedText(_arg0,*_arg1,_arg2,_arg3,_arg4); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + #define wxDC_DrawRoundedRectangle(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4) (_swigobj->DrawRoundedRectangle(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4)) static PyObject *_wrap_wxDC_DrawRoundedRectangle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -6714,16 +6572,14 @@ static PyObject *_wrap_new_wxImageList(PyObject *self, PyObject *args, PyObject wxImageList * _result; int _arg0; int _arg1; - bool _arg2 = (bool ) TRUE; + int _arg2 = (int ) TRUE; int _arg3 = (int ) 1; - int tempbool2 = (int) TRUE; char *_kwnames[] = { "width","height","mask","initialCount", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"ii|ii:new_wxImageList",_kwnames,&_arg0,&_arg1,&tempbool2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"ii|ii:new_wxImageList",_kwnames,&_arg0,&_arg1,&_arg2,&_arg3)) return NULL; - _arg2 = (bool ) tempbool2; { wxPy_BEGIN_ALLOW_THREADS; _result = (wxImageList *)new_wxImageList(_arg0,_arg1,_arg2,_arg3); @@ -7179,6 +7035,7 @@ static PyMethodDef gdicMethods[] = { { "wxDC_DrawText", (PyCFunction) _wrap_wxDC_DrawText, METH_VARARGS | METH_KEYWORDS }, { "wxDC_DrawSpline", (PyCFunction) _wrap_wxDC_DrawSpline, METH_VARARGS | METH_KEYWORDS }, { "wxDC_DrawRoundedRectangle", (PyCFunction) _wrap_wxDC_DrawRoundedRectangle, METH_VARARGS | METH_KEYWORDS }, + { "wxDC_DrawRotatedText", (PyCFunction) _wrap_wxDC_DrawRotatedText, METH_VARARGS | METH_KEYWORDS }, { "wxDC_DrawRectangle", (PyCFunction) _wrap_wxDC_DrawRectangle, METH_VARARGS | METH_KEYWORDS }, { "wxDC_DrawPoint", (PyCFunction) _wrap_wxDC_DrawPoint, METH_VARARGS | METH_KEYWORDS }, { "wxDC_DrawPolygon", (PyCFunction) _wrap_wxDC_DrawPolygon, METH_VARARGS | METH_KEYWORDS }, @@ -7208,8 +7065,8 @@ static PyMethodDef gdicMethods[] = { { "wxBrush_GetColour", (PyCFunction) _wrap_wxBrush_GetColour, METH_VARARGS | METH_KEYWORDS }, { "new_wxBrush", (PyCFunction) _wrap_new_wxBrush, METH_VARARGS | METH_KEYWORDS }, { "wxPen_SetStipple", (PyCFunction) _wrap_wxPen_SetStipple, METH_VARARGS | METH_KEYWORDS }, - { "wxPen_SetDashes", (PyCFunction) _wrap_wxPen_SetDashes, METH_VARARGS | METH_KEYWORDS }, { "wxPen_GetStipple", (PyCFunction) _wrap_wxPen_GetStipple, METH_VARARGS | METH_KEYWORDS }, + { "wxPen_SetDashes", (PyCFunction) _wrap_wxPen_SetDashes, METH_VARARGS | METH_KEYWORDS }, { "wxPen_GetDashes", (PyCFunction) _wrap_wxPen_GetDashes, METH_VARARGS | METH_KEYWORDS }, { "wxPen_SetWidth", (PyCFunction) _wrap_wxPen_SetWidth, METH_VARARGS | METH_KEYWORDS }, { "wxPen_SetStyle", (PyCFunction) _wrap_wxPen_SetStyle, METH_VARARGS | METH_KEYWORDS }, @@ -7251,36 +7108,30 @@ static PyMethodDef gdicMethods[] = { { "wxFont_GetFaceName", (PyCFunction) _wrap_wxFont_GetFaceName, METH_VARARGS | METH_KEYWORDS }, { "wxFont_Ok", (PyCFunction) _wrap_wxFont_Ok, METH_VARARGS | METH_KEYWORDS }, { "new_wxFont", (PyCFunction) _wrap_new_wxFont, METH_VARARGS | METH_KEYWORDS }, - { "wxCursor_Ok", (PyCFunction) _wrap_wxCursor_Ok, METH_VARARGS | METH_KEYWORDS }, { "delete_wxCursor", (PyCFunction) _wrap_delete_wxCursor, METH_VARARGS | METH_KEYWORDS }, { "new_wxCursor", (PyCFunction) _wrap_new_wxCursor, METH_VARARGS | METH_KEYWORDS }, - { "wxIcon_SetWidth", (PyCFunction) _wrap_wxIcon_SetWidth, METH_VARARGS | METH_KEYWORDS }, - { "wxIcon_SetHeight", (PyCFunction) _wrap_wxIcon_SetHeight, METH_VARARGS | METH_KEYWORDS }, - { "wxIcon_SetDepth", (PyCFunction) _wrap_wxIcon_SetDepth, METH_VARARGS | METH_KEYWORDS }, - { "wxIcon_Ok", (PyCFunction) _wrap_wxIcon_Ok, METH_VARARGS | METH_KEYWORDS }, { "wxIcon_LoadFile", (PyCFunction) _wrap_wxIcon_LoadFile, METH_VARARGS | METH_KEYWORDS }, - { "wxIcon_GetWidth", (PyCFunction) _wrap_wxIcon_GetWidth, METH_VARARGS | METH_KEYWORDS }, - { "wxIcon_GetHeight", (PyCFunction) _wrap_wxIcon_GetHeight, METH_VARARGS | METH_KEYWORDS }, - { "wxIcon_GetDepth", (PyCFunction) _wrap_wxIcon_GetDepth, METH_VARARGS | METH_KEYWORDS }, { "delete_wxIcon", (PyCFunction) _wrap_delete_wxIcon, METH_VARARGS | METH_KEYWORDS }, { "new_wxIcon", (PyCFunction) _wrap_new_wxIcon, METH_VARARGS | METH_KEYWORDS }, { "new_wxMask", (PyCFunction) _wrap_new_wxMask, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_SetWidth", (PyCFunction) _wrap_wxBitmap_SetWidth, METH_VARARGS | METH_KEYWORDS }, { "wxBitmap_SetPalette", (PyCFunction) _wrap_wxBitmap_SetPalette, METH_VARARGS | METH_KEYWORDS }, { "wxBitmap_SetMask", (PyCFunction) _wrap_wxBitmap_SetMask, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_SetHeight", (PyCFunction) _wrap_wxBitmap_SetHeight, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_SetDepth", (PyCFunction) _wrap_wxBitmap_SetDepth, METH_VARARGS | METH_KEYWORDS }, { "wxBitmap_SaveFile", (PyCFunction) _wrap_wxBitmap_SaveFile, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_Ok", (PyCFunction) _wrap_wxBitmap_Ok, METH_VARARGS | METH_KEYWORDS }, { "wxBitmap_LoadFile", (PyCFunction) _wrap_wxBitmap_LoadFile, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_GetWidth", (PyCFunction) _wrap_wxBitmap_GetWidth, METH_VARARGS | METH_KEYWORDS }, { "wxBitmap_GetMask", (PyCFunction) _wrap_wxBitmap_GetMask, METH_VARARGS | METH_KEYWORDS }, { "wxBitmap_GetPalette", (PyCFunction) _wrap_wxBitmap_GetPalette, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_GetHeight", (PyCFunction) _wrap_wxBitmap_GetHeight, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_GetDepth", (PyCFunction) _wrap_wxBitmap_GetDepth, METH_VARARGS | METH_KEYWORDS }, - { "wxBitmap_Create", (PyCFunction) _wrap_wxBitmap_Create, METH_VARARGS | METH_KEYWORDS }, { "delete_wxBitmap", (PyCFunction) _wrap_delete_wxBitmap, METH_VARARGS | METH_KEYWORDS }, { "new_wxBitmap", (PyCFunction) _wrap_new_wxBitmap, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_SetSize", (PyCFunction) _wrap_wxGDIImage_SetSize, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_SetDepth", (PyCFunction) _wrap_wxGDIImage_SetDepth, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_SetHeight", (PyCFunction) _wrap_wxGDIImage_SetHeight, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_SetWidth", (PyCFunction) _wrap_wxGDIImage_SetWidth, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_GetDepth", (PyCFunction) _wrap_wxGDIImage_GetDepth, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_GetHeight", (PyCFunction) _wrap_wxGDIImage_GetHeight, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_GetWidth", (PyCFunction) _wrap_wxGDIImage_GetWidth, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_Ok", (PyCFunction) _wrap_wxGDIImage_Ok, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_SetHandle", (PyCFunction) _wrap_wxGDIImage_SetHandle, METH_VARARGS | METH_KEYWORDS }, + { "wxGDIImage_GetHandle", (PyCFunction) _wrap_wxGDIImage_GetHandle, METH_VARARGS | METH_KEYWORDS }, { "wxMemoryDCFromDC", (PyCFunction) _wrap_wxMemoryDCFromDC, METH_VARARGS | METH_KEYWORDS }, { "wxNamedColour", (PyCFunction) _wrap_wxNamedColour, METH_VARARGS | METH_KEYWORDS }, { "wxFont_SetDefaultEncoding", (PyCFunction) _wrap_wxFont_SetDefaultEncoding, METH_VARARGS | METH_KEYWORDS }, @@ -7288,7 +7139,6 @@ static PyMethodDef gdicMethods[] = { { "wxStockCursor", (PyCFunction) _wrap_wxStockCursor, METH_VARARGS | METH_KEYWORDS }, { "wxMaskColour", (PyCFunction) _wrap_wxMaskColour, METH_VARARGS | METH_KEYWORDS }, { "wxBitmapFromData", (PyCFunction) _wrap_wxBitmapFromData, METH_VARARGS | METH_KEYWORDS }, - { "wxNoRefBitmap", (PyCFunction) _wrap_wxNoRefBitmap, METH_VARARGS | METH_KEYWORDS }, { "wxEmptyBitmap", (PyCFunction) _wrap_wxEmptyBitmap, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } }; @@ -7354,10 +7204,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_wxWindowID",0}, { "_wxRect","_class_wxRect",0}, { "_wxPoint","_class_wxPoint",0}, - { "_wxBitmap","_class_wxCursor",SwigwxCursorTowxBitmap}, - { "_wxBitmap","_wxCursor",SwigwxCursorTowxBitmap}, - { "_wxBitmap","_class_wxIcon",SwigwxIconTowxBitmap}, - { "_wxBitmap","_wxIcon",SwigwxIconTowxBitmap}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxPyTimer","_class_wxPyTimer",0}, { "_wxWindowDC","_class_wxWindowDC",0}, @@ -7368,6 +7214,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_EBool","_int",0}, { "_EBool","_wxWindowID",0}, { "_class_wxRegion","_wxRegion",0}, + { "_wxGDIImage","_class_wxCursor",SwigwxCursorTowxGDIImage}, + { "_wxGDIImage","_wxCursor",SwigwxCursorTowxGDIImage}, + { "_wxGDIImage","_class_wxIcon",SwigwxIconTowxGDIImage}, + { "_wxGDIImage","_wxIcon",SwigwxIconTowxGDIImage}, + { "_wxGDIImage","_class_wxBitmap",SwigwxBitmapTowxGDIImage}, + { "_wxGDIImage","_wxBitmap",SwigwxBitmapTowxGDIImage}, + { "_wxGDIImage","_class_wxGDIImage",0}, { "_wxFont","_class_wxFont",0}, { "_unsigned_long","_wxDash",0}, { "_unsigned_long","_long",0}, @@ -7429,6 +7282,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_short","_unsigned_short",0}, { "_short","_signed_short",0}, { "_class_wxImageList","_wxImageList",0}, + { "_class_wxGDIImage","_class_wxCursor",SwigwxCursorTowxGDIImage}, + { "_class_wxGDIImage","_wxCursor",SwigwxCursorTowxGDIImage}, + { "_class_wxGDIImage","_class_wxIcon",SwigwxIconTowxGDIImage}, + { "_class_wxGDIImage","_wxIcon",SwigwxIconTowxGDIImage}, + { "_class_wxGDIImage","_class_wxBitmap",SwigwxBitmapTowxGDIImage}, + { "_class_wxGDIImage","_wxBitmap",SwigwxBitmapTowxGDIImage}, + { "_class_wxGDIImage","_wxGDIImage",0}, { "_wxWindowID","_wxCoord",0}, { "_wxWindowID","_wxPrintQuality",0}, { "_wxWindowID","_size_t",0}, @@ -7466,10 +7326,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxBusyInfo","_wxBusyInfo",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSize","_wxSize",0}, - { "_class_wxBitmap","_class_wxCursor",SwigwxCursorTowxBitmap}, - { "_class_wxBitmap","_wxCursor",SwigwxCursorTowxBitmap}, - { "_class_wxBitmap","_class_wxIcon",SwigwxIconTowxBitmap}, - { "_class_wxBitmap","_wxIcon",SwigwxIconTowxBitmap}, { "_class_wxBitmap","_wxBitmap",0}, { "_class_wxMemoryDC","_wxMemoryDC",0}, { "_wxDash","_unsigned_long",0}, diff --git a/utils/wxPython/src/msw/gdi.py b/utils/wxPython/src/msw/gdi.py index 491e64eb7f..34b2e025ad 100644 --- a/utils/wxPython/src/msw/gdi.py +++ b/utils/wxPython/src/msw/gdi.py @@ -2,22 +2,56 @@ import gdic from misc import * -class wxBitmapPtr : +class wxGDIImagePtr : def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,gdic=gdic): - if self.thisown == 1 : - gdic.delete_wxBitmap(self) - def Create(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_Create,(self,) + _args, _kwargs) + def GetHandle(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_GetHandle,(self,) + _args, _kwargs) return val - def GetDepth(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_GetDepth,(self,) + _args, _kwargs) + def SetHandle(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_SetHandle,(self,) + _args, _kwargs) + return val + def Ok(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_Ok,(self,) + _args, _kwargs) + return val + def GetWidth(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_GetWidth,(self,) + _args, _kwargs) return val def GetHeight(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_GetHeight,(self,) + _args, _kwargs) + val = apply(gdic.wxGDIImage_GetHeight,(self,) + _args, _kwargs) + return val + def GetDepth(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_GetDepth,(self,) + _args, _kwargs) + return val + def SetWidth(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_SetWidth,(self,) + _args, _kwargs) + return val + def SetHeight(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_SetHeight,(self,) + _args, _kwargs) + return val + def SetDepth(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_SetDepth,(self,) + _args, _kwargs) + return val + def SetSize(self, *_args, **_kwargs): + val = apply(gdic.wxGDIImage_SetSize,(self,) + _args, _kwargs) return val + def __repr__(self): + return "" % (self.this,) +class wxGDIImage(wxGDIImagePtr): + def __init__(self,this): + self.this = this + + + + +class wxBitmapPtr(wxGDIImagePtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __del__(self,gdic=gdic): + if self.thisown == 1 : + gdic.delete_wxBitmap(self) def GetPalette(self, *_args, **_kwargs): val = apply(gdic.wxBitmap_GetPalette,(self,) + _args, _kwargs) if val: val = wxPalettePtr(val) @@ -26,33 +60,18 @@ class wxBitmapPtr : val = apply(gdic.wxBitmap_GetMask,(self,) + _args, _kwargs) if val: val = wxMaskPtr(val) return val - def GetWidth(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_GetWidth,(self,) + _args, _kwargs) - return val def LoadFile(self, *_args, **_kwargs): val = apply(gdic.wxBitmap_LoadFile,(self,) + _args, _kwargs) return val - def Ok(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_Ok,(self,) + _args, _kwargs) - return val def SaveFile(self, *_args, **_kwargs): val = apply(gdic.wxBitmap_SaveFile,(self,) + _args, _kwargs) return val - def SetDepth(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_SetDepth,(self,) + _args, _kwargs) - return val - def SetHeight(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_SetHeight,(self,) + _args, _kwargs) - return val def SetMask(self, *_args, **_kwargs): val = apply(gdic.wxBitmap_SetMask,(self,) + _args, _kwargs) return val def SetPalette(self, *_args, **_kwargs): val = apply(gdic.wxBitmap_SetPalette,(self,) + _args, _kwargs) return val - def SetWidth(self, *_args, **_kwargs): - val = apply(gdic.wxBitmap_SetWidth,(self,) + _args, _kwargs) - return val def __repr__(self): return "" % (self.this,) class wxBitmap(wxBitmapPtr): @@ -77,37 +96,16 @@ class wxMask(wxMaskPtr): -class wxIconPtr(wxBitmapPtr): +class wxIconPtr(wxGDIImagePtr): def __init__(self,this): self.this = this self.thisown = 0 def __del__(self,gdic=gdic): if self.thisown == 1 : gdic.delete_wxIcon(self) - def GetDepth(self, *_args, **_kwargs): - val = apply(gdic.wxIcon_GetDepth,(self,) + _args, _kwargs) - return val - def GetHeight(self, *_args, **_kwargs): - val = apply(gdic.wxIcon_GetHeight,(self,) + _args, _kwargs) - return val - def GetWidth(self, *_args, **_kwargs): - val = apply(gdic.wxIcon_GetWidth,(self,) + _args, _kwargs) - return val def LoadFile(self, *_args, **_kwargs): val = apply(gdic.wxIcon_LoadFile,(self,) + _args, _kwargs) return val - def Ok(self, *_args, **_kwargs): - val = apply(gdic.wxIcon_Ok,(self,) + _args, _kwargs) - return val - def SetDepth(self, *_args, **_kwargs): - val = apply(gdic.wxIcon_SetDepth,(self,) + _args, _kwargs) - return val - def SetHeight(self, *_args, **_kwargs): - val = apply(gdic.wxIcon_SetHeight,(self,) + _args, _kwargs) - return val - def SetWidth(self, *_args, **_kwargs): - val = apply(gdic.wxIcon_SetWidth,(self,) + _args, _kwargs) - return val def __repr__(self): return "" % (self.this,) class wxIcon(wxIconPtr): @@ -118,16 +116,13 @@ class wxIcon(wxIconPtr): -class wxCursorPtr(wxBitmapPtr): +class wxCursorPtr(wxGDIImagePtr): def __init__(self,this): self.this = this self.thisown = 0 def __del__(self,gdic=gdic): if self.thisown == 1 : gdic.delete_wxCursor(self) - def Ok(self, *_args, **_kwargs): - val = apply(gdic.wxCursor_Ok,(self,) + _args, _kwargs) - return val def __repr__(self): return "" % (self.this,) class wxCursor(wxCursorPtr): @@ -285,13 +280,13 @@ class wxPenPtr : def GetDashes(self, *_args, **_kwargs): val = apply(gdic.wxPen_GetDashes,(self,) + _args, _kwargs) return val + def SetDashes(self, *_args, **_kwargs): + val = apply(gdic.wxPen_SetDashes,(self,) + _args, _kwargs) + return val def GetStipple(self, *_args, **_kwargs): val = apply(gdic.wxPen_GetStipple,(self,) + _args, _kwargs) if val: val = wxBitmapPtr(val) return val - def SetDashes(self, *_args, **_kwargs): - val = apply(gdic.wxPen_SetDashes,(self,) + _args, _kwargs) - return val def SetStipple(self, *_args, **_kwargs): val = apply(gdic.wxPen_SetStipple,(self,) + _args, _kwargs) return val @@ -406,6 +401,9 @@ class wxDCPtr : def DrawRectangle(self, *_args, **_kwargs): val = apply(gdic.wxDC_DrawRectangle,(self,) + _args, _kwargs) return val + def DrawRotatedText(self, *_args, **_kwargs): + val = apply(gdic.wxDC_DrawRotatedText,(self,) + _args, _kwargs) + return val def DrawRoundedRectangle(self, *_args, **_kwargs): val = apply(gdic.wxDC_DrawRoundedRectangle,(self,) + _args, _kwargs) return val @@ -765,11 +763,6 @@ def wxEmptyBitmap(*_args, **_kwargs): if val: val = wxBitmapPtr(val); val.thisown = 1 return val -def wxNoRefBitmap(*_args, **_kwargs): - val = apply(gdic.wxNoRefBitmap,_args,_kwargs) - if val: val = wxBitmapPtr(val) - return val - def wxBitmapFromData(*_args, **_kwargs): val = apply(gdic.wxBitmapFromData,_args,_kwargs) if val: val = wxBitmapPtr(val); val.thisown = 1 diff --git a/utils/wxPython/src/msw/stattool.cpp b/utils/wxPython/src/msw/stattool.cpp index b1d703c985..04df51a9b3 100644 --- a/utils/wxPython/src/msw/stattool.cpp +++ b/utils/wxPython/src/msw/stattool.cpp @@ -631,6 +631,40 @@ static PyObject *_wrap_wxToolBarTool_GetHeight(PyObject *self, PyObject *args, P return _resultobj; } +#define wxToolBarTool_GetControl(_swigobj) (_swigobj->GetControl()) +static PyObject *_wrap_wxToolBarTool_GetControl(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxControl * _result; + wxToolBarTool * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBarTool_GetControl",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBarTool_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBarTool_GetControl. Expected _wxToolBarTool_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxControl *)wxToolBarTool_GetControl(_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxControl_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + #define wxToolBarTool_m_toolStyle_set(_swigobj,_swigval) (_swigobj->m_toolStyle = _swigval,_swigval) static PyObject *_wrap_wxToolBarTool_m_toolStyle_set(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1698,6 +1732,42 @@ static PyObject *_wrap_new_wxToolBar(PyObject *self, PyObject *args, PyObject *k return _resultobj; } +#define wxToolBar_AddControl(_swigobj,_swigarg0) (_swigobj->AddControl(_swigarg0)) +static PyObject *_wrap_wxToolBar_AddControl(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxToolBar * _arg0; + wxControl * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","control", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxToolBar_AddControl",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBar_AddControl. Expected _wxToolBar_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxControl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxToolBar_AddControl. Expected _wxControl_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxToolBar_AddControl(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + #define wxToolBar_AddSeparator(_swigobj) (_swigobj->AddSeparator()) static PyObject *_wrap_wxToolBar_AddSeparator(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -1725,6 +1795,33 @@ static PyObject *_wrap_wxToolBar_AddSeparator(PyObject *self, PyObject *args, Py return _resultobj; } +#define wxToolBar_ClearTools(_swigobj) (_swigobj->ClearTools()) +static PyObject *_wrap_wxToolBar_ClearTools(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToolBar * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBar_ClearTools",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBar_ClearTools. Expected _wxToolBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxToolBar_ClearTools(_arg0); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + static wxToolBarTool * wxToolBar_AddTool(wxToolBar *self,int toolIndex,const wxBitmap & bitmap1,const wxBitmap & bitmap2,int isToggle,long xPos,long yPos,const wxString & shortHelpString,const wxString & longHelpString) { return self->AddTool(toolIndex, bitmap1, bitmap2, isToggle, xPos, yPos, NULL, @@ -1925,14 +2022,14 @@ static PyObject *_wrap_wxToolBar_FindToolForPosition(PyObject *self, PyObject *a PyObject * _resultobj; wxToolBarTool * _result; wxToolBar * _arg0; - float _arg1; - float _arg2; + long _arg1; + long _arg2; PyObject * _argo0 = 0; char *_kwnames[] = { "self","x","y", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Off:wxToolBar_FindToolForPosition",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxToolBar_FindToolForPosition",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2049,6 +2146,35 @@ static PyObject *_wrap_wxToolBar_SetToolBitmapSize(PyObject *self, PyObject *arg return _resultobj; } +#define wxToolBar_GetToolMargins(_swigobj) (_swigobj->GetToolMargins()) +static PyObject *_wrap_wxToolBar_GetToolMargins(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxSize * _result; + wxToolBar * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBar_GetToolMargins",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBar_GetToolMargins. Expected _wxToolBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxSize (wxToolBar_GetToolMargins(_arg0)); + + wxPy_END_ALLOW_THREADS; +} SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + #define wxToolBar_GetMaxSize(_swigobj) (_swigobj->GetMaxSize()) static PyObject *_wrap_wxToolBar_GetMaxSize(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -2485,7 +2611,125 @@ static PyObject *_wrap_wxToolBar_ToggleTool(PyObject *self, PyObject *args, PyOb return _resultobj; } +#define wxToolBar_SetToggle(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetToggle(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxToolBar_SetToggle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToolBar * _arg0; + int _arg1; + bool _arg2; + PyObject * _argo0 = 0; + int tempbool2; + char *_kwnames[] = { "self","toolIndex","toggle", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxToolBar_SetToggle",_kwnames,&_argo0,&_arg1,&tempbool2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBar_SetToggle. Expected _wxToolBar_p."); + return NULL; + } + } + _arg2 = (bool ) tempbool2; +{ + wxPy_BEGIN_ALLOW_THREADS; + wxToolBar_SetToggle(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxToolBar_SetMaxRowsCols(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetMaxRowsCols(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxToolBar_SetMaxRowsCols(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxToolBar * _arg0; + int _arg1; + int _arg2; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","rows","cols", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxToolBar_SetMaxRowsCols",_kwnames,&_argo0,&_arg1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBar_SetMaxRowsCols. Expected _wxToolBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxToolBar_SetMaxRowsCols(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxToolBar_GetMaxRows(_swigobj) (_swigobj->GetMaxRows()) +static PyObject *_wrap_wxToolBar_GetMaxRows(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxToolBar * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBar_GetMaxRows",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBar_GetMaxRows. Expected _wxToolBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxToolBar_GetMaxRows(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxToolBar_GetMaxCols(_swigobj) (_swigobj->GetMaxCols()) +static PyObject *_wrap_wxToolBar_GetMaxCols(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + int _result; + wxToolBar * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxToolBar_GetMaxCols",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxToolBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxToolBar_GetMaxCols. Expected _wxToolBar_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (int )wxToolBar_GetMaxCols(_arg0); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static PyMethodDef stattoolcMethods[] = { + { "wxToolBar_GetMaxCols", (PyCFunction) _wrap_wxToolBar_GetMaxCols, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBar_GetMaxRows", (PyCFunction) _wrap_wxToolBar_GetMaxRows, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBar_SetMaxRowsCols", (PyCFunction) _wrap_wxToolBar_SetMaxRowsCols, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBar_SetToggle", (PyCFunction) _wrap_wxToolBar_SetToggle, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_ToggleTool", (PyCFunction) _wrap_wxToolBar_ToggleTool, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_SetToolSeparation", (PyCFunction) _wrap_wxToolBar_SetToolSeparation, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_SetToolPacking", (PyCFunction) _wrap_wxToolBar_SetToolPacking, METH_VARARGS | METH_KEYWORDS }, @@ -2500,6 +2744,7 @@ static PyMethodDef stattoolcMethods[] = { { "wxToolBar_GetToolLongHelp", (PyCFunction) _wrap_wxToolBar_GetToolLongHelp, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_GetToolEnabled", (PyCFunction) _wrap_wxToolBar_GetToolEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_GetMaxSize", (PyCFunction) _wrap_wxToolBar_GetMaxSize, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBar_GetToolMargins", (PyCFunction) _wrap_wxToolBar_GetToolMargins, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_SetToolBitmapSize", (PyCFunction) _wrap_wxToolBar_SetToolBitmapSize, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_GetToolBitmapSize", (PyCFunction) _wrap_wxToolBar_GetToolBitmapSize, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_GetToolSize", (PyCFunction) _wrap_wxToolBar_GetToolSize, METH_VARARGS | METH_KEYWORDS }, @@ -2507,7 +2752,9 @@ static PyMethodDef stattoolcMethods[] = { { "wxToolBar_EnableTool", (PyCFunction) _wrap_wxToolBar_EnableTool, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_AddSimpleTool", (PyCFunction) _wrap_wxToolBar_AddSimpleTool, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_AddTool", (PyCFunction) _wrap_wxToolBar_AddTool, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBar_ClearTools", (PyCFunction) _wrap_wxToolBar_ClearTools, METH_VARARGS | METH_KEYWORDS }, { "wxToolBar_AddSeparator", (PyCFunction) _wrap_wxToolBar_AddSeparator, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBar_AddControl", (PyCFunction) _wrap_wxToolBar_AddControl, METH_VARARGS | METH_KEYWORDS }, { "new_wxToolBar", (PyCFunction) _wrap_new_wxToolBar, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarTool_m_longHelpString_get", (PyCFunction) _wrap_wxToolBarTool_m_longHelpString_get, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarTool_m_longHelpString_set", (PyCFunction) _wrap_wxToolBarTool_m_longHelpString_set, METH_VARARGS | METH_KEYWORDS }, @@ -2541,6 +2788,7 @@ static PyMethodDef stattoolcMethods[] = { { "wxToolBarTool_m_clientData_set", (PyCFunction) _wrap_wxToolBarTool_m_clientData_set, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarTool_m_toolStyle_get", (PyCFunction) _wrap_wxToolBarTool_m_toolStyle_get, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarTool_m_toolStyle_set", (PyCFunction) _wrap_wxToolBarTool_m_toolStyle_set, METH_VARARGS | METH_KEYWORDS }, + { "wxToolBarTool_GetControl", (PyCFunction) _wrap_wxToolBarTool_GetControl, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarTool_GetHeight", (PyCFunction) _wrap_wxToolBarTool_GetHeight, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarTool_GetWidth", (PyCFunction) _wrap_wxToolBarTool_GetWidth, METH_VARARGS | METH_KEYWORDS }, { "wxToolBarTool_SetSize", (PyCFunction) _wrap_wxToolBarTool_SetSize, METH_VARARGS | METH_KEYWORDS }, @@ -2691,6 +2939,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxDataFormat","_wxDataFormat",0}, { "_class_wxDropFilesEvent","_wxDropFilesEvent",0}, { "_wxWindowDestroyEvent","_class_wxWindowDestroyEvent",0}, + { "_wxGDIImage","_class_wxGDIImage",0}, { "_wxStaticText","_class_wxStaticText",0}, { "_wxFont","_class_wxFont",0}, { "_class_wxPyDropTarget","_wxPyDropTarget",0}, @@ -2792,6 +3041,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSlider","_wxSlider",0}, { "_class_wxImageList","_wxImageList",0}, { "_class_wxBitmapButton","_wxBitmapButton",0}, + { "_class_wxGDIImage","_wxGDIImage",0}, { "_class_wxPaletteChangedEvent","_wxPaletteChangedEvent",0}, { "_wxWindowID","_wxCoord",0}, { "_wxWindowID","_wxPrintQuality",0}, diff --git a/utils/wxPython/src/msw/stattool.py b/utils/wxPython/src/msw/stattool.py index 56b82cfc7a..e41d5b837f 100644 --- a/utils/wxPython/src/msw/stattool.py +++ b/utils/wxPython/src/msw/stattool.py @@ -72,6 +72,10 @@ class wxToolBarToolPtr : def GetHeight(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBarTool_GetHeight,(self,) + _args, _kwargs) return val + def GetControl(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBarTool_GetControl,(self,) + _args, _kwargs) + if val: val = wxControlPtr(val) + return val def __setattr__(self,name,value): if name == "m_toolStyle" : stattoolc.wxToolBarTool_m_toolStyle_set(self,value) @@ -170,9 +174,15 @@ class wxToolBarPtr(wxControlPtr): def __init__(self,this): self.this = this self.thisown = 0 + def AddControl(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBar_AddControl,(self,) + _args, _kwargs) + return val def AddSeparator(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBar_AddSeparator,(self,) + _args, _kwargs) return val + def ClearTools(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBar_ClearTools,(self,) + _args, _kwargs) + return val def AddTool(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBar_AddTool,(self,) + _args, _kwargs) if val: val = wxToolBarToolPtr(val) @@ -199,6 +209,10 @@ class wxToolBarPtr(wxControlPtr): def SetToolBitmapSize(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBar_SetToolBitmapSize,(self,) + _args, _kwargs) return val + def GetToolMargins(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBar_GetToolMargins,(self,) + _args, _kwargs) + if val: val = wxSizePtr(val) ; val.thisown = 1 + return val def GetMaxSize(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBar_GetMaxSize,(self,) + _args, _kwargs) if val: val = wxSizePtr(val) ; val.thisown = 1 @@ -242,6 +256,18 @@ class wxToolBarPtr(wxControlPtr): def ToggleTool(self, *_args, **_kwargs): val = apply(stattoolc.wxToolBar_ToggleTool,(self,) + _args, _kwargs) return val + def SetToggle(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBar_SetToggle,(self,) + _args, _kwargs) + return val + def SetMaxRowsCols(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBar_SetMaxRowsCols,(self,) + _args, _kwargs) + return val + def GetMaxRows(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBar_GetMaxRows,(self,) + _args, _kwargs) + return val + def GetMaxCols(self, *_args, **_kwargs): + val = apply(stattoolc.wxToolBar_GetMaxCols,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxToolBar(wxToolBarPtr): diff --git a/utils/wxPython/src/msw/windows.cpp b/utils/wxPython/src/msw/windows.cpp index 10228a604c..1061ce66a6 100644 --- a/utils/wxPython/src/msw/windows.cpp +++ b/utils/wxPython/src/msw/windows.cpp @@ -529,6 +529,40 @@ static PyObject *_wrap_wxEvtHandler_Connect(PyObject *self, PyObject *args, PyOb return _resultobj; } +static bool wxEvtHandler_Disconnect(wxEvtHandler *self,int id,int lastId,wxEventType eventType) { + return self->Disconnect(id, lastId, eventType, + (wxObjectEventFunction) + &wxPyCallback::EventThunker); + } +static PyObject *_wrap_wxEvtHandler_Disconnect(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxEvtHandler * _arg0; + int _arg1; + int _arg2 = (int ) -1; + wxEventType _arg3 = (wxEventType ) wxEVT_NULL; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","id","lastId","eventType", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|ii:wxEvtHandler_Disconnect",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxEvtHandler_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxEvtHandler_Disconnect. Expected _wxEvtHandler_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxEvtHandler_Disconnect(_arg0,_arg1,_arg2,_arg3); + + wxPy_END_ALLOW_THREADS; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxValidatorTowxEvtHandler(void *ptr) { wxValidator *src; wxEvtHandler *dest; @@ -8651,6 +8685,7 @@ static PyMethodDef windowscMethods[] = { { "wxValidator_GetWindow", (PyCFunction) _wrap_wxValidator_GetWindow, METH_VARARGS | METH_KEYWORDS }, { "wxValidator_Clone", (PyCFunction) _wrap_wxValidator_Clone, METH_VARARGS | METH_KEYWORDS }, { "new_wxValidator", (PyCFunction) _wrap_new_wxValidator, METH_VARARGS | METH_KEYWORDS }, + { "wxEvtHandler_Disconnect", (PyCFunction) _wrap_wxEvtHandler_Disconnect, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_Connect", (PyCFunction) _wrap_wxEvtHandler_Connect, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_SetPreviousHandler", (PyCFunction) _wrap_wxEvtHandler_SetPreviousHandler, METH_VARARGS | METH_KEYWORDS }, { "wxEvtHandler_SetNextHandler", (PyCFunction) _wrap_wxEvtHandler_SetNextHandler, METH_VARARGS | METH_KEYWORDS }, @@ -8769,6 +8804,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_EBool","_wxWindowID",0}, { "_class_wxRegion","_wxRegion",0}, { "_class_wxDataFormat","_wxDataFormat",0}, + { "_wxGDIImage","_class_wxGDIImage",0}, { "_wxFont","_class_wxFont",0}, { "_class_wxPyDropTarget","_wxPyDropTarget",0}, { "_unsigned_long","_wxDash",0}, @@ -8844,6 +8880,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyDataObjectSimple","_wxPyDataObjectSimple",0}, { "_class_wxPyDropSource","_wxPyDropSource",0}, { "_class_wxImageList","_wxImageList",0}, + { "_class_wxGDIImage","_wxGDIImage",0}, { "_wxWindowID","_wxCoord",0}, { "_wxWindowID","_wxPrintQuality",0}, { "_wxWindowID","_size_t",0}, diff --git a/utils/wxPython/src/msw/windows.py b/utils/wxPython/src/msw/windows.py index 093d5cad01..d717351e22 100644 --- a/utils/wxPython/src/msw/windows.py +++ b/utils/wxPython/src/msw/windows.py @@ -50,6 +50,9 @@ class wxEvtHandlerPtr : def Connect(self, *_args, **_kwargs): val = apply(windowsc.wxEvtHandler_Connect,(self,) + _args, _kwargs) return val + def Disconnect(self, *_args, **_kwargs): + val = apply(windowsc.wxEvtHandler_Disconnect,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxEvtHandler(wxEvtHandlerPtr): diff --git a/utils/wxPython/src/stattool.i b/utils/wxPython/src/stattool.i index 87e11f71ad..78c43a5d9c 100644 --- a/utils/wxPython/src/stattool.i +++ b/utils/wxPython/src/stattool.i @@ -57,8 +57,6 @@ public: void DrawFieldText(wxDC& dc, int i); void InitColours(void); - // OnSysColourChanged(wxSysColourChangedEvent& event); - void SetFieldsCount(int number = 1); void SetStatusText(const wxString& text, int i = 0); void SetStatusWidths(int LCOUNT, int* LIST); @@ -71,22 +69,19 @@ class wxToolBarTool { public: wxToolBarTool(); ~wxToolBarTool(); -#ifdef __WXMSW__ void SetSize( long w, long h ) { m_width = w; m_height = h; } long GetWidth () const { return m_width; } long GetHeight () const { return m_height; } -#endif + wxControl *GetControl(); public: int m_toolStyle; wxObject * m_clientData; int m_index; -#ifdef __WXMSW__ long m_x; long m_y; long m_width; long m_height; -#endif bool m_toggleState; bool m_isToggle; bool m_deleteSecondBitmap; @@ -114,7 +109,9 @@ public: %pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)" + bool AddControl(wxControl * control); void AddSeparator(); + void ClearTools(); // Ignoge the clientData for now... %addmethods { @@ -143,17 +140,14 @@ public: } -// void DrawTool(wxMemoryDC& memDC, wxToolBarTool* tool); - void EnableTool(int toolIndex, const bool enable); -#ifdef __WXMSW__ - wxToolBarTool* FindToolForPosition(const float x, const float y); + void EnableTool(int toolIndex, bool enable); + wxToolBarTool* FindToolForPosition(long x, long y); wxSize GetToolSize(); wxSize GetToolBitmapSize(); void SetToolBitmapSize(const wxSize& size); -// wxSize GetMargins(); + wxSize GetToolMargins(); wxSize GetMaxSize(); // wxObject* GetToolClientData(int toolIndex); -#endif bool GetToolEnabled(int toolIndex); wxString GetToolLongHelp(int toolIndex); int GetToolPacking(); @@ -161,10 +155,6 @@ public: wxString GetToolShortHelp(int toolIndex); bool GetToolState(int toolIndex); - // TODO: figure out how to handle these - //bool OnLeftClick(int toolIndex, bool toggleDown); - //void OnMouseEnter(int toolIndex); - //void OnRightClick(int toolIndex, float x, float y); bool Realize(); @@ -174,6 +164,12 @@ public: void SetToolPacking(int packing); void SetToolSeparation(int separation); void ToggleTool(int toolIndex, const bool toggle); + void SetToggle(int toolIndex, bool toggle); + + void SetMaxRowsCols(int rows, int cols); + int GetMaxRows(); + int GetMaxCols(); + }; diff --git a/utils/wxPython/src/windows.i b/utils/wxPython/src/windows.i index 8b72acff56..5bfd5bbd17 100644 --- a/utils/wxPython/src/windows.i +++ b/utils/wxPython/src/windows.i @@ -55,6 +55,14 @@ public: new wxPyCallback(func)); } } + + bool Disconnect(int id, int lastId = -1, + wxEventType eventType = wxEVT_NULL) { + return self->Disconnect(id, lastId, eventType, + (wxObjectEventFunction) + &wxPyCallback::EventThunker); + } + } }; -- 2.45.2