]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow to set the various buttons explicitly (and
authorRobert Roebling <robert@roebling.de>
Sat, 1 Jan 2005 17:26:30 +0000 (17:26 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 1 Jan 2005 17:26:30 +0000 (17:26 +0000)
   not through IDs) in the wxStdButtonSizer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/sizer.h
src/common/sizer.cpp

index 11915e11b6e441b98b30ca145911e37cde76528b..35d020ad88285f5c6b6dd769155b357b413c0b5b 100644 (file)
@@ -645,19 +645,20 @@ private:
 class WXDLLEXPORT wxStdDialogButtonSizer: public wxBoxSizer
 {
 public:
-    wxStdDialogButtonSizer();
     // Constructor just creates a new wxBoxSizer, not much else.
     // Box sizer orientation is automatically determined here:
     // vertical for PDAs, horizontal for everything else?
+    wxStdDialogButtonSizer();
 
-    void AddButton(wxButton *button);
     // Checks button ID against system IDs and sets one of the pointers below
-    // to this button.
-    // Does not do any sizer-related things here.
+    // to this button. Does not do any sizer-related things here.
+    void AddButton(wxButton *button);
 
-    // Question: what to do for non-supported button IDs? assert?
+    // Use these if no standard ID can/should be used
+    void SetAffirmativeButton( wxButton *button );
+    void SetNegativeButton( wxButton *button );
+    void SetCancelButton( wxButton *button );
 
-    void Finalise();
     // All platform-specific code here, checks which buttons exist and add
     // them to the sizer accordingly.
     // Note - one potential hack on Mac we could use here,
@@ -665,6 +666,7 @@ public:
     // is set to _("Save") and m_buttonNegative is set to _("Don't Save")
     // I wouldn't add any other hacks like that into here,
     // but this one I can see being useful.
+    void Finalise();
     
     wxButton *GetAffirmativeButton() const { return m_buttonAffirmative; }
     wxButton *GetApplyButton() const { return m_buttonApply; }
@@ -673,16 +675,15 @@ public:
     wxButton *GetHelpButton() const { return m_buttonHelp; }
 
 protected:
-    wxButton *m_buttonAffirmative;
-    // wxID_OK, wxID_YES, wxID_SAVE go here
+    wxButton *m_buttonAffirmative;  // wxID_OK, wxID_YES, wxID_SAVE go here
     wxButton *m_buttonApply;
-    wxButton *m_buttonNegative; // wxID_NO
+    wxButton *m_buttonNegative;     // wxID_NO
     wxButton *m_buttonCancel;
     wxButton *m_buttonHelp;
     
 private:
     DECLARE_CLASS(wxStdDialogButtonSizer)
-    //DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer)
+    DECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer)
 };
 
 #if WXWIN_COMPATIBILITY_2_4
index 307ab3adc8ecac0dd10783f00e39be403f4d467a..d2e78491b5bd171325236c33a6b4f1b5adbd9c46 100644 (file)
@@ -1684,6 +1684,21 @@ void wxStdDialogButtonSizer::AddButton(wxButton *mybutton)
     }
 }
 
+void wxStdDialogButtonSizer::SetAffirmativeButton( wxButton *button )
+{
+    m_buttonAffirmative = button;
+}
+
+void wxStdDialogButtonSizer::SetNegativeButton( wxButton *button )
+{
+    m_buttonNegative = button;
+}
+
+void wxStdDialogButtonSizer::SetCancelButton( wxButton *button )
+{
+    m_buttonCancel = button;
+}
+
 void wxStdDialogButtonSizer::Finalise()
 {
 #ifdef __WXMAC__