Added wxStdDialogButtonSizer, which is a 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. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -143,7 +143,14 @@ SetDefaultPyEncoding will now allow you to control which encoding will
|
|||||||
be used to do those conversions. The default encoding is set to the
|
be used to do those conversions. The default encoding is set to the
|
||||||
value of `locale.getdefaultlocale()[1]` when wxPython is first
|
value of `locale.getdefaultlocale()[1]` when wxPython is first
|
||||||
imported. Please see http://www.alanwood.net/demos/charsetdiffs.html
|
imported. Please see http://www.alanwood.net/demos/charsetdiffs.html
|
||||||
for subtle differences between the common latin/roman encodings.
|
for information on the differences between the common latin/roman
|
||||||
|
encodings.
|
||||||
|
|
||||||
|
Added wxStdDialogButtonSizer, which is a 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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -957,7 +957,7 @@ For example::
|
|||||||
|
|
||||||
When `Layout` is called it first calls `CalcMin` followed by
|
When `Layout` is called it first calls `CalcMin` followed by
|
||||||
`RecalcSizes` so you can optimize a bit by saving the results of
|
`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`
|
:see: `wx.SizerItem`, `wx.Sizer.GetChildren`
|
||||||
|
|
||||||
@@ -1262,4 +1262,40 @@ 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.", "");
|
||||||
|
|
||||||
|
wxButton* GetAffirmativeButton() const;
|
||||||
|
wxButton* GetApplyButton() const;
|
||||||
|
wxButton* GetNegativeButton() const;
|
||||||
|
wxButton* GetCancelButton() const;
|
||||||
|
wxButton* GetHelpButton() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@@ -308,11 +308,11 @@ public:
|
|||||||
|
|
||||||
// splits text up at newlines and places the
|
// splits text up at newlines and places the
|
||||||
// lines into a vertical wxBoxSizer
|
// lines into a vertical wxBoxSizer
|
||||||
wxSizer *CreateTextSizer( const wxString &message );
|
wxSizer* CreateTextSizer( const wxString &message );
|
||||||
|
|
||||||
// places buttons into a horizontal wxBoxSizer
|
// places buttons into a horizontal wxBoxSizer
|
||||||
wxSizer *CreateButtonSizer( long flags );
|
wxSizer* CreateButtonSizer( long flags );
|
||||||
|
wxStdDialogButtonSizer* CreateStdDialogButtonSizer( long flags );
|
||||||
|
|
||||||
//void SetModal(bool flag);
|
//void SetModal(bool flag);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user