From 1b62f00d8e3ec5437ab780cb3d73d299cc61e20c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 16 Feb 2001 08:19:50 +0000 Subject: [PATCH] Copied/merged from the 2.2 branch. Changes needed to build with new event system git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/BUILD.win32.txt | 5 - wxPython/CHANGES.txt | 23 +- wxPython/MANIFEST.in | 2 + wxPython/b | 27 +- wxPython/contrib/glcanvas/msw/glcanvas.cpp | 4 +- wxPython/contrib/ogl/ogl.cpp | 10 +- wxPython/contrib/ogl/oglbasic.cpp | 10 +- wxPython/contrib/ogl/oglcanvas.cpp | 10 +- wxPython/contrib/ogl/oglshapes.cpp | 10 +- wxPython/contrib/ogl/oglshapes2.cpp | 10 +- wxPython/demo/FancyText.py | 41 ++ wxPython/demo/FileBrowseButton.py | 37 +- wxPython/demo/LayoutAnchors.py | 140 +++++++ wxPython/demo/Main.py | 6 +- wxPython/demo/bitmaps/robin.jpg | Bin 0 -> 4799 bytes wxPython/demo/bitmaps/test2.bmp | Bin 12342 -> 12342 bytes wxPython/demo/data/pic2.gif | Bin 0 -> 9184 bytes wxPython/demo/data/test.htm | 4 + wxPython/demo/wxChoice.py | 4 +- wxPython/demo/wxColourDialog.py | 5 +- wxPython/demo/wxListBox.py | 2 +- wxPython/demo/wxSashWindow.py | 2 +- wxPython/demo/wxStaticBitmap.py | 6 + wxPython/demo/wxTextEntryDialog.py | 20 - wxPython/demo/wxToolBar.py | 2 +- wxPython/distrib/wxPython.WSM | Bin 33 -> 33 bytes wxPython/distrib/wxPython.wse | 24 +- wxPython/distrib/zipall.bat | 4 + wxPython/setup.py | 418 +++++++-------------- wxPython/src/__version__.py | 2 +- wxPython/src/_defs.i | 62 +-- wxPython/src/controls2.i | 57 ++- wxPython/src/export.h | 8 +- wxPython/src/gdi.i | 9 - wxPython/src/gtk/misc2.cpp | 164 +++++--- wxPython/src/gtk/misc2.py | 9 +- wxPython/src/gtk/windows3.cpp | 3 + wxPython/src/gtk/windows3.py | 3 + wxPython/src/gtk/wx.cpp | 3 + wxPython/src/gtk/wx.py | 3 + wxPython/src/htmlhelp.i | 2 +- wxPython/src/libpy.c | 19 + wxPython/src/misc.i | 50 ++- wxPython/src/misc2.i | 13 + wxPython/src/msw/calendar.cpp | 2 - wxPython/src/msw/clip_dnd.cpp | 2 - wxPython/src/msw/cmndlgs.cpp | 2 - wxPython/src/msw/controls.cpp | 2 - wxPython/src/msw/controls2.cpp | 110 +++++- wxPython/src/msw/controls2.py | 39 ++ wxPython/src/msw/events.cpp | 2 - wxPython/src/msw/filesys.cpp | 2 - wxPython/src/msw/frames.cpp | 2 - wxPython/src/msw/gdi.cpp | 116 ------ wxPython/src/msw/gdi.py | 14 - wxPython/src/msw/grid.cpp | 2 - wxPython/src/msw/html.cpp | 4 +- wxPython/src/msw/htmlhelp.cpp | 4 +- wxPython/src/msw/image.cpp | 2 - wxPython/src/msw/mdi.cpp | 2 - wxPython/src/msw/misc2.cpp | 109 +++++- wxPython/src/msw/misc2.py | 3 + wxPython/src/msw/printfw.cpp | 153 +++++++- wxPython/src/msw/printfw.py | 19 + wxPython/src/msw/sizers.cpp | 2 - wxPython/src/msw/stattool.cpp | 2 - wxPython/src/msw/windows.cpp | 49 ++- wxPython/src/msw/windows.py | 2 + wxPython/src/msw/windows2.cpp | 8 +- wxPython/src/msw/windows2.py | 6 + wxPython/src/msw/windows3.cpp | 5 +- wxPython/src/msw/windows3.py | 3 + wxPython/src/msw/wx.cpp | 55 +-- wxPython/src/msw/wx.py | 51 +-- wxPython/src/printfw.i | 14 + wxPython/src/windows.i | 4 + wxPython/src/windows2.i | 17 +- wxPython/src/windows3.i | 3 + wxPython/tests/dynamicform.py | 62 +++ wxPython/tests/test2.py | 11 + wxPython/tests/test3.py | 11 + wxPython/tests/test4.py | 11 + wxPython/wxPython/lib/anchors.py | 91 +++++ wxPython/wxPython/lib/buttons.py | 11 +- wxPython/wxPython/lib/fancytext.py | 249 ++++++++++++ wxPython/wxPython/lib/filebrowsebutton.py | 2 +- wxPython/wxPython/lib/rpcMixin.py | 236 ++++++++++++ 87 files changed, 1982 insertions(+), 747 deletions(-) create mode 100644 wxPython/demo/FancyText.py create mode 100644 wxPython/demo/LayoutAnchors.py create mode 100644 wxPython/demo/bitmaps/robin.jpg create mode 100644 wxPython/demo/data/pic2.gif create mode 100755 wxPython/distrib/zipall.bat create mode 100644 wxPython/tests/dynamicform.py create mode 100644 wxPython/wxPython/lib/anchors.py create mode 100644 wxPython/wxPython/lib/fancytext.py create mode 100644 wxPython/wxPython/lib/rpcMixin.py diff --git a/wxPython/BUILD.win32.txt b/wxPython/BUILD.win32.txt index 4944ecebe2..d86ccfa952 100644 --- a/wxPython/BUILD.win32.txt +++ b/wxPython/BUILD.win32.txt @@ -55,10 +55,6 @@ B. You'll usually want to use wxWindows sources that have the same version number as the wxPython sources you are using. (Another advantage of using CVS is that you'll get both at the same time.) - NOTE: There probably isn't going to be an official 2.2.2 release - for wxMSW so I have taken a snapshot of my workspace and made it - available at http://alldunn.com/wxPython/dist/others/ - C. Once you get the sources be sure to put them in a path without a space in it (i.e., NOT c:\Program Files\wx) and set an environment variable named WXWIN to this directory. For example: @@ -93,7 +89,6 @@ D. Change to the wx2\include\wx\msw directory and copy setup0.h to wxUSE_DIALUP_MANAGER 0 wxUSE_DYNLIB_CLASS 0 wxUSE_DOC_VIEW_ARCHITECTURE 0 - wxUSE_MDI_ARCHITECTURE 0 wxUSE_PLOT 0 wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0 diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 9b96d8c58a..320f184450 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -2,7 +2,8 @@ CHANGES.txt for wxPython ---------------------------------------------------------------------- -2.3b2 + +2.2.5 ----- New typemaps for wxString when compiling for Python 2.0 and beyond @@ -35,8 +36,8 @@ Fixed GOBS of reference leaks. Massive code changes and cleanup to allow wxPython to be split into multiple extension modules again. A Python CObject is used to allow -the "export" of SWIG and other common helper functions from the wxc -module to other modules, even if they are in separate shared +the "export" of SWIG functions and other common helper functions from +the wxc module to other modules, even if they are in separate shared libraries. Should also be usable from 3rd party code, just include wxPython/src/export.h @@ -44,6 +45,22 @@ Changed the default setup so the following are built as separate extension modules: calendar, glcanvas, grid, html, ogl, stc, and utils. Will probably add more later. +Changed the wxPrinterDC to use the new constructor taking a +wxPrintData object. The old ctor is still there using the +wxPrinterDC2 name. + +Added wxPython.lib.anchors.py from Riaan Booysen. It contains a class +that implements Delphi's Anchors with wxLayoutConstraints. + +Added wxPython.lib.fancytext from Timothy Hochberg. + +Changed the GenericButtons to send their event in idle time, so the +mouse won't be captured when the event handler is called. + +Added wxPython.lib.rpcMixin from Greg Landrum, although it's not +integrated with the demo yet. It allows a wxPython GUI to be an +XML-RPC server. + New in 2.2.2 diff --git a/wxPython/MANIFEST.in b/wxPython/MANIFEST.in index eaffe899e6..2f1074b3fd 100644 --- a/wxPython/MANIFEST.in +++ b/wxPython/MANIFEST.in @@ -2,6 +2,8 @@ include *.txt include my_distutils.py ## include my_install_data.py include licence/*.txt +include b +include b.bat include demo/*.py include demo/bitmaps/*.bmp diff --git a/wxPython/b b/wxPython/b index c6ac5afd3f..7b5f575b73 100755 --- a/wxPython/b +++ b/wxPython/b @@ -33,8 +33,31 @@ elif [ "$1" = "s" ]; then # "r" --> rpm dist elif [ "$1" = "r" ]; then - shift - CMD="$SETUP $OTHERFLAGS bdist_rpm" + + # save the original + cp setup.py setup.py.save + + # fix up setup.py the way we want... + sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp + sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py + + # build wxPython-gl RPM + $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt + rm dist/wxPython-gl*.tar.gz + + # Build wxPython RPM + cp setup.py setup.py.temp + sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py + $SETUP $OTHERFLAGS bdist_rpm + + # put the oringal back + cp setup.py.save setup.py + rm setup.py.* + + # rebuild the source dist without the munched up setup.py + $SETUP $OTHERFLAGS sdist + exit 0 + # (no command arg) --> normal build for development else diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.cpp b/wxPython/contrib/glcanvas/msw/glcanvas.cpp index 0caf44c852..ec3035dbd9 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas.cpp @@ -653,9 +653,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, { "_wxPNMHandler","_class_wxPNMHandler",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, @@ -972,12 +972,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyApp","_wxPyApp",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxLogTextCtrl","_wxLogTextCtrl",0}, { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, diff --git a/wxPython/contrib/ogl/ogl.cpp b/wxPython/contrib/ogl/ogl.cpp index c4fccd233a..e49f3498ef 100644 --- a/wxPython/contrib/ogl/ogl.cpp +++ b/wxPython/contrib/ogl/ogl.cpp @@ -351,6 +351,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -360,7 +361,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPySizer","_wxPySizer",0}, { "_class_wxPyCompositeShape","_wxPyCompositeShape",0}, { "_wxPyPolygonShape","_class_wxPyPolygonShape",0}, - { "_class_wxPostScriptDC","_wxPostScriptDC",0}, { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, @@ -426,6 +426,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxZipFSHandler","_wxZipFSHandler",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxPyControlPoint","_class_wxPyControlPoint",0}, { "_wxWindowDC","_class_wxWindowDC",0}, @@ -517,6 +518,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTextCtrl","_wxTextCtrl",0}, { "_class_wxListItemAttr","_wxListItemAttr",0}, { "_wxLayoutConstraints","_class_wxLayoutConstraints",0}, + { "_wxMetaFileDC","_class_wxMetaFileDC",0}, { "_class_wxTextDataObject","_wxTextDataObject",0}, { "_wxMenu","_class_wxMenu",0}, { "_class_wxMoveEvent","_wxMoveEvent",0}, @@ -552,6 +554,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBusyInfo","_class_wxBusyInfo",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, + { "_wxJoystick","_class_wxJoystick",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, { "_class_wxPyCircleShape","_wxPyCircleShape",0}, { "_wxClientDC","_class_wxClientDC",0}, @@ -569,6 +572,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_short","_short",0}, { "_wxMemoryDC","_class_wxMemoryDC",0}, { "_wxPyTextDataObject","_class_wxPyTextDataObject",0}, + { "_class_wxTaskBarIcon","_wxTaskBarIcon",0}, { "_class_wxPrintDialog","_wxPrintDialog",0}, { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0}, { "_class_wxPyControlPoint","_wxPyControlPoint",0}, @@ -579,7 +583,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStatusBar","_class_wxStatusBar",0}, { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0}, { "_class_wxCursor","_wxCursor",0}, - { "_wxPostScriptDC","_class_wxPostScriptDC",0}, { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxPyProcess","_wxPyProcess",0}, { "_class_wxImageHandler","_wxImageHandler",0}, @@ -588,6 +591,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, + { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, { "_wxControl","_class_wxControl",0}, { "_class_wxListBox","_wxListBox",0}, @@ -680,6 +684,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -738,6 +743,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGauge","_class_wxGauge",0}, { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, diff --git a/wxPython/contrib/ogl/oglbasic.cpp b/wxPython/contrib/ogl/oglbasic.cpp index 502eb64124..c3355e8420 100644 --- a/wxPython/contrib/ogl/oglbasic.cpp +++ b/wxPython/contrib/ogl/oglbasic.cpp @@ -8466,6 +8466,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxPyShapeEvtHandler","_class_wxPyShape",SwigwxPyShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_wxPyShape",SwigwxPyShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0}, @@ -8475,7 +8476,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxStatusBar","_wxStatusBar",0}, { "_class_wxGIFHandler","_wxGIFHandler",0}, { "_class_wxPySizer","_wxPySizer",0}, - { "_class_wxPostScriptDC","_wxPostScriptDC",0}, { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, @@ -8538,6 +8538,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxZipFSHandler","_wxZipFSHandler",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, @@ -8622,6 +8623,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTextCtrl","_wxTextCtrl",0}, { "_class_wxListItemAttr","_wxListItemAttr",0}, { "_wxLayoutConstraints","_class_wxLayoutConstraints",0}, + { "_wxMetaFileDC","_class_wxMetaFileDC",0}, { "_class_wxTextDataObject","_wxTextDataObject",0}, { "_wxMenu","_class_wxMenu",0}, { "_class_wxMoveEvent","_wxMoveEvent",0}, @@ -8656,6 +8658,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBusyInfo","_class_wxBusyInfo",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, + { "_wxJoystick","_class_wxJoystick",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, { "_wxClientDC","_class_wxClientDC",0}, { "_wxMouseEvent","_class_wxMouseEvent",0}, @@ -8671,6 +8674,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_short","_short",0}, { "_wxMemoryDC","_class_wxMemoryDC",0}, { "_wxPyTextDataObject","_class_wxPyTextDataObject",0}, + { "_class_wxTaskBarIcon","_wxTaskBarIcon",0}, { "_class_wxPrintDialog","_wxPrintDialog",0}, { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0}, { "_wxPaintDC","_class_wxPaintDC",0}, @@ -8680,7 +8684,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStatusBar","_class_wxStatusBar",0}, { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0}, { "_class_wxCursor","_wxCursor",0}, - { "_wxPostScriptDC","_class_wxPostScriptDC",0}, { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxPyProcess","_wxPyProcess",0}, { "_class_wxImageHandler","_wxImageHandler",0}, @@ -8689,6 +8692,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, + { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, { "_wxControl","_class_wxControl",0}, { "_class_wxListBox","_wxListBox",0}, @@ -8779,6 +8783,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -8834,6 +8839,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGauge","_class_wxGauge",0}, { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, diff --git a/wxPython/contrib/ogl/oglcanvas.cpp b/wxPython/contrib/ogl/oglcanvas.cpp index 6c53cdc3b8..3a261ff244 100644 --- a/wxPython/contrib/ogl/oglcanvas.cpp +++ b/wxPython/contrib/ogl/oglcanvas.cpp @@ -2107,6 +2107,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -2114,7 +2115,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxStatusBar","_wxStatusBar",0}, { "_class_wxGIFHandler","_wxGIFHandler",0}, { "_class_wxPySizer","_wxPySizer",0}, - { "_class_wxPostScriptDC","_wxPostScriptDC",0}, { "_wxPanel","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel}, { "_wxPanel","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel}, { "_wxPanel","_class_wxPanel",0}, @@ -2180,6 +2180,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxZipFSHandler","_wxZipFSHandler",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxWindowDC","_class_wxWindowDC",0}, { "_wxTimerEvent","_class_wxTimerEvent",0}, @@ -2267,6 +2268,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTextCtrl","_wxTextCtrl",0}, { "_class_wxListItemAttr","_wxListItemAttr",0}, { "_wxLayoutConstraints","_class_wxLayoutConstraints",0}, + { "_wxMetaFileDC","_class_wxMetaFileDC",0}, { "_class_wxTextDataObject","_wxTextDataObject",0}, { "_wxMenu","_class_wxMenu",0}, { "_class_wxMoveEvent","_wxMoveEvent",0}, @@ -2303,6 +2305,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBusyInfo","_class_wxBusyInfo",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, + { "_wxJoystick","_class_wxJoystick",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, { "_wxClientDC","_class_wxClientDC",0}, { "_wxMouseEvent","_class_wxMouseEvent",0}, @@ -2318,6 +2321,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_short","_short",0}, { "_wxMemoryDC","_class_wxMemoryDC",0}, { "_wxPyTextDataObject","_class_wxPyTextDataObject",0}, + { "_class_wxTaskBarIcon","_wxTaskBarIcon",0}, { "_class_wxPrintDialog","_wxPrintDialog",0}, { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0}, { "_wxPaintDC","_class_wxPaintDC",0}, @@ -2327,7 +2331,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStatusBar","_class_wxStatusBar",0}, { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0}, { "_class_wxCursor","_wxCursor",0}, - { "_wxPostScriptDC","_class_wxPostScriptDC",0}, { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxPyProcess","_wxPyProcess",0}, { "_class_wxImageHandler","_wxImageHandler",0}, @@ -2338,6 +2341,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, + { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, { "_wxControl","_class_wxControl",0}, { "_class_wxListBox","_wxListBox",0}, @@ -2428,6 +2432,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -2484,6 +2489,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGauge","_class_wxGauge",0}, { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, diff --git a/wxPython/contrib/ogl/oglshapes.cpp b/wxPython/contrib/ogl/oglshapes.cpp index 3fa3b83486..9e8fb32054 100644 --- a/wxPython/contrib/ogl/oglshapes.cpp +++ b/wxPython/contrib/ogl/oglshapes.cpp @@ -12663,6 +12663,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxPyShapeEvtHandler","_class_wxPyDivisionShape",SwigwxPyDivisionShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_wxPyDivisionShape",SwigwxPyDivisionShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_class_wxPyDividedShape",SwigwxPyDividedShapeTowxPyShapeEvtHandler}, @@ -12687,7 +12688,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyCompositeShape","_class_wxPyDivisionShape",SwigwxPyDivisionShapeTowxPyCompositeShape}, { "_class_wxPyCompositeShape","_wxPyDivisionShape",SwigwxPyDivisionShapeTowxPyCompositeShape}, { "_class_wxPyCompositeShape","_wxPyCompositeShape",0}, - { "_class_wxPostScriptDC","_wxPostScriptDC",0}, { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, @@ -12752,6 +12752,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxZipFSHandler","_wxZipFSHandler",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxPyControlPoint","_class_wxPyControlPoint",0}, { "_wxWindowDC","_class_wxWindowDC",0}, @@ -12839,6 +12840,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTextCtrl","_wxTextCtrl",0}, { "_class_wxListItemAttr","_wxListItemAttr",0}, { "_wxLayoutConstraints","_class_wxLayoutConstraints",0}, + { "_wxMetaFileDC","_class_wxMetaFileDC",0}, { "_class_wxTextDataObject","_wxTextDataObject",0}, { "_wxMenu","_class_wxMenu",0}, { "_class_wxMoveEvent","_wxMoveEvent",0}, @@ -12873,6 +12875,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBusyInfo","_class_wxBusyInfo",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, + { "_wxJoystick","_class_wxJoystick",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, { "_wxClientDC","_class_wxClientDC",0}, { "_wxMouseEvent","_class_wxMouseEvent",0}, @@ -12889,6 +12892,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_short","_short",0}, { "_wxMemoryDC","_class_wxMemoryDC",0}, { "_wxPyTextDataObject","_class_wxPyTextDataObject",0}, + { "_class_wxTaskBarIcon","_wxTaskBarIcon",0}, { "_class_wxPrintDialog","_wxPrintDialog",0}, { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0}, { "_class_wxPyControlPoint","_wxPyControlPoint",0}, @@ -12899,7 +12903,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStatusBar","_class_wxStatusBar",0}, { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0}, { "_class_wxCursor","_wxCursor",0}, - { "_wxPostScriptDC","_class_wxPostScriptDC",0}, { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxPyProcess","_wxPyProcess",0}, { "_class_wxImageHandler","_wxImageHandler",0}, @@ -12922,6 +12925,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, + { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, { "_wxControl","_class_wxControl",0}, { "_class_wxListBox","_wxListBox",0}, @@ -13013,6 +13017,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -13083,6 +13088,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGauge","_class_wxGauge",0}, { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, diff --git a/wxPython/contrib/ogl/oglshapes2.cpp b/wxPython/contrib/ogl/oglshapes2.cpp index 28905f8456..b8803b62f4 100644 --- a/wxPython/contrib/ogl/oglshapes2.cpp +++ b/wxPython/contrib/ogl/oglshapes2.cpp @@ -8004,6 +8004,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxPNMHandler","_class_wxPNMHandler",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxPyShapeEvtHandler","_class_wxPyTextShape",SwigwxPyTextShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_wxPyTextShape",SwigwxPyTextShapeTowxPyShapeEvtHandler}, { "_class_wxPyShapeEvtHandler","_class_wxPyPolygonShape",SwigwxPyPolygonShapeTowxPyShapeEvtHandler}, @@ -8023,7 +8024,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPySizer","_wxPySizer",0}, { "_class_wxPyCompositeShape","_wxPyCompositeShape",0}, { "_wxPyPolygonShape","_class_wxPyPolygonShape",0}, - { "_class_wxPostScriptDC","_wxPostScriptDC",0}, { "_wxPanel","_class_wxPanel",0}, { "_wxInitDialogEvent","_class_wxInitDialogEvent",0}, { "_wxCheckBox","_class_wxCheckBox",0}, @@ -8088,6 +8088,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxZipFSHandler","_wxZipFSHandler",0}, { "_char","_wxChar",0}, { "_wxBitmap","_class_wxBitmap",0}, + { "_wxTaskBarIcon","_class_wxTaskBarIcon",0}, { "_wxPrintDialog","_class_wxPrintDialog",0}, { "_wxPyControlPoint","_class_wxPyControlPoint",0}, { "_wxWindowDC","_class_wxWindowDC",0}, @@ -8178,6 +8179,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTextCtrl","_wxTextCtrl",0}, { "_class_wxListItemAttr","_wxListItemAttr",0}, { "_wxLayoutConstraints","_class_wxLayoutConstraints",0}, + { "_wxMetaFileDC","_class_wxMetaFileDC",0}, { "_class_wxTextDataObject","_wxTextDataObject",0}, { "_wxMenu","_class_wxMenu",0}, { "_class_wxMoveEvent","_wxMoveEvent",0}, @@ -8213,6 +8215,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxBusyInfo","_class_wxBusyInfo",0}, { "_class_wxMenuEvent","_wxMenuEvent",0}, { "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0}, + { "_wxJoystick","_class_wxJoystick",0}, { "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0}, { "_class_wxPyCircleShape","_wxPyCircleShape",0}, { "_wxClientDC","_class_wxClientDC",0}, @@ -8230,6 +8233,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_signed_short","_short",0}, { "_wxMemoryDC","_class_wxMemoryDC",0}, { "_wxPyTextDataObject","_class_wxPyTextDataObject",0}, + { "_class_wxTaskBarIcon","_wxTaskBarIcon",0}, { "_class_wxPrintDialog","_wxPrintDialog",0}, { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0}, { "_class_wxPyControlPoint","_wxPyControlPoint",0}, @@ -8240,7 +8244,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxStatusBar","_class_wxStatusBar",0}, { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0}, { "_class_wxCursor","_wxCursor",0}, - { "_wxPostScriptDC","_class_wxPostScriptDC",0}, { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0}, { "_class_wxPyProcess","_wxPyProcess",0}, { "_class_wxImageHandler","_wxImageHandler",0}, @@ -8259,6 +8262,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLog","_wxLog",0}, { "_wxTreeItemId","_class_wxTreeItemId",0}, { "_unsigned_char","_byte",0}, + { "_class_wxMetaFileDC","_wxMetaFileDC",0}, { "_class_wxMenu","_wxMenu",0}, { "_wxControl","_class_wxControl",0}, { "_class_wxListBox","_wxListBox",0}, @@ -8351,6 +8355,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -8418,6 +8423,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxGauge","_class_wxGauge",0}, { "_class_wxCheckListBox","_wxCheckListBox",0}, { "_class_wxBusyInfo","_wxBusyInfo",0}, + { "_class_wxJoystick","_wxJoystick",0}, { "_class_wxCommandEvent","_wxCommandEvent",0}, { "_class_wxClientDC","_wxClientDC",0}, { "_class_wxSizeEvent","_wxSizeEvent",0}, diff --git a/wxPython/demo/FancyText.py b/wxPython/demo/FancyText.py new file mode 100644 index 0000000000..edda6ce178 --- /dev/null +++ b/wxPython/demo/FancyText.py @@ -0,0 +1,41 @@ + +from wxPython.wx import * +from wxPython.lib import fancytext + +#---------------------------------------------------------------------- + +test_str = ('' + 'some |23 textwith subscript' + ' some other text') + +test_str2 = 'big green text' + + +class TestPanel(wxPanel): + def __init__(self, parent): + wxPanel.__init__(self, parent, -1) + EVT_PAINT(self, self.OnPaint) + + + def OnPaint(self, evt): + dc = wxPaintDC(self) + + sz = fancytext.getExtent(test_str, dc) + fancytext.renderToDC(test_str, dc, 20, 20) + + fancytext.renderToDC(test_str2, dc, 20, 20 + sz.height + 10) + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = TestPanel(nb) + return win + +#---------------------------------------------------------------------- + + + +import string +overview = string.replace(fancytext.__doc__, "<", "<") + diff --git a/wxPython/demo/FileBrowseButton.py b/wxPython/demo/FileBrowseButton.py index c926dfa13a..9967ea355f 100644 --- a/wxPython/demo/FileBrowseButton.py +++ b/wxPython/demo/FileBrowseButton.py @@ -1,6 +1,10 @@ +""" Demonstrate filebrowsebutton module of the wxPython.lib Library. +14.1.2001 Bernhard Reiter + Added demo for DirBrowseButton and improved overview text. +""" from wxPython.wx import * -from wxPython.lib.filebrowsebutton import FileBrowseButton, FileBrowseButtonWithHistory +from wxPython.lib.filebrowsebutton import FileBrowseButton, FileBrowseButtonWithHistory,DirBrowseButton #---------------------------------------------------------------------- @@ -15,6 +19,9 @@ class TestPanel(wxPanel): wxSize(450, -1), #changeCallback = self.fbbhCallback ) + self.dbb = DirBrowseButton(self, -1, wxPoint(20,80), wxSize(450,-1), + changeCallback = self.dbbCallback) + self.fbbh.SetHistory(['You', 'can', 'put', 'some', 'file', 'names', 'here']) @@ -23,6 +30,7 @@ class TestPanel(wxPanel): self.log.write('FileBrowseButton: %s\n' % evt.GetString()) + def fbbhCallback(self, evt): if hasattr(self, 'fbbh'): value = evt.GetString() @@ -31,6 +39,10 @@ class TestPanel(wxPanel): history.append(value) self.fbbh.SetHistory(history) + def dbbCallback(self, evt): + self.log.write('DirBrowseButton: %s\n' % evt.GetString()) + + #---------------------------------------------------------------------- @@ -42,6 +54,23 @@ def runTest(frame, nb, log): #---------------------------------------------------------------------- - - -overview = FileBrowseButton.__doc__ +overview = """ +

