From 328fcd84d48cd830cef3cedaaf1e89ae969aa9aa Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 21 Feb 2004 02:04:26 +0000 Subject: [PATCH] reSWIGged git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/src/_misc_rename.i | 2 +- wxPython/src/msw/controls.py | 100 ++++-- wxPython/src/msw/controls_wrap.cpp | 16 +- wxPython/src/msw/core.py | 8 +- wxPython/src/msw/core_wrap.cpp | 52 ++- wxPython/src/msw/gdi.py | 152 +++++++-- wxPython/src/msw/gdi_wrap.cpp | 502 ++++++++++++++++------------- wxPython/src/msw/grid_wrap.cpp | 31 +- wxPython/src/msw/misc.py | 365 +++++++++++++++++---- wxPython/src/msw/misc_wrap.cpp | 406 +++++++++++------------ wxPython/src/msw/windows.py | 347 ++++++++++++++++---- wxPython/src/msw/windows_wrap.cpp | 191 +++++------ wxPython/wxPython/misc.py | 4 +- 13 files changed, 1377 insertions(+), 799 deletions(-) diff --git a/wxPython/src/_misc_rename.i b/wxPython/src/_misc_rename.i index 92fe4a3c9b..17f90a74bf 100644 --- a/wxPython/src/_misc_rename.i +++ b/wxPython/src/_misc_rename.i @@ -277,9 +277,9 @@ %rename(CONFIG_USE_RELATIVE_PATH) wxCONFIG_USE_RELATIVE_PATH; %rename(CONFIG_USE_NO_ESCAPE_CHARACTERS) wxCONFIG_USE_NO_ESCAPE_CHARACTERS; %rename(ConfigBase) wxConfigBase; -%rename(ConfigPathChanger) wxConfigPathChanger; %rename(Config) wxConfig; %rename(FileConfig) wxFileConfig; +%rename(ConfigPathChanger) wxConfigPathChanger; %rename(ExpandEnvVars) wxExpandEnvVars; %rename(DateTime) wxDateTime; %rename(TimeSpan) wxTimeSpan; diff --git a/wxPython/src/msw/controls.py b/wxPython/src/msw/controls.py index c4f50b2308..51a5ebaeb6 100644 --- a/wxPython/src/msw/controls.py +++ b/wxPython/src/msw/controls.py @@ -417,15 +417,21 @@ def PreChoice(*args, **kwargs): #--------------------------------------------------------------------------- class ComboBox(Choice): + """ + A combobox is like a combination of an edit control and a listbox. It can be + displayed as static list with editable or read-only text field; or a drop-down + list with text field. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxComboBox instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Window parent, int id, String value=EmptyString, Point pos=DefaultPosition, - Size size=DefaultSize, - wxArrayString choices=wxPyEmptyStringArray, - long style=0, Validator validator=DefaultValidator, - String name=ComboBoxNameStr) -> ComboBox + __init__(Window parent, int id, String value=EmptyString, + Point pos=DefaultPosition, Size size=DefaultSize, + List choices=[], long style=0, Validator validator=DefaultValidator, + String name=ComboBoxNameStr) -> ComboBox + + Constructor, creates and shows a ComboBox control. """ newobj = _controls.new_ComboBox(*args, **kwargs) self.this = newobj.this @@ -435,16 +441,21 @@ class ComboBox(Choice): def Create(*args, **kwargs): """ - Create(Window parent, int id, String value=EmptyString, Point pos=DefaultPosition, - Size size=DefaultSize, - wxArrayString choices=wxPyEmptyStringArray, - long style=0, Validator validator=DefaultValidator, - String name=ComboBoxNameStr) -> bool + Create(Window parent, int id, String value=EmptyString, + Point pos=DefaultPosition, Size size=DefaultSize, + List choices=[], long style=0, Validator validator=DefaultValidator, + String name=ChoiceNameStr) -> bool + + Actually create the GUI Choice control for 2-phase creation """ return _controls.ComboBox_Create(*args, **kwargs) def GetValue(*args, **kwargs): - """GetValue() -> String""" + """ + GetValue() -> String + + Returns the current value in the combobox text field. + """ return _controls.ComboBox_GetValue(*args, **kwargs) def SetValue(*args, **kwargs): @@ -452,35 +463,68 @@ class ComboBox(Choice): return _controls.ComboBox_SetValue(*args, **kwargs) def Copy(*args, **kwargs): - """Copy()""" + """ + Copy() + + Copies the selected text to the clipboard. + """ return _controls.ComboBox_Copy(*args, **kwargs) def Cut(*args, **kwargs): - """Cut()""" + """ + Cut() + + Copies the selected text to the clipboard and removes the selection. + """ return _controls.ComboBox_Cut(*args, **kwargs) def Paste(*args, **kwargs): - """Paste()""" + """ + Paste() + + Pastes text from the clipboard to the text field. + """ return _controls.ComboBox_Paste(*args, **kwargs) def SetInsertionPoint(*args, **kwargs): - """SetInsertionPoint(long pos)""" + """ + SetInsertionPoint(long pos) + + Sets the insertion point in the combobox text field. + """ return _controls.ComboBox_SetInsertionPoint(*args, **kwargs) def GetInsertionPoint(*args, **kwargs): - """GetInsertionPoint() -> long""" + """ + GetInsertionPoint() -> long + + Returns the insertion point for the combobox's text field. + """ return _controls.ComboBox_GetInsertionPoint(*args, **kwargs) def GetLastPosition(*args, **kwargs): - """GetLastPosition() -> long""" + """ + GetLastPosition() -> long + + Returns the last position in the combobox text field. + """ return _controls.ComboBox_GetLastPosition(*args, **kwargs) def Replace(*args, **kwargs): - """Replace(long from, long to, String value)""" + """ + Replace(long from, long to, String value) + + Replaces the text between two positions with the given text, in the + combobox text field. + """ return _controls.ComboBox_Replace(*args, **kwargs) def SetSelection(*args, **kwargs): - """SetSelection(int n)""" + """ + SetSelection(int n) + + Selects the text between the two positions, in the combobox text field. + """ return _controls.ComboBox_SetSelection(*args, **kwargs) def SetMark(*args, **kwargs): @@ -492,11 +536,19 @@ class ComboBox(Choice): return _controls.ComboBox_SetEditable(*args, **kwargs) def SetInsertionPointEnd(*args, **kwargs): - """SetInsertionPointEnd()""" + """ + SetInsertionPointEnd() + + Sets the insertion point at the end of the combobox text field. + """ return _controls.ComboBox_SetInsertionPointEnd(*args, **kwargs) def Remove(*args, **kwargs): - """Remove(long from, long to)""" + """ + Remove(long from, long to) + + Removes the text between the two positions in the combobox text field. + """ return _controls.ComboBox_Remove(*args, **kwargs) @@ -509,7 +561,11 @@ _controls.ComboBox_swigregister(ComboBoxPtr) ComboBoxNameStr = cvar.ComboBoxNameStr def PreComboBox(*args, **kwargs): - """PreComboBox() -> ComboBox""" + """ + PreComboBox() -> ComboBox + + Precreate a ComboBox control for 2-phase creation. + """ val = _controls.new_PreComboBox(*args, **kwargs) val.thisown = 1 return val diff --git a/wxPython/src/msw/controls_wrap.cpp b/wxPython/src/msw/controls_wrap.cpp index 09ecb3cd82..cb107e6ca0 100644 --- a/wxPython/src/msw/controls_wrap.cpp +++ b/wxPython/src/msw/controls_wrap.cpp @@ -665,14 +665,8 @@ wxWindow *wxPyListCtrl_GetMainWindow(wxPyListCtrl *self){ #include "wx/wxPython/pytree.h" static const wxString wxPyTreeCtrlNameStr(_T("wxTreeCtrl")); -bool wxTreeItemId_operator_ee___(wxTreeItemId *self,wxTreeItemId const *other){ - if (!other) return False; - return *self == *other; - } -bool wxTreeItemId_operator_Ne___(wxTreeItemId *self,wxTreeItemId const *other){ - if (!other) return True; - return *self != *other; - } +bool wxTreeItemId___eq__(wxTreeItemId *self,wxTreeItemId const *other){ return other ? (*self == *other) : False; } +bool wxTreeItemId___ne__(wxTreeItemId *self,wxTreeItemId const *other){ return other ? (*self != *other) : True; } void wxPyTreeItemData_Destroy(wxPyTreeItemData *self){ delete self; } // C++ version of Python aware wxTreeCtrl class wxPyTreeCtrl : public wxTreeCtrl { @@ -2787,7 +2781,7 @@ static PyObject *_wrap_ComboBox_Create(PyObject *self, PyObject *args, PyObject long arg8 = (long) 0 ; wxValidator const &arg9_defvalue = wxDefaultValidator ; wxValidator *arg9 = (wxValidator *) &arg9_defvalue ; - wxString const &arg10_defvalue = wxPyComboBoxNameStr ; + wxString const &arg10_defvalue = wxPyChoiceNameStr ; wxString *arg10 = (wxString *) &arg10_defvalue ; bool result; bool temp4 = False ; @@ -22934,7 +22928,7 @@ static PyObject *_wrap_TreeItemId___eq__(PyObject *self, PyObject *args, PyObjec if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTreeItemId,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTreeItemId_operator_ee___(arg1,(wxTreeItemId const *)arg2); + result = (bool)wxTreeItemId___eq__(arg1,(wxTreeItemId const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -22962,7 +22956,7 @@ static PyObject *_wrap_TreeItemId___ne__(PyObject *self, PyObject *args, PyObjec if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTreeItemId,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTreeItemId_operator_Ne___(arg1,(wxTreeItemId const *)arg2); + result = (bool)wxTreeItemId___ne__(arg1,(wxTreeItemId const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; diff --git a/wxPython/src/msw/core.py b/wxPython/src/msw/core.py index 10b7b26732..2a9ebc8fef 100644 --- a/wxPython/src/msw/core.py +++ b/wxPython/src/msw/core.py @@ -7518,11 +7518,11 @@ class GBPosition(object): return _core.GBPosition_SetCol(*args, **kwargs) def __eq__(*args, **kwargs): - """__eq__(GBPosition p) -> bool""" + """__eq__(GBPosition other) -> bool""" return _core.GBPosition___eq__(*args, **kwargs) def __ne__(*args, **kwargs): - """__ne__(GBPosition p) -> bool""" + """__ne__(GBPosition other) -> bool""" return _core.GBPosition___ne__(*args, **kwargs) def Set(*args, **kwargs): @@ -7583,11 +7583,11 @@ class GBSpan(object): return _core.GBSpan_SetColspan(*args, **kwargs) def __eq__(*args, **kwargs): - """__eq__(GBSpan o) -> bool""" + """__eq__(GBSpan other) -> bool""" return _core.GBSpan___eq__(*args, **kwargs) def __ne__(*args, **kwargs): - """__ne__(GBSpan o) -> bool""" + """__ne__(GBSpan other) -> bool""" return _core.GBSpan___ne__(*args, **kwargs) def Set(*args, **kwargs): diff --git a/wxPython/src/msw/core_wrap.cpp b/wxPython/src/msw/core_wrap.cpp index e25a23baa3..34df8895dd 100644 --- a/wxPython/src/msw/core_wrap.cpp +++ b/wxPython/src/msw/core_wrap.cpp @@ -1429,6 +1429,8 @@ bool wxGBSpan_helper(PyObject* source, wxGBSpan** obj) } +bool wxGBPosition___eq__(wxGBPosition *self,wxGBPosition const *other){ return other ? (*self == *other) : False; } +bool wxGBPosition___ne__(wxGBPosition *self,wxGBPosition const *other){ return other ? (*self != *other) : True; } void wxGBPosition_Set(wxGBPosition *self,int row,int col){ self->SetRow(row); self->SetCol(col); @@ -1441,6 +1443,8 @@ PyObject *wxGBPosition_Get(wxGBPosition *self){ wxPyEndBlockThreads(); return tup; } +bool wxGBSpan___eq__(wxGBSpan *self,wxGBSpan const *other){ return other ? (*self == *other) : False; } +bool wxGBSpan___ne__(wxGBSpan *self,wxGBSpan const *other){ return other ? (*self != *other) : True; } void wxGBSpan_Set(wxGBSpan *self,int rowspan,int colspan){ self->SetRowspan(rowspan); self->SetColspan(colspan); @@ -35443,24 +35447,20 @@ static PyObject *_wrap_GBPosition_SetCol(PyObject *self, PyObject *args, PyObjec static PyObject *_wrap_GBPosition___eq__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxGBPosition *arg1 = (wxGBPosition *) 0 ; - wxGBPosition *arg2 = 0 ; + wxGBPosition *arg2 = (wxGBPosition *) 0 ; bool result; - wxGBPosition temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "p", NULL + (char *) "self",(char *) "other", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GBPosition___eq__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxGBPosition,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - arg2 = &temp2; - if ( ! wxGBPosition_helper(obj1, &arg2)) SWIG_fail; - } + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxGBPosition,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxGBPosition const *)arg1)->operator ==((wxGBPosition const &)*arg2); + result = (bool)wxGBPosition___eq__(arg1,(wxGBPosition const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -35475,24 +35475,20 @@ static PyObject *_wrap_GBPosition___eq__(PyObject *self, PyObject *args, PyObjec static PyObject *_wrap_GBPosition___ne__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxGBPosition *arg1 = (wxGBPosition *) 0 ; - wxGBPosition *arg2 = 0 ; + wxGBPosition *arg2 = (wxGBPosition *) 0 ; bool result; - wxGBPosition temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "p", NULL + (char *) "self",(char *) "other", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GBPosition___ne__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxGBPosition,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - arg2 = &temp2; - if ( ! wxGBPosition_helper(obj1, &arg2)) SWIG_fail; - } + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxGBPosition,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxGBPosition const *)arg1)->operator !=((wxGBPosition const &)*arg2); + result = (bool)wxGBPosition___ne__(arg1,(wxGBPosition const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -35727,24 +35723,20 @@ static PyObject *_wrap_GBSpan_SetColspan(PyObject *self, PyObject *args, PyObjec static PyObject *_wrap_GBSpan___eq__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxGBSpan *arg1 = (wxGBSpan *) 0 ; - wxGBSpan *arg2 = 0 ; + wxGBSpan *arg2 = (wxGBSpan *) 0 ; bool result; - wxGBSpan temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "o", NULL + (char *) "self",(char *) "other", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GBSpan___eq__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxGBSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - arg2 = &temp2; - if ( ! wxGBSpan_helper(obj1, &arg2)) SWIG_fail; - } + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxGBSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxGBSpan const *)arg1)->operator ==((wxGBSpan const &)*arg2); + result = (bool)wxGBSpan___eq__(arg1,(wxGBSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -35759,24 +35751,20 @@ static PyObject *_wrap_GBSpan___eq__(PyObject *self, PyObject *args, PyObject *k static PyObject *_wrap_GBSpan___ne__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxGBSpan *arg1 = (wxGBSpan *) 0 ; - wxGBSpan *arg2 = 0 ; + wxGBSpan *arg2 = (wxGBSpan *) 0 ; bool result; - wxGBSpan temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "o", NULL + (char *) "self",(char *) "other", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GBSpan___ne__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxGBSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - arg2 = &temp2; - if ( ! wxGBSpan_helper(obj1, &arg2)) SWIG_fail; - } + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxGBSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxGBSpan const *)arg1)->operator !=((wxGBSpan const &)*arg2); + result = (bool)wxGBSpan___ne__(arg1,(wxGBSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index 40a48c5cb2..b9da9091e1 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -45,10 +45,31 @@ _gdi.GDIObject_swigregister(GDIObjectPtr) #--------------------------------------------------------------------------- class Colour(core.Object): + """ + A colour is an object representing a combination of Red, Green, and Blue (RGB) + intensity values, and is used to determine drawing colours, window colours, + etc. Valid RGB values are in the range 0 to 255. + + In wxPython there are typemaps that will automatically convert from a colour + name, or from a "#RRGGBB" colour hex value string to a wx.Colour object when + calling C++ methods that expect a wxColour. This means that the following are + all equivallent: + + win.SetBackgroundColour(wxColour(0,0,255)) + win.SetBackgroundColour("BLUE") + win.SetBackgroundColour("#0000FF") + + You can retrieve the various current system colour settings with + wx.SystemSettings.GetColour. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxColour instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(unsigned char red=0, unsigned char green=0, unsigned char blue=0) -> Colour""" + """ + __init__(unsigned char red=0, unsigned char green=0, unsigned char blue=0) -> Colour + + Constructs a colour from red, green and blue values. + """ newobj = _gdi.new_Colour(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -60,45 +81,104 @@ class Colour(core.Object): except: pass def Red(*args, **kwargs): - """Red() -> unsigned char""" + """ + Red() -> unsigned char + + Returns the red intensity. + """ return _gdi.Colour_Red(*args, **kwargs) def Green(*args, **kwargs): - """Green() -> unsigned char""" + """ + Green() -> unsigned char + + Returns the green intensity. + """ return _gdi.Colour_Green(*args, **kwargs) def Blue(*args, **kwargs): - """Blue() -> unsigned char""" + """ + Blue() -> unsigned char + + Returns the blue intensity. + """ return _gdi.Colour_Blue(*args, **kwargs) def Ok(*args, **kwargs): - """Ok() -> bool""" + """ + Ok() -> bool + + Returns True if the colour object is valid (the colour has been + initialised with RGB values). + """ return _gdi.Colour_Ok(*args, **kwargs) def Set(*args, **kwargs): - """Set(unsigned char red, unsigned char green, unsigned char blue)""" + """ + Set(unsigned char red, unsigned char green, unsigned char blue) + + Sets the RGB intensity values. + """ return _gdi.Colour_Set(*args, **kwargs) def SetRGB(*args, **kwargs): - """SetRGB(unsigned long colRGB)""" + """ + SetRGB(unsigned long colRGB) + + Sets the RGB intensity values from a packed RGB value. + """ return _gdi.Colour_SetRGB(*args, **kwargs) + def SetFromName(*args, **kwargs): + """ + SetFromName(String colourName) + + Sets the RGB intensity values using a colour name listed in wx.TheColourDatabase. + """ + return _gdi.Colour_SetFromName(*args, **kwargs) + + def GetPixel(*args, **kwargs): + """ + GetPixel() -> long + + Returns a pixel value which is platform-dependent. On Windows, a + COLORREF is returned. On X, an allocated pixel value is returned. + -1 is returned if the pixel is invalid (on X, unallocated). + """ + return _gdi.Colour_GetPixel(*args, **kwargs) + def __eq__(*args, **kwargs): - """__eq__(Colour colour) -> bool""" + """ + __eq__(Colour colour) -> bool + + Compare colours for equality + """ return _gdi.Colour___eq__(*args, **kwargs) def __ne__(*args, **kwargs): - """__ne__(Colour colour) -> bool""" - return _gdi.Colour___ne__(*args, **kwargs) + """ + __ne__(Colour colour) -> bool - def InitFromName(*args, **kwargs): - """InitFromName(String colourName)""" - return _gdi.Colour_InitFromName(*args, **kwargs) + Compare colours for inequality + """ + return _gdi.Colour___ne__(*args, **kwargs) def Get(*args, **kwargs): - """Get() -> PyObject""" + """ + Get() -> (r, g, b) + + Returns the RGB intensity values as a tuple. + """ return _gdi.Colour_Get(*args, **kwargs) + def GetRGB(*args, **kwargs): + """ + GetRGB() -> unsigned long + + Return the colour as a packed RGB value + """ + return _gdi.Colour_GetRGB(*args, **kwargs) + asTuple = Get def __str__(self): return str(self.asTuple()) def __repr__(self): return 'wx.Colour' + str(self.asTuple()) @@ -115,13 +195,21 @@ class ColourPtr(Colour): _gdi.Colour_swigregister(ColourPtr) def NamedColour(*args, **kwargs): - """NamedColour(String colorName) -> Colour""" + """ + NamedColour(String colorName) -> Colour + + Constructs a colour object using a colour name listed in wx.TheColourDatabase. + """ val = _gdi.new_NamedColour(*args, **kwargs) val.thisown = 1 return val def ColourRGB(*args, **kwargs): - """ColourRGB(unsigned long colRGB) -> Colour""" + """ + ColourRGB(unsigned long colRGB) -> Colour + + Constructs a colour from a packed RGB value. + """ val = _gdi.new_ColourRGB(*args, **kwargs) val.thisown = 1 return val @@ -236,9 +324,13 @@ class Pen(GDIObject): return _gdi.Pen_GetDashes(*args, **kwargs) def __eq__(*args, **kwargs): - """__eq__(Pen pen) -> bool""" + """__eq__(Pen other) -> bool""" return _gdi.Pen___eq__(*args, **kwargs) + def __ne__(*args, **kwargs): + """__ne__(Pen other) -> bool""" + return _gdi.Pen___ne__(*args, **kwargs) + def GetDashCount(*args, **kwargs): """GetDashCount() -> int""" return _gdi.Pen_GetDashCount(*args, **kwargs) @@ -1491,11 +1583,11 @@ class Font(GDIObject): def __nonzero__(self): return self.Ok() def __eq__(*args, **kwargs): - """__eq__(Font font) -> bool""" + """__eq__(Font other) -> bool""" return _gdi.Font___eq__(*args, **kwargs) def __ne__(*args, **kwargs): - """__ne__(Font font) -> bool""" + """__ne__(Font other) -> bool""" return _gdi.Font___ne__(*args, **kwargs) def GetPointSize(*args, **kwargs): @@ -2894,16 +2986,13 @@ def MemoryDCFromDC(*args, **kwargs): #--------------------------------------------------------------------------- -BUFFER_DC_OVERWRITE_BG = _gdi.BUFFER_DC_OVERWRITE_BG -BUFFER_DC_PRESERVE_BG = _gdi.BUFFER_DC_PRESERVE_BG -BUFFER_DC_DEFAULT = _gdi.BUFFER_DC_DEFAULT class BufferedDC(MemoryDC): def __repr__(self): return "<%s.%s; proxy of C++ wxBufferedDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args): """ __init__(DC dc, Bitmap buffer) -> BufferedDC - __init__(DC dc, Size area, int flags=BUFFER_DC_DEFAULT) -> BufferedDC + __init__(DC dc, Size area) -> BufferedDC """ newobj = _gdi.new_BufferedDC(*args) self.this = newobj.this @@ -2911,6 +3000,12 @@ class BufferedDC(MemoryDC): del newobj.thisown self._dc = args[0] # save a ref so the other dc will not be deleted before self + def __del__(self, destroy=_gdi.delete_BufferedDC): + """__del__()""" + try: + if self.thisown: destroy(self) + except: pass + def UnMask(*args, **kwargs): """UnMask()""" return _gdi.BufferedDC_UnMask(*args, **kwargs) @@ -2924,7 +3019,7 @@ class BufferedDCPtr(BufferedDC): _gdi.BufferedDC_swigregister(BufferedDCPtr) def BufferedDCInternalBuffer(*args): - """BufferedDCInternalBuffer(DC dc, Size area, int flags=BUFFER_DC_DEFAULT) -> BufferedDC""" + """BufferedDCInternalBuffer(DC dc, Size area) -> BufferedDC""" val = _gdi.new_BufferedDCInternalBuffer(*args) val.thisown = 1 val._dc = args[0] # save a ref so the other dc will not be deleted before self @@ -2933,12 +3028,9 @@ def BufferedDCInternalBuffer(*args): class BufferedPaintDC(BufferedDC): def __repr__(self): return "<%s.%s; proxy of C++ wxBufferedPaintDC instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args): - """ - __init__(Window window, Bitmap buffer) -> BufferedPaintDC - __init__(Window window, int flags=BUFFER_DC_DEFAULT) -> BufferedPaintDC - """ - newobj = _gdi.new_BufferedPaintDC(*args) + def __init__(self, *args, **kwargs): + """__init__(Window window, Bitmap buffer=NullBitmap) -> BufferedPaintDC""" + newobj = _gdi.new_BufferedPaintDC(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown diff --git a/wxPython/src/msw/gdi_wrap.cpp b/wxPython/src/msw/gdi_wrap.cpp index d8c84481f6..d10d694271 100644 --- a/wxPython/src/msw/gdi_wrap.cpp +++ b/wxPython/src/msw/gdi_wrap.cpp @@ -371,6 +371,17 @@ PyObject *wxColour_Get(wxColour *self){ PyTuple_SetItem(rv, 2, PyInt_FromLong(blue)); return rv; } +unsigned long wxColour_GetRGB(wxColour *self){ + return self->Red() | (self->Green() << 8) | (self->Blue() << 16); + } + +SWIGSTATIC(PyObject* ) +SWIG_PyObj_FromUnsignedLong(unsigned long value) +{ + return (value > (unsigned long)(LONG_MAX)) ? + PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)value); +} + SWIGSTATIC(int) SWIG_PyObj_AsInt(PyObject *obj) @@ -416,6 +427,8 @@ PyObject *wxPen_GetDashes(wxPen *self){ wxPyEndBlockThreads(); return retval; } +bool wxPen___eq__(wxPen *self,wxPen const *other){ return other ? (*self == *other) : False; } +bool wxPen___ne__(wxPen *self,wxPen const *other){ return other ? (*self != *other) : True; } wxPyPen::~wxPyPen() { @@ -570,14 +583,6 @@ wxString wxNativeFontInfo___str__(wxNativeFontInfo *self){ bool wxTestFontEncoding(const wxNativeEncodingInfo& info) { wxPyRaiseNotImplemented(); return False; } - -SWIGSTATIC(PyObject* ) -SWIG_PyObj_FromUnsignedLong(unsigned long value) -{ - return (value > (unsigned long)(LONG_MAX)) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)value); -} - PyObject *wxFontMapper_GetAltForEncoding(wxFontMapper *self,wxFontEncoding encoding,wxString const &facename,bool interactive){ wxFontEncoding alt_enc; if (self->GetAltForEncoding(encoding, &alt_enc, facename, interactive)) @@ -595,6 +600,8 @@ wxFont *new_wxFont(wxString const &info){ wxFont *new_wxFont(int pointSize,wxFontFamily family,int flags,wxString const &face,wxFontEncoding encoding){ return wxFont::New(pointSize, family, flags, face, encoding); } +bool wxFont___eq__(wxFont *self,wxFont const *other){ return other ? (*self == *other) : False; } +bool wxFont___ne__(wxFont *self,wxFont const *other){ return other ? (*self != *other) : True; } class wxPyFontEnumerator : public wxFontEnumerator { public: @@ -692,6 +699,93 @@ static void wxDC_GetBoundingBox(wxDC* dc, int* x1, int* y1, int* x2, int* y2) { } +//-=-=-=-=-=-=-=-=-=-=- +#if 0 +#include +#else + + +// Temporarily put a set of classes here similar to the old buffered DC +// classes until the real ones can be fixed to work "correctly" again. + +class wxBufferedDC : public wxMemoryDC +{ +private: + wxDC *m_dc; + wxBitmap m_buffer; + +public: + + wxBufferedDC() : m_dc( 0 ) {} + + wxBufferedDC( wxDC *dc, const wxBitmap &buffer ) + : m_dc( dc ), m_buffer( buffer ) + { + SelectObject( m_buffer ); + } + + wxBufferedDC( wxDC *dc, const wxSize &area ) + : m_dc( dc ), m_buffer( area.GetWidth(), area.GetHeight() ) + { + SelectObject( m_buffer ); + } + + ~wxBufferedDC() { + if( m_dc != 0 ) + UnMask(); + } + + + void Init( wxDC *dc, const wxBitmap &buffer ) { + wxASSERT_MSG( m_dc == 0 && m_buffer == wxNullBitmap, + _T("wxBufferedDC already initialised") ); + m_dc = dc; + m_buffer = buffer; + SelectObject( m_buffer ); + } + + void Init( wxDC *dc, const wxSize &area ) { + wxASSERT_MSG( m_dc == 0 && m_buffer == wxNullBitmap, + _T("wxBufferedDC already initialised") ); + m_dc = dc; + m_buffer = wxBitmap( area.GetWidth(), area.GetHeight() ); + SelectObject( m_buffer ); + } + + void UnMask() { + wxASSERT_MSG( m_dc != 0, _T("No low level DC associated with buffer (anymore)") ); + m_dc->Blit( 0, 0, m_buffer.GetWidth(), m_buffer.GetHeight(), this, 0, 0 ); + m_dc = 0; + } +}; + + +class wxBufferedPaintDC : public wxBufferedDC +{ +private: + wxPaintDC m_paintdc; + +public: + wxBufferedPaintDC( wxWindow *window, const wxBitmap &buffer = wxNullBitmap ) + : m_paintdc( window ) + { + window->PrepareDC( m_paintdc ); + + if( buffer != wxNullBitmap ) + Init( &m_paintdc, buffer ); + else + Init( &m_paintdc, window->GetClientSize() ); + } + + ~wxBufferedPaintDC() { + UnMask(); + } +}; + +#endif +//-=-=-=-=-=-=-=-=-=-=- + + #include @@ -887,30 +981,6 @@ static PyObject *_wrap_new_Colour(PyObject *self, PyObject *args, PyObject *kwar } -static PyObject *_wrap_delete_Colour(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxColour *arg1 = (wxColour *) 0 ; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_Colour",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxColour,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - delete arg1; - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; -} - - static PyObject *_wrap_new_NamedColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxString *arg1 = 0 ; @@ -977,6 +1047,30 @@ static PyObject *_wrap_new_ColourRGB(PyObject *self, PyObject *args, PyObject *k } +static PyObject *_wrap_delete_Colour(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxColour *arg1 = (wxColour *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_Colour",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxColour,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete arg1; + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Colour_Red(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxColour *arg1 = (wxColour *) 0 ; @@ -1149,6 +1243,71 @@ static PyObject *_wrap_Colour_SetRGB(PyObject *self, PyObject *args, PyObject *k } +static PyObject *_wrap_Colour_SetFromName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxColour *arg1 = (wxColour *) 0 ; + wxString *arg2 = 0 ; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "colourName", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Colour_SetFromName",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxColour,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->InitFromName((wxString const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_Colour_GetPixel(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxColour *arg1 = (wxColour *) 0 ; + long result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Colour_GetPixel",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxColour,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (long)((wxColour const *)arg1)->GetPixel(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_PyObj_FromLong((long)result); + return resultobj; + fail: + return NULL; +} + + static PyObject *_wrap_Colour___eq__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxColour *arg1 = (wxColour *) 0 ; @@ -1213,65 +1372,50 @@ static PyObject *_wrap_Colour___ne__(PyObject *self, PyObject *args, PyObject *k } -static PyObject *_wrap_Colour_InitFromName(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_Colour_Get(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxColour *arg1 = (wxColour *) 0 ; - wxString *arg2 = 0 ; - bool temp2 = False ; + PyObject *result; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "colourName", NULL + (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Colour_InitFromName",kwnames,&obj0,&obj1)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Colour_Get",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxColour,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - arg2 = wxString_in_helper(obj1); - if (arg2 == NULL) SWIG_fail; - temp2 = True; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->InitFromName((wxString const &)*arg2); + result = (PyObject *)wxColour_Get(arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - Py_INCREF(Py_None); resultobj = Py_None; - { - if (temp2) - delete arg2; - } + resultobj = result; return resultobj; fail: - { - if (temp2) - delete arg2; - } return NULL; } -static PyObject *_wrap_Colour_Get(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_Colour_GetRGB(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxColour *arg1 = (wxColour *) 0 ; - PyObject *result; + unsigned long result; PyObject * obj0 = 0 ; char *kwnames[] = { (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Colour_Get",kwnames,&obj0)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:Colour_GetRGB",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxColour,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (PyObject *)wxColour_Get(arg1); + result = (unsigned long)wxColour_GetRGB(arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result; + resultobj = SWIG_PyObj_FromUnsignedLong((unsigned long)result); return resultobj; fail: return NULL; @@ -1913,23 +2057,48 @@ static PyObject *_wrap_Pen_GetDashes(PyObject *self, PyObject *args, PyObject *k static PyObject *_wrap_Pen___eq__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxPen *arg1 = (wxPen *) 0 ; - wxPen *arg2 = 0 ; + wxPen *arg2 = (wxPen *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "pen", NULL + (char *) "self",(char *) "other", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Pen___eq__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)wxPen___eq__(arg1,(wxPen const *)arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; } + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_Pen___ne__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPen *arg1 = (wxPen *) 0 ; + wxPen *arg2 = (wxPen *) 0 ; + bool result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "other", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Pen___ne__",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxPen,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)(arg1)->operator ==((wxPen const &)*arg2); + result = (bool)wxPen___ne__(arg1,(wxPen const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -7907,23 +8076,20 @@ static PyObject *_wrap_Font_Ok(PyObject *self, PyObject *args, PyObject *kwargs) static PyObject *_wrap_Font___eq__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxFont *arg1 = (wxFont *) 0 ; - wxFont *arg2 = 0 ; + wxFont *arg2 = (wxFont *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "font", NULL + (char *) "self",(char *) "other", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Font___eq__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxFont const *)arg1)->operator ==((wxFont const &)*arg2); + result = (bool)wxFont___eq__(arg1,(wxFont const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -7938,23 +8104,20 @@ static PyObject *_wrap_Font___eq__(PyObject *self, PyObject *args, PyObject *kwa static PyObject *_wrap_Font___ne__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxFont *arg1 = (wxFont *) 0 ; - wxFont *arg2 = 0 ; + wxFont *arg2 = (wxFont *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "font", NULL + (char *) "self",(char *) "other", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Font___ne__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxFont,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxFont const *)arg1)->operator !=((wxFont const &)*arg2); + result = (bool)wxFont___ne__(arg1,(wxFont const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -15168,28 +15331,20 @@ static PyObject *_wrap_new_BufferedDC__SWIG_1(PyObject *self, PyObject *args) { PyObject *resultobj; wxDC *arg1 = (wxDC *) 0 ; wxSize *arg2 = 0 ; - int arg3 = (int) wxBUFFER_DC_DEFAULT ; wxBufferedDC *result; wxSize temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - if(!PyArg_ParseTuple(args,(char *)"OO|O:new_BufferedDC",&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTuple(args,(char *)"OO:new_BufferedDC",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDC,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { arg2 = &temp2; if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail; } - if (obj2) { - { - arg3 = (int) SWIG_PyObj_AsInt(obj2); - if (PyErr_Occurred()) SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxBufferedDC *)new wxBufferedDC(arg1,(wxSize const &)*arg2,arg3); + result = (wxBufferedDC *)new wxBufferedDC(arg1,(wxSize const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -15203,11 +15358,11 @@ static PyObject *_wrap_new_BufferedDC__SWIG_1(PyObject *self, PyObject *args) { static PyObject *_wrap_new_BufferedDC(PyObject *self, PyObject *args) { int argc; - PyObject *argv[4]; + PyObject *argv[3]; int ii; argc = PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 3); ii++) { + for (ii = 0; (ii < argc) && (ii < 2); ii++) { argv[ii] = PyTuple_GetItem(args,ii); } if (argc == 2) { @@ -15236,7 +15391,7 @@ static PyObject *_wrap_new_BufferedDC(PyObject *self, PyObject *args) { } } } - if ((argc >= 2) && (argc <= 3)) { + if (argc == 2) { int _v; { void *ptr; @@ -15252,21 +15407,7 @@ static PyObject *_wrap_new_BufferedDC(PyObject *self, PyObject *args) { _v = wxPySimple_typecheck(argv[1], wxT("wxSize"), 2); } if (_v) { - if (argc <= 2) { - return _wrap_new_BufferedDC__SWIG_1(self,args); - } - { - SWIG_PyObj_AsInt(argv[2]); - if (PyErr_Occurred()) { - _v = 0; - PyErr_Clear(); - } else { - _v = 1; - } - } - if (_v) { - return _wrap_new_BufferedDC__SWIG_1(self,args); - } + return _wrap_new_BufferedDC__SWIG_1(self,args); } } } @@ -15280,28 +15421,20 @@ static PyObject *_wrap_new_BufferedDCInternalBuffer(PyObject *self, PyObject *ar PyObject *resultobj; wxDC *arg1 = (wxDC *) 0 ; wxSize *arg2 = 0 ; - int arg3 = (int) wxBUFFER_DC_DEFAULT ; wxBufferedDC *result; wxSize temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - if(!PyArg_ParseTuple(args,(char *)"OO|O:new_BufferedDCInternalBuffer",&obj0,&obj1,&obj2)) goto fail; + if(!PyArg_ParseTuple(args,(char *)"OO:new_BufferedDCInternalBuffer",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDC,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { arg2 = &temp2; if ( ! wxSize_helper(obj1, &arg2)) SWIG_fail; } - if (obj2) { - { - arg3 = (int) SWIG_PyObj_AsInt(obj2); - if (PyErr_Occurred()) SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxBufferedDC *)new wxBufferedDC(arg1,(wxSize const &)*arg2,arg3); + result = (wxBufferedDC *)new wxBufferedDC(arg1,(wxSize const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -15313,7 +15446,7 @@ static PyObject *_wrap_new_BufferedDCInternalBuffer(PyObject *self, PyObject *ar } -static PyObject *_wrap_BufferedDC_UnMask(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_delete_BufferedDC(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxBufferedDC *arg1 = (wxBufferedDC *) 0 ; PyObject * obj0 = 0 ; @@ -15321,11 +15454,11 @@ static PyObject *_wrap_BufferedDC_UnMask(PyObject *self, PyObject *args, PyObjec (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:BufferedDC_UnMask",kwnames,&obj0)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_BufferedDC",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxBufferedDC,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->UnMask(); + delete arg1; wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -15337,60 +15470,60 @@ static PyObject *_wrap_BufferedDC_UnMask(PyObject *self, PyObject *args, PyObjec } -static PyObject * BufferedDC_swigregister(PyObject *self, PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; - SWIG_TypeClientData(SWIGTYPE_p_wxBufferedDC, obj); - Py_INCREF(obj); - return Py_BuildValue((char *)""); -} -static PyObject *_wrap_new_BufferedPaintDC__SWIG_0(PyObject *self, PyObject *args) { +static PyObject *_wrap_BufferedDC_UnMask(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; - wxWindow *arg1 = (wxWindow *) 0 ; - wxBitmap *arg2 = 0 ; - wxBufferedPaintDC *result; + wxBufferedDC *arg1 = (wxBufferedDC *) 0 ; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; - if(!PyArg_ParseTuple(args,(char *)"OO:new_BufferedPaintDC",&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxBitmap,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:BufferedDC_UnMask",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxBufferedDC,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxBufferedPaintDC *)new wxBufferedPaintDC(arg1,(wxBitmap const &)*arg2); + (arg1)->UnMask(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxBufferedPaintDC, 1); + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } -static PyObject *_wrap_new_BufferedPaintDC__SWIG_1(PyObject *self, PyObject *args) { +static PyObject * BufferedDC_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxBufferedDC, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_new_BufferedPaintDC(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; - int arg2 = (int) wxBUFFER_DC_DEFAULT ; + wxBitmap const &arg2_defvalue = wxNullBitmap ; + wxBitmap *arg2 = (wxBitmap *) &arg2_defvalue ; wxBufferedPaintDC *result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "window",(char *) "buffer", NULL + }; - if(!PyArg_ParseTuple(args,(char *)"O|O:new_BufferedPaintDC",&obj0,&obj1)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:new_BufferedPaintDC",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if (obj1) { - { - arg2 = (int) SWIG_PyObj_AsInt(obj1); - if (PyErr_Occurred()) SWIG_fail; + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxBitmap,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; } } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxBufferedPaintDC *)new wxBufferedPaintDC(arg1,arg2); + result = (wxBufferedPaintDC *)new wxBufferedPaintDC(arg1,(wxBitmap const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -15402,76 +15535,6 @@ static PyObject *_wrap_new_BufferedPaintDC__SWIG_1(PyObject *self, PyObject *arg } -static PyObject *_wrap_new_BufferedPaintDC(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; - - argc = PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 2); ii++) { - argv[ii] = PyTuple_GetItem(args,ii); - } - if ((argc >= 1) && (argc <= 2)) { - int _v; - { - void *ptr; - if (SWIG_ConvertPtr(argv[0], (void **) &ptr, SWIGTYPE_p_wxWindow, 0) == -1) { - _v = 0; - PyErr_Clear(); - } else { - _v = 1; - } - } - if (_v) { - if (argc <= 1) { - return _wrap_new_BufferedPaintDC__SWIG_1(self,args); - } - { - SWIG_PyObj_AsInt(argv[1]); - if (PyErr_Occurred()) { - _v = 0; - PyErr_Clear(); - } else { - _v = 1; - } - } - if (_v) { - return _wrap_new_BufferedPaintDC__SWIG_1(self,args); - } - } - } - if (argc == 2) { - int _v; - { - void *ptr; - if (SWIG_ConvertPtr(argv[0], (void **) &ptr, SWIGTYPE_p_wxWindow, 0) == -1) { - _v = 0; - PyErr_Clear(); - } else { - _v = 1; - } - } - if (_v) { - { - void *ptr; - if (SWIG_ConvertPtr(argv[1], (void **) &ptr, SWIGTYPE_p_wxBitmap, 0) == -1) { - _v = 0; - PyErr_Clear(); - } else { - _v = 1; - } - } - if (_v) { - return _wrap_new_BufferedPaintDC__SWIG_0(self,args); - } - } - } - - PyErr_SetString(PyExc_TypeError,"No matching function for overloaded 'new_BufferedPaintDC'"); - return NULL; -} - - static PyObject * BufferedPaintDC_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -18486,19 +18549,21 @@ static PyMethodDef SwigMethods[] = { { (char *)"GDIObject_IsNull", (PyCFunction) _wrap_GDIObject_IsNull, METH_VARARGS | METH_KEYWORDS }, { (char *)"GDIObject_swigregister", GDIObject_swigregister, METH_VARARGS }, { (char *)"new_Colour", (PyCFunction) _wrap_new_Colour, METH_VARARGS | METH_KEYWORDS }, - { (char *)"delete_Colour", (PyCFunction) _wrap_delete_Colour, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_NamedColour", (PyCFunction) _wrap_new_NamedColour, METH_VARARGS | METH_KEYWORDS }, { (char *)"new_ColourRGB", (PyCFunction) _wrap_new_ColourRGB, METH_VARARGS | METH_KEYWORDS }, + { (char *)"delete_Colour", (PyCFunction) _wrap_delete_Colour, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_Red", (PyCFunction) _wrap_Colour_Red, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_Green", (PyCFunction) _wrap_Colour_Green, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_Blue", (PyCFunction) _wrap_Colour_Blue, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_Ok", (PyCFunction) _wrap_Colour_Ok, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_Set", (PyCFunction) _wrap_Colour_Set, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_SetRGB", (PyCFunction) _wrap_Colour_SetRGB, METH_VARARGS | METH_KEYWORDS }, + { (char *)"Colour_SetFromName", (PyCFunction) _wrap_Colour_SetFromName, METH_VARARGS | METH_KEYWORDS }, + { (char *)"Colour_GetPixel", (PyCFunction) _wrap_Colour_GetPixel, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour___eq__", (PyCFunction) _wrap_Colour___eq__, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour___ne__", (PyCFunction) _wrap_Colour___ne__, METH_VARARGS | METH_KEYWORDS }, - { (char *)"Colour_InitFromName", (PyCFunction) _wrap_Colour_InitFromName, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_Get", (PyCFunction) _wrap_Colour_Get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"Colour_GetRGB", (PyCFunction) _wrap_Colour_GetRGB, METH_VARARGS | METH_KEYWORDS }, { (char *)"Colour_swigregister", Colour_swigregister, METH_VARARGS }, { (char *)"new_Palette", (PyCFunction) _wrap_new_Palette, METH_VARARGS | METH_KEYWORDS }, { (char *)"delete_Palette", (PyCFunction) _wrap_delete_Palette, METH_VARARGS | METH_KEYWORDS }, @@ -18522,6 +18587,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"Pen_SetDashes", (PyCFunction) _wrap_Pen_SetDashes, METH_VARARGS | METH_KEYWORDS }, { (char *)"Pen_GetDashes", (PyCFunction) _wrap_Pen_GetDashes, METH_VARARGS | METH_KEYWORDS }, { (char *)"Pen___eq__", (PyCFunction) _wrap_Pen___eq__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"Pen___ne__", (PyCFunction) _wrap_Pen___ne__, METH_VARARGS | METH_KEYWORDS }, { (char *)"Pen_GetDashCount", (PyCFunction) _wrap_Pen_GetDashCount, METH_VARARGS | METH_KEYWORDS }, { (char *)"Pen_GetStipple", (PyCFunction) _wrap_Pen_GetStipple, METH_VARARGS | METH_KEYWORDS }, { (char *)"Pen_SetStipple", (PyCFunction) _wrap_Pen_SetStipple, METH_VARARGS | METH_KEYWORDS }, @@ -18931,9 +18997,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"MemoryDC_swigregister", MemoryDC_swigregister, METH_VARARGS }, { (char *)"new_BufferedDC", _wrap_new_BufferedDC, METH_VARARGS }, { (char *)"new_BufferedDCInternalBuffer", _wrap_new_BufferedDCInternalBuffer, METH_VARARGS }, + { (char *)"delete_BufferedDC", (PyCFunction) _wrap_delete_BufferedDC, METH_VARARGS | METH_KEYWORDS }, { (char *)"BufferedDC_UnMask", (PyCFunction) _wrap_BufferedDC_UnMask, METH_VARARGS | METH_KEYWORDS }, { (char *)"BufferedDC_swigregister", BufferedDC_swigregister, METH_VARARGS }, - { (char *)"new_BufferedPaintDC", _wrap_new_BufferedPaintDC, METH_VARARGS }, + { (char *)"new_BufferedPaintDC", (PyCFunction) _wrap_new_BufferedPaintDC, METH_VARARGS | METH_KEYWORDS }, { (char *)"BufferedPaintDC_swigregister", BufferedPaintDC_swigregister, METH_VARARGS }, { (char *)"new_ScreenDC", (PyCFunction) _wrap_new_ScreenDC, METH_VARARGS | METH_KEYWORDS }, { (char *)"ScreenDC_StartDrawingOnTopWin", (PyCFunction) _wrap_ScreenDC_StartDrawingOnTopWin, METH_VARARGS | METH_KEYWORDS }, @@ -19944,9 +20011,6 @@ SWIGEXPORT(void) SWIG_init(void) { PyDict_SetItemString(d,"PLATFORM_WINDOWS", SWIG_PyObj_FromInt((int)wxPLATFORM_WINDOWS)); PyDict_SetItemString(d,"PLATFORM_OS2", SWIG_PyObj_FromInt((int)wxPLATFORM_OS2)); PyDict_SetItemString(d,"PLATFORM_MAC", SWIG_PyObj_FromInt((int)wxPLATFORM_MAC)); - PyDict_SetItemString(d,"BUFFER_DC_OVERWRITE_BG", SWIG_PyObj_FromInt((int)wxBUFFER_DC_OVERWRITE_BG)); - PyDict_SetItemString(d,"BUFFER_DC_PRESERVE_BG", SWIG_PyObj_FromInt((int)wxBUFFER_DC_PRESERVE_BG)); - PyDict_SetItemString(d,"BUFFER_DC_DEFAULT", SWIG_PyObj_FromInt((int)wxBUFFER_DC_DEFAULT)); PyDict_SetItemString(d,"IMAGELIST_DRAW_NORMAL", SWIG_PyObj_FromInt((int)wxIMAGELIST_DRAW_NORMAL)); PyDict_SetItemString(d,"IMAGELIST_DRAW_TRANSPARENT", SWIG_PyObj_FromInt((int)wxIMAGELIST_DRAW_TRANSPARENT)); PyDict_SetItemString(d,"IMAGELIST_DRAW_SELECTED", SWIG_PyObj_FromInt((int)wxIMAGELIST_DRAW_SELECTED)); diff --git a/wxPython/src/msw/grid_wrap.cpp b/wxPython/src/msw/grid_wrap.cpp index aa95d6659c..54e82855a0 100644 --- a/wxPython/src/msw/grid_wrap.cpp +++ b/wxPython/src/msw/grid_wrap.cpp @@ -1223,15 +1223,14 @@ public: }; void wxPyGridTableBase_Destroy(wxPyGridTableBase *self){ delete self; } -PyObject *wxGridCellCoords_asTuple(wxGridCellCoords *self){ - PyObject* tup = PyTuple_New(2); - PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->GetRow())); - PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->GetCol())); - return tup; - } bool wxGridCellCoords_helper(PyObject* source, wxGridCellCoords** obj) { + if (source == Py_None) { + **obj = wxGridCellCoords(-1,-1); + return True; + } + // If source is an object instance then it may already be the right type if (wxPySwigInstance_Check(source)) { wxGridCellCoords* ptr; @@ -1291,6 +1290,12 @@ PyObject* wxGridCellCoordsArray_helper(const wxGridCellCoordsArray& source) return list; } +PyObject *wxGridCellCoords_asTuple(wxGridCellCoords *self){ + PyObject* tup = PyTuple_New(2); + PyTuple_SET_ITEM(tup, 0, PyInt_FromLong(self->GetRow())); + PyTuple_SET_ITEM(tup, 1, PyInt_FromLong(self->GetCol())); + return tup; + } typedef wxGrid::wxGridSelectionModes WXGRIDSELECTIONMODES; @@ -7746,6 +7751,7 @@ static PyObject *_wrap_GridCellCoords___eq__(PyObject *self, PyObject *args, PyO wxGridCellCoords *arg1 = (wxGridCellCoords *) 0 ; wxGridCellCoords *arg2 = 0 ; bool result; + wxGridCellCoords temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { @@ -7754,9 +7760,9 @@ static PyObject *_wrap_GridCellCoords___eq__(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GridCellCoords___eq__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxGridCellCoords,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxGridCellCoords,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; + { + arg2 = &temp2; + if (! wxGridCellCoords_helper(obj1, &arg2)) SWIG_fail; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); @@ -7777,6 +7783,7 @@ static PyObject *_wrap_GridCellCoords___ne__(PyObject *self, PyObject *args, PyO wxGridCellCoords *arg1 = (wxGridCellCoords *) 0 ; wxGridCellCoords *arg2 = 0 ; bool result; + wxGridCellCoords temp2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { @@ -7785,9 +7792,9 @@ static PyObject *_wrap_GridCellCoords___ne__(PyObject *self, PyObject *args, PyO if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:GridCellCoords___ne__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxGridCellCoords,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxGridCellCoords,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; + { + arg2 = &temp2; + if (! wxGridCellCoords_helper(obj1, &arg2)) SWIG_fail; } { PyThreadState* __tstate = wxPyBeginAllowThreads(); diff --git a/wxPython/src/msw/misc.py b/wxPython/src/msw/misc.py index 6e38e457f8..f647c311c5 100644 --- a/wxPython/src/msw/misc.py +++ b/wxPython/src/msw/misc.py @@ -2478,6 +2478,26 @@ CONFIG_USE_GLOBAL_FILE = _misc.CONFIG_USE_GLOBAL_FILE CONFIG_USE_RELATIVE_PATH = _misc.CONFIG_USE_RELATIVE_PATH CONFIG_USE_NO_ESCAPE_CHARACTERS = _misc.CONFIG_USE_NO_ESCAPE_CHARACTERS class ConfigBase(object): + """ + wx.ConfigBase class defines the basic interface of all config + classes. It can not be used by itself (it is an abstract base + class) and you will always use one of its derivations: wx.Config + or wx.FileConfig. + + wx.ConfigBase organizes the items in a tree-like structure + (modeled after the Unix/Dos filesystem). There are groups + (directories) and keys (files). There is always one current + group given by the current path. As in the file system case, to + specify a key in the config class you must use a path to it. + Config classes also support the notion of the current group, + which makes it possible to use relative paths. + + Keys are pairs "key_name = value" where value may be of string, integer + floating point or boolean, you can not store binary data without first + encoding it as a string. For performance reasons items should be kept small, + no more than a couple kilobytes. + + """ def __init__(self): raise RuntimeError, "No constructor defined" def __repr__(self): return "<%s.%s; proxy of C++ wxConfigBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) @@ -2493,147 +2513,311 @@ class ConfigBase(object): Type_Integer = _misc.ConfigBase_Type_Integer Type_Float = _misc.ConfigBase_Type_Float def Set(*args, **kwargs): - """Set(ConfigBase pConfig) -> ConfigBase""" + """ + Set(ConfigBase config) -> ConfigBase + + Sets the global config object (the one returned by Get) and + returns a reference to the previous global config object. + """ return _misc.ConfigBase_Set(*args, **kwargs) Set = staticmethod(Set) def Get(*args, **kwargs): - """Get(bool createOnDemand=True) -> ConfigBase""" + """ + Get(bool createOnDemand=True) -> ConfigBase + + Returns the current global config object, creating one if neccessary. + """ return _misc.ConfigBase_Get(*args, **kwargs) Get = staticmethod(Get) def Create(*args, **kwargs): - """Create() -> ConfigBase""" + """ + Create() -> ConfigBase + + Create and return a new global config object. This function will + create the "best" implementation of wx.Config available for the + current platform. + """ return _misc.ConfigBase_Create(*args, **kwargs) Create = staticmethod(Create) def DontCreateOnDemand(*args, **kwargs): - """DontCreateOnDemand()""" + """ + DontCreateOnDemand() + + Should Get() try to create a new log object if there isn't a current one? + """ return _misc.ConfigBase_DontCreateOnDemand(*args, **kwargs) DontCreateOnDemand = staticmethod(DontCreateOnDemand) def SetPath(*args, **kwargs): - """SetPath(String strPath)""" + """ + SetPath(String path) + + Set current path: if the first character is '/', it's the absolute path, + otherwise it's a relative path. '..' is supported. If the strPath + doesn't exist it is created. + """ return _misc.ConfigBase_SetPath(*args, **kwargs) def GetPath(*args, **kwargs): - """GetPath() -> String""" + """ + GetPath() -> String + + Retrieve the current path (always as absolute path) + """ return _misc.ConfigBase_GetPath(*args, **kwargs) def GetFirstGroup(*args, **kwargs): - """GetFirstGroup() -> PyObject""" + """ + GetFirstGroup() -> (more, value, index) + + Allows enumerating the subgroups in a config object. Returns + a tuple containing a flag indicating there are more items, the + name of the current item, and an index to pass to GetNextGroup to + fetch the next item. + """ return _misc.ConfigBase_GetFirstGroup(*args, **kwargs) def GetNextGroup(*args, **kwargs): - """GetNextGroup(long index) -> PyObject""" + """ + GetNextGroup(long index) -> (more, value, index) + + Allows enumerating the subgroups in a config object. Returns + a tuple containing a flag indicating there are more items, the + name of the current item, and an index to pass to GetNextGroup to + fetch the next item. + """ return _misc.ConfigBase_GetNextGroup(*args, **kwargs) def GetFirstEntry(*args, **kwargs): - """GetFirstEntry() -> PyObject""" + """ + GetFirstEntry() -> (more, value, index) + + Allows enumerating the entries in the current group in a config + object. Returns a tuple containing a flag indicating there are + more items, the name of the current item, and an index to pass to + GetNextGroup to fetch the next item. + """ return _misc.ConfigBase_GetFirstEntry(*args, **kwargs) def GetNextEntry(*args, **kwargs): - """GetNextEntry(long index) -> PyObject""" + """ + GetNextEntry(long index) -> (more, value, index) + + Allows enumerating the entries in the current group in a config + object. Returns a tuple containing a flag indicating there are + more items, the name of the current item, and an index to pass to + GetNextGroup to fetch the next item. + """ return _misc.ConfigBase_GetNextEntry(*args, **kwargs) def GetNumberOfEntries(*args, **kwargs): - """GetNumberOfEntries(bool bRecursive=False) -> size_t""" + """ + GetNumberOfEntries(bool recursive=False) -> size_t + + Get the number of entries in the current group, with or + without its subgroups. + """ return _misc.ConfigBase_GetNumberOfEntries(*args, **kwargs) def GetNumberOfGroups(*args, **kwargs): - """GetNumberOfGroups(bool bRecursive=False) -> size_t""" + """ + GetNumberOfGroups(bool recursive=False) -> size_t + + Get the number of subgroups in the current group, with or + without its subgroups. + """ return _misc.ConfigBase_GetNumberOfGroups(*args, **kwargs) def HasGroup(*args, **kwargs): - """HasGroup(String strName) -> bool""" + """ + HasGroup(String name) -> bool + + Returns True if the group by this name exists + """ return _misc.ConfigBase_HasGroup(*args, **kwargs) def HasEntry(*args, **kwargs): - """HasEntry(String strName) -> bool""" + """ + HasEntry(String name) -> bool + + Returns True if the entry by this name exists + """ return _misc.ConfigBase_HasEntry(*args, **kwargs) def Exists(*args, **kwargs): - """Exists(String strName) -> bool""" + """ + Exists(String name) -> bool + + Returns True if either a group or an entry with a given name exists + """ return _misc.ConfigBase_Exists(*args, **kwargs) def GetEntryType(*args, **kwargs): - """GetEntryType(String name) -> int""" + """ + GetEntryType(String name) -> int + + Get the type of the entry. Returns one of the wx.Config.Type_XXX values. + """ return _misc.ConfigBase_GetEntryType(*args, **kwargs) def Read(*args, **kwargs): - """Read(String key, String defaultVal=EmptyString) -> String""" + """ + Read(String key, String defaultVal=EmptyString) -> String + + Returns the value of key if it exists, defaultVal otherwise. + """ return _misc.ConfigBase_Read(*args, **kwargs) def ReadInt(*args, **kwargs): - """ReadInt(String key, long defaultVal=0) -> long""" + """ + ReadInt(String key, long defaultVal=0) -> long + + Returns the value of key if it exists, defaultVal otherwise. + """ return _misc.ConfigBase_ReadInt(*args, **kwargs) def ReadFloat(*args, **kwargs): - """ReadFloat(String key, double defaultVal=0.0) -> double""" + """ + ReadFloat(String key, double defaultVal=0.0) -> double + + Returns the value of key if it exists, defaultVal otherwise. + """ return _misc.ConfigBase_ReadFloat(*args, **kwargs) def ReadBool(*args, **kwargs): - """ReadBool(String key, bool defaultVal=False) -> bool""" + """ + ReadBool(String key, bool defaultVal=False) -> bool + + Returns the value of key if it exists, defaultVal otherwise. + """ return _misc.ConfigBase_ReadBool(*args, **kwargs) def Write(*args, **kwargs): - """Write(String key, String value) -> bool""" + """ + Write(String key, String value) -> bool + + write the value (return True on success) + """ return _misc.ConfigBase_Write(*args, **kwargs) def WriteInt(*args, **kwargs): - """WriteInt(String key, long value) -> bool""" + """ + WriteInt(String key, long value) -> bool + + write the value (return True on success) + """ return _misc.ConfigBase_WriteInt(*args, **kwargs) def WriteFloat(*args, **kwargs): - """WriteFloat(String key, double value) -> bool""" + """ + WriteFloat(String key, double value) -> bool + + write the value (return True on success) + """ return _misc.ConfigBase_WriteFloat(*args, **kwargs) def WriteBool(*args, **kwargs): - """WriteBool(String key, bool value) -> bool""" + """ + WriteBool(String key, bool value) -> bool + + write the value (return True on success) + """ return _misc.ConfigBase_WriteBool(*args, **kwargs) def Flush(*args, **kwargs): - """Flush(bool bCurrentOnly=False) -> bool""" + """ + Flush(bool currentOnly=False) -> bool + + permanently writes all changes + """ return _misc.ConfigBase_Flush(*args, **kwargs) def RenameEntry(*args, **kwargs): - """RenameEntry(String oldName, String newName) -> bool""" + """ + RenameEntry(String oldName, String newName) -> bool + + Rename an entry. Returns False on failure (probably because the new + name is already taken by an existing entry) + """ return _misc.ConfigBase_RenameEntry(*args, **kwargs) def RenameGroup(*args, **kwargs): - """RenameGroup(String oldName, String newName) -> bool""" + """ + RenameGroup(String oldName, String newName) -> bool + + Rename aa group. Returns False on failure (probably because the new + name is already taken by an existing entry) + """ return _misc.ConfigBase_RenameGroup(*args, **kwargs) def DeleteEntry(*args, **kwargs): - """DeleteEntry(String key, bool bDeleteGroupIfEmpty=True) -> bool""" + """ + DeleteEntry(String key, bool deleteGroupIfEmpty=True) -> bool + + Deletes the specified entry and the group it belongs to if + it was the last key in it and the second parameter is True + """ return _misc.ConfigBase_DeleteEntry(*args, **kwargs) def DeleteGroup(*args, **kwargs): - """DeleteGroup(String key) -> bool""" + """ + DeleteGroup(String key) -> bool + + Delete the group (with all subgroups) + """ return _misc.ConfigBase_DeleteGroup(*args, **kwargs) def DeleteAll(*args, **kwargs): - """DeleteAll() -> bool""" - return _misc.ConfigBase_DeleteAll(*args, **kwargs) + """ + DeleteAll() -> bool - def IsExpandingEnvVars(*args, **kwargs): - """IsExpandingEnvVars() -> bool""" - return _misc.ConfigBase_IsExpandingEnvVars(*args, **kwargs) + Delete the whole underlying object (disk file, registry key, ...) + primarly intended for use by desinstallation routine. + """ + return _misc.ConfigBase_DeleteAll(*args, **kwargs) def SetExpandEnvVars(*args, **kwargs): - """SetExpandEnvVars(bool bDoIt=True)""" + """ + SetExpandEnvVars(bool doIt=True) + + We can automatically expand environment variables in the config entries + (this option is on by default, you can turn it on/off at any time) + """ return _misc.ConfigBase_SetExpandEnvVars(*args, **kwargs) + def IsExpandingEnvVars(*args, **kwargs): + """ + IsExpandingEnvVars() -> bool + + Are we currently expanding environment variables? + """ + return _misc.ConfigBase_IsExpandingEnvVars(*args, **kwargs) + def SetRecordDefaults(*args, **kwargs): - """SetRecordDefaults(bool bDoIt=True)""" + """ + SetRecordDefaults(bool doIt=True) + + Set whether the config objec should record default values. + """ return _misc.ConfigBase_SetRecordDefaults(*args, **kwargs) def IsRecordingDefaults(*args, **kwargs): - """IsRecordingDefaults() -> bool""" + """ + IsRecordingDefaults() -> bool + + Are we currently recording default values? + """ return _misc.ConfigBase_IsRecordingDefaults(*args, **kwargs) def ExpandEnvVars(*args, **kwargs): - """ExpandEnvVars(String str) -> String""" + """ + ExpandEnvVars(String str) -> String + + Expand any environment variables in str and return the result + """ return _misc.ConfigBase_ExpandEnvVars(*args, **kwargs) def GetAppName(*args, **kwargs): @@ -2669,49 +2853,45 @@ class ConfigBasePtr(ConfigBase): _misc.ConfigBase_swigregister(ConfigBasePtr) def ConfigBase_Set(*args, **kwargs): - """ConfigBase_Set(ConfigBase pConfig) -> ConfigBase""" + """ + ConfigBase_Set(ConfigBase config) -> ConfigBase + + Sets the global config object (the one returned by Get) and + returns a reference to the previous global config object. + """ return _misc.ConfigBase_Set(*args, **kwargs) def ConfigBase_Get(*args, **kwargs): - """ConfigBase_Get(bool createOnDemand=True) -> ConfigBase""" + """ + ConfigBase_Get(bool createOnDemand=True) -> ConfigBase + + Returns the current global config object, creating one if neccessary. + """ return _misc.ConfigBase_Get(*args, **kwargs) def ConfigBase_Create(*args, **kwargs): - """ConfigBase_Create() -> ConfigBase""" + """ + ConfigBase_Create() -> ConfigBase + + Create and return a new global config object. This function will + create the "best" implementation of wx.Config available for the + current platform. + """ return _misc.ConfigBase_Create(*args, **kwargs) def ConfigBase_DontCreateOnDemand(*args, **kwargs): - """ConfigBase_DontCreateOnDemand()""" - return _misc.ConfigBase_DontCreateOnDemand(*args, **kwargs) - -class ConfigPathChanger(object): - def __repr__(self): - return "<%s.%s; proxy of C++ wxConfigPathChanger instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args, **kwargs): - """__init__(ConfigBase pContainer, String strEntry) -> ConfigPathChanger""" - newobj = _misc.new_ConfigPathChanger(*args, **kwargs) - self.this = newobj.this - self.thisown = 1 - del newobj.thisown - def __del__(self, destroy=_misc.delete_ConfigPathChanger): - """__del__()""" - try: - if self.thisown: destroy(self) - except: pass - - def Name(*args, **kwargs): - """Name() -> String""" - return _misc.ConfigPathChanger_Name(*args, **kwargs) - + """ + ConfigBase_DontCreateOnDemand() -class ConfigPathChangerPtr(ConfigPathChanger): - def __init__(self, this): - self.this = this - if not hasattr(self,"thisown"): self.thisown = 0 - self.__class__ = ConfigPathChanger -_misc.ConfigPathChanger_swigregister(ConfigPathChangerPtr) + Should Get() try to create a new log object if there isn't a current one? + """ + return _misc.ConfigBase_DontCreateOnDemand(*args, **kwargs) class Config(ConfigBase): + """ + This ConfigBase-derived class will use the registry on Windows, + and will be a wx.FileConfig on other platforms. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxConfig instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -2739,6 +2919,7 @@ class ConfigPtr(Config): _misc.Config_swigregister(ConfigPtr) class FileConfig(ConfigBase): + """This config class will use a file for storage on all platforms.""" def __repr__(self): return "<%s.%s; proxy of C++ wxFileConfig instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -2765,9 +2946,53 @@ class FileConfigPtr(FileConfig): self.__class__ = FileConfig _misc.FileConfig_swigregister(FileConfigPtr) +class ConfigPathChanger(object): + """ + A handy little class which changes current path to the path of + given entry and restores it in the destructoir: so if you declare + a local variable of this type, you work in the entry directory + and the path is automatically restored when the function returns. + """ + def __repr__(self): + return "<%s.%s; proxy of C++ wxConfigPathChanger instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """__init__(ConfigBase config, String entry) -> ConfigPathChanger""" + newobj = _misc.new_ConfigPathChanger(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + def __del__(self, destroy=_misc.delete_ConfigPathChanger): + """__del__()""" + try: + if self.thisown: destroy(self) + except: pass + + def Name(*args, **kwargs): + """ + Name() -> String + + Get the key name + """ + return _misc.ConfigPathChanger_Name(*args, **kwargs) + + +class ConfigPathChangerPtr(ConfigPathChanger): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = ConfigPathChanger +_misc.ConfigPathChanger_swigregister(ConfigPathChangerPtr) + def ExpandEnvVars(*args, **kwargs): - """ExpandEnvVars(String sz) -> String""" + """ + ExpandEnvVars(String sz) -> String + + Replace environment variables ($SOMETHING) with their values. The + format is $VARNAME or ${VARNAME} where VARNAME contains + alphanumeric characters and '_' only. '$' must be escaped ('\$') + in order to be taken literally. + """ return _misc.ExpandEnvVars(*args, **kwargs) #--------------------------------------------------------------------------- diff --git a/wxPython/src/msw/misc_wrap.cpp b/wxPython/src/msw/misc_wrap.cpp index dc2efa5b0d..599e916e4a 100644 --- a/wxPython/src/msw/misc_wrap.cpp +++ b/wxPython/src/msw/misc_wrap.cpp @@ -975,12 +975,12 @@ wxDateTime wxDateTime___add____SWIG_1(wxDateTime *self,wxDateSpan const &other){ wxTimeSpan wxDateTime___sub____SWIG_0(wxDateTime *self,wxDateTime const &other){ return *self - other; } wxDateTime wxDateTime___sub____SWIG_1(wxDateTime *self,wxTimeSpan const &other){ return *self - other; } wxDateTime wxDateTime___sub____SWIG_2(wxDateTime *self,wxDateSpan const &other){ return *self - other; } -bool wxDateTime___lt__(wxDateTime *self,wxDateTime const &other){ return *self < other; } -bool wxDateTime___le__(wxDateTime *self,wxDateTime const &other){ return *self <= other; } -bool wxDateTime___gt__(wxDateTime *self,wxDateTime const &other){ return *self > other; } -bool wxDateTime___ge__(wxDateTime *self,wxDateTime const &other){ return *self >= other; } -bool wxDateTime___eq__(wxDateTime *self,wxDateTime const &other){ return *self == other; } -bool wxDateTime___ne__(wxDateTime *self,wxDateTime const &other){ return *self != other; } +bool wxDateTime___lt__(wxDateTime *self,wxDateTime const *other){ return other ? (*self < *other) : False; } +bool wxDateTime___le__(wxDateTime *self,wxDateTime const *other){ return other ? (*self <= *other) : False; } +bool wxDateTime___gt__(wxDateTime *self,wxDateTime const *other){ return other ? (*self > *other) : True; } +bool wxDateTime___ge__(wxDateTime *self,wxDateTime const *other){ return other ? (*self >= *other) : True; } +bool wxDateTime___eq__(wxDateTime *self,wxDateTime const *other){ return other ? (*self == *other) : False; } +bool wxDateTime___ne__(wxDateTime *self,wxDateTime const *other){ return other ? (*self != *other) : True; } int wxDateTime_ParseRfc822Date(wxDateTime *self,wxString const &date){ const wxChar* rv; const wxChar* _date = date; @@ -1020,18 +1020,18 @@ wxTimeSpan wxTimeSpan___add__(wxTimeSpan *self,wxTimeSpan const &other){ return wxTimeSpan wxTimeSpan___sub__(wxTimeSpan *self,wxTimeSpan const &other){ return *self - other; } wxTimeSpan wxTimeSpan___mul__(wxTimeSpan *self,int n){ return *self * n; } wxTimeSpan wxTimeSpan___rmul__(wxTimeSpan *self,int n){ return n * *self; } -bool wxTimeSpan___lt__(wxTimeSpan *self,wxTimeSpan const &other){ return *self < other; } -bool wxTimeSpan___le__(wxTimeSpan *self,wxTimeSpan const &other){ return *self <= other; } -bool wxTimeSpan___gt__(wxTimeSpan *self,wxTimeSpan const &other){ return *self > other; } -bool wxTimeSpan___ge__(wxTimeSpan *self,wxTimeSpan const &other){ return *self >= other; } -bool wxTimeSpan___eq__(wxTimeSpan *self,wxTimeSpan const &other){ return *self == other; } -bool wxTimeSpan___ne__(wxTimeSpan *self,wxTimeSpan const &other){ return *self != other; } +bool wxTimeSpan___lt__(wxTimeSpan *self,wxTimeSpan const *other){ return other ? (*self < *other) : False; } +bool wxTimeSpan___le__(wxTimeSpan *self,wxTimeSpan const *other){ return other ? (*self <= *other) : False; } +bool wxTimeSpan___gt__(wxTimeSpan *self,wxTimeSpan const *other){ return other ? (*self > *other) : True; } +bool wxTimeSpan___ge__(wxTimeSpan *self,wxTimeSpan const *other){ return other ? (*self >= *other) : True; } +bool wxTimeSpan___eq__(wxTimeSpan *self,wxTimeSpan const *other){ return other ? (*self == *other) : False; } +bool wxTimeSpan___ne__(wxTimeSpan *self,wxTimeSpan const *other){ return other ? (*self != *other) : True; } wxDateSpan wxDateSpan___add__(wxDateSpan *self,wxDateSpan const &other){ return *self + other; } wxDateSpan wxDateSpan___sub__(wxDateSpan *self,wxDateSpan const &other){ return *self - other; } wxDateSpan wxDateSpan___mul__(wxDateSpan *self,int n){ return *self * n; } wxDateSpan wxDateSpan___rmul__(wxDateSpan *self,int n){ return n * *self; } -bool wxDateSpan___eq__(wxDateSpan *self,wxDateSpan const &other){ return *self == other; } -bool wxDateSpan___ne__(wxDateSpan *self,wxDateSpan const &other){ return *self != other; } +bool wxDateSpan___eq__(wxDateSpan *self,wxDateSpan const *other){ return other ? (*self == *other) : False; } +bool wxDateSpan___ne__(wxDateSpan *self,wxDateSpan const *other){ return other ? (*self != *other) : True; } #include @@ -14316,7 +14316,7 @@ static PyObject *_wrap_ConfigBase_Set(PyObject *self, PyObject *args, PyObject * wxConfigBase *result; PyObject * obj0 = 0 ; char *kwnames[] = { - (char *) "pConfig", NULL + (char *) "config", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ConfigBase_Set",kwnames,&obj0)) goto fail; @@ -14416,7 +14416,7 @@ static PyObject *_wrap_ConfigBase_SetPath(PyObject *self, PyObject *args, PyObje PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "strPath", NULL + (char *) "self",(char *) "path", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ConfigBase_SetPath",kwnames,&obj0,&obj1)) goto fail; @@ -14602,7 +14602,7 @@ static PyObject *_wrap_ConfigBase_GetNumberOfEntries(PyObject *self, PyObject *a PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "bRecursive", NULL + (char *) "self",(char *) "recursive", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_GetNumberOfEntries",kwnames,&obj0,&obj1)) goto fail; @@ -14635,7 +14635,7 @@ static PyObject *_wrap_ConfigBase_GetNumberOfGroups(PyObject *self, PyObject *ar PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "bRecursive", NULL + (char *) "self",(char *) "recursive", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_GetNumberOfGroups",kwnames,&obj0,&obj1)) goto fail; @@ -14669,7 +14669,7 @@ static PyObject *_wrap_ConfigBase_HasGroup(PyObject *self, PyObject *args, PyObj PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "strName", NULL + (char *) "self",(char *) "name", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ConfigBase_HasGroup",kwnames,&obj0,&obj1)) goto fail; @@ -14710,7 +14710,7 @@ static PyObject *_wrap_ConfigBase_HasEntry(PyObject *self, PyObject *args, PyObj PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "strName", NULL + (char *) "self",(char *) "name", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ConfigBase_HasEntry",kwnames,&obj0,&obj1)) goto fail; @@ -14751,7 +14751,7 @@ static PyObject *_wrap_ConfigBase_Exists(PyObject *self, PyObject *args, PyObjec PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "strName", NULL + (char *) "self",(char *) "name", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ConfigBase_Exists",kwnames,&obj0,&obj1)) goto fail; @@ -15243,7 +15243,7 @@ static PyObject *_wrap_ConfigBase_Flush(PyObject *self, PyObject *args, PyObject PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "bCurrentOnly", NULL + (char *) "self",(char *) "currentOnly", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_Flush",kwnames,&obj0,&obj1)) goto fail; @@ -15393,7 +15393,7 @@ static PyObject *_wrap_ConfigBase_DeleteEntry(PyObject *self, PyObject *args, Py PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "key",(char *) "bDeleteGroupIfEmpty", NULL + (char *) "self",(char *) "key",(char *) "deleteGroupIfEmpty", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:ConfigBase_DeleteEntry",kwnames,&obj0,&obj1,&obj2)) goto fail; @@ -15497,57 +15497,57 @@ static PyObject *_wrap_ConfigBase_DeleteAll(PyObject *self, PyObject *args, PyOb } -static PyObject *_wrap_ConfigBase_IsExpandingEnvVars(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_ConfigBase_SetExpandEnvVars(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxConfigBase *arg1 = (wxConfigBase *) 0 ; - bool result; + bool arg2 = (bool) True ; PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self", NULL + (char *) "self",(char *) "doIt", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ConfigBase_IsExpandingEnvVars",kwnames,&obj0)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_SetExpandEnvVars",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (obj1) { + { + arg2 = (bool) SWIG_PyObj_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + } + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)((wxConfigBase const *)arg1)->IsExpandingEnvVars(); + (arg1)->SetExpandEnvVars(arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); + Py_INCREF(Py_None); resultobj = Py_None; return resultobj; fail: return NULL; } -static PyObject *_wrap_ConfigBase_SetExpandEnvVars(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_ConfigBase_IsExpandingEnvVars(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxConfigBase *arg1 = (wxConfigBase *) 0 ; - bool arg2 = (bool) True ; + bool result; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "bDoIt", NULL + (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_SetExpandEnvVars",kwnames,&obj0,&obj1)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ConfigBase_IsExpandingEnvVars",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (obj1) { - { - arg2 = (bool) SWIG_PyObj_AsBool(obj1); - if (PyErr_Occurred()) SWIG_fail; - } - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - (arg1)->SetExpandEnvVars(arg2); + result = (bool)((wxConfigBase const *)arg1)->IsExpandingEnvVars(); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - Py_INCREF(Py_None); resultobj = Py_None; + resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj); return resultobj; fail: return NULL; @@ -15561,7 +15561,7 @@ static PyObject *_wrap_ConfigBase_SetRecordDefaults(PyObject *self, PyObject *ar PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *kwnames[] = { - (char *) "self",(char *) "bDoIt", NULL + (char *) "self",(char *) "doIt", NULL }; if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:ConfigBase_SetRecordDefaults",kwnames,&obj0,&obj1)) goto fail; @@ -15862,112 +15862,6 @@ static PyObject * ConfigBase_swigregister(PyObject *self, PyObject *args) { Py_INCREF(obj); return Py_BuildValue((char *)""); } -static PyObject *_wrap_new_ConfigPathChanger(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxConfigBase *arg1 = (wxConfigBase *) 0 ; - wxString *arg2 = 0 ; - wxConfigPathChanger *result; - bool temp2 = False ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "pContainer",(char *) "strEntry", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:new_ConfigPathChanger",kwnames,&obj0,&obj1)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - arg2 = wxString_in_helper(obj1); - if (arg2 == NULL) SWIG_fail; - temp2 = True; - } - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxConfigPathChanger *)new wxConfigPathChanger((wxConfigBase const *)arg1,(wxString const &)*arg2); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxConfigPathChanger, 1); - { - if (temp2) - delete arg2; - } - return resultobj; - fail: - { - if (temp2) - delete arg2; - } - return NULL; -} - - -static PyObject *_wrap_delete_ConfigPathChanger(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxConfigPathChanger *arg1 = (wxConfigPathChanger *) 0 ; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_ConfigPathChanger",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigPathChanger,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - delete arg1; - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - Py_INCREF(Py_None); resultobj = Py_None; - return resultobj; - fail: - return NULL; -} - - -static PyObject *_wrap_ConfigPathChanger_Name(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxConfigPathChanger *arg1 = (wxConfigPathChanger *) 0 ; - wxString *result; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ConfigPathChanger_Name",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigPathChanger,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - { - wxString const &_result_ref = ((wxConfigPathChanger const *)arg1)->Name(); - result = (wxString *) &_result_ref; - } - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - { -#if wxUSE_UNICODE - resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); -#else - resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); -#endif - } - return resultobj; - fail: - return NULL; -} - - -static PyObject * ConfigPathChanger_swigregister(PyObject *self, PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; - SWIG_TypeClientData(SWIGTYPE_p_wxConfigPathChanger, obj); - Py_INCREF(obj); - return Py_BuildValue((char *)""); -} static PyObject *_wrap_new_Config(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxString const &arg1_defvalue = wxPyEmptyString ; @@ -16242,6 +16136,112 @@ static PyObject * FileConfig_swigregister(PyObject *self, PyObject *args) { Py_INCREF(obj); return Py_BuildValue((char *)""); } +static PyObject *_wrap_new_ConfigPathChanger(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxConfigBase *arg1 = (wxConfigBase *) 0 ; + wxString *arg2 = 0 ; + wxConfigPathChanger *result; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "config",(char *) "entry", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:new_ConfigPathChanger",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigBase,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (wxConfigPathChanger *)new wxConfigPathChanger((wxConfigBase const *)arg1,(wxString const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxConfigPathChanger, 1); + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_delete_ConfigPathChanger(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxConfigPathChanger *arg1 = (wxConfigPathChanger *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_ConfigPathChanger",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigPathChanger,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete arg1; + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ConfigPathChanger_Name(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxConfigPathChanger *arg1 = (wxConfigPathChanger *) 0 ; + wxString *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ConfigPathChanger_Name",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxConfigPathChanger,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxString const &_result_ref = ((wxConfigPathChanger const *)arg1)->Name(); + result = (wxString *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); +#else + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject * ConfigPathChanger_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxConfigPathChanger, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} static PyObject *_wrap_ExpandEnvVars(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxString *arg1 = 0 ; @@ -20240,7 +20240,7 @@ static PyObject *_wrap_DateTime___sub__(PyObject *self, PyObject *args) { static PyObject *_wrap_DateTime___lt__(PyObject *self, PyObject *args) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; - wxDateTime *arg2 = 0 ; + wxDateTime *arg2 = (wxDateTime *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -20248,12 +20248,9 @@ static PyObject *_wrap_DateTime___lt__(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args,(char *)"OO:DateTime___lt__",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateTime___lt__(arg1,(wxDateTime const &)*arg2); + result = (bool)wxDateTime___lt__(arg1,(wxDateTime const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20268,7 +20265,7 @@ static PyObject *_wrap_DateTime___lt__(PyObject *self, PyObject *args) { static PyObject *_wrap_DateTime___le__(PyObject *self, PyObject *args) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; - wxDateTime *arg2 = 0 ; + wxDateTime *arg2 = (wxDateTime *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -20276,12 +20273,9 @@ static PyObject *_wrap_DateTime___le__(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args,(char *)"OO:DateTime___le__",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateTime___le__(arg1,(wxDateTime const &)*arg2); + result = (bool)wxDateTime___le__(arg1,(wxDateTime const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20296,7 +20290,7 @@ static PyObject *_wrap_DateTime___le__(PyObject *self, PyObject *args) { static PyObject *_wrap_DateTime___gt__(PyObject *self, PyObject *args) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; - wxDateTime *arg2 = 0 ; + wxDateTime *arg2 = (wxDateTime *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -20304,12 +20298,9 @@ static PyObject *_wrap_DateTime___gt__(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args,(char *)"OO:DateTime___gt__",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateTime___gt__(arg1,(wxDateTime const &)*arg2); + result = (bool)wxDateTime___gt__(arg1,(wxDateTime const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20324,7 +20315,7 @@ static PyObject *_wrap_DateTime___gt__(PyObject *self, PyObject *args) { static PyObject *_wrap_DateTime___ge__(PyObject *self, PyObject *args) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; - wxDateTime *arg2 = 0 ; + wxDateTime *arg2 = (wxDateTime *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -20332,12 +20323,9 @@ static PyObject *_wrap_DateTime___ge__(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args,(char *)"OO:DateTime___ge__",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateTime___ge__(arg1,(wxDateTime const &)*arg2); + result = (bool)wxDateTime___ge__(arg1,(wxDateTime const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20352,7 +20340,7 @@ static PyObject *_wrap_DateTime___ge__(PyObject *self, PyObject *args) { static PyObject *_wrap_DateTime___eq__(PyObject *self, PyObject *args) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; - wxDateTime *arg2 = 0 ; + wxDateTime *arg2 = (wxDateTime *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -20360,12 +20348,9 @@ static PyObject *_wrap_DateTime___eq__(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args,(char *)"OO:DateTime___eq__",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateTime___eq__(arg1,(wxDateTime const &)*arg2); + result = (bool)wxDateTime___eq__(arg1,(wxDateTime const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -20380,7 +20365,7 @@ static PyObject *_wrap_DateTime___eq__(PyObject *self, PyObject *args) { static PyObject *_wrap_DateTime___ne__(PyObject *self, PyObject *args) { PyObject *resultobj; wxDateTime *arg1 = (wxDateTime *) 0 ; - wxDateTime *arg2 = 0 ; + wxDateTime *arg2 = (wxDateTime *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -20388,12 +20373,9 @@ static PyObject *_wrap_DateTime___ne__(PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args,(char *)"OO:DateTime___ne__",&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateTime,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateTime___ne__(arg1,(wxDateTime const &)*arg2); + result = (bool)wxDateTime___ne__(arg1,(wxDateTime const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21635,7 +21617,7 @@ static PyObject *_wrap_TimeSpan___rmul__(PyObject *self, PyObject *args, PyObjec static PyObject *_wrap_TimeSpan___lt__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxTimeSpan *arg1 = (wxTimeSpan *) 0 ; - wxTimeSpan *arg2 = 0 ; + wxTimeSpan *arg2 = (wxTimeSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -21646,12 +21628,9 @@ static PyObject *_wrap_TimeSpan___lt__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TimeSpan___lt__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTimeSpan___lt__(arg1,(wxTimeSpan const &)*arg2); + result = (bool)wxTimeSpan___lt__(arg1,(wxTimeSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21666,7 +21645,7 @@ static PyObject *_wrap_TimeSpan___lt__(PyObject *self, PyObject *args, PyObject static PyObject *_wrap_TimeSpan___le__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxTimeSpan *arg1 = (wxTimeSpan *) 0 ; - wxTimeSpan *arg2 = 0 ; + wxTimeSpan *arg2 = (wxTimeSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -21677,12 +21656,9 @@ static PyObject *_wrap_TimeSpan___le__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TimeSpan___le__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTimeSpan___le__(arg1,(wxTimeSpan const &)*arg2); + result = (bool)wxTimeSpan___le__(arg1,(wxTimeSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21697,7 +21673,7 @@ static PyObject *_wrap_TimeSpan___le__(PyObject *self, PyObject *args, PyObject static PyObject *_wrap_TimeSpan___gt__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxTimeSpan *arg1 = (wxTimeSpan *) 0 ; - wxTimeSpan *arg2 = 0 ; + wxTimeSpan *arg2 = (wxTimeSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -21708,12 +21684,9 @@ static PyObject *_wrap_TimeSpan___gt__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TimeSpan___gt__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTimeSpan___gt__(arg1,(wxTimeSpan const &)*arg2); + result = (bool)wxTimeSpan___gt__(arg1,(wxTimeSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21728,7 +21701,7 @@ static PyObject *_wrap_TimeSpan___gt__(PyObject *self, PyObject *args, PyObject static PyObject *_wrap_TimeSpan___ge__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxTimeSpan *arg1 = (wxTimeSpan *) 0 ; - wxTimeSpan *arg2 = 0 ; + wxTimeSpan *arg2 = (wxTimeSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -21739,12 +21712,9 @@ static PyObject *_wrap_TimeSpan___ge__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TimeSpan___ge__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTimeSpan___ge__(arg1,(wxTimeSpan const &)*arg2); + result = (bool)wxTimeSpan___ge__(arg1,(wxTimeSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21759,7 +21729,7 @@ static PyObject *_wrap_TimeSpan___ge__(PyObject *self, PyObject *args, PyObject static PyObject *_wrap_TimeSpan___eq__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxTimeSpan *arg1 = (wxTimeSpan *) 0 ; - wxTimeSpan *arg2 = 0 ; + wxTimeSpan *arg2 = (wxTimeSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -21770,12 +21740,9 @@ static PyObject *_wrap_TimeSpan___eq__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TimeSpan___eq__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTimeSpan___eq__(arg1,(wxTimeSpan const &)*arg2); + result = (bool)wxTimeSpan___eq__(arg1,(wxTimeSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -21790,7 +21757,7 @@ static PyObject *_wrap_TimeSpan___eq__(PyObject *self, PyObject *args, PyObject static PyObject *_wrap_TimeSpan___ne__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxTimeSpan *arg1 = (wxTimeSpan *) 0 ; - wxTimeSpan *arg2 = 0 ; + wxTimeSpan *arg2 = (wxTimeSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -21801,12 +21768,9 @@ static PyObject *_wrap_TimeSpan___ne__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:TimeSpan___ne__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxTimeSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxTimeSpan___ne__(arg1,(wxTimeSpan const &)*arg2); + result = (bool)wxTimeSpan___ne__(arg1,(wxTimeSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -23189,7 +23153,7 @@ static PyObject *_wrap_DateSpan___rmul__(PyObject *self, PyObject *args, PyObjec static PyObject *_wrap_DateSpan___eq__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxDateSpan *arg1 = (wxDateSpan *) 0 ; - wxDateSpan *arg2 = 0 ; + wxDateSpan *arg2 = (wxDateSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -23200,12 +23164,9 @@ static PyObject *_wrap_DateSpan___eq__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:DateSpan___eq__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateSpan___eq__(arg1,(wxDateSpan const &)*arg2); + result = (bool)wxDateSpan___eq__(arg1,(wxDateSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -23220,7 +23181,7 @@ static PyObject *_wrap_DateSpan___eq__(PyObject *self, PyObject *args, PyObject static PyObject *_wrap_DateSpan___ne__(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxDateSpan *arg1 = (wxDateSpan *) 0 ; - wxDateSpan *arg2 = 0 ; + wxDateSpan *arg2 = (wxDateSpan *) 0 ; bool result; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; @@ -23231,12 +23192,9 @@ static PyObject *_wrap_DateSpan___ne__(PyObject *self, PyObject *args, PyObject if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:DateSpan___ne__",kwnames,&obj0,&obj1)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxDateSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxDateSpan,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (bool)wxDateSpan___ne__(arg1,(wxDateSpan const &)*arg2); + result = (bool)wxDateSpan___ne__(arg1,(wxDateSpan const *)arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -27136,8 +27094,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"ConfigBase_DeleteEntry", (PyCFunction) _wrap_ConfigBase_DeleteEntry, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_DeleteGroup", (PyCFunction) _wrap_ConfigBase_DeleteGroup, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_DeleteAll", (PyCFunction) _wrap_ConfigBase_DeleteAll, METH_VARARGS | METH_KEYWORDS }, - { (char *)"ConfigBase_IsExpandingEnvVars", (PyCFunction) _wrap_ConfigBase_IsExpandingEnvVars, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_SetExpandEnvVars", (PyCFunction) _wrap_ConfigBase_SetExpandEnvVars, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ConfigBase_IsExpandingEnvVars", (PyCFunction) _wrap_ConfigBase_IsExpandingEnvVars, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_SetRecordDefaults", (PyCFunction) _wrap_ConfigBase_SetRecordDefaults, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_IsRecordingDefaults", (PyCFunction) _wrap_ConfigBase_IsRecordingDefaults, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_ExpandEnvVars", (PyCFunction) _wrap_ConfigBase_ExpandEnvVars, METH_VARARGS | METH_KEYWORDS }, @@ -27148,16 +27106,16 @@ static PyMethodDef SwigMethods[] = { { (char *)"ConfigBase_SetStyle", (PyCFunction) _wrap_ConfigBase_SetStyle, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_GetStyle", (PyCFunction) _wrap_ConfigBase_GetStyle, METH_VARARGS | METH_KEYWORDS }, { (char *)"ConfigBase_swigregister", ConfigBase_swigregister, METH_VARARGS }, - { (char *)"new_ConfigPathChanger", (PyCFunction) _wrap_new_ConfigPathChanger, METH_VARARGS | METH_KEYWORDS }, - { (char *)"delete_ConfigPathChanger", (PyCFunction) _wrap_delete_ConfigPathChanger, METH_VARARGS | METH_KEYWORDS }, - { (char *)"ConfigPathChanger_Name", (PyCFunction) _wrap_ConfigPathChanger_Name, METH_VARARGS | METH_KEYWORDS }, - { (char *)"ConfigPathChanger_swigregister", ConfigPathChanger_swigregister, METH_VARARGS }, { (char *)"new_Config", (PyCFunction) _wrap_new_Config, METH_VARARGS | METH_KEYWORDS }, { (char *)"delete_Config", (PyCFunction) _wrap_delete_Config, METH_VARARGS | METH_KEYWORDS }, { (char *)"Config_swigregister", Config_swigregister, METH_VARARGS }, { (char *)"new_FileConfig", (PyCFunction) _wrap_new_FileConfig, METH_VARARGS | METH_KEYWORDS }, { (char *)"delete_FileConfig", (PyCFunction) _wrap_delete_FileConfig, METH_VARARGS | METH_KEYWORDS }, { (char *)"FileConfig_swigregister", FileConfig_swigregister, METH_VARARGS }, + { (char *)"new_ConfigPathChanger", (PyCFunction) _wrap_new_ConfigPathChanger, METH_VARARGS | METH_KEYWORDS }, + { (char *)"delete_ConfigPathChanger", (PyCFunction) _wrap_delete_ConfigPathChanger, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ConfigPathChanger_Name", (PyCFunction) _wrap_ConfigPathChanger_Name, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ConfigPathChanger_swigregister", ConfigPathChanger_swigregister, METH_VARARGS }, { (char *)"ExpandEnvVars", (PyCFunction) _wrap_ExpandEnvVars, METH_VARARGS | METH_KEYWORDS }, { (char *)"DateTime_SetCountry", (PyCFunction) _wrap_DateTime_SetCountry, METH_VARARGS | METH_KEYWORDS }, { (char *)"DateTime_GetCountry", (PyCFunction) _wrap_DateTime_GetCountry, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 03f585570f..93e563e029 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -2001,13 +2001,16 @@ _windows.FileDialog_swigregister(FileDialogPtr) CHOICEDLG_STYLE = _windows.CHOICEDLG_STYLE class MultiChoiceDialog(Dialog): + """A simple dialog with a multi selection listbox.""" def __repr__(self): return "<%s.%s; proxy of C++ wxMultiChoiceDialog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Window parent, String message, String caption, int choices=0, - String choices_array, long style=CHOICEDLG_STYLE, + __init__(Window parent, String message, String caption, + List choices=[], long style=CHOICEDLG_STYLE, Point pos=DefaultPosition) -> MultiChoiceDialog + + Constructor. Use ShowModal method to show the dialog. """ newobj = _windows.new_MultiChoiceDialog(*args, **kwargs) self.this = newobj.this @@ -2016,11 +2019,19 @@ class MultiChoiceDialog(Dialog): self._setOORInfo(self) def SetSelections(*args, **kwargs): - """SetSelections(wxArrayInt selections)""" + """ + SetSelections(List selections) + + Specify the items in the list that shoudl be selected, using a list of integers. + """ return _windows.MultiChoiceDialog_SetSelections(*args, **kwargs) def GetSelections(*args, **kwargs): - """GetSelections() -> PyObject""" + """ + GetSelections() -> [selections] + + Returns a list of integers representing the items that are selected. + """ return _windows.MultiChoiceDialog_GetSelections(*args, **kwargs) @@ -2032,13 +2043,16 @@ class MultiChoiceDialogPtr(MultiChoiceDialog): _windows.MultiChoiceDialog_swigregister(MultiChoiceDialogPtr) class SingleChoiceDialog(Dialog): + """A simple dialog with a single selection listbox.""" def __repr__(self): return "<%s.%s; proxy of C++ wxSingleChoiceDialog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ - __init__(Window parent, String message, String caption, int choices, - String choices_array, long style=CHOICEDLG_STYLE, + __init__(Window parent, String message, String caption, + List choices=[], long style=CHOICEDLG_STYLE, Point pos=DefaultPosition) -> SingleChoiceDialog + + Constructor. Use ShowModal method to show the dialog. """ newobj = _windows.new_SingleChoiceDialog(*args, **kwargs) self.this = newobj.this @@ -2047,20 +2061,28 @@ class SingleChoiceDialog(Dialog): self._setOORInfo(self) def GetSelection(*args, **kwargs): - """GetSelection() -> int""" + """ + GetSelection() -> int + + Get the index of teh currently selected item. + """ return _windows.SingleChoiceDialog_GetSelection(*args, **kwargs) def GetStringSelection(*args, **kwargs): - """GetStringSelection() -> String""" + """ + GetStringSelection() -> String + + Returns the string value of the currently selected item + """ return _windows.SingleChoiceDialog_GetStringSelection(*args, **kwargs) def SetSelection(*args, **kwargs): - """SetSelection(int sel)""" - return _windows.SingleChoiceDialog_SetSelection(*args, **kwargs) + """ + SetSelection(int sel) - def ShowModal(*args, **kwargs): - """ShowModal() -> int""" - return _windows.SingleChoiceDialog_ShowModal(*args, **kwargs) + Set the current selected item to sel + """ + return _windows.SingleChoiceDialog_SetSelection(*args, **kwargs) class SingleChoiceDialogPtr(SingleChoiceDialog): @@ -2071,6 +2093,7 @@ class SingleChoiceDialogPtr(SingleChoiceDialog): _windows.SingleChoiceDialog_swigregister(SingleChoiceDialogPtr) class TextEntryDialog(Dialog): + """A dialog with text control, [ok] and [cancel] buttons""" def __repr__(self): return "<%s.%s; proxy of C++ wxTextEntryDialog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -2078,6 +2101,8 @@ class TextEntryDialog(Dialog): __init__(Window parent, String message, String caption=GetTextFromUserPromptStr, String defaultValue=EmptyString, long style=wxOK|wxCANCEL|wxCENTRE, Point pos=DefaultPosition) -> TextEntryDialog + + Constructor. Use ShowModal method to show the dialog. """ newobj = _windows.new_TextEntryDialog(*args, **kwargs) self.this = newobj.this @@ -2086,16 +2111,21 @@ class TextEntryDialog(Dialog): self._setOORInfo(self) def GetValue(*args, **kwargs): - """GetValue() -> String""" + """ + GetValue() -> String + + Returns the text that the user has entered if the user has pressed OK, + or the original value if the user has pressed Cancel. + """ return _windows.TextEntryDialog_GetValue(*args, **kwargs) def SetValue(*args, **kwargs): - """SetValue(String value)""" - return _windows.TextEntryDialog_SetValue(*args, **kwargs) + """ + SetValue(String value) - def ShowModal(*args, **kwargs): - """ShowModal() -> int""" - return _windows.TextEntryDialog_ShowModal(*args, **kwargs) + Sets the default text value. + """ + return _windows.TextEntryDialog_SetValue(*args, **kwargs) class TextEntryDialogPtr(TextEntryDialog): @@ -2106,10 +2136,15 @@ class TextEntryDialogPtr(TextEntryDialog): _windows.TextEntryDialog_swigregister(TextEntryDialogPtr) class FontData(core.Object): + """This class holds a variety of information related to font dialogs.""" def __repr__(self): return "<%s.%s; proxy of C++ wxFontData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__() -> FontData""" + """ + __init__() -> FontData + + This class holds a variety of information related to font dialogs. + """ newobj = _windows.new_FontData(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -2121,55 +2156,116 @@ class FontData(core.Object): except: pass def EnableEffects(*args, **kwargs): - """EnableEffects(bool enable)""" + """ + EnableEffects(bool enable) + + Enables or disables 'effects' under MS Windows only. This refers + to the controls for manipulating colour, strikeout and underline + properties. The default value is true. + """ return _windows.FontData_EnableEffects(*args, **kwargs) def GetAllowSymbols(*args, **kwargs): - """GetAllowSymbols() -> bool""" + """ + GetAllowSymbols() -> bool + + Under MS Windows, returns a flag determining whether symbol fonts can be + selected. Has no effect on other platforms. The default value is true. + """ return _windows.FontData_GetAllowSymbols(*args, **kwargs) def GetColour(*args, **kwargs): - """GetColour() -> Colour""" + """ + GetColour() -> Colour + + Gets the colour associated with the font dialog. The default value is black. + """ return _windows.FontData_GetColour(*args, **kwargs) def GetChosenFont(*args, **kwargs): - """GetChosenFont() -> Font""" + """ + GetChosenFont() -> Font + + Gets the font chosen by the user. + """ return _windows.FontData_GetChosenFont(*args, **kwargs) def GetEnableEffects(*args, **kwargs): - """GetEnableEffects() -> bool""" + """ + GetEnableEffects() -> bool + + Determines whether 'effects' are enabled under Windows. + """ return _windows.FontData_GetEnableEffects(*args, **kwargs) def GetInitialFont(*args, **kwargs): - """GetInitialFont() -> Font""" + """ + GetInitialFont() -> Font + + Gets the font that will be initially used by the font dialog. This should have + previously been set by the application. + """ return _windows.FontData_GetInitialFont(*args, **kwargs) def GetShowHelp(*args, **kwargs): - """GetShowHelp() -> bool""" + """ + GetShowHelp() -> bool + + Returns true if the Help button will be shown (Windows only). The default + value is false. + """ return _windows.FontData_GetShowHelp(*args, **kwargs) def SetAllowSymbols(*args, **kwargs): - """SetAllowSymbols(bool allowSymbols)""" + """ + SetAllowSymbols(bool allowSymbols) + + Under MS Windows, determines whether symbol fonts can be selected. Has no + effect on other platforms. The default value is true. + """ return _windows.FontData_SetAllowSymbols(*args, **kwargs) def SetChosenFont(*args, **kwargs): - """SetChosenFont(Font font)""" + """ + SetChosenFont(Font font) + + Sets the font that will be returned to the user (for internal use only). + """ return _windows.FontData_SetChosenFont(*args, **kwargs) def SetColour(*args, **kwargs): - """SetColour(Colour colour)""" + """ + SetColour(Colour colour) + + Sets the colour that will be used for the font foreground colour. The default + colour is black. + """ return _windows.FontData_SetColour(*args, **kwargs) def SetInitialFont(*args, **kwargs): - """SetInitialFont(Font font)""" + """ + SetInitialFont(Font font) + + Sets the font that will be initially used by the font dialog. + """ return _windows.FontData_SetInitialFont(*args, **kwargs) def SetRange(*args, **kwargs): - """SetRange(int min, int max)""" + """ + SetRange(int min, int max) + + Sets the valid range for the font point size (Windows only). The default is + 0, 0 (unrestricted range). + """ return _windows.FontData_SetRange(*args, **kwargs) def SetShowHelp(*args, **kwargs): - """SetShowHelp(bool showHelp)""" + """ + SetShowHelp(bool showHelp) + + Determines whether the Help button will be displayed in the font dialog + (Windows only). The default value is false. + """ return _windows.FontData_SetShowHelp(*args, **kwargs) @@ -2181,23 +2277,30 @@ class FontDataPtr(FontData): _windows.FontData_swigregister(FontDataPtr) class FontDialog(Dialog): + """This class represents the font chooser dialog.""" def __repr__(self): return "<%s.%s; proxy of C++ wxFontDialog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) - def __init__(self, *args, **kwargs): - """__init__(Window parent, FontData data) -> FontDialog""" - newobj = _windows.new_FontDialog(*args, **kwargs) + def __init__(self, *args): + """ + __init__(Window parent) -> FontDialog + __init__(Window parent, FontData data) -> FontDialog + + Constructor. Pass a parent window, and optionally the font data object to be + used to initialize the dialog controls. + """ + newobj = _windows.new_FontDialog(*args) self.this = newobj.this self.thisown = 1 del newobj.thisown self._setOORInfo(self) def GetFontData(*args, **kwargs): - """GetFontData() -> FontData""" - return _windows.FontDialog_GetFontData(*args, **kwargs) + """ + GetFontData() -> FontData - def ShowModal(*args, **kwargs): - """ShowModal() -> int""" - return _windows.FontDialog_ShowModal(*args, **kwargs) + Returns a reference to the internal FontData used by the FontDialog. + """ + return _windows.FontDialog_GetFontData(*args, **kwargs) class FontDialogPtr(FontDialog): @@ -2208,6 +2311,10 @@ class FontDialogPtr(FontDialog): _windows.FontDialog_swigregister(FontDialogPtr) class MessageDialog(Dialog): + """ + This class provides a dialog that shows a single or multi-line message, with + a choice of OK, Yes, No and Cancel buttons. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxMessageDialog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): @@ -2215,6 +2322,9 @@ class MessageDialog(Dialog): __init__(Window parent, String message, String caption=MessageBoxCaptionStr, long style=wxOK|wxCANCEL|wxCENTRE, Point pos=DefaultPosition) -> MessageDialog + + This class provides a dialog that shows a single or multi-line message, with + a choice of OK, Yes, No and Cancel buttons. """ newobj = _windows.new_MessageDialog(*args, **kwargs) self.this = newobj.this @@ -2222,10 +2332,6 @@ class MessageDialog(Dialog): del newobj.thisown self._setOORInfo(self) - def ShowModal(*args, **kwargs): - """ShowModal() -> int""" - return _windows.MessageDialog_ShowModal(*args, **kwargs) - class MessageDialogPtr(MessageDialog): def __init__(self, this): @@ -2235,12 +2341,19 @@ class MessageDialogPtr(MessageDialog): _windows.MessageDialog_swigregister(MessageDialogPtr) class ProgressDialog(Frame): + """ + A dialog that shows a short message and a progress bar. Optionally, it can + display an ABORT button. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxProgressDialog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ __init__(String title, String message, int maximum=100, Window parent=None, int style=wxPD_AUTO_HIDE|wxPD_APP_MODAL) -> ProgressDialog + + Constructor. Creates the dialog, displays it and disables user input for other + windows, or, if wxPD_APP_MODAL flag is not given, for its parent window only. """ newobj = _windows.new_ProgressDialog(*args, **kwargs) self.this = newobj.this @@ -2249,11 +2362,25 @@ class ProgressDialog(Frame): self._setOORInfo(self) def Update(*args, **kwargs): - """Update(int value, String newmsg=EmptyString) -> bool""" + """ + Update(int value, String newmsg=EmptyString) -> bool + + Updates the dialog, setting the progress bar to the new value and, if given + changes the message above it. Returns true unless the Cancel button has been + pressed. + + If false is returned, the application can either immediately destroy the + dialog or ask the user for the confirmation and if the abort is not confirmed + the dialog may be resumed with Resume function. + """ return _windows.ProgressDialog_Update(*args, **kwargs) def Resume(*args, **kwargs): - """Resume()""" + """ + Resume() + + Can be used to continue with the dialog, after the user had chosen to abort. + """ return _windows.ProgressDialog_Resume(*args, **kwargs) @@ -2290,28 +2417,51 @@ EVT_COMMAND_FIND_REPLACE_ALL = EVT_FIND_REPLACE_ALL EVT_COMMAND_FIND_CLOSE = EVT_FIND_CLOSE class FindDialogEvent(core.CommandEvent): + """Events for the FindReplaceDialog""" def __repr__(self): return "<%s.%s; proxy of C++ wxFindDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(wxEventType commandType=wxEVT_NULL, int id=0) -> FindDialogEvent""" + """ + __init__(wxEventType commandType=wxEVT_NULL, int id=0) -> FindDialogEvent + + Events for the FindReplaceDialog + """ newobj = _windows.new_FindDialogEvent(*args, **kwargs) self.this = newobj.this self.thisown = 1 del newobj.thisown def GetFlags(*args, **kwargs): - """GetFlags() -> int""" + """ + GetFlags() -> int + + Get the currently selected flags: this is the combination of + wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags. + """ return _windows.FindDialogEvent_GetFlags(*args, **kwargs) def GetFindString(*args, **kwargs): - """GetFindString() -> String""" + """ + GetFindString() -> String + + Return the string to find (never empty). + """ return _windows.FindDialogEvent_GetFindString(*args, **kwargs) def GetReplaceString(*args, **kwargs): - """GetReplaceString() -> String""" + """ + GetReplaceString() -> String + + Return the string to replace the search string with (only + for replace and replace all events). + """ return _windows.FindDialogEvent_GetReplaceString(*args, **kwargs) def GetDialog(*args, **kwargs): - """GetDialog() -> FindReplaceDialog""" + """ + GetDialog() -> FindReplaceDialog + + Return the pointer to the dialog which generated this event. + """ return _windows.FindDialogEvent_GetDialog(*args, **kwargs) def SetFlags(*args, **kwargs): @@ -2335,10 +2485,33 @@ class FindDialogEventPtr(FindDialogEvent): _windows.FindDialogEvent_swigregister(FindDialogEventPtr) class FindReplaceData(core.Object): + """ + FindReplaceData holds the data for FindReplaceDialog. It is used to initialize + the dialog with the default values and will keep the last values from the + dialog when it is closed. It is also updated each time a wxFindDialogEvent is + generated so instead of using the wxFindDialogEvent methods you can also + directly query this object. + + Note that all SetXXX() methods may only be called before showing the dialog + and calling them has no effect later. + + Flags + wxFR_DOWN: downward search/replace selected (otherwise, upwards) + + wxFR_WHOLEWORD: whole word search/replace selected + + wxFR_MATCHCASE: case sensitive search/replace selected (otherwise, + case insensitive) + + """ def __repr__(self): return "<%s.%s; proxy of C++ wxFindReplaceData instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): - """__init__(int flags=0) -> FindReplaceData""" + """ + __init__(int flags=0) -> FindReplaceData + + Constuctor initializes the flags to default value (0). + """ newobj = _windows.new_FindReplaceData(*args, **kwargs) self.this = newobj.this self.thisown = 1 @@ -2350,27 +2523,51 @@ class FindReplaceData(core.Object): except: pass def GetFindString(*args, **kwargs): - """GetFindString() -> String""" + """ + GetFindString() -> String + + Get the string to find. + """ return _windows.FindReplaceData_GetFindString(*args, **kwargs) def GetReplaceString(*args, **kwargs): - """GetReplaceString() -> String""" + """ + GetReplaceString() -> String + + Get the replacement string. + """ return _windows.FindReplaceData_GetReplaceString(*args, **kwargs) def GetFlags(*args, **kwargs): - """GetFlags() -> int""" + """ + GetFlags() -> int + + Get the combination of flag values. + """ return _windows.FindReplaceData_GetFlags(*args, **kwargs) def SetFlags(*args, **kwargs): - """SetFlags(int flags)""" + """ + SetFlags(int flags) + + Set the flags to use to initialize the controls of the dialog. + """ return _windows.FindReplaceData_SetFlags(*args, **kwargs) def SetFindString(*args, **kwargs): - """SetFindString(String str)""" + """ + SetFindString(String str) + + Set the string to find (used as initial value by the dialog). + """ return _windows.FindReplaceData_SetFindString(*args, **kwargs) def SetReplaceString(*args, **kwargs): - """SetReplaceString(String str)""" + """ + SetReplaceString(String str) + + Set the replacement string (used as initial value by the dialog). + """ return _windows.FindReplaceData_SetReplaceString(*args, **kwargs) @@ -2382,12 +2579,24 @@ class FindReplaceDataPtr(FindReplaceData): _windows.FindReplaceData_swigregister(FindReplaceDataPtr) class FindReplaceDialog(Dialog): + """ + FindReplaceDialog is a standard modeless dialog which is used to allow the + user to search for some text (and possibly replace it with something + else). The actual searching is supposed to be done in the owner window which + is the parent of this dialog. Note that it means that unlike for the other + standard dialogs this one must have a parent window. Also note that there is + no way to use this dialog in a modal way; it is always, by design and + implementation, modeless. + """ def __repr__(self): return "<%s.%s; proxy of C++ wxFindReplaceDialog instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) def __init__(self, *args, **kwargs): """ __init__(Window parent, FindReplaceData data, String title, int style=0) -> FindReplaceDialog + + Create a FindReplaceDialog. The parent and data parameters must be + non-None. Use Show to display the dialog. """ newobj = _windows.new_FindReplaceDialog(*args, **kwargs) self.this = newobj.this @@ -2399,15 +2608,25 @@ class FindReplaceDialog(Dialog): """ Create(Window parent, FindReplaceData data, String title, int style=0) -> bool + + Create the dialog, for 2-phase create. """ return _windows.FindReplaceDialog_Create(*args, **kwargs) def GetData(*args, **kwargs): - """GetData() -> FindReplaceData""" + """ + GetData() -> FindReplaceData + + Get the FindReplaceData object used by this dialog. + """ return _windows.FindReplaceDialog_GetData(*args, **kwargs) def SetData(*args, **kwargs): - """SetData(FindReplaceData data)""" + """ + SetData(FindReplaceData data) + + Set the FindReplaceData object used by this dialog. + """ return _windows.FindReplaceDialog_SetData(*args, **kwargs) @@ -2419,7 +2638,11 @@ class FindReplaceDialogPtr(FindReplaceDialog): _windows.FindReplaceDialog_swigregister(FindReplaceDialogPtr) def PreFindReplaceDialog(*args, **kwargs): - """PreFindReplaceDialog() -> FindReplaceDialog""" + """ + PreFindReplaceDialog() -> FindReplaceDialog + + Precreate a FindReplaceDialog for 2-phase creation + """ val = _windows.new_PreFindReplaceDialog(*args, **kwargs) val.thisown = 1 return val diff --git a/wxPython/src/msw/windows_wrap.cpp b/wxPython/src/msw/windows_wrap.cpp index 0346ae018b..8e94d5d71c 100644 --- a/wxPython/src/msw/windows_wrap.cpp +++ b/wxPython/src/msw/windows_wrap.cpp @@ -12317,31 +12317,6 @@ static PyObject *_wrap_SingleChoiceDialog_SetSelection(PyObject *self, PyObject } -static PyObject *_wrap_SingleChoiceDialog_ShowModal(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxSingleChoiceDialog *arg1 = (wxSingleChoiceDialog *) 0 ; - int result; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:SingleChoiceDialog_ShowModal",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxSingleChoiceDialog,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (int)(arg1)->ShowModal(); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_PyObj_FromInt((int)result); - return resultobj; - fail: - return NULL; -} - - static PyObject * SingleChoiceDialog_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -12517,31 +12492,6 @@ static PyObject *_wrap_TextEntryDialog_SetValue(PyObject *self, PyObject *args, } -static PyObject *_wrap_TextEntryDialog_ShowModal(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxTextEntryDialog *arg1 = (wxTextEntryDialog *) 0 ; - int result; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:TextEntryDialog_ShowModal",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxTextEntryDialog,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (int)(arg1)->ShowModal(); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_PyObj_FromInt((int)result); - return resultobj; - fail: - return NULL; -} - - static PyObject * TextEntryDialog_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -12981,26 +12931,17 @@ static PyObject * FontData_swigregister(PyObject *self, PyObject *args) { Py_INCREF(obj); return Py_BuildValue((char *)""); } -static PyObject *_wrap_new_FontDialog(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_new_FontDialog__SWIG_0(PyObject *self, PyObject *args) { PyObject *resultobj; wxWindow *arg1 = (wxWindow *) 0 ; - wxFontData *arg2 = 0 ; wxFontDialog *result; PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *kwnames[] = { - (char *) "parent",(char *) "data", NULL - }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:new_FontDialog",kwnames,&obj0,&obj1)) goto fail; + if(!PyArg_ParseTuple(args,(char *)"O:new_FontDialog",&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxFontData,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - if (arg2 == NULL) { - PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; - } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (wxFontDialog *)new wxFontDialog(arg1,(wxFontData const &)*arg2); + result = (wxFontDialog *)new wxFontDialog(arg1); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; @@ -13012,53 +12953,112 @@ static PyObject *_wrap_new_FontDialog(PyObject *self, PyObject *args, PyObject * } -static PyObject *_wrap_FontDialog_GetFontData(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_new_FontDialog__SWIG_1(PyObject *self, PyObject *args) { PyObject *resultobj; - wxFontDialog *arg1 = (wxFontDialog *) 0 ; - wxFontData *result; + wxWindow *arg1 = (wxWindow *) 0 ; + wxFontData *arg2 = 0 ; + wxFontDialog *result; PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; + PyObject * obj1 = 0 ; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FontDialog_GetFontData",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxFontDialog,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if(!PyArg_ParseTuple(args,(char *)"OO:new_FontDialog",&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxWindow,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_wxFontData,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError,"null reference"); SWIG_fail; + } { PyThreadState* __tstate = wxPyBeginAllowThreads(); - { - wxFontData &_result_ref = (arg1)->GetFontData(); - result = (wxFontData *) &_result_ref; - } + result = (wxFontDialog *)new wxFontDialog(arg1,(wxFontData const &)*arg2); wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxFontData, 0); + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxFontDialog, 1); return resultobj; fail: return NULL; } -static PyObject *_wrap_FontDialog_ShowModal(PyObject *self, PyObject *args, PyObject *kwargs) { +static PyObject *_wrap_new_FontDialog(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GetItem(args,ii); + } + if (argc == 1) { + int _v; + { + void *ptr; + if (SWIG_ConvertPtr(argv[0], (void **) &ptr, SWIGTYPE_p_wxWindow, 0) == -1) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } + } + if (_v) { + return _wrap_new_FontDialog__SWIG_0(self,args); + } + } + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_ConvertPtr(argv[0], (void **) &ptr, SWIGTYPE_p_wxWindow, 0) == -1) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } + } + if (_v) { + { + void *ptr; + if (SWIG_ConvertPtr(argv[1], (void **) &ptr, SWIGTYPE_p_wxFontData, 0) == -1) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } + } + if (_v) { + return _wrap_new_FontDialog__SWIG_1(self,args); + } + } + } + + PyErr_SetString(PyExc_TypeError,"No matching function for overloaded 'new_FontDialog'"); + return NULL; +} + + +static PyObject *_wrap_FontDialog_GetFontData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj; wxFontDialog *arg1 = (wxFontDialog *) 0 ; - int result; + wxFontData *result; PyObject * obj0 = 0 ; char *kwnames[] = { (char *) "self", NULL }; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FontDialog_ShowModal",kwnames,&obj0)) goto fail; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FontDialog_GetFontData",kwnames,&obj0)) goto fail; if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxFontDialog,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; { PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (int)(arg1)->ShowModal(); + { + wxFontData &_result_ref = (arg1)->GetFontData(); + result = (wxFontData *) &_result_ref; + } wxPyEndAllowThreads(__tstate); if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_PyObj_FromInt((int)result); + resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_wxFontData, 0); return resultobj; fail: return NULL; @@ -13150,31 +13150,6 @@ static PyObject *_wrap_new_MessageDialog(PyObject *self, PyObject *args, PyObjec } -static PyObject *_wrap_MessageDialog_ShowModal(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject *resultobj; - wxMessageDialog *arg1 = (wxMessageDialog *) 0 ; - int result; - PyObject * obj0 = 0 ; - char *kwnames[] = { - (char *) "self", NULL - }; - - if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:MessageDialog_ShowModal",kwnames,&obj0)) goto fail; - if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_wxMessageDialog,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; - { - PyThreadState* __tstate = wxPyBeginAllowThreads(); - result = (int)(arg1)->ShowModal(); - - wxPyEndAllowThreads(__tstate); - if (PyErr_Occurred()) SWIG_fail; - } - resultobj = SWIG_PyObj_FromInt((int)result); - return resultobj; - fail: - return NULL; -} - - static PyObject * MessageDialog_swigregister(PyObject *self, PyObject *args) { PyObject *obj; if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; @@ -23070,12 +23045,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"SingleChoiceDialog_GetSelection", (PyCFunction) _wrap_SingleChoiceDialog_GetSelection, METH_VARARGS | METH_KEYWORDS }, { (char *)"SingleChoiceDialog_GetStringSelection", (PyCFunction) _wrap_SingleChoiceDialog_GetStringSelection, METH_VARARGS | METH_KEYWORDS }, { (char *)"SingleChoiceDialog_SetSelection", (PyCFunction) _wrap_SingleChoiceDialog_SetSelection, METH_VARARGS | METH_KEYWORDS }, - { (char *)"SingleChoiceDialog_ShowModal", (PyCFunction) _wrap_SingleChoiceDialog_ShowModal, METH_VARARGS | METH_KEYWORDS }, { (char *)"SingleChoiceDialog_swigregister", SingleChoiceDialog_swigregister, METH_VARARGS }, { (char *)"new_TextEntryDialog", (PyCFunction) _wrap_new_TextEntryDialog, METH_VARARGS | METH_KEYWORDS }, { (char *)"TextEntryDialog_GetValue", (PyCFunction) _wrap_TextEntryDialog_GetValue, METH_VARARGS | METH_KEYWORDS }, { (char *)"TextEntryDialog_SetValue", (PyCFunction) _wrap_TextEntryDialog_SetValue, METH_VARARGS | METH_KEYWORDS }, - { (char *)"TextEntryDialog_ShowModal", (PyCFunction) _wrap_TextEntryDialog_ShowModal, METH_VARARGS | METH_KEYWORDS }, { (char *)"TextEntryDialog_swigregister", TextEntryDialog_swigregister, METH_VARARGS }, { (char *)"new_FontData", (PyCFunction) _wrap_new_FontData, METH_VARARGS | METH_KEYWORDS }, { (char *)"delete_FontData", (PyCFunction) _wrap_delete_FontData, METH_VARARGS | METH_KEYWORDS }, @@ -23093,12 +23066,10 @@ static PyMethodDef SwigMethods[] = { { (char *)"FontData_SetRange", (PyCFunction) _wrap_FontData_SetRange, METH_VARARGS | METH_KEYWORDS }, { (char *)"FontData_SetShowHelp", (PyCFunction) _wrap_FontData_SetShowHelp, METH_VARARGS | METH_KEYWORDS }, { (char *)"FontData_swigregister", FontData_swigregister, METH_VARARGS }, - { (char *)"new_FontDialog", (PyCFunction) _wrap_new_FontDialog, METH_VARARGS | METH_KEYWORDS }, + { (char *)"new_FontDialog", _wrap_new_FontDialog, METH_VARARGS }, { (char *)"FontDialog_GetFontData", (PyCFunction) _wrap_FontDialog_GetFontData, METH_VARARGS | METH_KEYWORDS }, - { (char *)"FontDialog_ShowModal", (PyCFunction) _wrap_FontDialog_ShowModal, METH_VARARGS | METH_KEYWORDS }, { (char *)"FontDialog_swigregister", FontDialog_swigregister, METH_VARARGS }, { (char *)"new_MessageDialog", (PyCFunction) _wrap_new_MessageDialog, METH_VARARGS | METH_KEYWORDS }, - { (char *)"MessageDialog_ShowModal", (PyCFunction) _wrap_MessageDialog_ShowModal, METH_VARARGS | METH_KEYWORDS }, { (char *)"MessageDialog_swigregister", MessageDialog_swigregister, METH_VARARGS }, { (char *)"new_ProgressDialog", (PyCFunction) _wrap_new_ProgressDialog, METH_VARARGS | METH_KEYWORDS }, { (char *)"ProgressDialog_Update", (PyCFunction) _wrap_ProgressDialog_Update, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/wxPython/misc.py b/wxPython/wxPython/misc.py index b9faf4bb83..4f130ed5f6 100644 --- a/wxPython/wxPython/misc.py +++ b/wxPython/wxPython/misc.py @@ -433,12 +433,12 @@ wxConfigBase_Set = wx.misc.ConfigBase_Set wxConfigBase_Get = wx.misc.ConfigBase_Get wxConfigBase_Create = wx.misc.ConfigBase_Create wxConfigBase_DontCreateOnDemand = wx.misc.ConfigBase_DontCreateOnDemand -wxConfigPathChanger = wx.misc.ConfigPathChanger -wxConfigPathChangerPtr = wx.misc.ConfigPathChangerPtr wxConfig = wx.misc.Config wxConfigPtr = wx.misc.ConfigPtr wxFileConfig = wx.misc.FileConfig wxFileConfigPtr = wx.misc.FileConfigPtr +wxConfigPathChanger = wx.misc.ConfigPathChanger +wxConfigPathChangerPtr = wx.misc.ConfigPathChangerPtr wxExpandEnvVars = wx.misc.ExpandEnvVars wxDateFormatStr = wx.misc.DateFormatStr wxTimeSpanFormatStr = wx.misc.TimeSpanFormatStr -- 2.45.2