X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/994453b843b007de6367fedbf4a49ac9d920c63c..f7a50432401c62a3300b0b9faa7e99d7ffe3d4e8:/wxPython/src/_toplvl.i diff --git a/wxPython/src/_toplvl.i b/wxPython/src/_toplvl.i index bb383c2b01..b85506b0d1 100644 --- a/wxPython/src/_toplvl.i +++ b/wxPython/src/_toplvl.i @@ -130,6 +130,9 @@ public: virtual void SetTitle(const wxString& title); virtual wxString GetTitle() const; + // enable/disable close button [x] + virtual bool EnableCloseButton(bool enable ); + // Set the shape of the window to the given region. // Returns True if the platform supports this feature // (and the operation is successful.) @@ -168,15 +171,6 @@ public: "Center the window on screen", ""); %pythoncode { CentreOnScreen = CenterOnScreen } -#ifdef __WXMSW__ - bool EnableCloseButton(bool enable = true); -#else - %extend { - bool EnableCloseButton(bool enable = true) { return false; } - } -#endif - - DocDeclStr( virtual wxWindow *, GetDefaultItem() const, @@ -388,10 +382,24 @@ public: // lines into a vertical wxBoxSizer wxSizer* CreateTextSizer( const wxString &message ); - // places buttons into a horizontal wxBoxSizer - wxSizer* CreateButtonSizer( long flags, - bool separated = false, - wxCoord distance = 0 ); + + // returns a horizontal wxBoxSizer containing the given buttons + // + // notice that the returned sizer can be NULL if no buttons are put in the + // sizer (this mostly happens under smart phones and other atypical + // platforms which have hardware buttons replacing OK/Cancel and such) + %Rename(_CreateButtonSizer, + wxSizer* , CreateButtonSizer( long flags )); + %pythoncode { + def CreateButtonSizer(self, flags, *ignored): + return self._CreateButtonSizer(flags) + } + + // returns the sizer containing CreateButtonSizer() below a separating + // static line for the platforms which use static lines for items + // separation (i.e. not Mac) + wxSizer *CreateSeparatedButtonSizer(long flags); + wxStdDialogButtonSizer* CreateStdDialogButtonSizer( long flags ); //void SetModal( bool flag ); @@ -417,6 +425,14 @@ public: //--------------------------------------------------------------------------- %newgroup +%{ +#define wxDEFAULT_MINIFRAME_STYLE wxCAPTION | wxRESIZE_BORDER | wxTINY_CAPTION_HORIZ +%} + +enum { + wxDEFAULT_MINIFRAME_STYLE +}; + MustHaveApp(wxMiniFrame); @@ -431,7 +447,7 @@ public: const wxString& title = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, + long style = wxDEFAULT_MINIFRAME_STYLE, const wxString& name = wxPyFrameNameStr); %RenameCtor(PreMiniFrame, wxMiniFrame()); @@ -440,7 +456,7 @@ public: const wxString& title = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE, + long style = wxDEFAULT_MINIFRAME_STYLE, const wxString& name = wxPyFrameNameStr); };