class FileBrowseButton:

+
+%s
+
+ +

class FileBrowseButtonWithHistory(FileBrowseButton):

+
+%s
+
+ +

class DirBrowseButton(FileBrowseButton):

+
+%s
+
+ +< +""" % ( FileBrowseButton.__doc__, + FileBrowseButtonWithHistory.__doc__ , + str(DirBrowseButton.__doc__) ) diff --git a/wxPython/demo/LayoutAnchors.py b/wxPython/demo/LayoutAnchors.py new file mode 100644 index 0000000000..b201372a7e --- /dev/null +++ b/wxPython/demo/LayoutAnchors.py @@ -0,0 +1,140 @@ + +from wxPython.wx import * +from wxPython.lib.anchors import LayoutAnchors + +#---------------------------------------------------------------------- + + +[wxID_ANCHORSDEMOFRAMEANCHOREDPANEL, wxID_ANCHORSDEMOFRAMEHELPSTATICTEXT, + wxID_ANCHORSDEMOFRAMEMAINPANEL, wxID_ANCHORSDEMOFRAMEBACKGROUNDPANEL, + wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, wxID_ANCHORSDEMOFRAMEOKBUTTON, + wxID_ANCHORSDEMOFRAMETOPCHECKBOX, wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, + wxID_ANCHORSDEMOFRAME, wxID_ANCHORSDEMOFRAMELEFTCHECKBOX, + ] = map(lambda _init_ctrls: wxNewId(), range(10)) + +class AnchorsDemoFrame(wxFrame): + def _init_utils(self): + pass + + def _init_ctrls(self, prnt): + wxFrame.__init__(self, size = wxSize(328, 187), id = wxID_ANCHORSDEMOFRAME, title = 'LayoutAnchors Demonstration', parent = prnt, name = 'AnchorsDemoFrame', style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN, pos = wxPoint(261, 123)) + self._init_utils() + + self.mainPanel = wxPanel(size = wxSize(320, 160), parent = self, id = wxID_ANCHORSDEMOFRAMEMAINPANEL, name = 'panel1', style = wxTAB_TRAVERSAL | wxCLIP_CHILDREN, pos = wxPoint(0, 0)) + self.mainPanel.SetAutoLayout(true) + + self.okButton = wxButton(label = 'OK', id = wxID_ANCHORSDEMOFRAMEOKBUTTON, parent = self.mainPanel, name = 'okButton', size = wxSize(72, 24), style = 0, pos = wxPoint(240, 128)) + self.okButton.SetConstraints(LayoutAnchors(self.okButton, false, false, true, true)) + EVT_BUTTON(self.okButton, wxID_ANCHORSDEMOFRAMEOKBUTTON, self.OnOkButtonButton) + + self.backgroundPanel = wxPanel(size = wxSize(304, 80), parent = self.mainPanel, id = wxID_ANCHORSDEMOFRAMEBACKGROUNDPANEL, name = 'backgroundPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN, pos = wxPoint(8, 40)) + self.backgroundPanel.SetBackgroundColour(wxColour(255, 255, 255)) + self.backgroundPanel.SetConstraints(LayoutAnchors(self.backgroundPanel, true, true, true, true)) + + self.anchoredPanel = wxPanel(size = wxSize(88, 48), id = wxID_ANCHORSDEMOFRAMEANCHOREDPANEL, parent = self.backgroundPanel, name = 'anchoredPanel', style = wxSIMPLE_BORDER, pos = wxPoint(104, 16)) + self.anchoredPanel.SetBackgroundColour(wxColour(0, 0, 222)) + self.anchoredPanel.SetConstraints(LayoutAnchors(self.anchoredPanel, false, false, false, false)) + + self.leftCheckBox = wxCheckBox(label = 'Left', id = wxID_ANCHORSDEMOFRAMELEFTCHECKBOX, parent = self.mainPanel, name = 'leftCheckBox', size = wxSize(40, 16), style = 0, pos = wxPoint(8, 8)) + self.leftCheckBox.SetConstraints(LayoutAnchors(self.leftCheckBox, false, true, false, false)) + EVT_CHECKBOX(self.leftCheckBox, wxID_ANCHORSDEMOFRAMELEFTCHECKBOX, self.OnCheckboxCheckbox) + + self.topCheckBox = wxCheckBox(label = 'Top', id = wxID_ANCHORSDEMOFRAMETOPCHECKBOX, parent = self.mainPanel, name = 'topCheckBox', size = wxSize(40, 16), style = 0, pos = wxPoint(88, 8)) + self.topCheckBox.SetConstraints(LayoutAnchors(self.topCheckBox, false, true, false, false)) + EVT_CHECKBOX(self.topCheckBox, wxID_ANCHORSDEMOFRAMETOPCHECKBOX, self.OnCheckboxCheckbox) + + self.rightCheckBox = wxCheckBox(label = 'Right', id = wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, parent = self.mainPanel, name = 'rightCheckBox', size = wxSize(48, 16), style = 0, pos = wxPoint(168, 8)) + self.rightCheckBox.SetConstraints(LayoutAnchors(self.rightCheckBox, false, true, false, false)) + EVT_CHECKBOX(self.rightCheckBox, wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, self.OnCheckboxCheckbox) + + self.bottomCheckBox = wxCheckBox(label = 'Bottom', id = wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, parent = self.mainPanel, name = 'bottomCheckBox', size = wxSize(56, 16), style = 0, pos = wxPoint(248, 8)) + self.bottomCheckBox.SetConstraints(LayoutAnchors(self.bottomCheckBox, false, true, false, false)) + EVT_CHECKBOX(self.bottomCheckBox, wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, self.OnCheckboxCheckbox) + + self.helpStaticText = wxStaticText(label = 'Select anchor options above, then resize window to see the effect', id = wxID_ANCHORSDEMOFRAMEHELPSTATICTEXT, parent = self.mainPanel, name = 'helpStaticText', size = wxSize(224, 24), style = wxST_NO_AUTORESIZE, pos = wxPoint(8, 128)) + self.helpStaticText.SetConstraints(LayoutAnchors(self.helpStaticText, true, false, true, true)) + + def __init__(self, parent): + self._init_ctrls(parent) + + def OnCheckboxCheckbox(self, event): + self.anchoredPanel.SetConstraints( + LayoutAnchors(self.anchoredPanel, + self.leftCheckBox.GetValue(), self.topCheckBox.GetValue(), + self.rightCheckBox.GetValue(), self.bottomCheckBox.GetValue()) ) + + def OnOkButtonButton(self, event): + self.Close() + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = AnchorsDemoFrame(frame) + frame.otherWin = win + win.Show(true) + + + + +#---------------------------------------------------------------------- + + + + +overview = """ +

LayoutAnchors

+ A class that implements Delphi's Anchors with wxLayoutConstraints. +

+ Anchored sides maintain the distance from the edge of the + control to the same edge of the parent. + When neither side is selected, the control keeps the same + relative position to both sides. +

+ The current position and size of the control and it's parent + is used when setting up the constraints. To change the size or + position of an already anchored control, set the constraints to + None, reposition or resize and reapply the anchors. +

+ Examples: +

+ Let's anchor the right and bottom edge of a control and + resize it's parent. +

+

+        ctrl.SetConstraints(LayoutAnchors(ctrl, left=0, top=0, right=1, bottom=1))
+
+        +=========+         +===================+
+        | +-----+ |         |                   |
+        | |     * |   ->    |                   |
+        | +--*--+ |         |           +-----+ |
+        +---------+         |           |     * |
+                            |           +--*--+ |
+                            +-------------------+
+        * = anchored edge
+
+

+ When anchored on both sides the control will stretch horizontally. +

+

