X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5cf1cb1006d6b5762d96c07ee3892883607460c7..0a5bb138a71dfc1c706fc0858fb2801500e2c2e8:/wxPython/src/_toplvl.i diff --git a/wxPython/src/_toplvl.i b/wxPython/src/_toplvl.i index ceeaf5b111..b85506b0d1 100644 --- a/wxPython/src/_toplvl.i +++ b/wxPython/src/_toplvl.i @@ -53,14 +53,19 @@ enum wxFRAME_EX_METAL, wxDIALOG_EX_METAL, + wxWS_EX_CONTEXTHELP, // Obsolete wxDIALOG_MODAL, wxDIALOG_MODELESS, wxUSER_COLOURS, wxNO_3D, + + wxFRAME_EX_CONTEXTHELP, + wxDIALOG_EX_CONTEXTHELP, }; + enum { wxFULLSCREEN_NOMENUBAR, @@ -100,6 +105,10 @@ public: // return True if the frame is maximized virtual bool IsMaximized() const; + // return true if the frame is always maximized + // due to native guidelines or current policy + virtual bool IsAlwaysMaximized() const; + // return True if the frame is iconized virtual bool IsIconized() const; @@ -121,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.) @@ -134,7 +146,16 @@ public: virtual bool IsActive(); #ifdef __WXMAC__ - void MacSetMetalAppearance( bool on ); + %extend { + void MacSetMetalAppearance( bool on ) { + int style = self->GetExtraStyle(); + if ( on ) + style |= wxFRAME_EX_METAL; + else + style &= ~wxFRAME_EX_METAL; + self->SetExtraStyle(style); + } + } bool MacGetMetalAppearance() const; #else %extend @@ -149,6 +170,29 @@ public: void , CenterOnScreen(int dir = wxBOTH), "Center the window on screen", ""); %pythoncode { CentreOnScreen = CenterOnScreen } + + + DocDeclStr( + virtual wxWindow *, GetDefaultItem() const, + "Get the default child of this parent, i.e. the one which is activated +by pressing such as the OK button on a wx.Dialog.", ""); + + DocDeclStr( + virtual wxWindow *, SetDefaultItem(wxWindow * child), + "Set this child as default, return the old default.", ""); + + DocDeclStr( + virtual void , SetTmpDefaultItem(wxWindow * win), + "Set this child as temporary default", ""); + + DocDeclStr( + virtual wxWindow *, GetTmpDefaultItem() const, + "Return the temporary default item, which can be None.", ""); + + %property(DefaultItem, GetDefaultItem, SetDefaultItem, doc="See `GetDefaultItem` and `SetDefaultItem`"); + %property(Icon, GetIcon, SetIcon, doc="See `GetIcon` and `SetIcon`"); + %property(Title, GetTitle, SetTitle, doc="See `GetTitle` and `SetTitle`"); + %property(TmpDefaultItem, GetTmpDefaultItem, SetTmpDefaultItem, doc="See `GetTmpDefaultItem` and `SetTmpDefaultItem`"); }; @@ -272,6 +316,11 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(MenuBar, GetMenuBar, SetMenuBar, doc="See `GetMenuBar` and `SetMenuBar`"); + %property(StatusBar, GetStatusBar, SetStatusBar, doc="See `GetStatusBar` and `SetStatusBar`"); + %property(StatusBarPane, GetStatusBarPane, SetStatusBarPane, doc="See `GetStatusBarPane` and `SetStatusBarPane`"); + %property(ToolBar, GetToolBar, SetToolBar, doc="See `GetToolBar` and `SetToolBar`"); }; //--------------------------------------------------------------------------- @@ -317,11 +366,15 @@ public: void SetReturnCode(int returnCode); int GetReturnCode() const; - // The identifier for the affirmative button + // Set the identifier for the affirmative button: this button will close + // the dialog after validating data and calling TransferDataFromWindow() void SetAffirmativeId(int affirmativeId); int GetAffirmativeId() const; - // Identifier for Esc key translation + // Set identifier for Esc key translation: the button with this id will + // close the dialog without doing anything else; special value wxID_NONE + // means to not handle Esc at all while wxID_ANY means to map Esc to + // wxID_CANCEL if present and GetAffirmativeId() otherwise void SetEscapeId(int escapeId); int GetEscapeId() const; @@ -329,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 ); @@ -349,11 +416,23 @@ public: static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); + + %property(AffirmativeId, GetAffirmativeId, SetAffirmativeId, doc="See `GetAffirmativeId` and `SetAffirmativeId`"); + %property(EscapeId, GetEscapeId, SetEscapeId, doc="See `GetEscapeId` and `SetEscapeId`"); + %property(ReturnCode, GetReturnCode, SetReturnCode, doc="See `GetReturnCode` and `SetReturnCode`"); }; //--------------------------------------------------------------------------- %newgroup +%{ +#define wxDEFAULT_MINIFRAME_STYLE wxCAPTION | wxRESIZE_BORDER | wxTINY_CAPTION_HORIZ +%} + +enum { + wxDEFAULT_MINIFRAME_STYLE +}; + MustHaveApp(wxMiniFrame); @@ -368,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()); @@ -377,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); }; @@ -412,6 +491,8 @@ public: void SetBitmap(const wxBitmap& bitmap); wxBitmap& GetBitmap(); + + %property(Bitmap, GetBitmap, SetBitmap, doc="See `GetBitmap` and `SetBitmap`"); }; @@ -433,6 +514,10 @@ public: long GetSplashStyle() const; wxSplashScreenWindow* GetSplashWindow() const; int GetTimeout() const; + + %property(SplashStyle, GetSplashStyle, doc="See `GetSplashStyle`"); + %property(SplashWindow, GetSplashWindow, doc="See `GetSplashWindow`"); + %property(Timeout, GetTimeout, doc="See `GetTimeout`"); };