X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7aada1e05a7ed29ee5a0afb5f3464b803e966d7c..e981e2b5556f1361edf0784584e1ce4c23ef89ab:/wxPython/src/_sizers.i diff --git a/wxPython/src/_sizers.i b/wxPython/src/_sizers.i index 0a1f5101b9..e34ed95a19 100644 --- a/wxPython/src/_sizers.i +++ b/wxPython/src/_sizers.i @@ -51,8 +51,9 @@ methods are called. int border, PyObject* userData=NULL ), "Constructs a `wx.SizerItem` for tracking a window.", ""); - %name(SizerItemWindow) wxSizerItem( wxWindow *window, int proportion, int flag, - int border, PyObject* userData=NULL ) { + %RenameCtor(SizerItemWindow, wxSizerItem( wxWindow *window, int proportion, int flag, + int border, PyObject* userData=NULL )) + { wxPyUserData* data = NULL; if ( userData ) { bool blocked = wxPyBeginBlockThreads(); @@ -67,8 +68,10 @@ methods are called. wxSizerItem( int width, int height, int proportion, int flag, int border, PyObject* userData=NULL), "Constructs a `wx.SizerItem` for tracking a spacer.", ""); - %name(SizerItemSpacer) wxSizerItem( int width, int height, int proportion, int flag, - int border, PyObject* userData=NULL) { + + %RenameCtor(SizerItemSpacer, wxSizerItem( int width, int height, int proportion, int flag, + int border, PyObject* userData=NULL)) + { wxPyUserData* data = NULL; if ( userData ) { bool blocked = wxPyBeginBlockThreads(); @@ -81,9 +84,11 @@ methods are called. DocStr( wxSizerItem( wxSizer *sizer, int proportion, int flag, int border, PyObject* userData=NULL ), - "Constructs a `wx.SizerItem` for tracking a subsizer", ""); - %name(SizerItemSizer) wxSizerItem( wxSizer *sizer, int proportion, int flag, - int border, PyObject* userData=NULL ) { + "Constructs a `wx.SizerItem` for tracking a subsizer", ""); + + %RenameCtor(SizerItemSizer, wxSizerItem( wxSizer *sizer, int proportion, int flag, + int border, PyObject* userData=NULL )) + { wxPyUserData* data = NULL; if ( userData ) { bool blocked = wxPyBeginBlockThreads(); @@ -139,8 +144,8 @@ added, if needed.", ""); DocStr(SetRatio, "Set the ratio item attribute.", ""); - %name(SetRatioWH) void SetRatio( int width, int height ); - %name(SetRatioSize) void SetRatio( wxSize size ); + %Rename(SetRatioWH, void, SetRatio( int width, int height )); + %Rename(SetRatioSize, void, SetRatio( wxSize size )); void SetRatio( float ratio ); DocDeclStr( @@ -836,7 +841,7 @@ as well.", ""); // wxList& GetChildren(); %extend { DocAStr(GetChildren, - "GetChildren(sefl) -> list", + "GetChildren(self) -> list", "Returns a list of all the `wx.SizerItem` objects managed by the sizer.", ""); PyObject* GetChildren() { wxSizerItemList& list = self->GetChildren(); @@ -952,7 +957,7 @@ For example:: When `Layout` is called it first calls `CalcMin` followed by `RecalcSizes` so you can optimize a bit by saving the results of -`CalcMin` and resuing them in `RecalcSizes`. +`CalcMin` and reusing them in `RecalcSizes`. :see: `wx.SizerItem`, `wx.Sizer.GetChildren` @@ -1038,10 +1043,12 @@ public: "Constructor. It takes an associated static box and the orientation *orient* as parameters - orient can be either of ``wx.VERTICAL`` or ``wx.HORIZONTAL``.", ""); + + // TODO: wxStaticBoxSizer(int orient, wxWindow *win, const wxString& label = wxEmptyString); - DocDeclStr( - wxStaticBox *, GetStaticBox(), - "Returns the static box associated with this sizer.", ""); + DocDeclStr( + wxStaticBox *, GetStaticBox(), + "Returns the static box associated with this sizer.", ""); }; @@ -1257,4 +1264,44 @@ columns in the sizer.", ""); }; +//--------------------------------------------------------------------------- + +DocStr(wxStdDialogButtonSizer, +"A special sizer that knows how to order and position standard buttons +in order to conform to the current platform's standards. You simply +need to add each `wx.Button` to the sizer, and be sure to create the +buttons using the standard ID's. Then call `Finalize` and the sizer +will take care of the rest. +", ""); + +class wxStdDialogButtonSizer: public wxBoxSizer +{ +public: + DocCtorStr( + wxStdDialogButtonSizer(), + "", ""); + + DocDeclStr( + void , AddButton(wxButton *button), + "Use this to add the buttons to this sizer. Do not use the `Add` +method in the base class.", ""); + + DocDeclStr( + void , Finalise(), + "This funciton needs to be called after all the buttons have been added +to the sizer. It will reorder them and position them in a platform +specifc manner.", ""); + + void SetAffirmativeButton( wxButton *button ); + void SetNegativeButton( wxButton *button ); + void SetCancelButton( wxButton *button ); + + wxButton* GetAffirmativeButton() const; + wxButton* GetApplyButton() const; + wxButton* GetNegativeButton() const; + wxButton* GetCancelButton() const; + wxButton* GetHelpButton() const; +}; + + //---------------------------------------------------------------------------