+        ctrl.SetConstraints(LayoutAnchors(ctrl, 1, 0, 1, 1))
+
+        +=========+         +===================+
+        | +-----+ |         |                   |
+        | *     * |   ->    |                   |
+        | +--*--+ |         | +---------------+ |
+        +---------+         | *     ctrl      * |
+                            | +-------*-------+ |
+                            +-------------------+
+        * = anchored edge
+
+ +""" + + + + + + + + + diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 893fca90d2..7379e4db9f 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -20,7 +20,7 @@ from wxPython.html import wxHtmlWindow _treeList = [ - ('New since last release', ['wxProcess', + ('New since last release', ['LayoutAnchors', "FancyText", ]), ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']), @@ -43,14 +43,14 @@ _treeList = [ 'wxCalendarCtrl', ]), - ('Window Layout', ['wxLayoutConstraints', 'Sizers', ]), + ('Window Layout', ['wxLayoutConstraints', 'LayoutAnchors', 'Sizers', ]), ('Miscellaneous', [ 'DragAndDrop', 'CustomDragAndDrop', 'FontEnumerator', 'wxTimer', 'wxValidator', 'wxGLCanvas', 'DialogUnits', 'wxImage', 'wxMask', 'PrintFramework', 'wxOGL', 'PythonEvents', 'Threads', 'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE', - 'wxDragImage', + 'wxDragImage', "wxProcess", "FancyText", ]), ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog', diff --git a/wxPython/demo/bitmaps/robin.jpg b/wxPython/demo/bitmaps/robin.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f559cad0c186e2162a7683a94e77b29b7a86a444 GIT binary patch literal 4799 zcmb7{XIN8RmxfbFCQlv?fBAp;bP^yBINbgDsC?Z8r z=?F;GfG83~MWnZhe)G;d^K;hO|IW4db)WOBXRWnQXHH1~gu%s27Xd&Z5RgN80H^Z+ z9RL^v`m-oOMOhFU2!x6XLPt#vrGeAI;V?QFjGloRLC?U%0D~de5lk$sY;0_BMkEJ2 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 literal 0 HcmV?d00001 diff --git a/wxPython/demo/bitmaps/test2.bmp b/wxPython/demo/bitmaps/test2.bmp index 3a6547321271e48f304443d3597480f9e1b6f448..6f57c102c11423944009c3a3e1fb485450ffe66f 100644 GIT binary patch delta 533 zcmY+9O-lk%6o&6uj*O0E2$^U)sdHx>9TgHo2&P?|urDZr!lAY;{P+V!(N@Q^4VsOu zf*`?VxCz=R^ap0s4+z>%bFW{uxZL+X=Y7vPx3Bm0HfDo9gn~XJdj`k(Tcc7kbQTWt zcT{n3!BjwtczRXWQy3a-1cYdp-qz$c*Saob!y^uZ9-B!aPUV9`t+_M>O7~NacYP*> z1eF2N@s8z4j5?BoYrhA2$qwn?#z}bNIcTO%7m#hkFjXQrAg_QW20#_76t~0~Ht{8F zW1iwYT%Nj3d_~cc^atrMkjBoTv^96KVB!O(#PMa+-a)TNXhdeW=k)osBIHD7ytausXecM7u&iW^0SlTMUbOAWuLPL|a!l+G6@F0R z8>wGN`9$&ulHQ#y$RgE@MB=qv(aFZ=SrdD~&IrJ`6{s^CkRJ~fL(o+3$;(UgvG}m7{=kO- delta 691 zcmZvYze^)Q6vv0GnYhRLBVaIIqHdDSZW6O`#nZz>h=rh)5-dbG$-;q^&E0XmrG;R| zR|{!!l_0r*rQ{01?iBw3(_CQ}L9h|mH#1oi&|#MS@_FBR-#2sSp1Bp160unR>xlQx zV)ZZmK8EW;fvwLmmkxP^_>}))X8IRfn`f>{WrfvOp%@D_%7Ncw0gpgEI0kyW=F3)B zR>x}!o`I?v1$UyW^+~CZk+*tuRhPVEpg+;odQ$3e8vPx8osOYaVQ(M=jnt9IVP+D} zH5GmuTgoEl{xjw!&&I$tK7gGrD=Wwk(~^fX5uEKCESZ|JjeOl)5Pr#bm3?GG)+-C{ z;KT6yE<=@$LetWebDm-?`lqOH@C%o)tZECSvO@lBkgGeMnt9_p%@$!esKKXfRCz+n z-~0r$Ee#I(qJTq)2S;xhM92lDi?9OJZGI5P}=ZQ4e;3_YNaA<_JaHe>t6ch9DQZv!;?9YK0D7pYT diff --git a/wxPython/demo/data/pic2.gif b/wxPython/demo/data/pic2.gif new file mode 100644 index 0000000000000000000000000000000000000000..a7f522a20d778b7bec53b75be5c0138f68231689 GIT binary patch literal 9184 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, he? this is text......
Testing image image (try clicking on the image :-) and this is text...... + +
+Here is a GIF: +
 
 
    diff --git a/wxPython/demo/wxChoice.py b/wxPython/demo/wxChoice.py index 55ddbb5ebf..20b706694b 100644 --- a/wxPython/demo/wxChoice.py +++ b/wxPython/demo/wxChoice.py @@ -15,8 +15,8 @@ class TestChoice(wxPanel): wxPoint(15, 10)) wxStaticText(self, -1, "Select one:", wxPoint(15, 50), wxSize(75, 20)) - wxChoice(self, 40, wxPoint(80, 50), wxSize(95, 20), #wxDefaultSize, - sampleList) + wxChoice(self, 40, (80, 50), (95, 125), + choices = sampleList) EVT_CHOICE(self, 40, self.EvtChoice) def EvtChoice(self, event): diff --git a/wxPython/demo/wxColourDialog.py b/wxPython/demo/wxColourDialog.py index 1f06f5cb28..e750561b93 100644 --- a/wxPython/demo/wxColourDialog.py +++ b/wxPython/demo/wxColourDialog.py @@ -4,9 +4,8 @@ from wxPython.wx import * #--------------------------------------------------------------------------- def runTest(frame, nb, log): - data = wxColourData() - data.SetChooseFull(true) - dlg = wxColourDialog(frame, data) + dlg = wxColourDialog(frame) + dlg.GetColourData().SetChooseFull(true) if dlg.ShowModal() == wxID_OK: data = dlg.GetColourData() log.WriteText('You selected: %s\n' % str(data.GetColour().Get())) diff --git a/wxPython/demo/wxListBox.py b/wxPython/demo/wxListBox.py index ce659bd79c..11c21d9d90 100644 --- a/wxPython/demo/wxListBox.py +++ b/wxPython/demo/wxListBox.py @@ -66,7 +66,7 @@ class TestListBox(wxPanel): EVT_LISTBOX(self, 60, self.EvtListBox) EVT_LISTBOX_DCLICK(self, 60, self.EvtListBoxDClick) EVT_RIGHT_UP(self.lb1, self.EvtRightButton) - self.lb1.SetSelection(0) + self.lb1.SetSelection(3) wxStaticText(self, -1, "Select many:", wxPoint(200, 50), wxSize(65, 18)) diff --git a/wxPython/demo/wxSashWindow.py b/wxPython/demo/wxSashWindow.py index 620427eaeb..be6a46d7c5 100644 --- a/wxPython/demo/wxSashWindow.py +++ b/wxPython/demo/wxSashWindow.py @@ -15,7 +15,7 @@ class TestSashWindow(wxPanel): self.log = log - # will accupy the space not uised by the Layout Algorithm + # will occupy the space not used by the Layout Algorithm self.remainingSpace = wxPanel(self, -1, style=wxSUNKEN_BORDER) EVT_SASH_DRAGGED_RANGE(self, self.ID_WINDOW_TOP, diff --git a/wxPython/demo/wxStaticBitmap.py b/wxPython/demo/wxStaticBitmap.py index cb9c8df10b..5075e946c4 100644 --- a/wxPython/demo/wxStaticBitmap.py +++ b/wxPython/demo/wxStaticBitmap.py @@ -14,10 +14,16 @@ class TestPanel(wxPanel): wxStaticText(self, -1, "This is a wxStaticBitmap.", wxPoint(45, 15)) bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP) + mask = wxMaskColour(bmp, wxBLUE) + bmp.SetMask(mask) wxStaticBitmap(self, -1, bmp, wxPoint(80, 50), wxSize(bmp.GetWidth(), bmp.GetHeight())) + bmp = wxBitmap('bitmaps/robin.jpg', wxBITMAP_TYPE_JPEG) + wxStaticBitmap(self, -1, bmp, (80, 150)) + wxStaticText(self, -1, "Hey, if Ousterhout can do it, so can I.", + (200, 175)) #---------------------------------------------------------------------- diff --git a/wxPython/demo/wxTextEntryDialog.py b/wxPython/demo/wxTextEntryDialog.py index 08e93e237e..b0049d6506 100644 --- a/wxPython/demo/wxTextEntryDialog.py +++ b/wxPython/demo/wxTextEntryDialog.py @@ -26,25 +26,5 @@ def runTest(frame, nb, log): overview = """\ -This class represents a dialog that requests a one-line text string from the user. It is implemented as a generic wxWindows dialog. -wxTextEntryDialog() ----------------------------------- - -wxTextEntryDialog(wxWindow* parent, const wxString& message, const wxString& caption = "Please enter text", const wxString& defaultValue = "", long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition) - -Constructor. Use wxTextEntryDialog::ShowModal to show the dialog. - -Parameters -------------------- - -parent = Parent window. - -message = Message to show on the dialog. - -defaultValue = The default value, which may be the empty string. - -style = A dialog style, specifying the buttons (wxOK, wxCANCEL) and an optional wxCENTRE style. - -pos = Dialog position. """ diff --git a/wxPython/demo/wxToolBar.py b/wxPython/demo/wxToolBar.py index 4a4df1b506..e8deb0b9d3 100644 --- a/wxPython/demo/wxToolBar.py +++ b/wxPython/demo/wxToolBar.py @@ -13,7 +13,7 @@ class TestToolBar(wxFrame): wxWindow(self, -1).SetBackgroundColour(wxNamedColour("WHITE")) - tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER) #|wxTB_FLAT) + tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER|wxTB_FLAT) #tb = wxToolBarSimple(self, -1, wxDefaultPosition, wxDefaultSize, # wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT) #self.SetToolBar(tb) diff --git a/wxPython/distrib/wxPython.WSM b/wxPython/distrib/wxPython.WSM index 1a9e35266f380844ca6f33c93f7232bfa8d84520..075f558178800d97840ee9f539f9099908b334cf 100644 GIT binary patch literal 33 lcmWF!_BE?9V_;xpu+w7PtsCjhP^HSm00NAmp_SWIG_MakePtr(a, b, c)) #define SWIG_GetPtr(a, b, c) (wxPyCoreAPIPtr->p_SWIG_GetPtr(a, b, c)) diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index 8d6dbfe7a5..e66a31dd73 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -594,15 +594,6 @@ public: //--------------------------------------------------------------------------- -#ifdef __WXMSW__ -class wxPrinterDC : public wxDC { -public: - wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, - bool interactive = TRUE, int orientation = wxPORTRAIT); -}; -#endif - -//--------------------------------------------------------------------------- #ifdef __WXMSW__ class wxMetaFileDC : public wxDC { diff --git a/wxPython/src/gtk/misc2.cpp b/wxPython/src/gtk/misc2.cpp index cc1e4cba55..633073aeb3 100644 --- a/wxPython/src/gtk/misc2.cpp +++ b/wxPython/src/gtk/misc2.cpp @@ -361,6 +361,111 @@ static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObjec return _resultobj; } +static PyObject *_wrap_wxGetPasswordFromUser(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxString * _arg0; + wxString * _arg1 = (wxString *) &wxPyEmptyStr; + wxString * _arg2 = (wxString *) &wxPyEmptyStr; + wxWindow * _arg3 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + PyObject * _argo3 = 0; + char *_kwnames[] = { "message","caption","default_value","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OOO:wxGetPasswordFromUser",_kwnames,&_obj0,&_obj1,&_obj2,&_argo3)) + return NULL; +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif +} + if (_obj1) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif +} + if (_obj2) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif +} + if (_argo3) { + if (_argo3 == Py_None) { _arg3 = NULL; } + else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxGetPasswordFromUser. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxGetPasswordFromUser(*_arg0,*_arg1,*_arg2,_arg3)); + + wxPy_END_ALLOW_THREADS; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + delete _result; +} + return _resultobj; +} + static PyObject *_wrap_wxGetSingleChoice(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; @@ -865,62 +970,6 @@ static PyObject *_wrap_wxGetDisplaySize(PyObject *self, PyObject *args, PyObject return _resultobj; } -static PyObject *_wrap_wxDisplaySizeMM(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - int * _arg0; - int temp; - int * _arg1; - int temp0; - char *_kwnames[] = { NULL }; - - self = self; -{ - _arg0 = &temp; -} -{ - _arg1 = &temp0; -} - if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDisplaySizeMM",_kwnames)) - return NULL; -{ - wxPy_BEGIN_ALLOW_THREADS; - wxDisplaySizeMM(_arg0,_arg1); - - wxPy_END_ALLOW_THREADS; -} Py_INCREF(Py_None); - _resultobj = Py_None; -{ - PyObject *o; - o = PyInt_FromLong((long) (*_arg0)); - _resultobj = t_output_helper(_resultobj, o); -} -{ - PyObject *o; - o = PyInt_FromLong((long) (*_arg1)); - _resultobj = t_output_helper(_resultobj, o); -} - return _resultobj; -} - -static PyObject *_wrap_wxGetDisplaySizeMM(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxSize * _result; - char *_kwnames[] = { NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetDisplaySizeMM",_kwnames)) - return NULL; -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = new wxSize (wxGetDisplaySizeMM()); - - wxPy_END_ALLOW_THREADS; -} SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - static PyObject *_wrap_wxSetCursor(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxCursor * _arg0; @@ -5362,8 +5411,6 @@ static PyMethodDef misc2cMethods[] = { { "wxFindWindowByName", (PyCFunction) _wrap_wxFindWindowByName, METH_VARARGS | METH_KEYWORDS }, { "wxFindWindowByLabel", (PyCFunction) _wrap_wxFindWindowByLabel, METH_VARARGS | METH_KEYWORDS }, { "wxSetCursor", (PyCFunction) _wrap_wxSetCursor, METH_VARARGS | METH_KEYWORDS }, - { "wxGetDisplaySizeMM", (PyCFunction) _wrap_wxGetDisplaySizeMM, METH_VARARGS | METH_KEYWORDS }, - { "wxDisplaySizeMM", (PyCFunction) _wrap_wxDisplaySizeMM, METH_VARARGS | METH_KEYWORDS }, { "wxGetDisplaySize", (PyCFunction) _wrap_wxGetDisplaySize, METH_VARARGS | METH_KEYWORDS }, { "wxDisplaySize", (PyCFunction) _wrap_wxDisplaySize, METH_VARARGS | METH_KEYWORDS }, { "wxGetDisplayDepth", (PyCFunction) _wrap_wxGetDisplayDepth, METH_VARARGS | METH_KEYWORDS }, @@ -5373,6 +5420,7 @@ static PyMethodDef misc2cMethods[] = { { "wxMessageBox", (PyCFunction) _wrap_wxMessageBox, METH_VARARGS | METH_KEYWORDS }, { "wxGetSingleChoiceIndex", (PyCFunction) _wrap_wxGetSingleChoiceIndex, METH_VARARGS | METH_KEYWORDS }, { "wxGetSingleChoice", (PyCFunction) _wrap_wxGetSingleChoice, METH_VARARGS | METH_KEYWORDS }, + { "wxGetPasswordFromUser", (PyCFunction) _wrap_wxGetPasswordFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxGetTextFromUser", (PyCFunction) _wrap_wxGetTextFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxFileSelector", (PyCFunction) _wrap_wxFileSelector, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } diff --git a/wxPython/src/gtk/misc2.py b/wxPython/src/gtk/misc2.py index 9c69cbc476..2d7b08bedf 100644 --- a/wxPython/src/gtk/misc2.py +++ b/wxPython/src/gtk/misc2.py @@ -479,6 +479,8 @@ wxFileSelector = misc2c.wxFileSelector wxGetTextFromUser = misc2c.wxGetTextFromUser +wxGetPasswordFromUser = misc2c.wxGetPasswordFromUser + wxGetSingleChoice = misc2c.wxGetSingleChoice wxGetSingleChoiceIndex = misc2c.wxGetSingleChoiceIndex @@ -500,13 +502,6 @@ def wxGetDisplaySize(*_args, **_kwargs): if val: val = wxSizePtr(val); val.thisown = 1 return val -wxDisplaySizeMM = misc2c.wxDisplaySizeMM - -def wxGetDisplaySizeMM(*_args, **_kwargs): - val = apply(misc2c.wxGetDisplaySizeMM,_args,_kwargs) - if val: val = wxSizePtr(val); val.thisown = 1 - return val - wxSetCursor = misc2c.wxSetCursor def wxFindWindowByLabel(*_args, **_kwargs): diff --git a/wxPython/src/gtk/windows3.cpp b/wxPython/src/gtk/windows3.cpp index 8abbf324a4..0f6aa9d8e4 100644 --- a/wxPython/src/gtk/windows3.cpp +++ b/wxPython/src/gtk/windows3.cpp @@ -2137,6 +2137,9 @@ SWIGEXPORT(void) initwindows3c() { PyDict_SetItemString(d,"wxSASH_NONE", PyInt_FromLong((long) wxSASH_NONE)); PyDict_SetItemString(d,"wxEVT_SASH_DRAGGED", PyInt_FromLong((long) wxEVT_SASH_DRAGGED)); PyDict_SetItemString(d,"wxSW_3D", PyInt_FromLong((long) wxSW_3D)); + PyDict_SetItemString(d,"wxSW_3DSASH", PyInt_FromLong((long) wxSW_3DSASH)); + PyDict_SetItemString(d,"wxSW_3DBORDER", PyInt_FromLong((long) wxSW_3DBORDER)); + PyDict_SetItemString(d,"wxSW_BORDER", PyInt_FromLong((long) wxSW_BORDER)); PyDict_SetItemString(d,"wxSASH_STATUS_OK", PyInt_FromLong((long) wxSASH_STATUS_OK)); PyDict_SetItemString(d,"wxSASH_STATUS_OUT_OF_RANGE", PyInt_FromLong((long) wxSASH_STATUS_OUT_OF_RANGE)); PyDict_SetItemString(d,"wxLAYOUT_HORIZONTAL", PyInt_FromLong((long) wxLAYOUT_HORIZONTAL)); diff --git a/wxPython/src/gtk/windows3.py b/wxPython/src/gtk/windows3.py index 33b2785627..7a6fd3ac16 100644 --- a/wxPython/src/gtk/windows3.py +++ b/wxPython/src/gtk/windows3.py @@ -262,6 +262,9 @@ wxSASH_LEFT = windows3c.wxSASH_LEFT wxSASH_NONE = windows3c.wxSASH_NONE wxEVT_SASH_DRAGGED = windows3c.wxEVT_SASH_DRAGGED wxSW_3D = windows3c.wxSW_3D +wxSW_3DSASH = windows3c.wxSW_3DSASH +wxSW_3DBORDER = windows3c.wxSW_3DBORDER +wxSW_BORDER = windows3c.wxSW_BORDER wxSASH_STATUS_OK = windows3c.wxSASH_STATUS_OK wxSASH_STATUS_OUT_OF_RANGE = windows3c.wxSASH_STATUS_OUT_OF_RANGE wxLAYOUT_HORIZONTAL = windows3c.wxLAYOUT_HORIZONTAL diff --git a/wxPython/src/gtk/wx.cpp b/wxPython/src/gtk/wx.cpp index d1b80b4dcc..afcaa16328 100644 --- a/wxPython/src/gtk/wx.cpp +++ b/wxPython/src/gtk/wx.cpp @@ -2393,6 +2393,9 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxSP_WRAP", PyInt_FromLong((long) wxSP_WRAP)); PyDict_SetItemString(d,"wxSP_NOBORDER", PyInt_FromLong((long) wxSP_NOBORDER)); PyDict_SetItemString(d,"wxSP_3D", PyInt_FromLong((long) wxSP_3D)); + PyDict_SetItemString(d,"wxSP_3DSASH", PyInt_FromLong((long) wxSP_3DSASH)); + PyDict_SetItemString(d,"wxSP_3DBORDER", PyInt_FromLong((long) wxSP_3DBORDER)); + PyDict_SetItemString(d,"wxSP_FULLSASH", PyInt_FromLong((long) wxSP_FULLSASH)); PyDict_SetItemString(d,"wxSP_BORDER", PyInt_FromLong((long) wxSP_BORDER)); PyDict_SetItemString(d,"wxSP_LIVE_UPDATE", PyInt_FromLong((long) wxSP_LIVE_UPDATE)); PyDict_SetItemString(d,"wxSP_PERMIT_UNSPLIT", PyInt_FromLong((long) wxSP_PERMIT_UNSPLIT)); diff --git a/wxPython/src/gtk/wx.py b/wxPython/src/gtk/wx.py index abfdcf2279..63c5c1b3e5 100644 --- a/wxPython/src/gtk/wx.py +++ b/wxPython/src/gtk/wx.py @@ -301,6 +301,9 @@ wxSP_ARROW_KEYS = wxc.wxSP_ARROW_KEYS wxSP_WRAP = wxc.wxSP_WRAP wxSP_NOBORDER = wxc.wxSP_NOBORDER wxSP_3D = wxc.wxSP_3D +wxSP_3DSASH = wxc.wxSP_3DSASH +wxSP_3DBORDER = wxc.wxSP_3DBORDER +wxSP_FULLSASH = wxc.wxSP_FULLSASH wxSP_BORDER = wxc.wxSP_BORDER wxSP_LIVE_UPDATE = wxc.wxSP_LIVE_UPDATE wxSP_PERMIT_UNSPLIT = wxc.wxSP_PERMIT_UNSPLIT diff --git a/wxPython/src/htmlhelp.i b/wxPython/src/htmlhelp.i index 0715d1ae0b..1947f066ab 100644 --- a/wxPython/src/htmlhelp.i +++ b/wxPython/src/htmlhelp.i @@ -37,9 +37,9 @@ %extern controls2.i %extern utils.i - %extern html.i + //--------------------------------------------------------------------------- enum { diff --git a/wxPython/src/libpy.c b/wxPython/src/libpy.c index 7f05d84e59..d8d22da4f4 100644 --- a/wxPython/src/libpy.c +++ b/wxPython/src/libpy.c @@ -405,13 +405,32 @@ SWIG_GetPtrObj(PyObject *obj, void **ptr, char *type) { if (!PyString_Check(obj)) { if (!PyInstance_Check(obj) || !(sobj = PyObject_GetAttrString(obj,"this"))) return ""; + // PyObject_GetAttrString increases sobj refcout ! + Py_DECREF(sobj); } str = PyString_AsString(sobj); return SWIG_GetPtr(str,ptr,type); } + #ifdef __cplusplus } #endif + + + + + + + + + + + + + + + + diff --git a/wxPython/src/misc.i b/wxPython/src/misc.i index 70e22c48ac..74b104185d 100644 --- a/wxPython/src/misc.i +++ b/wxPython/src/misc.i @@ -60,8 +60,17 @@ public: return tup; } } - %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())" - %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())" + + %pragma(python) addtoclass = " + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple() + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.width = val + elif index == 1: self.height = val + else: raise IndexError +" }; @@ -101,8 +110,16 @@ public: return *self == *p; } } - %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())" - %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())" + %pragma(python) addtoclass = " + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple() + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.width = val + elif index == 1: self.height = val + else: raise IndexError +" }; @@ -140,8 +157,16 @@ public: return *self == *p; } } - %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())" - %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())" + %pragma(python) addtoclass = " + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple() + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.x = val + elif index == 1: self.y = val + else: raise IndexError +" }; //--------------------------------------------------------------------------- @@ -201,9 +226,18 @@ public: } } - %pragma(python) addtoclass = "def __str__(self): return str(self.asTuple())" - %pragma(python) addtoclass = "def __repr__(self): return str(self.asTuple())" %pragma(python) addtoclass = " + def __str__(self): return str(self.asTuple()) + def __repr__(self): return str(self.asTuple()) + def __len__(self): return len(self.asTuple() + def __getitem__(self, index): return self.asTuple()[index] + def __setitem__(self, index, val): + if index == 0: self.x = val + elif index == 1: self.y = val + elif index == 2: self.width = val + elif index == 3: self.height = val + else: raise IndexError + # override the __getattr__ made by SWIG def __getattr__(self, name): d = { diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i index e594ee49c6..e68acb89f9 100644 --- a/wxPython/src/misc2.i +++ b/wxPython/src/misc2.i @@ -61,6 +61,11 @@ wxString wxGetTextFromUser(const wxString& message, int x = -1, int y = -1, bool centre = TRUE); +wxString wxGetPasswordFromUser(const wxString& message, + const wxString& caption = wxPyEmptyStr, + const wxString& default_value = wxPyEmptyStr, + wxWindow *parent = NULL); + // TODO: Need to custom wrap this one... // int wxGetMultipleChoice(char* message, char* caption, @@ -109,6 +114,7 @@ int wxGetDisplayDepth(); void wxDisplaySize(int* OUTPUT, int* OUTPUT); wxSize wxGetDisplaySize(); + void wxDisplaySizeMM(int* OUTPUT, int* OUTPUT); wxSize wxGetDisplaySizeMM(); @@ -625,6 +631,13 @@ void wxLogSysError(const char *szFormat); //---------------------------------------------------------------------- + +enum { + /* event type */ + wxEVT_END_PROCESS +}; + + class wxProcessEvent : public wxEvent { public: wxProcessEvent(int id = 0, int pid = 0, int exitcode = 0); diff --git a/wxPython/src/msw/calendar.cpp b/wxPython/src/msw/calendar.cpp index 242c2ca34b..232a7de8bc 100644 --- a/wxPython/src/msw/calendar.cpp +++ b/wxPython/src/msw/calendar.cpp @@ -1729,7 +1729,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -1948,7 +1947,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPaintDC","_wxPaintDC",0}, diff --git a/wxPython/src/msw/clip_dnd.cpp b/wxPython/src/msw/clip_dnd.cpp index cfb9bc878b..d4ccd97f49 100644 --- a/wxPython/src/msw/clip_dnd.cpp +++ b/wxPython/src/msw/clip_dnd.cpp @@ -3515,7 +3515,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_wxWindowID",0}, { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMask","_wxMask",0}, { "_wxTextDataObject","_class_wxPyTextDataObject",SwigwxPyTextDataObjectTowxTextDataObject}, { "_wxTextDataObject","_wxPyTextDataObject",SwigwxPyTextDataObjectTowxTextDataObject}, @@ -3680,7 +3679,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_size_t",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxPyFileDropTarget","_wxPyFileDropTarget",0}, diff --git a/wxPython/src/msw/cmndlgs.cpp b/wxPython/src/msw/cmndlgs.cpp index c4645576f1..aaed3689ec 100644 --- a/wxPython/src/msw/cmndlgs.cpp +++ b/wxPython/src/msw/cmndlgs.cpp @@ -2966,7 +2966,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -3253,7 +3252,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, diff --git a/wxPython/src/msw/controls.cpp b/wxPython/src/msw/controls.cpp index ca3e1931f8..7c63d3c250 100644 --- a/wxPython/src/msw/controls.cpp +++ b/wxPython/src/msw/controls.cpp @@ -8098,7 +8098,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -8384,7 +8383,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index e6084cd765..3375c1d964 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -2930,6 +2930,43 @@ static PyObject *_wrap_wxListCtrl_Arrange(PyObject *self, PyObject *args, PyObje return _resultobj; } +#define wxListCtrl_AssignImageList(_swigobj,_swigarg0,_swigarg1) (_swigobj->AssignImageList(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_AssignImageList(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxListCtrl * _arg0; + wxImageList * _arg1; + int _arg2; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","imageList","which", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxListCtrl_AssignImageList",_kwnames,&_argo0,&_argo1,&_arg2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_AssignImageList. Expected _wxListCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImageList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_AssignImageList. Expected _wxImageList_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxListCtrl_AssignImageList(_arg0,_arg1,_arg2); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxListCtrl_DeleteItem(_swigobj,_swigarg0) (_swigobj->DeleteItem(_swigarg0)) static PyObject *_wrap_wxListCtrl_DeleteItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -5269,6 +5306,42 @@ static PyObject *_wrap_wxTreeCtrl__setSelf(PyObject *self, PyObject *args, PyObj return _resultobj; } +#define wxTreeCtrl_AssignImageList(_swigobj,_swigarg0) (_swigobj->AssignImageList(_swigarg0)) +static PyObject *_wrap_wxTreeCtrl_AssignImageList(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyTreeCtrl * _arg0; + wxImageList * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","imageList", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxTreeCtrl_AssignImageList",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyTreeCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTreeCtrl_AssignImageList. Expected _wxPyTreeCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImageList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxTreeCtrl_AssignImageList. Expected _wxImageList_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + wxTreeCtrl_AssignImageList(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; +} Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define wxTreeCtrl_GetCount(_swigobj) (_swigobj->GetCount()) static PyObject *_wrap_wxTreeCtrl_GetCount(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -7998,6 +8071,7 @@ static PyMethodDef controls2cMethods[] = { { "wxTreeCtrl_SetIndent", (PyCFunction) _wrap_wxTreeCtrl_SetIndent, METH_VARARGS | METH_KEYWORDS }, { "wxTreeCtrl_GetIndent", (PyCFunction) _wrap_wxTreeCtrl_GetIndent, METH_VARARGS | METH_KEYWORDS }, { "wxTreeCtrl_GetCount", (PyCFunction) _wrap_wxTreeCtrl_GetCount, METH_VARARGS | METH_KEYWORDS }, + { "wxTreeCtrl_AssignImageList", (PyCFunction) _wrap_wxTreeCtrl_AssignImageList, METH_VARARGS | METH_KEYWORDS }, { "wxTreeCtrl__setSelf", (PyCFunction) _wrap_wxTreeCtrl__setSelf, METH_VARARGS | METH_KEYWORDS }, { "new_wxTreeCtrl", (PyCFunction) _wrap_new_wxTreeCtrl, METH_VARARGS | METH_KEYWORDS }, { "wxTreeEvent_GetLabel", (PyCFunction) _wrap_wxTreeEvent_GetLabel, METH_VARARGS | METH_KEYWORDS }, @@ -8065,6 +8139,7 @@ static PyMethodDef controls2cMethods[] = { { "wxListCtrl_DeleteColumn", (PyCFunction) _wrap_wxListCtrl_DeleteColumn, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_DeleteAllItems", (PyCFunction) _wrap_wxListCtrl_DeleteAllItems, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_DeleteItem", (PyCFunction) _wrap_wxListCtrl_DeleteItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_AssignImageList", (PyCFunction) _wrap_wxListCtrl_AssignImageList, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_Arrange", (PyCFunction) _wrap_wxListCtrl_Arrange, METH_VARARGS | METH_KEYWORDS }, { "new_wxListCtrl", (PyCFunction) _wrap_new_wxListCtrl, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetItem", (PyCFunction) _wrap_wxListEvent_GetItem, METH_VARARGS | METH_KEYWORDS }, @@ -8237,7 +8312,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -8459,7 +8533,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, { "_class_wxPaintDC","_wxPaintDC",0}, @@ -8592,6 +8665,22 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxLIST_FORMAT_RIGHT", PyInt_FromLong((long) wxLIST_FORMAT_RIGHT)); PyDict_SetItemString(d,"wxLIST_FORMAT_CENTRE", PyInt_FromLong((long) wxLIST_FORMAT_CENTRE)); PyDict_SetItemString(d,"wxLIST_FORMAT_CENTER", PyInt_FromLong((long) wxLIST_FORMAT_CENTER)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_DRAG)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_RDRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_RDRAG)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_END_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_END_LABEL_EDIT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ITEM)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_GET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_GET_INFO)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_SET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_SET_INFO)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_SELECTED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_DESELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_DESELECTED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_LIST_KEY_DOWN)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_INSERT_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_INSERT_ITEM)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_ACTIVATED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK)); PyDict_SetItemString(d,"wxTreeItemIcon_Normal", PyInt_FromLong((long) wxTreeItemIcon_Normal)); PyDict_SetItemString(d,"wxTreeItemIcon_Selected", PyInt_FromLong((long) wxTreeItemIcon_Selected)); PyDict_SetItemString(d,"wxTreeItemIcon_Expanded", PyInt_FromLong((long) wxTreeItemIcon_Expanded)); @@ -8611,6 +8700,23 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxTREE_HITTEST_ONITEMUPPERPART", PyInt_FromLong((long) wxTREE_HITTEST_ONITEMUPPERPART)); PyDict_SetItemString(d,"wxTREE_HITTEST_ONITEMLOWERPART", PyInt_FromLong((long) wxTREE_HITTEST_ONITEMLOWERPART)); PyDict_SetItemString(d,"wxTREE_HITTEST_ONITEM", PyInt_FromLong((long) wxTREE_HITTEST_ONITEM)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_TREE_BEGIN_DRAG)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_BEGIN_RDRAG", PyInt_FromLong((long) wxEVT_COMMAND_TREE_BEGIN_RDRAG)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_END_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_TREE_END_LABEL_EDIT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_DELETE_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_TREE_DELETE_ITEM)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_GET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_TREE_GET_INFO)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SET_INFO)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_EXPANDED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_EXPANDED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_EXPANDING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_EXPANDING)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_COLLAPSED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_COLLAPSED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_COLLAPSING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_COLLAPSING)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGING)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_TREE_KEY_DOWN)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_ACTIVATED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK)); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index 6acc423c61..ed3bb0c9b7 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -319,6 +319,9 @@ class wxListCtrlPtr(wxControlPtr): def Arrange(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_Arrange,(self,) + _args, _kwargs) return val + def AssignImageList(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_AssignImageList,(self,) + _args, _kwargs) + return val def DeleteItem(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_DeleteItem,(self,) + _args, _kwargs) return val @@ -578,6 +581,9 @@ class wxTreeCtrlPtr(wxControlPtr): def _setSelf(self, *_args, **_kwargs): val = apply(controls2c.wxTreeCtrl__setSelf,(self,) + _args, _kwargs) return val + def AssignImageList(self, *_args, **_kwargs): + val = apply(controls2c.wxTreeCtrl_AssignImageList,(self,) + _args, _kwargs) + return val def GetCount(self, *_args, **_kwargs): val = apply(controls2c.wxTreeCtrl_GetCount,(self,) + _args, _kwargs) return val @@ -876,6 +882,22 @@ wxLIST_FORMAT_LEFT = controls2c.wxLIST_FORMAT_LEFT wxLIST_FORMAT_RIGHT = controls2c.wxLIST_FORMAT_RIGHT wxLIST_FORMAT_CENTRE = controls2c.wxLIST_FORMAT_CENTRE wxLIST_FORMAT_CENTER = controls2c.wxLIST_FORMAT_CENTER +wxEVT_COMMAND_LIST_BEGIN_DRAG = controls2c.wxEVT_COMMAND_LIST_BEGIN_DRAG +wxEVT_COMMAND_LIST_BEGIN_RDRAG = controls2c.wxEVT_COMMAND_LIST_BEGIN_RDRAG +wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = controls2c.wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT +wxEVT_COMMAND_LIST_END_LABEL_EDIT = controls2c.wxEVT_COMMAND_LIST_END_LABEL_EDIT +wxEVT_COMMAND_LIST_DELETE_ITEM = controls2c.wxEVT_COMMAND_LIST_DELETE_ITEM +wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = controls2c.wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS +wxEVT_COMMAND_LIST_GET_INFO = controls2c.wxEVT_COMMAND_LIST_GET_INFO +wxEVT_COMMAND_LIST_SET_INFO = controls2c.wxEVT_COMMAND_LIST_SET_INFO +wxEVT_COMMAND_LIST_ITEM_SELECTED = controls2c.wxEVT_COMMAND_LIST_ITEM_SELECTED +wxEVT_COMMAND_LIST_ITEM_DESELECTED = controls2c.wxEVT_COMMAND_LIST_ITEM_DESELECTED +wxEVT_COMMAND_LIST_KEY_DOWN = controls2c.wxEVT_COMMAND_LIST_KEY_DOWN +wxEVT_COMMAND_LIST_INSERT_ITEM = controls2c.wxEVT_COMMAND_LIST_INSERT_ITEM +wxEVT_COMMAND_LIST_COL_CLICK = controls2c.wxEVT_COMMAND_LIST_COL_CLICK +wxEVT_COMMAND_LIST_ITEM_ACTIVATED = controls2c.wxEVT_COMMAND_LIST_ITEM_ACTIVATED +wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK +wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK wxTreeItemIcon_Normal = controls2c.wxTreeItemIcon_Normal wxTreeItemIcon_Selected = controls2c.wxTreeItemIcon_Selected wxTreeItemIcon_Expanded = controls2c.wxTreeItemIcon_Expanded @@ -895,3 +917,20 @@ wxTREE_HITTEST_TORIGHT = controls2c.wxTREE_HITTEST_TORIGHT wxTREE_HITTEST_ONITEMUPPERPART = controls2c.wxTREE_HITTEST_ONITEMUPPERPART wxTREE_HITTEST_ONITEMLOWERPART = controls2c.wxTREE_HITTEST_ONITEMLOWERPART wxTREE_HITTEST_ONITEM = controls2c.wxTREE_HITTEST_ONITEM +wxEVT_COMMAND_TREE_BEGIN_DRAG = controls2c.wxEVT_COMMAND_TREE_BEGIN_DRAG +wxEVT_COMMAND_TREE_BEGIN_RDRAG = controls2c.wxEVT_COMMAND_TREE_BEGIN_RDRAG +wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT = controls2c.wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT +wxEVT_COMMAND_TREE_END_LABEL_EDIT = controls2c.wxEVT_COMMAND_TREE_END_LABEL_EDIT +wxEVT_COMMAND_TREE_DELETE_ITEM = controls2c.wxEVT_COMMAND_TREE_DELETE_ITEM +wxEVT_COMMAND_TREE_GET_INFO = controls2c.wxEVT_COMMAND_TREE_GET_INFO +wxEVT_COMMAND_TREE_SET_INFO = controls2c.wxEVT_COMMAND_TREE_SET_INFO +wxEVT_COMMAND_TREE_ITEM_EXPANDED = controls2c.wxEVT_COMMAND_TREE_ITEM_EXPANDED +wxEVT_COMMAND_TREE_ITEM_EXPANDING = controls2c.wxEVT_COMMAND_TREE_ITEM_EXPANDING +wxEVT_COMMAND_TREE_ITEM_COLLAPSED = controls2c.wxEVT_COMMAND_TREE_ITEM_COLLAPSED +wxEVT_COMMAND_TREE_ITEM_COLLAPSING = controls2c.wxEVT_COMMAND_TREE_ITEM_COLLAPSING +wxEVT_COMMAND_TREE_SEL_CHANGED = controls2c.wxEVT_COMMAND_TREE_SEL_CHANGED +wxEVT_COMMAND_TREE_SEL_CHANGING = controls2c.wxEVT_COMMAND_TREE_SEL_CHANGING +wxEVT_COMMAND_TREE_KEY_DOWN = controls2c.wxEVT_COMMAND_TREE_KEY_DOWN +wxEVT_COMMAND_TREE_ITEM_ACTIVATED = controls2c.wxEVT_COMMAND_TREE_ITEM_ACTIVATED +wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = controls2c.wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK +wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = controls2c.wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK diff --git a/wxPython/src/msw/events.cpp b/wxPython/src/msw/events.cpp index 06c0f87017..7cb96dd196 100644 --- a/wxPython/src/msw/events.cpp +++ b/wxPython/src/msw/events.cpp @@ -6395,7 +6395,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, @@ -6614,7 +6613,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxNavigationKeyEvent","_wxNavigationKeyEvent",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, { "_class_wxInitDialogEvent","_wxInitDialogEvent",0}, diff --git a/wxPython/src/msw/filesys.cpp b/wxPython/src/msw/filesys.cpp index 7bec489951..f40624059d 100644 --- a/wxPython/src/msw/filesys.cpp +++ b/wxPython/src/msw/filesys.cpp @@ -2243,7 +2243,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxPNMHandler","_class_wxPNMHandler",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxGIFHandler","_wxGIFHandler",0}, { "_wxFileConfig","_class_wxFileConfig",0}, { "_class_wxMask","_wxMask",0}, @@ -2379,7 +2378,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxLayoutConstraints","_wxLayoutConstraints",0}, diff --git a/wxPython/src/msw/frames.cpp b/wxPython/src/msw/frames.cpp index 2dc5a21929..8489f08de4 100644 --- a/wxPython/src/msw/frames.cpp +++ b/wxPython/src/msw/frames.cpp @@ -1297,7 +1297,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -1506,7 +1505,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index a11115c704..6f87090c25 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -7520,115 +7520,6 @@ static PyObject *_wrap_new_wxWindowDC(PyObject *self, PyObject *args, PyObject * return _resultobj; } -static void *SwigwxPrinterDCTowxDC(void *ptr) { - wxPrinterDC *src; - wxDC *dest; - src = (wxPrinterDC *) ptr; - dest = (wxDC *) src; - return (void *) dest; -} - -#define new_wxPrinterDC(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4) (new wxPrinterDC(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4)) -static PyObject *_wrap_new_wxPrinterDC(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxPrinterDC * _result; - wxString * _arg0; - wxString * _arg1; - wxString * _arg2; - bool _arg3 = (bool ) TRUE; - int _arg4 = (int ) wxPORTRAIT; - PyObject * _obj0 = 0; - PyObject * _obj1 = 0; - PyObject * _obj2 = 0; - int tempbool3 = (int) TRUE; - char *_kwnames[] = { "driver","device","output","interactive","orientation", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|ii:new_wxPrinterDC",_kwnames,&_obj0,&_obj1,&_obj2,&tempbool3,&_arg4)) - return NULL; -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); - return NULL; - } - if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg0 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj0)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); -#endif -} -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); - return NULL; - } - if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg1 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj1)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); -#endif -} -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif -} - _arg3 = (bool ) tempbool3; -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPrinterDC *)new_wxPrinterDC(*_arg0,*_arg1,*_arg2,_arg3,_arg4); - - wxPy_END_ALLOW_THREADS; -} if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxPrinterDC_p"); - _resultobj = Py_BuildValue("s",_ptemp); - } else { - Py_INCREF(Py_None); - _resultobj = Py_None; - } -{ - if (_obj0) - delete _arg0; -} -{ - if (_obj1) - delete _arg1; -} -{ - if (_obj2) - delete _arg2; -} - return _resultobj; -} - static void *SwigwxMetaFileDCTowxDC(void *ptr) { wxMetaFileDC *src; wxDC *dest; @@ -8347,7 +8238,6 @@ static PyMethodDef gdicMethods[] = { { "new_wxPalette", (PyCFunction) _wrap_new_wxPalette, METH_VARARGS | METH_KEYWORDS }, { "wxMetaFileDC_Close", (PyCFunction) _wrap_wxMetaFileDC_Close, METH_VARARGS | METH_KEYWORDS }, { "new_wxMetaFileDC", (PyCFunction) _wrap_new_wxMetaFileDC, METH_VARARGS | METH_KEYWORDS }, - { "new_wxPrinterDC", (PyCFunction) _wrap_new_wxPrinterDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxWindowDC", (PyCFunction) _wrap_new_wxWindowDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxPaintDC", (PyCFunction) _wrap_new_wxPaintDC, METH_VARARGS | METH_KEYWORDS }, { "new_wxClientDC", (PyCFunction) _wrap_new_wxClientDC, METH_VARARGS | METH_KEYWORDS }, @@ -8583,8 +8473,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxAcceleratorTable","_wxAcceleratorTable",0}, { "_wxDC","_class_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, { "_wxDC","_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, - { "_wxDC","_class_wxPrinterDC",SwigwxPrinterDCTowxDC}, - { "_wxDC","_wxPrinterDC",SwigwxPrinterDCTowxDC}, { "_wxDC","_class_wxWindowDC",SwigwxWindowDCTowxDC}, { "_wxDC","_wxWindowDC",SwigwxWindowDCTowxDC}, { "_wxDC","_class_wxPaintDC",SwigwxPaintDCTowxDC}, @@ -8604,7 +8492,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_wxWindowID",0}, { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMask","_wxMask",0}, { "_wxColour","_class_wxColour",0}, { "_wxBrush","_class_wxBrush",0}, @@ -8633,8 +8520,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRect","_wxRect",0}, { "_class_wxDC","_class_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, { "_class_wxDC","_wxMetaFileDC",SwigwxMetaFileDCTowxDC}, - { "_class_wxDC","_class_wxPrinterDC",SwigwxPrinterDCTowxDC}, - { "_class_wxDC","_wxPrinterDC",SwigwxPrinterDCTowxDC}, { "_class_wxDC","_class_wxWindowDC",SwigwxWindowDCTowxDC}, { "_class_wxDC","_wxWindowDC",SwigwxWindowDCTowxDC}, { "_class_wxDC","_class_wxPaintDC",SwigwxPaintDCTowxDC}, @@ -8715,7 +8600,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_size_t",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxLayoutConstraints","_wxLayoutConstraints",0}, { "_class_wxIcon","_wxIcon",0}, diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index 5f8cf2c835..aec000e86d 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -779,20 +779,6 @@ class wxWindowDC(wxWindowDCPtr): -class wxPrinterDCPtr(wxDCPtr): - def __init__(self,this): - self.this = this - self.thisown = 0 - def __repr__(self): - return "" % (self.this,) -class wxPrinterDC(wxPrinterDCPtr): - def __init__(self,*_args,**_kwargs): - self.this = apply(gdic.new_wxPrinterDC,_args,_kwargs) - self.thisown = 1 - - - - class wxMetaFileDCPtr(wxDCPtr): def __init__(self,this): self.this = this diff --git a/wxPython/src/msw/grid.cpp b/wxPython/src/msw/grid.cpp index 6aa73ff324..05c0c740b5 100644 --- a/wxPython/src/msw/grid.cpp +++ b/wxPython/src/msw/grid.cpp @@ -13174,7 +13174,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, { "_class_wxGridRangeSelectEvent","_wxGridRangeSelectEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -13471,7 +13470,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, diff --git a/wxPython/src/msw/html.cpp b/wxPython/src/msw/html.cpp index f8ed7ce9c9..b2d3b303f0 100644 --- a/wxPython/src/msw/html.cpp +++ b/wxPython/src/msw/html.cpp @@ -6051,9 +6051,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, { "_wxPNMHandler","_class_wxPNMHandler",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, @@ -6403,12 +6403,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyApp","_wxPyApp",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxLogTextCtrl","_wxLogTextCtrl",0}, { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, diff --git a/wxPython/src/msw/htmlhelp.cpp b/wxPython/src/msw/htmlhelp.cpp index c9831ae331..0eebb250fd 100644 --- a/wxPython/src/msw/htmlhelp.cpp +++ b/wxPython/src/msw/htmlhelp.cpp @@ -2981,9 +2981,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, { "_wxPNMHandler","_class_wxPNMHandler",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, @@ -3320,12 +3320,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyApp","_wxPyApp",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxLogTextCtrl","_wxLogTextCtrl",0}, { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, diff --git a/wxPython/src/msw/image.cpp b/wxPython/src/msw/image.cpp index 5c6b50eeee..c46c40550f 100644 --- a/wxPython/src/msw/image.cpp +++ b/wxPython/src/msw/image.cpp @@ -2187,7 +2187,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxPNMHandler","_class_wxPNMHandler",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxGIFHandler","_wxGIFHandler",0}, { "_class_wxMask","_wxMask",0}, { "_class_wxPNGHandler","_wxPNGHandler",0}, @@ -2305,7 +2304,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_size_t",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxLayoutConstraints","_wxLayoutConstraints",0}, { "_class_wxIcon","_wxIcon",0}, diff --git a/wxPython/src/msw/mdi.cpp b/wxPython/src/msw/mdi.cpp index cfce9eae48..87a067db11 100644 --- a/wxPython/src/msw/mdi.cpp +++ b/wxPython/src/msw/mdi.cpp @@ -883,7 +883,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -1100,7 +1099,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_class_wxPaintDC","_wxPaintDC",0}, diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp index bd406390a3..533cd27c06 100644 --- a/wxPython/src/msw/misc2.cpp +++ b/wxPython/src/msw/misc2.cpp @@ -361,6 +361,111 @@ static PyObject *_wrap_wxGetTextFromUser(PyObject *self, PyObject *args, PyObjec return _resultobj; } +static PyObject *_wrap_wxGetPasswordFromUser(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxString * _arg0; + wxString * _arg1 = (wxString *) &wxPyEmptyStr; + wxString * _arg2 = (wxString *) &wxPyEmptyStr; + wxWindow * _arg3 = (wxWindow *) NULL; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + PyObject * _argo3 = 0; + char *_kwnames[] = { "message","caption","default_value","parent", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|OOO:wxGetPasswordFromUser",_kwnames,&_obj0,&_obj1,&_obj2,&_argo3)) + return NULL; +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif +} + if (_obj1) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif +} + if (_obj2) +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif +} + if (_argo3) { + if (_argo3 == Py_None) { _arg3 = NULL; } + else if (SWIG_GetPtrObj(_argo3,(void **) &_arg3,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of wxGetPasswordFromUser. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxGetPasswordFromUser(*_arg0,*_arg1,*_arg2,_arg3)); + + wxPy_END_ALLOW_THREADS; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} +{ + delete _result; +} + return _resultobj; +} + static PyObject *_wrap_wxGetSingleChoice(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxString * _result; @@ -6594,6 +6699,7 @@ static PyMethodDef misc2cMethods[] = { { "wxMessageBox", (PyCFunction) _wrap_wxMessageBox, METH_VARARGS | METH_KEYWORDS }, { "wxGetSingleChoiceIndex", (PyCFunction) _wrap_wxGetSingleChoiceIndex, METH_VARARGS | METH_KEYWORDS }, { "wxGetSingleChoice", (PyCFunction) _wrap_wxGetSingleChoice, METH_VARARGS | METH_KEYWORDS }, + { "wxGetPasswordFromUser", (PyCFunction) _wrap_wxGetPasswordFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxGetTextFromUser", (PyCFunction) _wrap_wxGetTextFromUser, METH_VARARGS | METH_KEYWORDS }, { "wxFileSelector", (PyCFunction) _wrap_wxFileSelector, METH_VARARGS | METH_KEYWORDS }, { NULL, NULL } @@ -6675,7 +6781,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, { "_class_wxMenuItem","_wxMenuItem",0}, @@ -6879,7 +6984,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxLogNull","_class_wxLogNull",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxLogTextCtrl","_wxLogTextCtrl",0}, { "_class_wxLogGui","_wxLogGui",0}, @@ -7050,6 +7154,7 @@ SWIGEXPORT(void) initmisc2c() { PyDict_SetItemString(d,"wxLOG_Trace", PyInt_FromLong((long) wxLOG_Trace)); PyDict_SetItemString(d,"wxLOG_Progress", PyInt_FromLong((long) wxLOG_Progress)); PyDict_SetItemString(d,"wxLOG_User", PyInt_FromLong((long) wxLOG_User)); + PyDict_SetItemString(d,"wxEVT_END_PROCESS", PyInt_FromLong((long) wxEVT_END_PROCESS)); { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/src/msw/misc2.py b/wxPython/src/msw/misc2.py index dd70b6014f..203232ce6a 100644 --- a/wxPython/src/msw/misc2.py +++ b/wxPython/src/msw/misc2.py @@ -620,6 +620,8 @@ wxFileSelector = misc2c.wxFileSelector wxGetTextFromUser = misc2c.wxGetTextFromUser +wxGetPasswordFromUser = misc2c.wxGetPasswordFromUser + wxGetSingleChoice = misc2c.wxGetSingleChoice wxGetSingleChoiceIndex = misc2c.wxGetSingleChoiceIndex @@ -905,3 +907,4 @@ wxLOG_Debug = misc2c.wxLOG_Debug wxLOG_Trace = misc2c.wxLOG_Trace wxLOG_Progress = misc2c.wxLOG_Progress wxLOG_User = misc2c.wxLOG_User +wxEVT_END_PROCESS = misc2c.wxEVT_END_PROCESS diff --git a/wxPython/src/msw/printfw.cpp b/wxPython/src/msw/printfw.cpp index b13dbf8765..c224ea72a8 100644 --- a/wxPython/src/msw/printfw.cpp +++ b/wxPython/src/msw/printfw.cpp @@ -761,6 +761,149 @@ static PyObject *_wrap_wxPrintData_SetQuality(PyObject *self, PyObject *args, Py return _resultobj; } +static void *SwigwxPrinterDCTowxDC(void *ptr) { + wxPrinterDC *src; + wxDC *dest; + src = (wxPrinterDC *) ptr; + dest = (wxDC *) src; + return (void *) dest; +} + +#define new_wxPrinterDC(_swigarg0) (new wxPrinterDC(_swigarg0)) +static PyObject *_wrap_new_wxPrinterDC(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPrinterDC * _result; + wxPrintData * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "printData", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:new_wxPrinterDC",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPrintData_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of new_wxPrinterDC. Expected _wxPrintData_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxPrinterDC *)new_wxPrinterDC(*_arg0); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxPrinterDC_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define new_wxPrinterDC2(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4) (new wxPrinterDC(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4)) +static PyObject *_wrap_new_wxPrinterDC2(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPrinterDC * _result; + wxString * _arg0; + wxString * _arg1; + wxString * _arg2; + bool _arg3 = (bool ) TRUE; + int _arg4 = (int ) wxPORTRAIT; + PyObject * _obj0 = 0; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + int tempbool3 = (int) TRUE; + char *_kwnames[] = { "driver","device","output","interactive","orientation", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO|ii:new_wxPrinterDC2",_kwnames,&_obj0,&_obj1,&_obj2,&tempbool3,&_arg4)) + return NULL; +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif +} +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg1 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AS_STRING(_obj1), PyString_GET_SIZE(_obj1)); +#endif +} +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif +} + _arg3 = (bool ) tempbool3; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxPrinterDC *)new_wxPrinterDC2(*_arg0,*_arg1,*_arg2,_arg3,_arg4); + + wxPy_END_ALLOW_THREADS; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxPrinterDC_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } +{ + if (_obj0) + delete _arg0; +} +{ + if (_obj1) + delete _arg1; +} +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + #define new_wxPageSetupDialogData() (new wxPageSetupDialogData()) static PyObject *_wrap_new_wxPageSetupDialogData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; @@ -4335,6 +4478,8 @@ static PyMethodDef printfwcMethods[] = { { "wxPageSetupDialogData_EnableHelp", (PyCFunction) _wrap_wxPageSetupDialogData_EnableHelp, METH_VARARGS | METH_KEYWORDS }, { "delete_wxPageSetupDialogData", (PyCFunction) _wrap_delete_wxPageSetupDialogData, METH_VARARGS | METH_KEYWORDS }, { "new_wxPageSetupDialogData", (PyCFunction) _wrap_new_wxPageSetupDialogData, METH_VARARGS | METH_KEYWORDS }, + { "new_wxPrinterDC2", (PyCFunction) _wrap_new_wxPrinterDC2, METH_VARARGS | METH_KEYWORDS }, + { "new_wxPrinterDC", (PyCFunction) _wrap_new_wxPrinterDC, METH_VARARGS | METH_KEYWORDS }, { "wxPrintData_SetQuality", (PyCFunction) _wrap_wxPrintData_SetQuality, METH_VARARGS | METH_KEYWORDS }, { "wxPrintData_SetPaperSize", (PyCFunction) _wrap_wxPrintData_SetPaperSize, METH_VARARGS | METH_KEYWORDS }, { "wxPrintData_SetPaperId", (PyCFunction) _wrap_wxPrintData_SetPaperId, METH_VARARGS | METH_KEYWORDS }, @@ -4423,6 +4568,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxAcceleratorTable","_wxAcceleratorTable",0}, { "_class_wxClipboard","_wxClipboard",0}, { "_class_wxGauge","_wxGauge",0}, + { "_wxDC","_class_wxPrinterDC",SwigwxPrinterDCTowxDC}, + { "_wxDC","_wxPrinterDC",SwigwxPrinterDCTowxDC}, { "_wxDC","_class_wxDC",0}, { "_class_wxBitmapDataObject","_wxBitmapDataObject",0}, { "_class_wxSingleChoiceDialog","_wxSingleChoiceDialog",0}, @@ -4438,8 +4585,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, @@ -4534,6 +4681,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCloseEvent","_class_wxCloseEvent",0}, { "_unsigned_long","_long",0}, { "_class_wxRect","_wxRect",0}, + { "_class_wxDC","_class_wxPrinterDC",SwigwxPrinterDCTowxDC}, + { "_class_wxDC","_wxPrinterDC",SwigwxPrinterDCTowxDC}, { "_class_wxDC","_wxDC",0}, { "_wxScrollWinEvent","_class_wxScrollWinEvent",0}, { "_class_wxProgressDialog","_wxProgressDialog",0}, @@ -4684,8 +4833,8 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, { "_class_wxPyFileDropTarget","_wxPyFileDropTarget",0}, diff --git a/wxPython/src/msw/printfw.py b/wxPython/src/msw/printfw.py index 793dc118bb..ff628475d1 100644 --- a/wxPython/src/msw/printfw.py +++ b/wxPython/src/msw/printfw.py @@ -91,6 +91,25 @@ class wxPrintData(wxPrintDataPtr): +class wxPrinterDCPtr(wxDCPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def __repr__(self): + return "" % (self.this,) +class wxPrinterDC(wxPrinterDCPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(printfwc.new_wxPrinterDC,_args,_kwargs) + self.thisown = 1 + + + +def wxPrinterDC2(*_args,**_kwargs): + val = wxPrinterDCPtr(apply(printfwc.new_wxPrinterDC2,_args,_kwargs)) + val.thisown = 1 + return val + + class wxPageSetupDialogDataPtr : def __init__(self,this): self.this = this diff --git a/wxPython/src/msw/sizers.cpp b/wxPython/src/msw/sizers.cpp index 54ebaf3eba..15224016f3 100644 --- a/wxPython/src/msw/sizers.cpp +++ b/wxPython/src/msw/sizers.cpp @@ -2891,7 +2891,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -3096,7 +3095,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxPaintDC","_wxPaintDC",0}, diff --git a/wxPython/src/msw/stattool.cpp b/wxPython/src/msw/stattool.cpp index dbc9a36d08..4ebba6ad10 100644 --- a/wxPython/src/msw/stattool.cpp +++ b/wxPython/src/msw/stattool.cpp @@ -3331,7 +3331,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -3546,7 +3545,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index b0ac818a70..94a9f1d2de 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -9462,7 +9462,54 @@ static PyObject *_wrap_wxMenuItem_SetAccel(PyObject *self, PyObject *args, PyObj return _resultobj; } +static PyObject *_wrap_wxMenuItem_GetLabelFromText(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxString * _result; + wxString * _arg0; + PyObject * _obj0 = 0; + char *_kwnames[] = { "text", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxMenuItem_GetLabelFromText",_kwnames,&_obj0)) + return NULL; +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj0) && !PyUnicode_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, "String or Unicode type required"); + return NULL; + } + if (PyString_AsStringAndSize(_obj0, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg0 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj0)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg0 = new wxString(PyString_AS_STRING(_obj0), PyString_GET_SIZE(_obj0)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = new wxString (wxMenuItem::GetLabelFromText(*_arg0)); + + wxPy_END_ALLOW_THREADS; +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + if (_obj0) + delete _arg0; +} +{ + delete _result; +} + return _resultobj; +} + static PyMethodDef windowscMethods[] = { + { "wxMenuItem_GetLabelFromText", (PyCFunction) _wrap_wxMenuItem_GetLabelFromText, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_SetAccel", (PyCFunction) _wrap_wxMenuItem_SetAccel, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_GetAccel", (PyCFunction) _wrap_wxMenuItem_GetAccel, METH_VARARGS | METH_KEYWORDS }, { "wxMenuItem_GetHelp", (PyCFunction) _wrap_wxMenuItem_GetHelp, METH_VARARGS | METH_KEYWORDS }, @@ -9791,7 +9838,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_wxWindowID",0}, { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_wxPanel","_class_wxScrolledWindow",SwigwxScrolledWindowTowxPanel}, { "_wxPanel","_wxScrolledWindow",SwigwxScrolledWindowTowxPanel}, @@ -9934,7 +9980,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_time_t","_size_t",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxPyFileDropTarget","_wxPyFileDropTarget",0}, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index ce4c9259eb..a304465e37 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -1000,6 +1000,8 @@ wxWindow_NextControlId = windowsc.wxWindow_NextControlId wxWindow_PrevControlId = windowsc.wxWindow_PrevControlId +wxMenuItem_GetLabelFromText = windowsc.wxMenuItem_GetLabelFromText + #-------------- VARIABLE WRAPPERS ------------------ diff --git a/wxPython/src/msw/windows2.cpp b/wxPython/src/msw/windows2.cpp index fb7972c127..118dcc2ed8 100644 --- a/wxPython/src/msw/windows2.cpp +++ b/wxPython/src/msw/windows2.cpp @@ -2185,7 +2185,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -2403,7 +2402,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxPaintDC","_wxPaintDC",0}, { "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0}, @@ -2489,6 +2487,12 @@ SWIGEXPORT(void) initwindows2c() { SWIG_globals = SWIG_newvarlink(); m = Py_InitModule("windows2c", windows2cMethods); d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)); + PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING)); + PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_UNSPLIT", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_UNSPLIT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_DOUBLECLICKED", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_DOUBLECLICKED)); 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)); diff --git a/wxPython/src/msw/windows2.py b/wxPython/src/msw/windows2.py index 9b1c01ba96..293782f021 100644 --- a/wxPython/src/msw/windows2.py +++ b/wxPython/src/msw/windows2.py @@ -262,6 +262,12 @@ class wxTaskBarIcon(wxTaskBarIconPtr): #-------------- VARIABLE WRAPPERS ------------------ +wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = windows2c.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED +wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = windows2c.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING +wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = windows2c.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING +wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = windows2c.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED +wxEVT_COMMAND_SPLITTER_UNSPLIT = windows2c.wxEVT_COMMAND_SPLITTER_UNSPLIT +wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = windows2c.wxEVT_COMMAND_SPLITTER_DOUBLECLICKED wxSPLIT_HORIZONTAL = windows2c.wxSPLIT_HORIZONTAL wxSPLIT_VERTICAL = windows2c.wxSPLIT_VERTICAL wxSPLIT_DRAG_NONE = windows2c.wxSPLIT_DRAG_NONE diff --git a/wxPython/src/msw/windows3.cpp b/wxPython/src/msw/windows3.cpp index 82cd1f7d2d..2710a673bb 100644 --- a/wxPython/src/msw/windows3.cpp +++ b/wxPython/src/msw/windows3.cpp @@ -1810,7 +1810,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_size_t","_uint",0}, { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, @@ -2047,7 +2046,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxButton","_class_wxButton",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_class_wxPaintDC","_wxPaintDC",0}, @@ -2141,6 +2139,9 @@ SWIGEXPORT(void) initwindows3c() { PyDict_SetItemString(d,"wxSASH_NONE", PyInt_FromLong((long) wxSASH_NONE)); PyDict_SetItemString(d,"wxEVT_SASH_DRAGGED", PyInt_FromLong((long) wxEVT_SASH_DRAGGED)); PyDict_SetItemString(d,"wxSW_3D", PyInt_FromLong((long) wxSW_3D)); + PyDict_SetItemString(d,"wxSW_3DSASH", PyInt_FromLong((long) wxSW_3DSASH)); + PyDict_SetItemString(d,"wxSW_3DBORDER", PyInt_FromLong((long) wxSW_3DBORDER)); + PyDict_SetItemString(d,"wxSW_BORDER", PyInt_FromLong((long) wxSW_BORDER)); PyDict_SetItemString(d,"wxSASH_STATUS_OK", PyInt_FromLong((long) wxSASH_STATUS_OK)); PyDict_SetItemString(d,"wxSASH_STATUS_OUT_OF_RANGE", PyInt_FromLong((long) wxSASH_STATUS_OUT_OF_RANGE)); PyDict_SetItemString(d,"wxLAYOUT_HORIZONTAL", PyInt_FromLong((long) wxLAYOUT_HORIZONTAL)); diff --git a/wxPython/src/msw/windows3.py b/wxPython/src/msw/windows3.py index 33b2785627..7a6fd3ac16 100644 --- a/wxPython/src/msw/windows3.py +++ b/wxPython/src/msw/windows3.py @@ -262,6 +262,9 @@ wxSASH_LEFT = windows3c.wxSASH_LEFT wxSASH_NONE = windows3c.wxSASH_NONE wxEVT_SASH_DRAGGED = windows3c.wxEVT_SASH_DRAGGED wxSW_3D = windows3c.wxSW_3D +wxSW_3DSASH = windows3c.wxSW_3DSASH +wxSW_3DBORDER = windows3c.wxSW_3DBORDER +wxSW_BORDER = windows3c.wxSW_BORDER wxSASH_STATUS_OK = windows3c.wxSASH_STATUS_OK wxSASH_STATUS_OUT_OF_RANGE = windows3c.wxSASH_STATUS_OUT_OF_RANGE wxLAYOUT_HORIZONTAL = windows3c.wxLAYOUT_HORIZONTAL diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 71e5f430a9..d07edf5db1 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -1886,9 +1886,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxRealPoint","_wxRealPoint",0}, { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0}, { "_wxPNMHandler","_class_wxPNMHandler",0}, - { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0}, { "_wxLogGui","_class_wxLogGui",0}, + { "_wxPrinterDC","_class_wxPrinterDC",0}, { "_class_wxMenuItem","_wxMenuItem",0}, { "_class_wxPaintEvent","_wxPaintEvent",0}, { "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0}, @@ -2195,12 +2195,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_class_wxPyApp","_wxPyApp",0}, { "_wxSize","_class_wxSize",0}, { "_wxRegionIterator","_class_wxRegionIterator",0}, - { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_class_wxPyTextDataObject","_wxPyTextDataObject",0}, { "_class_wxLogTextCtrl","_wxLogTextCtrl",0}, { "_class_wxLogGui","_wxLogGui",0}, { "_class_wxMDIParentFrame","_wxMDIParentFrame",0}, { "_wxPyTreeItemData","_class_wxPyTreeItemData",0}, + { "_class_wxPrinterDC","_wxPrinterDC",0}, { "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0}, { "_class_wxTimeSpan","_wxTimeSpan",0}, { "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0}, @@ -2356,6 +2356,8 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxFRAME_TOOL_WINDOW", PyInt_FromLong((long) wxFRAME_TOOL_WINDOW)); PyDict_SetItemString(d,"wxFRAME_FLOAT_ON_PARENT", PyInt_FromLong((long) wxFRAME_FLOAT_ON_PARENT)); PyDict_SetItemString(d,"wxFRAME_NO_WINDOW_MENU", PyInt_FromLong((long) wxFRAME_NO_WINDOW_MENU)); + PyDict_SetItemString(d,"wxFRAME_NO_TASKBAR", PyInt_FromLong((long) wxFRAME_NO_TASKBAR)); + PyDict_SetItemString(d,"wxFRAME_EX_CONTEXTHELP", PyInt_FromLong((long) wxFRAME_EX_CONTEXTHELP)); PyDict_SetItemString(d,"wxED_CLIENT_MARGIN", PyInt_FromLong((long) wxED_CLIENT_MARGIN)); PyDict_SetItemString(d,"wxED_BUTTONS_BOTTOM", PyInt_FromLong((long) wxED_BUTTONS_BOTTOM)); PyDict_SetItemString(d,"wxED_BUTTONS_RIGHT", PyInt_FromLong((long) wxED_BUTTONS_RIGHT)); @@ -2382,6 +2384,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxALIGN_CENTER", PyInt_FromLong((long) wxALIGN_CENTER)); PyDict_SetItemString(d,"wxALIGN_CENTRE", PyInt_FromLong((long) wxALIGN_CENTRE)); PyDict_SetItemString(d,"wxSHAPED", PyInt_FromLong((long) wxSHAPED)); + PyDict_SetItemString(d,"wxADJUST_MINSIZE", PyInt_FromLong((long) wxADJUST_MINSIZE)); PyDict_SetItemString(d,"wxLB_NEEDED_SB", PyInt_FromLong((long) wxLB_NEEDED_SB)); PyDict_SetItemString(d,"wxLB_ALWAYS_SB", PyInt_FromLong((long) wxLB_ALWAYS_SB)); PyDict_SetItemString(d,"wxLB_SORT", PyInt_FromLong((long) wxLB_SORT)); @@ -2452,12 +2455,17 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxLC_MASK_TYPE", PyInt_FromLong((long) wxLC_MASK_TYPE)); PyDict_SetItemString(d,"wxLC_MASK_ALIGN", PyInt_FromLong((long) wxLC_MASK_ALIGN)); PyDict_SetItemString(d,"wxLC_MASK_SORT", PyInt_FromLong((long) wxLC_MASK_SORT)); + PyDict_SetItemString(d,"wxLC_HRULES", PyInt_FromLong((long) wxLC_HRULES)); + PyDict_SetItemString(d,"wxLC_VRULES", PyInt_FromLong((long) wxLC_VRULES)); PyDict_SetItemString(d,"wxSP_VERTICAL", PyInt_FromLong((long) wxSP_VERTICAL)); PyDict_SetItemString(d,"wxSP_HORIZONTAL", PyInt_FromLong((long) wxSP_HORIZONTAL)); PyDict_SetItemString(d,"wxSP_ARROW_KEYS", PyInt_FromLong((long) wxSP_ARROW_KEYS)); PyDict_SetItemString(d,"wxSP_WRAP", PyInt_FromLong((long) wxSP_WRAP)); PyDict_SetItemString(d,"wxSP_NOBORDER", PyInt_FromLong((long) wxSP_NOBORDER)); PyDict_SetItemString(d,"wxSP_3D", PyInt_FromLong((long) wxSP_3D)); + PyDict_SetItemString(d,"wxSP_3DSASH", PyInt_FromLong((long) wxSP_3DSASH)); + PyDict_SetItemString(d,"wxSP_3DBORDER", PyInt_FromLong((long) wxSP_3DBORDER)); + PyDict_SetItemString(d,"wxSP_FULLSASH", PyInt_FromLong((long) wxSP_FULLSASH)); PyDict_SetItemString(d,"wxSP_BORDER", PyInt_FromLong((long) wxSP_BORDER)); PyDict_SetItemString(d,"wxSP_LIVE_UPDATE", PyInt_FromLong((long) wxSP_LIVE_UPDATE)); PyDict_SetItemString(d,"wxSP_PERMIT_UNSPLIT", PyInt_FromLong((long) wxSP_PERMIT_UNSPLIT)); @@ -2569,6 +2577,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxOVERWRITE_PROMPT", PyInt_FromLong((long) wxOVERWRITE_PROMPT)); PyDict_SetItemString(d,"wxFILE_MUST_EXIST", PyInt_FromLong((long) wxFILE_MUST_EXIST)); PyDict_SetItemString(d,"wxMULTIPLE", PyInt_FromLong((long) wxMULTIPLE)); + PyDict_SetItemString(d,"wxCHANGE_DIR", PyInt_FromLong((long) wxCHANGE_DIR)); PyDict_SetItemString(d,"wxACCEL_ALT", PyInt_FromLong((long) wxACCEL_ALT)); PyDict_SetItemString(d,"wxACCEL_CTRL", PyInt_FromLong((long) wxACCEL_CTRL)); PyDict_SetItemString(d,"wxACCEL_SHIFT", PyInt_FromLong((long) wxACCEL_SHIFT)); @@ -2950,50 +2959,8 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_COMMAND_SET_FOCUS", PyInt_FromLong((long) wxEVT_COMMAND_SET_FOCUS)); PyDict_SetItemString(d,"wxEVT_COMMAND_KILL_FOCUS", PyInt_FromLong((long) wxEVT_COMMAND_KILL_FOCUS)); PyDict_SetItemString(d,"wxEVT_COMMAND_ENTER", PyInt_FromLong((long) wxEVT_COMMAND_ENTER)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_TREE_BEGIN_DRAG)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_BEGIN_RDRAG", PyInt_FromLong((long) wxEVT_COMMAND_TREE_BEGIN_RDRAG)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_END_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_TREE_END_LABEL_EDIT)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_DELETE_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_TREE_DELETE_ITEM)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_GET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_TREE_GET_INFO)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SET_INFO)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_EXPANDED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_EXPANDED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_EXPANDING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_EXPANDING)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_COLLAPSED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_COLLAPSED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_COLLAPSING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_COLLAPSING)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_SEL_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_TREE_SEL_CHANGING)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_TREE_KEY_DOWN)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_ACTIVATED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_DRAG)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_RDRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_RDRAG)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_END_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_END_LABEL_EDIT)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ITEM)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_GET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_GET_INFO)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_SET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_SET_INFO)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_SELECTED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_DESELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_DESELECTED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_LIST_KEY_DOWN)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_INSERT_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_INSERT_ITEM)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_CLICK)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_ACTIVATED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TAB_SEL_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_TAB_SEL_CHANGED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_TAB_SEL_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_TAB_SEL_CHANGING)); - PyDict_SetItemString(d,"wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)); - PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING)); - PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_UNSPLIT", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_UNSPLIT)); - PyDict_SetItemString(d,"wxEVT_COMMAND_SPLITTER_DOUBLECLICKED", PyInt_FromLong((long) wxEVT_COMMAND_SPLITTER_DOUBLECLICKED)); PyDict_SetItemString(d,"wxEVT_NAVIGATION_KEY", PyInt_FromLong((long) wxEVT_NAVIGATION_KEY)); PyDict_SetItemString(d,"wxEVT_TIMER", PyInt_FromLong((long) wxEVT_TIMER)); - PyDict_SetItemString(d,"wxEVT_END_PROCESS", PyInt_FromLong((long) wxEVT_END_PROCESS)); PyDict_SetItemString(d,"__version__", PyString_FromString("0.0.0")); PyDict_SetItemString(d,"cvar", SWIG_globals); SWIG_addvarlink(SWIG_globals,"wxDefaultPosition",_wrap_wxDefaultPosition_get, _wrap_wxDefaultPosition_set); diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index 2d15bf9e40..323099d434 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -205,6 +205,8 @@ wxDEFAULT_DIALOG_STYLE = wxc.wxDEFAULT_DIALOG_STYLE wxFRAME_TOOL_WINDOW = wxc.wxFRAME_TOOL_WINDOW wxFRAME_FLOAT_ON_PARENT = wxc.wxFRAME_FLOAT_ON_PARENT wxFRAME_NO_WINDOW_MENU = wxc.wxFRAME_NO_WINDOW_MENU +wxFRAME_NO_TASKBAR = wxc.wxFRAME_NO_TASKBAR +wxFRAME_EX_CONTEXTHELP = wxc.wxFRAME_EX_CONTEXTHELP wxED_CLIENT_MARGIN = wxc.wxED_CLIENT_MARGIN wxED_BUTTONS_BOTTOM = wxc.wxED_BUTTONS_BOTTOM wxED_BUTTONS_RIGHT = wxc.wxED_BUTTONS_RIGHT @@ -231,6 +233,7 @@ wxALIGN_TOP = wxc.wxALIGN_TOP wxALIGN_CENTER = wxc.wxALIGN_CENTER wxALIGN_CENTRE = wxc.wxALIGN_CENTRE wxSHAPED = wxc.wxSHAPED +wxADJUST_MINSIZE = wxc.wxADJUST_MINSIZE wxLB_NEEDED_SB = wxc.wxLB_NEEDED_SB wxLB_ALWAYS_SB = wxc.wxLB_ALWAYS_SB wxLB_SORT = wxc.wxLB_SORT @@ -301,12 +304,17 @@ wxLC_SORT_DESCENDING = wxc.wxLC_SORT_DESCENDING wxLC_MASK_TYPE = wxc.wxLC_MASK_TYPE wxLC_MASK_ALIGN = wxc.wxLC_MASK_ALIGN wxLC_MASK_SORT = wxc.wxLC_MASK_SORT +wxLC_HRULES = wxc.wxLC_HRULES +wxLC_VRULES = wxc.wxLC_VRULES wxSP_VERTICAL = wxc.wxSP_VERTICAL wxSP_HORIZONTAL = wxc.wxSP_HORIZONTAL wxSP_ARROW_KEYS = wxc.wxSP_ARROW_KEYS wxSP_WRAP = wxc.wxSP_WRAP wxSP_NOBORDER = wxc.wxSP_NOBORDER wxSP_3D = wxc.wxSP_3D +wxSP_3DSASH = wxc.wxSP_3DSASH +wxSP_3DBORDER = wxc.wxSP_3DBORDER +wxSP_FULLSASH = wxc.wxSP_FULLSASH wxSP_BORDER = wxc.wxSP_BORDER wxSP_LIVE_UPDATE = wxc.wxSP_LIVE_UPDATE wxSP_PERMIT_UNSPLIT = wxc.wxSP_PERMIT_UNSPLIT @@ -418,6 +426,7 @@ wxHIDE_READONLY = wxc.wxHIDE_READONLY wxOVERWRITE_PROMPT = wxc.wxOVERWRITE_PROMPT wxFILE_MUST_EXIST = wxc.wxFILE_MUST_EXIST wxMULTIPLE = wxc.wxMULTIPLE +wxCHANGE_DIR = wxc.wxCHANGE_DIR wxACCEL_ALT = wxc.wxACCEL_ALT wxACCEL_CTRL = wxc.wxACCEL_CTRL wxACCEL_SHIFT = wxc.wxACCEL_SHIFT @@ -799,50 +808,8 @@ wxEVT_COMMAND_RIGHT_DCLICK = wxc.wxEVT_COMMAND_RIGHT_DCLICK wxEVT_COMMAND_SET_FOCUS = wxc.wxEVT_COMMAND_SET_FOCUS wxEVT_COMMAND_KILL_FOCUS = wxc.wxEVT_COMMAND_KILL_FOCUS wxEVT_COMMAND_ENTER = wxc.wxEVT_COMMAND_ENTER -wxEVT_COMMAND_TREE_BEGIN_DRAG = wxc.wxEVT_COMMAND_TREE_BEGIN_DRAG -wxEVT_COMMAND_TREE_BEGIN_RDRAG = wxc.wxEVT_COMMAND_TREE_BEGIN_RDRAG -wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT = wxc.wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT -wxEVT_COMMAND_TREE_END_LABEL_EDIT = wxc.wxEVT_COMMAND_TREE_END_LABEL_EDIT -wxEVT_COMMAND_TREE_DELETE_ITEM = wxc.wxEVT_COMMAND_TREE_DELETE_ITEM -wxEVT_COMMAND_TREE_GET_INFO = wxc.wxEVT_COMMAND_TREE_GET_INFO -wxEVT_COMMAND_TREE_SET_INFO = wxc.wxEVT_COMMAND_TREE_SET_INFO -wxEVT_COMMAND_TREE_ITEM_EXPANDED = wxc.wxEVT_COMMAND_TREE_ITEM_EXPANDED -wxEVT_COMMAND_TREE_ITEM_EXPANDING = wxc.wxEVT_COMMAND_TREE_ITEM_EXPANDING -wxEVT_COMMAND_TREE_ITEM_COLLAPSED = wxc.wxEVT_COMMAND_TREE_ITEM_COLLAPSED -wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxc.wxEVT_COMMAND_TREE_ITEM_COLLAPSING -wxEVT_COMMAND_TREE_SEL_CHANGED = wxc.wxEVT_COMMAND_TREE_SEL_CHANGED -wxEVT_COMMAND_TREE_SEL_CHANGING = wxc.wxEVT_COMMAND_TREE_SEL_CHANGING -wxEVT_COMMAND_TREE_KEY_DOWN = wxc.wxEVT_COMMAND_TREE_KEY_DOWN -wxEVT_COMMAND_TREE_ITEM_ACTIVATED = wxc.wxEVT_COMMAND_TREE_ITEM_ACTIVATED -wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = wxc.wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK -wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = wxc.wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK -wxEVT_COMMAND_LIST_BEGIN_DRAG = wxc.wxEVT_COMMAND_LIST_BEGIN_DRAG -wxEVT_COMMAND_LIST_BEGIN_RDRAG = wxc.wxEVT_COMMAND_LIST_BEGIN_RDRAG -wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = wxc.wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT -wxEVT_COMMAND_LIST_END_LABEL_EDIT = wxc.wxEVT_COMMAND_LIST_END_LABEL_EDIT -wxEVT_COMMAND_LIST_DELETE_ITEM = wxc.wxEVT_COMMAND_LIST_DELETE_ITEM -wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = wxc.wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS -wxEVT_COMMAND_LIST_GET_INFO = wxc.wxEVT_COMMAND_LIST_GET_INFO -wxEVT_COMMAND_LIST_SET_INFO = wxc.wxEVT_COMMAND_LIST_SET_INFO -wxEVT_COMMAND_LIST_ITEM_SELECTED = wxc.wxEVT_COMMAND_LIST_ITEM_SELECTED -wxEVT_COMMAND_LIST_ITEM_DESELECTED = wxc.wxEVT_COMMAND_LIST_ITEM_DESELECTED -wxEVT_COMMAND_LIST_KEY_DOWN = wxc.wxEVT_COMMAND_LIST_KEY_DOWN -wxEVT_COMMAND_LIST_INSERT_ITEM = wxc.wxEVT_COMMAND_LIST_INSERT_ITEM -wxEVT_COMMAND_LIST_COL_CLICK = wxc.wxEVT_COMMAND_LIST_COL_CLICK -wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxc.wxEVT_COMMAND_LIST_ITEM_ACTIVATED -wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = wxc.wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK -wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = wxc.wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK -wxEVT_COMMAND_TAB_SEL_CHANGED = wxc.wxEVT_COMMAND_TAB_SEL_CHANGED -wxEVT_COMMAND_TAB_SEL_CHANGING = wxc.wxEVT_COMMAND_TAB_SEL_CHANGING -wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxc.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED -wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxc.wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING -wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = wxc.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING -wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = wxc.wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED -wxEVT_COMMAND_SPLITTER_UNSPLIT = wxc.wxEVT_COMMAND_SPLITTER_UNSPLIT -wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = wxc.wxEVT_COMMAND_SPLITTER_DOUBLECLICKED wxEVT_NAVIGATION_KEY = wxc.wxEVT_NAVIGATION_KEY wxEVT_TIMER = wxc.wxEVT_TIMER -wxEVT_END_PROCESS = wxc.wxEVT_END_PROCESS __version__ = wxc.__version__ cvar = wxc.cvar wxDefaultPosition = wxPointPtr(wxc.cvar.wxDefaultPosition) diff --git a/wxPython/src/printfw.i b/wxPython/src/printfw.i index 77403a96b7..2586d65229 100644 --- a/wxPython/src/printfw.i +++ b/wxPython/src/printfw.i @@ -98,6 +98,20 @@ public: //---------------------------------------------------------------------- +#ifdef __WXMSW__ +class wxPrinterDC : public wxDC { +public: + wxPrinterDC(const wxPrintData& printData); + %name(wxPrinterDC2) wxPrinterDC(const wxString& driver, + const wxString& device, + const wxString& output, + bool interactive = TRUE, + int orientation = wxPORTRAIT); +}; +#endif + +//--------------------------------------------------------------------------- + class wxPageSetupDialogData { public: wxPageSetupDialogData(); diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 1b2abd0737..502e8d2d66 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -709,6 +709,10 @@ public: wxAcceleratorEntry *GetAccel(); void SetAccel(wxAcceleratorEntry *accel); + static wxString GetLabelFromText(const wxString& text); + + // TODO: Add wxOwnerDrawn methods, also look at other ownerdrawn classes... + }; //--------------------------------------------------------------------------- diff --git a/wxPython/src/windows2.i b/wxPython/src/windows2.i index b5c4d0ebd9..8be7dabf60 100644 --- a/wxPython/src/windows2.i +++ b/wxPython/src/windows2.i @@ -242,6 +242,13 @@ enum { //--------------------------------------------------------------------------- +enum { + /* notebook control event types */ + wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, + wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, +}; + + class wxNotebookEvent : public wxNotifyEvent { public: int GetSelection(); @@ -304,6 +311,15 @@ public: //--------------------------------------------------------------------------- +enum { + /* splitter window events */ + wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, + wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, + wxEVT_COMMAND_SPLITTER_UNSPLIT, + wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, +}; + + enum { wxSPLIT_HORIZONTAL, @@ -311,7 +327,6 @@ enum wxSPLIT_DRAG_NONE, wxSPLIT_DRAG_DRAGGING, wxSPLIT_DRAG_LEFT_DOWN - }; diff --git a/wxPython/src/windows3.i b/wxPython/src/windows3.i index 32d115e9ce..1bd4260499 100644 --- a/wxPython/src/windows3.i +++ b/wxPython/src/windows3.i @@ -47,6 +47,9 @@ enum wxSashEdgePosition { enum { wxEVT_SASH_DRAGGED, wxSW_3D, + wxSW_3DSASH, + wxSW_3DBORDER, + wxSW_BORDER }; enum wxSashDragStatus diff --git a/wxPython/tests/dynamicform.py b/wxPython/tests/dynamicform.py new file mode 100644 index 0000000000..e65b3fddc5 --- /dev/null +++ b/wxPython/tests/dynamicform.py @@ -0,0 +1,62 @@ + + +from wxPython.wx import * + +class FieldData: + def __init__(self, name, label, shortHelp="", defValue="", + size=(-1, -1), style=0, ID=-1): + self.name = name + self.label = label + self.shortHelp = shortHelp + self.defValue = defValue + self.size = size + self.style = style + self.ID = ID + + +class DynamicForm(wxPanel): + def __init__(self, parent, ID, fieldData): + wxPanel.__init__(self, parent, ID) + + sizer = wxFlexGridSizer(cols=2, vgap=5, hgap=5) + for field in fieldData: + label = wxStaticText(self, -1, field.label) + sizer.Add(label, 0, wxALIGN_RIGHT) + text = wxTextCtrl(self, field.ID, field.defValue, + size=field.size, style=field.style) + if field.shortHelp: + text.SetToolTip(wxToolTip(field.shortHelp)) + self.__dict__["get_"+field.name] = text.GetValue + self.__dict__["set_"+field.name] = text.SetValue + sizer.Add(text, 0, wxEXPAND) + + sizer.Fit(self) + self.SetAutoLayout(true) + self.SetSizer(sizer) + + +class TestFrame(wxFrame): + testFields = [ + FieldData("fname", "First name:", "Enter someone's first name"), + FieldData("lname", "Last name:", "Enter someone's last name"), + FieldData("email", "Email address:", "just figure it out..."), + ] + def __init__(self): + wxFrame.__init__(self, None, -1, "This is a test") + form = DynamicForm(self, -1, self.testFields) + form.set_fname("Robin") + form.set_lname("Dunn") + self.form = form + self.Fit() + EVT_CLOSE(self, self.OnCloseWindow) + + def OnCloseWindow(self, evt): + print self.form.get_email() + self.Destroy() + + +app = wxPySimpleApp() +frame = TestFrame() +frame.Show(true) +app.MainLoop() + diff --git a/wxPython/tests/test2.py b/wxPython/tests/test2.py index 647cb9727b..47ecaea47f 100644 --- a/wxPython/tests/test2.py +++ b/wxPython/tests/test2.py @@ -154,7 +154,18 @@ if __name__ == '__main__': #---------------------------------------------------------------------------- # # $Log$ +# Revision 1.4 2001/02/16 08:19:38 robind +# Copied/merged from the 2.2 branch. +# +# Changes needed to build with new event system +# +# Revision 1.1.2.2 2001/01/30 20:54:16 robind +# +# Gobs of changes move from the main trunk to the 2.2 branch in +# preparataion for 2.2.5 release. See CHANGES.txt for details. +# # Revision 1.3 2000/10/30 21:05:22 robind +# # Merged wxPython 2.2.2 over to the main branch # # Revision 1.1.2.1 2000/05/16 02:07:01 RD diff --git a/wxPython/tests/test3.py b/wxPython/tests/test3.py index 262563a8da..dec9670a24 100644 --- a/wxPython/tests/test3.py +++ b/wxPython/tests/test3.py @@ -146,7 +146,18 @@ if __name__ == '__main__': #---------------------------------------------------------------------------- # # $Log$ +# Revision 1.4 2001/02/16 08:19:38 robind +# Copied/merged from the 2.2 branch. +# +# Changes needed to build with new event system +# +# Revision 1.1.2.2 2001/01/30 20:54:16 robind +# +# Gobs of changes move from the main trunk to the 2.2 branch in +# preparataion for 2.2.5 release. See CHANGES.txt for details. +# # Revision 1.3 2000/10/30 21:05:22 robind +# # Merged wxPython 2.2.2 over to the main branch # # Revision 1.1.2.1 2000/05/16 02:07:01 RD diff --git a/wxPython/tests/test4.py b/wxPython/tests/test4.py index 9c16108828..469e14f497 100644 --- a/wxPython/tests/test4.py +++ b/wxPython/tests/test4.py @@ -998,7 +998,18 @@ if __name__ == '__main__': #---------------------------------------------------------------------------- # # $Log$ +# Revision 1.4 2001/02/16 08:19:38 robind +# Copied/merged from the 2.2 branch. +# +# Changes needed to build with new event system +# +# Revision 1.1.2.2 2001/01/30 20:54:16 robind +# +# Gobs of changes move from the main trunk to the 2.2 branch in +# preparataion for 2.2.5 release. See CHANGES.txt for details. +# # Revision 1.3 2000/10/30 21:05:22 robind +# # Merged wxPython 2.2.2 over to the main branch # # Revision 1.1.2.1 2000/05/16 02:07:02 RD diff --git a/wxPython/wxPython/lib/anchors.py b/wxPython/wxPython/lib/anchors.py new file mode 100644 index 0000000000..c2e52c433d --- /dev/null +++ b/wxPython/wxPython/lib/anchors.py @@ -0,0 +1,91 @@ +#---------------------------------------------------------------------- +# Name: wxPython.lib.anchors +# Purpose: A class that provides an easy to use interface over layout +# constraints for anchored layout. +# +# Author: Riaan Booysen +# +# Created: 15-Dec-2000 +# RCS-ID: $Id$ +# Copyright: (c) 2000 by Total Control Software +# Licence: wxWindows license +#---------------------------------------------------------------------- + +from wxPython.wx import wxLayoutConstraints, wxTop, wxLeft, wxBottom, wxRight, \ + wxHeight, wxWidth + +class LayoutAnchors(wxLayoutConstraints): + """ A class that implements Delphi's Anchors with wxLayoutConstraints. + + Anchored sides maintain the distance from the edge of the + control to the same edge of the parent. + When neither side is selected, the control keeps the same + relative position to both sides. + + The current position and size of the control and it's parent + is used when setting up the constraints. To change the size or + position of an already anchored control, set the constraints to + None, reposition or resize and reapply the anchors. + + Examples: + + Let's anchor the right and bottom edge of a control and + resize it's parent. + + ctrl.SetConstraints(LayoutAnchors(ctrl, left=0, top=0, right=1, bottom=1)) + + +=========+ +===================+ + | +-----+ | | | + | | * | -> | | + | +--*--+ | | +-----+ | + +---------+ | | * | + | +--*--+ | + +-------------------+ + * = anchored edge + + When anchored on both sides the control will stretch horizontally. + + ctrl.SetConstraints(LayoutAnchors(ctrl, 1, 0, 1, 1)) + + +=========+ +===================+ + | +-----+ | | | + | * * | -> | | + | +--*--+ | | +---------------+ | + +---------+ | * ctrl * | + | +-------*-------+ | + +-------------------+ + * = anchored edge + """ + def __init__(self, control, left = 1, top = 1, right = 0, bottom = 0): + wxLayoutConstraints.__init__(self) + parent = control.GetParent() + if not parent: return + + pPos, pSize = parent.GetPosition(), parent.GetClientSize() + cPos, cSize = control.GetPosition(), control.GetSize() + + self.setConstraintSides(self.left, wxLeft, left, + self.right, wxRight, right, + self.width, wxWidth, self.centreX, + cPos.x, cSize.x, pSize.x, parent) + + self.setConstraintSides(self.top, wxTop, top, + self.bottom, wxBottom, bottom, + self.height, wxHeight, self.centreY, + cPos.y, cSize.y, pSize.y, parent) + + def setConstraintSides(self, side1, side1Edge, side1Anchor, + side2, side2Edge, side2Anchor, + size, sizeEdge, centre, + cPos, cSize, pSize, parent): + if side2Anchor: + side2.SameAs(parent, side2Edge, pSize - (cPos + cSize)) + if side1Anchor: + side1.SameAs(parent, side1Edge, cPos) + if not side2Anchor: + size.AsIs() + else: + size.AsIs() + if not side2Anchor: + centre.PercentOf(parent, sizeEdge, + int(((cPos + cSize / 2.0) / pSize)*100)) diff --git a/wxPython/wxPython/lib/buttons.py b/wxPython/wxPython/lib/buttons.py index 6e3c713662..fb455c86c4 100644 --- a/wxPython/wxPython/lib/buttons.py +++ b/wxPython/wxPython/lib/buttons.py @@ -67,6 +67,7 @@ class wxGenButton(wxControl): self.bezelWidth = 2 self.hasFocus = false self.useFocusInd = true + self.evtToSend = [] self.SetLabel(label) self.SetPosition(pos) @@ -86,6 +87,7 @@ class wxGenButton(wxControl): EVT_KEY_UP(self, self.OnKeyUp) EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) EVT_PAINT(self, self.OnPaint) + EVT_IDLE(self, self.OnIdle) def SetBestSize(self, size=None): @@ -174,7 +176,14 @@ class wxGenButton(wxControl): evt = wxGenButtonEvent(wxEVT_COMMAND_BUTTON_CLICKED, self.GetId()) evt.SetIsDown(not self.up) evt.SetButtonObj(self) - self.GetEventHandler().ProcessEvent(evt) + self.evtToSend.append(evt) + + + def OnIdle(self, evt): + while self.evtToSend: + evt = self.evtToSend[0] + del self.evtToSend[0] + self.GetEventHandler().ProcessEvent(evt) def DrawBezel(self, dc, x1, y1, x2, y2): diff --git a/wxPython/wxPython/lib/fancytext.py b/wxPython/wxPython/lib/fancytext.py new file mode 100644 index 0000000000..566e24627d --- /dev/null +++ b/wxPython/wxPython/lib/fancytext.py @@ -0,0 +1,249 @@ +"""wxFancyText -- methods for rendering XML specified text + +This module has four main methods: + +def getExtent(str, dc=None, enclose=1): +def renderToBitmap(str, background=None, enclose=1) +def renderToDC(str, dc, x, y, enclose=1) + +In all cases, 'str' is an XML string. The tags in the string can +currently specify the font, subscripts, superscripts, and the angle +sign. The allowable properties of font are size, family, style, weght, +encoding, and color. See the example on the bottom for a better idea +of how this works. + +Note that start and end tags for the string are provided if enclose is +true, so for instance, renderToBitmap("X1") will work. + +""" +# Copyright 2001 Timothy Hochberg +# Use as you see fit. No warantees, I cannot be held responsible, etc. + + + +# TODO: Make a wxFancyTextCtrl class that derives from wxControl. +# Add support for line breaks +# etc. +# - Robin + + + +from wxPython.wx import * +import xml.parsers.expat, copy + +_families = {"default" : wxDEFAULT, "decorative" : wxDECORATIVE, "roman" : wxROMAN, + "swiss" : wxSWISS, "modern" : wxMODERN} +_styles = {"normal" : wxNORMAL, "slant" : wxSLANT, "italic" : wxITALIC} +_weights = {"normal" : wxNORMAL, "light" : wxLIGHT, "bold" : wxBOLD} + +# The next three classes: Renderer, SizeRenderer and DCRenderer are +# what you will need to override to extend the XML language. All of +# the font stuff as well as the subscript and superscript stuff are in +# Renderer. + +class Renderer: + + defaultSize = wxNORMAL_FONT.GetPointSize() + defaultFamily = wxDEFAULT + defaultStyle = wxNORMAL + defaultWeight = wxNORMAL + defaultEncoding = wxFont_GetDefaultEncoding() + defaultColor = "black" + + def __init__(self, dc=None): + if dc == None: + dc = wxMemoryDC() + self.dc = dc + self.offsets = [0] + self.fonts = [{}] + + def startElement(self, name, attrs): + method = "start_" + name + if not hasattr(self, method): + raise ValueError("XML tag '%s' not supported" % name) + getattr(self, method)(attrs) + + def endElement(self, name): + method = "end_" + name + if not hasattr(self, method): + raise ValueError("XML tag '%s' not supported" % name) + getattr(self, method)() + + def start_wxFancyString(self, attrs): + pass + + def end_wxFancyString(self): + pass + + def start_font(self, attrs): + for key, value in attrs.items(): + if key == "size": + value = int(value) + elif key == "family": + value = _families[value] + elif key == "style": + value = _styles[value] + elif key == "weight": + value = _weights[value] + elif key == "encoding": + pass + elif key == "color": + pass + else: + raise ValueError("unknown font attribute '%s'" % key) + attrs[key] = value + font = copy.copy(self.fonts[-1]) + font.update(attrs) + self.fonts.append(font) + + def end_font(self): + self.fonts.pop() + + def start_sub(self, attrs): + if attrs.keys(): + raise ValueError(" does not take attributes") + font = self.getCurrentFont() + self.offsets.append(self.offsets[-1] + self.dc.GetFullTextExtent("M", font)[1]*0.5) + self.start_font({"size" : font.GetPointSize() * 0.8}) + + def end_sub(self): + self.fonts.pop() + self.offsets.pop() + + def start_sup(self, attrs): + if attrs.keys(): + raise ValueError(" does not take attributes") + font = self.getCurrentFont() + self.offsets.append(self.offsets[-1] - self.dc.GetFullTextExtent("M", font)[1]*0.3) + self.start_font({"size" : font.GetPointSize() * 0.8}) + + def end_sup(self): + self.fonts.pop() + self.offsets.pop() + + def getCurrentFont(self): + font = self.fonts[-1] + return wxFont(font.get("size", self.defaultSize), + font.get("family", self.defaultFamily), + font.get("style", self.defaultStyle), + font.get("weight", self.defaultWeight), + encoding = font.get("encoding", self.defaultEncoding)) + + def getCurrentColor(self): + font = self.fonts[-1] + return wxNamedColour(font.get("color", self.defaultColor)) + + +class SizeRenderer(Renderer): + + def __init__(self, dc=None): + Renderer.__init__(self, dc) + self.width = self.height = 0 + self.minY = self.maxY = 0 + + def characterData(self, data): + self.dc.SetFont(self.getCurrentFont()) + width, height = self.dc.GetTextExtent(data) + self.width = self.width + width + self.minY = min(self.minY, self.offsets[-1]) + self.maxY = max(self.maxY, self.offsets[-1] + height) + self.height = self.maxY - self.minY + + def start_angle(self, attrs): + self.characterData("M") + + def end_angle(self): + pass + +class DCRenderer(Renderer): + + def __init__(self, dc=None, x=0, y=0): + Renderer.__init__(self, dc) + self.x = x + self.y = y + + def characterData(self, data): + self.dc.SetFont(self.getCurrentFont()) + self.dc.SetTextForeground(self.getCurrentColor()) + width, height = self.dc.GetTextExtent(data) + self.dc.DrawText(data, self.x, self.y + self.offsets[-1]) + self.x = self.x + width + + def start_angle(self, attrs): + self.dc.SetFont(self.getCurrentFont()) + self.dc.SetPen(wxPen(self.getCurrentColor(), 1)) + width, height, descent, leading = self.dc.GetFullTextExtent("M") + y = self.y + self.offsets[-1] + height - descent + self.dc.DrawLine(self.x, y, self.x+width, y) + self.dc.DrawLine(self.x, y, self.x+width, y-width) + self.x = self.x + width + + def end_angle(self): + pass + +# This is a rendering function that is primarily used internally, +# although it could be used externally if one had overridden the +# Renderer classes. + +def renderToRenderer(str, renderer, enclose=1): + if enclose: + str = '%s' % str + p = xml.parsers.expat.ParserCreate() + p.returns_unicode = 0 + p.StartElementHandler = renderer.startElement + p.EndElementHandler = renderer.endElement + p.CharacterDataHandler = renderer.characterData + p.Parse(str, 1) + + +def getExtent(str, dc=None, enclose=1): + "Return the extent of str" + renderer = SizeRenderer(dc) + renderToRenderer(str, renderer, enclose) + return wxSize(renderer.width, renderer.height) + +# This should probably only be used internally.... + +def getFullExtent(str, dc=None, enclose=1): + renderer = SizeRenderer(dc) + renderToRenderer(str, renderer, enclose) + return renderer.width, renderer.height, -renderer.minY + +def renderToBitmap(str, background=None, enclose=1): + "Return str rendered on a minumum size bitmap" + dc = wxMemoryDC() + width, height, dy = getFullExtent(str, dc) + bmp = wxEmptyBitmap(width, height) + dc.SelectObject(bmp) + if background is not None: + dc.SetBackground(background) + dc.Clear() + renderer = DCRenderer(dc, y=dy) + dc.BeginDrawing() + renderToRenderer(str, renderer, enclose) + dc.EndDrawing() + dc.SelectObject(wxNullBitmap) + return bmp + +def renderToDC(str, dc, x, y, enclose=1): + "Render str onto a wxDC at (x,y)" + width, height, dy = getFullExtent(str, dc) + renderer = DCRenderer(dc, x, y+dy) + renderToRenderer(str, renderer, enclose) + + +if __name__ == "__main__": + str = ('some |23 textwith subscript some other text' + 'big green text') + ID_EXIT = 102 + class myApp(wxApp): + def OnInit(self): + return 1 + app = myApp() + frame = wxFrame(NULL, -1, "wxFancyText demo", wxDefaultPosition) + frame.SetClientSize(getExtent(str)) + bmp = renderToBitmap(str, wxCYAN_BRUSH) + sb = wxStaticBitmap(frame, -1, bmp) + EVT_MENU(frame, ID_EXIT, frame.Destroy) + frame.Show(1) + app.MainLoop() diff --git a/wxPython/wxPython/lib/filebrowsebutton.py b/wxPython/wxPython/lib/filebrowsebutton.py index 731a48dd34..93ea1d3cf6 100644 --- a/wxPython/wxPython/lib/filebrowsebutton.py +++ b/wxPython/wxPython/lib/filebrowsebutton.py @@ -31,7 +31,7 @@ class FileBrowseButton(wxPanel): startDirectory -- Default directory for file dialog startup fileMask -- File mask (glob pattern, such as *.*) to use in file dialog fileMode -- wxOPEN or wxSAVE, indicates type of file dialog to use - changeCallback -- callback receives all changes in value of control + changeCallback -- callback receives all > > changes in value of control ) GetValue() -- retrieve current value of text control SetValue(string) -- set current value of text control diff --git a/wxPython/wxPython/lib/rpcMixin.py b/wxPython/wxPython/lib/rpcMixin.py new file mode 100644 index 0000000000..44736e6bd8 --- /dev/null +++ b/wxPython/wxPython/lib/rpcMixin.py @@ -0,0 +1,236 @@ +#---------------------------------------------------------------------- +# Name: rpcMixin +# Version: 0.1 +# Purpose: provides xmlrpc server functionality for wxPython +# applications via a mixin class +# +# Requires: (1) Python with threading enabled. +# (2) xmlrpclib from PythonWare +# (http://www.pythonware.com/products/xmlrpc/) +# the code was developed and tested using version 0.9.8 +# +# Author: greg Landrum (Landrum@RationalDiscovery.com) +# +# Copyright: (c) 2000 by Greg Landrum and Rational Discovery LLC +# Licence: wxWindows license +#---------------------------------------------------------------------- + +""" +Some Notes: + +1) The xmlrpc server runs in a separate thread from the main GUI + application, communication between the two threads using a custom + event (see the Threads demo in the wxPython docs for more info). + +2) Neither the server nor the client are particularly smart about + checking method names. So it's easy to shoot yourself in the foot + by calling improper methods. It would be pretty easy to add + either a list of allowed methods or a list of forbidden methods. + +3) Authentication of xmlrpc clients is *not* performed. I think it + would be pretty easy to do this in a hacky way, but I haven't done + it yet. + +4) The default port number is 800, it's a windows thing... at least + it seems like a windows thing to me. Since I'm not being smart + about port numbers, you can probably hork yourself arbitrarily by + firing up more than one xmlrpc-active frame at the same time, but + I haven't tried that. + +5) See the bottom of this file for an example of using the class. + +Obligatory disclaimer: + This is my first crack at both using xmlrpc and multi-threaded + programming, so there could be huge horrible bugs or design + flaws. If you see one, I'd love to hear about them. + +""" + +from wxPython.wx import * +import xmlrpcserver +import Threading +import SocketServer + +rpcPENDING = 0 +rpcDONE = 1 +rpcEXCEPT = 2 +class RPCRequest: + """A wrapper to use for handling requests and their responses""" + status = rpcPENDING + result = None + +# here's the ID for external events +wxEVT_EXTERNAL_EVENT = 25015 +class ExternalEvent(wxPyEvent): + """The custom event class used to pass xmlrpc calls from + the server thread into the GUI thread + """ + def __init__(self,method,args): + wxPyEvent.__init__(self) + self.SetEventType(wxEVT_EXTERNAL_EVENT) + self.method = method + self.args = args + self.rpcStatus = RPCRequest() + self.rpcStatusLock = Threading.Lock() + self.rpcCondVar = Threading.Condition() + +def EVT_EXTERNAL_EVENT(win,func): + win.Connect(-1,-1,wxEVT_EXTERNAL_EVENT,func) + +class Handler(xmlrpcserver.RequestHandler): + """The handler class that the xmlrpcserver actually calls + when a request comes in. + """ + def call(self,method,params): + """When an xmlrpc request comes in, this is the method that + gets called. + """ + # construct the event + evt = ExternalEvent(method,params) + + # update the status variable + evt.rpcStatusLock.acquire() + evt.rpcStatus.status = rpcPENDING + evt.rpcStatusLock.release() + + # acquire the condition lock + evt.rpcCondVar.acquire() + # dispatch the event to the GUI + wxPostEvent(self._app,evt) + # wait for the GUI to finish + while evt.rpcStatus.status == rpcPENDING: + evt.rpcCondVar.wait() + evt.rpcCondVar.release() + evt.rpcStatusLock.acquire() + if evt.rpcStatus.status == rpcEXCEPT: + # The GUI threw an exception, release the status lock + # and re-raise the exception + evt.rpcStatusLock.release() + raise evt.rpcStatus.result[0],evt.rpcStatus.result[1] + else: + # everything went through without problems + s = evt.rpcStatus.result + evt.rpcStatusLock.release() + return s + +class rpcMixin: + """A mixin class to provide xmlrpc server functionality to wxPython + frames/windows + + If you want to customize this, probably the best idea is to + override the OnExternal method, which is what's invoked when an + RPC is handled. + + """ + def __init__(self,host='',port=800): + """ + Arguments: + host: (optional) the hostname for the server + port: (optional) the port the server will use + """ + EVT_EXTERNAL_EVENT(self,self.OnExternal) + if hasattr(self,'OnClose'): + self._origOnClose = self.OnClose + else: + self._origOnClose = None + EVT_CLOSE(self,self.OnClose) + + exec('class Handler%d(Handler): pass'%(port)) + exec('tClass= Handler%d'%(port)) + tClass._app = self + self._xmlServ = SocketServer.TCPServer((host,port),tClass) + self.servThread = Threading.Thread(target=self._xmlServ.serve_forever) + self.servThread.setDaemon(1) + self.servThread.start() + + def OnClose(self,event): + """ be sure to shutdown the server and the server thread before + leaving + """ + self._xmlServ = None + self.servThread = None + if self._origOnClose is not None: + self._origOnClose(event) + + def OnExternal(self,event): + """ this is the callback used to handle RPCs + + Exceptions are caught and returned in the global _rpcStatus + structure. This allows the xmlrpc server to report the + exception to the client without mucking up any of the delicate + thread stuff. + """ + event.rpcStatusLock.acquire() + try: + res = eval('apply(self.%s,event.args)'%event.method) + except: + import sys,traceback + traceback.print_exc() + event.rpcStatus.result = sys.exc_info()[:2] + event.rpcStatus.status = rpcEXCEPT + else: + if res is None: + event.rpcStatus.result = [] + else: + event.rpcStatus.result = res + event.rpcStatus.status = rpcDONE + event.rpcStatusLock.release() + event.rpcCondVar.acquire() + event.rpcCondVar.notify() + event.rpcCondVar.release() + +if __name__ == '__main__': + import sys + port = 800 + if len(sys.argv)>1: + port = int(sys.argv[1]) + + class rpcFrame(wxFrame,rpcMixin): + """A simple wxFrame with the rpcMixin functionality added + """ + def __init__(self,*args,**kwargs): + """ rpcHost or rpcPort keyword arguments will be passed along to + the xmlrpc server. + """ + mixinArgs = {} + if kwargs.has_key('rpcHost'): + mixinArgs['host'] = kwargs['rpcHost'] + del kwargs['rpcHost'] + if kwargs.has_key('rpcPort'): + mixinArgs['port'] = kwargs['rpcPort'] + del kwargs['rpcPort'] + + apply(wxFrame.__init__,(self,)+args,kwargs) + apply(rpcMixin.__init__,(self,),mixinArgs) + + EVT_CHAR(self,self.OnChar) + + def TestFunc(self,args): + """a demo method""" + return args + + def OnChar(self,event): + key = event.GetKeyCode() + if key == ord('q'): + self.OnQuit(event) + + def OnQuit(self,event): + self.OnClose(event) + + def OnClose(self,event): + self.Destroy() + + class MyApp(wxApp): + def OnInit(self): + frame = rpcFrame(NULL, -1, "wxPython RPCDemo", wxDefaultPosition, wxSize(300,300),rpcHost='localhost',rpcPort=port) + frame.Show(TRUE) + import time + + #self.SetTopWindow(frame) + frame2 = rpcFrame(NULL, -1, "wxPython RPCDemo2", wxDefaultPosition, wxSize(300,300),rpcHost='localhost',rpcPort=port+1) + frame2.Show(TRUE) + + return TRUE + app = MyApp(0) + app.MainLoop() + -- 2.45.2