From a0c0d1c33337dfc1da89352e3c9cbd103cf29ac0 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 12 Jun 2000 19:07:29 +0000 Subject: [PATCH] Added wxSpinCtrl Added some missing methods and constants Fixed wxTreeCtrl.HitTest bug new SWIGged code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/BUILD.txt | 46 ++++++-------- wxPython/CHANGES.txt | 1 + wxPython/demo/Main.py | 7 +- wxPython/demo/wxSpinCtrl.py | 37 +++++++++++ wxPython/demo/wxTreeCtrl.py | 3 +- wxPython/src/controls.i | 20 +++++- wxPython/src/controls2.i | 17 +++-- wxPython/src/msw/calendar.cpp | 2 + wxPython/src/msw/cmndlgs.cpp | 2 + wxPython/src/msw/controls.cpp | 113 ++++++++++++++++++++++++++++++++- wxPython/src/msw/controls.py | 14 ++++ wxPython/src/msw/controls2.cpp | 2 + wxPython/src/msw/controls2.py | 15 +++-- wxPython/src/msw/frames.cpp | 2 + wxPython/src/msw/grid.cpp | 2 + wxPython/src/msw/html.cpp | 2 + wxPython/src/msw/htmlhelp.cpp | 2 + wxPython/src/msw/mdi.cpp | 2 + wxPython/src/msw/printfw.cpp | 2 + wxPython/src/msw/sizers.cpp | 2 + wxPython/src/msw/stattool.cpp | 2 + wxPython/src/msw/windows.cpp | 58 +++++++++++++++++ wxPython/src/msw/windows.py | 6 ++ wxPython/src/msw/windows2.cpp | 7 ++ wxPython/src/msw/windows2.py | 5 ++ wxPython/src/msw/windows3.cpp | 2 + wxPython/src/msw/wx.cpp | 2 + wxPython/src/windows.i | 2 + wxPython/src/windows2.i | 12 ++++ 29 files changed, 347 insertions(+), 42 deletions(-) create mode 100644 wxPython/demo/wxSpinCtrl.py diff --git a/wxPython/BUILD.txt b/wxPython/BUILD.txt index bb6cef6c36..36366ccfeb 100644 --- a/wxPython/BUILD.txt +++ b/wxPython/BUILD.txt @@ -63,12 +63,17 @@ below.) wxUSE_NEW_GRID 1 wxUSE_GLOBAL_MEMORY_OPERATORS 0 wxUSE_LIBTIFF 1 + wxUSE_GLCANVAS 1 I also change these: wxUSE_DIALUP_MANAGER 0 - wxUSE_SOCKETS 0 - wxUSE_FS_INET 0 + wxUSE_DYNLIB_CLASS 0 + wxUSE_DOC_VIEW_ARCHITECTURE 0 + wxUSE_MDI_ARCHITECTURE 0 + wxUSE_PLOT 0 + wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 + There are probably other flags that can be disabled to remove things not being used in wxPython, but I havn't investigated all @@ -84,12 +89,6 @@ below.) If you want to make a release build, add FINAL=1 to the nmake command, as well as to build.local for wxPython, (see below.) - If you want the optional OGL (Object Graphics Library) and/or STC - (Styled Text Control) then you need to go to contrib/src/ogl and - contrib/src/stc and build those libraries. The command to use is: - - nmake -f makefile.vc WXUSINGDLL=1 CRTFLAG=/MD EXTRAFLAGS=-D__NO_VC_CRTDBG__ - 2. For either platform, you should be sure to set an environment variable named WXWIN to be the path to the top of the wxWindows @@ -97,25 +96,24 @@ below.) 3. If you are working from a copy of the code retrieved from CVS, then - you will find wxPython in $WXWIN/utils/wxPython. If you are - working from the tar.gz or .zip files then you will probably want - to unpack wxPython in the $WXWIN/utils directory and rename the new - directory to wxPython (or use a symlink.) If you want to keep it - in a separate directory then you can change where the build.py tool - expects to find it by creating a file named build.local (see step 7 - for more examples about build.local,) containing something like - this: + you will find wxPython in $WXWIN/wxPython. If you are working from + the tar.gz or .zip files then you will probably want to unpack + wxPython in the $WXWIN directory and rename the new directory to + wxPython (or use a symlink.) If you want to keep it in a separate + directory then you can change where the build.py tool expects to + find it by creating a file named build.local (see step 7 for more + examples about build.local,) containing something like this: WXPSRCDIR = "~/MyStuff/wxPython-2.1.15/src" 4. At this point you may want to make an alias, symlink, script, batch file, or whatever on the PATH that invokes - $WXWIN/utils/wxPython/distrib/build.py to help simplify matters - somewhat. For example, on my win32 system I have a file named - build.bat in a directory on the PATH that contains: + $WXWIN/wxPython/distrib/build.py to help simplify matters somewhat. + For example, on my win32 system I have a file named build.bat in a + directory on the PATH that contains: - python %WXWIN%/utils/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6 + python %WXWIN%/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6 5. Change into the $(WXWIN)/utils/wxPython/src directory. @@ -151,8 +149,8 @@ below.) 8. To build and install the add-on modules, change to the appropriate - directory under $WXWIN/utils/wxPython/modules and run the build - utility again. + directory under $WXWIN/wxPython/contrib and run the build utility + again. 9. Change to the $WXWIN/utils/wxPython/demo directory. @@ -166,7 +164,3 @@ below.) pythonw.exe version of Python either from the command line or from a shortcut. - - - - diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 9fb17b511e..f76b5bcee3 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -42,6 +42,7 @@ modify your code to add the EVT_* to hook the event to the method. OnCloseWindow OnScroll +Added wxSpinCtrl. diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index c15a3a70c5..9a14510b02 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -22,7 +22,7 @@ _useSplitter = true _useNestedSplitter = true _treeList = [ - ('New since last release', ['wxDragImage', 'wxCalendarCtrl', + ('New since last release', ['wxDragImage', 'wxCalendarCtrl', 'wxSpinCtrl', ]), ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']), @@ -40,8 +40,9 @@ _treeList = [ ('Controls', ['wxButton', 'wxCheckBox', 'wxCheckListBox', 'wxChoice', 'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl', - 'wxTreeCtrl', 'wxSpinButton', 'wxStaticText', 'wxStaticBitmap', - 'wxRadioBox', 'wxSlider', 'wxToolBar', #'wxToggleButton' + 'wxTreeCtrl', 'wxSpinButton', 'wxSpinCtrl', 'wxStaticText', + 'wxStaticBitmap', 'wxRadioBox', 'wxSlider', 'wxToolBar', + #'wxToggleButton' ]), ('Window Layout', ['wxLayoutConstraints', 'Sizers', 'OldSizers']), diff --git a/wxPython/demo/wxSpinCtrl.py b/wxPython/demo/wxSpinCtrl.py new file mode 100644 index 0000000000..7729b88b5d --- /dev/null +++ b/wxPython/demo/wxSpinCtrl.py @@ -0,0 +1,37 @@ + +from wxPython.wx import * + +import string + +#---------------------------------------------------------------------- + +class TestPanel(wxPanel): + def __init__(self, parent, log): + wxPanel.__init__(self, parent, -1) + self.log = log + self.count = 0 + + wxStaticText(self, -1, "This example uses the wxSpinCtrl control.", + wxPoint(45, 15)) + + sc = wxSpinCtrl(self, -1, "", wxPoint(30, 50), wxSize(80, -1)) + sc.SetRange(1,100) + sc.SetValue(5) + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = TestPanel(nb, log) + return win + +#---------------------------------------------------------------------- + + + + + + + +overview = """\ +""" diff --git a/wxPython/demo/wxTreeCtrl.py b/wxPython/demo/wxTreeCtrl.py index 8c46448325..9f1c20183a 100644 --- a/wxPython/demo/wxTreeCtrl.py +++ b/wxPython/demo/wxTreeCtrl.py @@ -77,7 +77,8 @@ class TestTreeCtrlPanel(wxPanel): def OnRightClick(self, event): pt = event.GetPosition(); item, flags = self.tree.HitTest(pt) - self.log.WriteText("OnRightClick: %s\n" % self.tree.GetItemText(item)) + self.log.WriteText("OnRightClick: %s, %s\n" % (self.tree.GetItemText(item), + type(item))) self.tree.SelectItem(item) diff --git a/wxPython/src/controls.i b/wxPython/src/controls.i index 5c8e592e12..fe6928cb3d 100644 --- a/wxPython/src/controls.i +++ b/wxPython/src/controls.i @@ -16,6 +16,7 @@ #include "helpers.h" #include #include +#include #include #include //#include @@ -328,7 +329,7 @@ public: wxArrayInt lst; self->GetSelections(lst); PyObject *tup = PyTuple_New(lst.GetCount()); - for(int i=0; i #include +#include #include #include //#include @@ -3262,7 +3263,7 @@ static PyObject * wxListBox_GetSelections(wxListBox *self) { wxArrayInt lst; self->GetSelections(lst); PyObject *tup = PyTuple_New(lst.GetCount()); - for(int i=0; i" % (self.this,) +class wxSpinCtrl(wxSpinCtrlPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(controlsc.new_wxSpinCtrl,_args,_kwargs) + self.thisown = 1 + + + + #-------------- FUNCTION WRAPPERS ------------------ diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index 1bf2d519c9..7f23106db4 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -8022,6 +8022,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -8118,6 +8119,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxWindowDC","_class_wxWindowDC",0}, diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index 2feebd2b0f..cc494e055b 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -798,14 +798,19 @@ class wxTreeCtrlPtr(wxControlPtr): def __repr__(self): return "" % (self.this,) - # Redefine a couple methods that SWIG gets a bit confused on... - def GetFirstChild(self,arg0,arg1): - val1, val2 = controls2c.wxTreeCtrl_GetFirstChild(self.this,arg0.this,arg1) + # Redefine some methods that SWIG gets a bit confused on... + def GetFirstChild(self, *_args, **_kwargs): + val1,val2 = apply(controls2c.wxTreeCtrl_GetFirstChild,(self,) + _args, _kwargs) val1 = wxTreeItemIdPtr(val1) val1.thisown = 1 return (val1,val2) - def GetNextChild(self,arg0,arg1): - val1, val2 = controls2c.wxTreeCtrl_GetNextChild(self.this,arg0.this,arg1) + def GetNextChild(self, *_args, **_kwargs): + val1,val2 = apply(controls2c.wxTreeCtrl_GetNextChild,(self,) + _args, _kwargs) + val1 = wxTreeItemIdPtr(val1) + val1.thisown = 1 + return (val1,val2) + def HitTest(self, *_args, **_kwargs): + val1, val2 = apply(controls2c.wxTreeCtrl_HitTest,(self,) + _args, _kwargs) val1 = wxTreeItemIdPtr(val1) val1.thisown = 1 return (val1,val2) diff --git a/wxPython/src/msw/frames.cpp b/wxPython/src/msw/frames.cpp index 3c0b73105a..58f4237c58 100644 --- a/wxPython/src/msw/frames.cpp +++ b/wxPython/src/msw/frames.cpp @@ -1174,6 +1174,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -1260,6 +1261,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxWindowDC","_class_wxWindowDC",0}, diff --git a/wxPython/src/msw/grid.cpp b/wxPython/src/msw/grid.cpp index a5f1462c4b..2b72368545 100644 --- a/wxPython/src/msw/grid.cpp +++ b/wxPython/src/msw/grid.cpp @@ -12676,6 +12676,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -12793,6 +12794,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxGridCellStringRenderer","_class_wxGridCellFloatRenderer",SwigwxGridCellFloatRendererTowxGridCellStringRenderer}, diff --git a/wxPython/src/msw/html.cpp b/wxPython/src/msw/html.cpp index e421cf73a8..6259b3bde0 100644 --- a/wxPython/src/msw/html.cpp +++ b/wxPython/src/msw/html.cpp @@ -5668,6 +5668,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_wxFontData","_class_wxFontData",0}, { "_class_HtmlHistoryItem","_HtmlHistoryItem",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, @@ -5812,6 +5813,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSashLayoutWindow","_wxSashLayoutWindow",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_class_wxFontData","_wxFontData",0}, { "_class_wxPNMHandler","_wxPNMHandler",0}, { "_wxBoxSizer","_class_wxBoxSizer",0}, diff --git a/wxPython/src/msw/htmlhelp.cpp b/wxPython/src/msw/htmlhelp.cpp index 845df7c18e..b93b7860d9 100644 --- a/wxPython/src/msw/htmlhelp.cpp +++ b/wxPython/src/msw/htmlhelp.cpp @@ -2659,6 +2659,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_wxFontData","_class_wxFontData",0}, { "_class_HtmlHistoryItem","_HtmlHistoryItem",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, @@ -2801,6 +2802,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSashLayoutWindow","_wxSashLayoutWindow",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_class_wxFontData","_wxFontData",0}, { "_class_wxPNMHandler","_wxPNMHandler",0}, { "_wxBoxSizer","_class_wxBoxSizer",0}, diff --git a/wxPython/src/msw/mdi.cpp b/wxPython/src/msw/mdi.cpp index 79f454aa9c..178767f380 100644 --- a/wxPython/src/msw/mdi.cpp +++ b/wxPython/src/msw/mdi.cpp @@ -740,6 +740,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -828,6 +829,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxWindowDC","_class_wxWindowDC",0}, diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp index 8f208ec8a1..b6d6548a70 100644 --- a/wxPython/src/msw/printfw.cpp +++ b/wxPython/src/msw/printfw.cpp @@ -4366,6 +4366,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_wxFontData","_class_wxFontData",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, @@ -4474,6 +4475,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_class_wxFontData","_wxFontData",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, diff --git a/wxPython/src/msw/sizers.cpp b/wxPython/src/msw/sizers.cpp index cdf969a710..5a9d1b9af5 100644 --- a/wxPython/src/msw/sizers.cpp +++ b/wxPython/src/msw/sizers.cpp @@ -2828,6 +2828,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -2928,6 +2929,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_wxBoxSizer","_class_wxStaticBoxSizer",SwigwxStaticBoxSizerTowxBoxSizer}, { "_wxBoxSizer","_wxStaticBoxSizer",SwigwxStaticBoxSizerTowxBoxSizer}, { "_wxBoxSizer","_class_wxBoxSizer",0}, diff --git a/wxPython/src/msw/stattool.cpp b/wxPython/src/msw/stattool.cpp index 5d43a9b9ff..52d8e0963d 100644 --- a/wxPython/src/msw/stattool.cpp +++ b/wxPython/src/msw/stattool.cpp @@ -3131,6 +3131,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -3224,6 +3225,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxWindowDC","_class_wxWindowDC",0}, diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 679b80b0c5..e264927e8b 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -2466,6 +2466,62 @@ static PyObject *_wrap_wxWindow_GetWindowStyleFlag(PyObject *self, PyObject *arg return _resultobj; } +#define wxWindow_SetWindowStyleFlag(_swigobj,_swigarg0) (_swigobj->SetWindowStyleFlag(_swigarg0)) +static PyObject *_wrap_wxWindow_SetWindowStyleFlag(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","style", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxWindow_SetWindowStyleFlag",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_SetWindowStyleFlag. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_SetWindowStyleFlag(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxWindow_SetWindowStyle(_swigobj,_swigarg0) (_swigobj->SetWindowStyle(_swigarg0)) +static PyObject *_wrap_wxWindow_SetWindowStyle(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxWindow * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","style", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxWindow_SetWindowStyle",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_SetWindowStyle. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxWindow_SetWindowStyle(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxWindow_Hide(_swigobj) (_swigobj->Hide()) static PyObject *_wrap_wxWindow_Hide(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -9056,6 +9112,8 @@ static PyMethodDef windowscMethods[] = { { "wxWindow_IsEnabled", (PyCFunction) _wrap_wxWindow_IsEnabled, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_InitDialog", (PyCFunction) _wrap_wxWindow_InitDialog, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Hide", (PyCFunction) _wrap_wxWindow_Hide, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetWindowStyle", (PyCFunction) _wrap_wxWindow_SetWindowStyle, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_SetWindowStyleFlag", (PyCFunction) _wrap_wxWindow_SetWindowStyleFlag, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetWindowStyleFlag", (PyCFunction) _wrap_wxWindow_GetWindowStyleFlag, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetUpdateRegion", (PyCFunction) _wrap_wxWindow_GetUpdateRegion, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetTitle", (PyCFunction) _wrap_wxWindow_GetTitle, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 99718ba8b7..4af6096011 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -262,6 +262,12 @@ class wxWindowPtr(wxEvtHandlerPtr): def GetWindowStyleFlag(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_GetWindowStyleFlag,(self,) + _args, _kwargs) return val + def SetWindowStyleFlag(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetWindowStyleFlag,(self,) + _args, _kwargs) + return val + def SetWindowStyle(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_SetWindowStyle,(self,) + _args, _kwargs) + return val def Hide(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_Hide,(self,) + _args, _kwargs) return val diff --git a/wxPython/src/msw/windows2.cpp b/wxPython/src/msw/windows2.cpp index c4edd5a0cf..202bd9d833 100644 --- a/wxPython/src/msw/windows2.cpp +++ b/wxPython/src/msw/windows2.cpp @@ -1973,6 +1973,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -2070,6 +2071,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPoint","_class_wxPoint",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, @@ -2311,6 +2313,11 @@ SWIGEXPORT(void) initwindows2c() { SWIG_globals = SWIG_newvarlink(); m = Py_InitModule("windows2c", windows2cMethods); d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxSPLIT_HORIZONTAL", PyInt_FromLong((long) wxSPLIT_HORIZONTAL)); + PyDict_SetItemString(d,"wxSPLIT_VERTICAL", PyInt_FromLong((long) wxSPLIT_VERTICAL)); + PyDict_SetItemString(d,"wxSPLIT_DRAG_NONE", PyInt_FromLong((long) wxSPLIT_DRAG_NONE)); + PyDict_SetItemString(d,"wxSPLIT_DRAG_DRAGGING", PyInt_FromLong((long) wxSPLIT_DRAG_DRAGGING)); + PyDict_SetItemString(d,"wxSPLIT_DRAG_LEFT_DOWN", PyInt_FromLong((long) wxSPLIT_DRAG_LEFT_DOWN)); PyDict_SetItemString(d,"wxEVT_TASKBAR_MOVE", PyInt_FromLong((long) wxEVT_TASKBAR_MOVE)); PyDict_SetItemString(d,"wxEVT_TASKBAR_LEFT_DOWN", PyInt_FromLong((long) wxEVT_TASKBAR_LEFT_DOWN)); PyDict_SetItemString(d,"wxEVT_TASKBAR_LEFT_UP", PyInt_FromLong((long) wxEVT_TASKBAR_LEFT_UP)); diff --git a/wxPython/src/msw/windows2.py b/wxPython/src/msw/windows2.py index f6996924e4..3e39408b67 100644 --- a/wxPython/src/msw/windows2.py +++ b/wxPython/src/msw/windows2.py @@ -250,6 +250,11 @@ class wxTaskBarIcon(wxTaskBarIconPtr): #-------------- VARIABLE WRAPPERS ------------------ +wxSPLIT_HORIZONTAL = windows2c.wxSPLIT_HORIZONTAL +wxSPLIT_VERTICAL = windows2c.wxSPLIT_VERTICAL +wxSPLIT_DRAG_NONE = windows2c.wxSPLIT_DRAG_NONE +wxSPLIT_DRAG_DRAGGING = windows2c.wxSPLIT_DRAG_DRAGGING +wxSPLIT_DRAG_LEFT_DOWN = windows2c.wxSPLIT_DRAG_LEFT_DOWN wxEVT_TASKBAR_MOVE = windows2c.wxEVT_TASKBAR_MOVE wxEVT_TASKBAR_LEFT_DOWN = windows2c.wxEVT_TASKBAR_LEFT_DOWN wxEVT_TASKBAR_LEFT_UP = windows2c.wxEVT_TASKBAR_LEFT_UP diff --git a/wxPython/src/msw/windows3.cpp b/wxPython/src/msw/windows3.cpp index 4f243c1126..920ae40a10 100644 --- a/wxPython/src/msw/windows3.cpp +++ b/wxPython/src/msw/windows3.cpp @@ -1757,6 +1757,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, { "_class_wxMenuBar","_wxMenuBar",0}, @@ -1864,6 +1865,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSashLayoutWindow","_wxSashLayoutWindow",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index ce94ed21f0..e07f35db10 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -1717,6 +1717,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPrintQuality","_EBool",0}, { "_wxPrintQuality","_size_t",0}, { "_class_wxCustomDataObject","_wxCustomDataObject",0}, + { "_wxSpinCtrl","_class_wxSpinCtrl",0}, { "_wxFontData","_class_wxFontData",0}, { "_class_wxRegionIterator","_wxRegionIterator",0}, { "_class_wxPyTextDropTarget","_wxPyTextDropTarget",0}, @@ -1848,6 +1849,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxSashLayoutWindow","_wxSashLayoutWindow",0}, { "_class_wxButton","_wxButton",0}, { "_wxRadioBox","_class_wxRadioBox",0}, + { "_class_wxSpinCtrl","_wxSpinCtrl",0}, { "_class_wxFontData","_wxFontData",0}, { "_class_wxPNMHandler","_wxPNMHandler",0}, { "_wxBoxSizer","_class_wxBoxSizer",0}, diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 1ce31f6a8b..cdc34d5a12 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -233,6 +233,8 @@ public: wxString GetTitle(); wxRegion GetUpdateRegion(); long GetWindowStyleFlag(); + void SetWindowStyleFlag(long style); + void SetWindowStyle(long style); bool Hide(); void InitDialog(); bool IsEnabled(); diff --git a/wxPython/src/windows2.i b/wxPython/src/windows2.i index 31d5da09b3..0a0658dc6b 100644 --- a/wxPython/src/windows2.i +++ b/wxPython/src/windows2.i @@ -305,6 +305,18 @@ public: //--------------------------------------------------------------------------- + +enum +{ + wxSPLIT_HORIZONTAL, + wxSPLIT_VERTICAL, + wxSPLIT_DRAG_NONE, + wxSPLIT_DRAG_DRAGGING, + wxSPLIT_DRAG_LEFT_DOWN + +}; + + class wxSplitterEvent : public wxCommandEvent { public: int GetSashPosition();