From: Robin Dunn Date: Sat, 31 Jul 2004 20:24:29 +0000 (+0000) Subject: Various updates to catch up to wxWidgets CVS X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9f8a9f548973be3033383aa235edadcf858336e8?ds=inline Various updates to catch up to wxWidgets CVS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/__windows_rename.i b/wxPython/src/__windows_rename.i index fe1411c631..9a0d81ac2b 100644 --- a/wxPython/src/__windows_rename.i +++ b/wxPython/src/__windows_rename.i @@ -48,6 +48,9 @@ %rename(SPLASH_NO_TIMEOUT) wxSPLASH_NO_TIMEOUT; %rename(SplashScreenWindow) wxSplashScreenWindow; %rename(SplashScreen) wxSplashScreen; +%rename(SB_NORMAL) wxSB_NORMAL; +%rename(SB_FLAT) wxSB_FLAT; +%rename(SB_RAISED) wxSB_RAISED; %rename(StatusBar) wxStatusBar; %rename(SP_NOBORDER) wxSP_NOBORDER; %rename(SP_NOSASH) wxSP_NOSASH; diff --git a/wxPython/src/_display.i b/wxPython/src/_display.i index 259d1a92cd..9e26f5f69d 100644 --- a/wxPython/src/_display.i +++ b/wxPython/src/_display.i @@ -227,7 +227,22 @@ function is not supported at all on this platform.", ""); DocDeclStr( virtual bool , ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode), - "Change current mode, return true if succeeded, false otherwise", ""); + "Changes the video mode of this display to the mode specified in the +mode parameter. + +If wx.DefaultVideoMode is passed in as the mode parameter, the defined +behaviour is that wx.Display will reset the video mode to the default +mode used by the display. On Windows, the behavior is normal. +However, there are differences on other platforms. On Unix variations +using X11 extensions it should behave as defined, but some +irregularities may occur. + +On wxMac passing in wx.DefaultVideoMode as the mode parameter does +nothing. This happens because Carbon no longer has access to +DMUseScreenPrefs, an undocumented function that changed the video mode +to the system default by using the system's 'scrn' resource. + +Returns True if succeeded, False otherwise", ""); DocDeclStr( diff --git a/wxPython/src/_region.i b/wxPython/src/_region.i index a1394b3056..7a0dcb737c 100644 --- a/wxPython/src/_region.i +++ b/wxPython/src/_region.i @@ -50,18 +50,8 @@ public: %name(RegionFromBitmapColour)wxRegion(const wxBitmap& bmp, const wxColour& transColour, int tolerance = 0); -#ifndef __WXMAC__ %name(RegionFromPoints)wxRegion(int points, wxPoint* points_array, int fillStyle = wxWINDING_RULE); -#else - %extend { - %name(RegionFromPoints)wxRegion(int points, wxPoint* points_array, - int fillStyle = wxWINDING_RULE) { - wxPyRaiseNotImplemented(); - return NULL; - } - } -#endif ~wxRegion(); diff --git a/wxPython/src/_sizers.i b/wxPython/src/_sizers.i index f015df3233..4f74fdb6e1 100644 --- a/wxPython/src/_sizers.i +++ b/wxPython/src/_sizers.i @@ -497,6 +497,8 @@ public: proportion, flag, border, data); } +// virtual void AddSpacer(int size); +// virtual void AddStretchSpacer(int prop = 1); DocAStr(Insert, "Insert(self, int before, item, int proportion=0, int flag=0, int border=0, @@ -525,6 +527,8 @@ the item at index *before*. See `Add` for a description of the parameters.", "" } +// virtual void InsertSpacer(size_t index, int size); +// virtual void InsertStretchSpacer(size_t index, int prop = 1); DocAStr(Prepend, "Prepend(self, item, int proportion=0, int flag=0, int border=0, @@ -552,6 +556,8 @@ this sizer. See `Add` for a description of the parameters.", ""); proportion, flag, border, data); } +// virtual void PrependSpacer(int size); +// virtual void PrependStretchSpacer(int prop = 1); DocAStr(Remove, "Remove(self, item) -> bool", diff --git a/wxPython/src/_statusbar.i b/wxPython/src/_statusbar.i index 50013980d5..14fa24cb93 100644 --- a/wxPython/src/_statusbar.i +++ b/wxPython/src/_statusbar.i @@ -22,7 +22,15 @@ %newgroup; +enum { + wxSB_NORMAL, + wxSB_FLAT, + wxSB_RAISED +}; + + + // wxStatusBar: a window near the bottom of the frame used for status info MustHaveApp(wxStatusBar); class wxStatusBar : public wxWindow @@ -62,8 +70,16 @@ public: // minus the sum of fixed width fields) is divided between the fields with // negative width according to the abs value of the width (field with width // -2 grows twice as much as one with width -1 &c) - virtual void SetStatusWidths(int widths, const int* widths_field); // uses typemap in _toplvl.i + virtual void SetStatusWidths(int widths, const int* widths_field); + + // Set the field style. Use either wxSB_NORMAL (default) for a standard 3D + // border around a field, wxSB_FLAT for no border around a field, so that it + // appears flat or wxSB_POPOUT to make the field appear raised. + // Setting field styles only works on wxMSW + virtual void SetStatusStyles(int styles, const int* styles_field); + + // Get the position and size of the field's internal bounding rectangle %extend { wxRect GetFieldRect(int i) { diff --git a/wxPython/src/_toplvl.i b/wxPython/src/_toplvl.i index 01f14c5b27..f62099e5f4 100644 --- a/wxPython/src/_toplvl.i +++ b/wxPython/src/_toplvl.i @@ -70,18 +70,6 @@ enum }; - -%typemap(in) (int widths, int* widths_field) { - $1 = PyList_Size($input); - $2 = int_LIST_helper($input); - if ($2 == NULL) SWIG_fail; -} - -%typemap(freearg) (int widths, int* widths_field) { - if ($2) delete [] $2; -} - - //--------------------------------------------------------------------------- class wxTopLevelWindow : public wxWindow diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index b027f9f3b9..be6b0561d0 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -588,7 +588,6 @@ anything if there are no subwindows.", ""); - %nokwargs SetSizeHints; DocStr(SetSizeHints, "Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the @@ -601,24 +600,25 @@ The resizing increments are only significant under Motif or Xt.", " :see: `GetMinSize`, `GetMaxSize`, `SetMinSize`, `SetMaxSize` "); - void SetSizeHints( const wxSize& minSize, - const wxSize& maxSize=wxDefaultSize, - const wxSize& incSize=wxDefaultSize); virtual void SetSizeHints( int minW, int minH, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 ); + %name(SetSizeHintsSz) void SetSizeHints( const wxSize& minSize, + const wxSize& maxSize=wxDefaultSize, + const wxSize& incSize=wxDefaultSize); - %nokwargs SetVirtualSizeHints; DocStr(SetVirtualSizeHints, "Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the virtual area of the window outside the given bounds.", ""); - void SetVirtualSizeHints( const wxSize& minSize, - const wxSize& maxSize=wxDefaultSize); virtual void SetVirtualSizeHints( int minW, int minH, int maxW = -1, int maxH = -1 ); + %name(SetVirtualSizeHintsSz)void SetVirtualSizeHints( + const wxSize& minSize, const wxSize& maxSize=wxDefaultSize); + + DocDeclStr( virtual wxSize , GetMaxSize() const, diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index d9ce9153bf..da6de8d8eb 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -14,6 +14,24 @@ //---------------------------------------------------------------------- // Typemaps to convert a list of items to an int (size) and an array +%define MAKE_INT_ARRAY_TYPEMAPS(NAME, ARR_NAME) + %typemap(in) (int NAME, int* ARR_NAME) { + $1 = PyList_Size($input); + $2 = int_LIST_helper($input); + if ($2 == NULL) SWIG_fail; + } + + %typemap(freearg) (int NAME, int* ARR_NAME) { + if ($2) delete [] $2; + } +%enddef + +MAKE_INT_ARRAY_TYPEMAPS(widths, widths_field) +MAKE_INT_ARRAY_TYPEMAPS(styles, styles_field) + + + +// Same things for a wxString %typemap(in) (int choices, wxString* choices_array ) { $1 = PyList_Size($input); $2 = wxString_LIST_helper($input); @@ -24,6 +42,7 @@ } + //--------------------------------------------------------------------------- // wxString typemaps