]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxStdDialogButtonSizer, which is a a special sizer that knows
authorRobin Dunn <robin@alldunn.com>
Fri, 31 Dec 2004 22:55:57 +0000 (22:55 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 31 Dec 2004 22:55:57 +0000 (22:55 +0000)
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

wxPython/docs/CHANGES.txt
wxPython/src/_sizers.i
wxPython/src/_toplvl.i

index 862685247644316830ed5df9df54fda027bad1af..00472b4f425c140996445338bb859be30de96fdd 100644 (file)
@@ -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
 value of `locale.getdefaultlocale()[1]` when wxPython is first
 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.
 
 
 
index bba510b197c9a12556506851fed6733ba1f86496..157024fb7d38aede0da45c3af9eb93f128f9876c 100644 (file)
@@ -957,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`
 
@@ -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;
+};
+
+
 //---------------------------------------------------------------------------
index f6d8e172a19ef709f3254b49c5b5d67d0d4fc733..4032625afe2662a5bf8c6e1710ff38d3a2d4dea1 100644 (file)
@@ -308,11 +308,11 @@ public:
 
     // splits text up at newlines and places the
     // lines into a vertical wxBoxSizer
-    wxSizer *CreateTextSizer( const wxString &message );
+    wxSizerCreateTextSizer( const wxString &message );
 
     // places buttons into a horizontal wxBoxSizer
-    wxSizer *CreateButtonSizer( long flags );
-
+    wxSizerCreateButtonSizer( long flags );
+    wxStdDialogButtonSizer* CreateStdDialogButtonSizer( long flags );
 
     //void SetModal(bool flag);