+void wxStdDialogButtonSizer::Realize()
+{
+#ifdef __WXMAC__
+ Add(0, 0, 0, wxLEFT, 6);
+ if (m_buttonHelp)
+ Add((wxWindow*)m_buttonHelp, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 6);
+
+ if (m_buttonNegative){
+ // HIG POLICE BULLETIN - destructive buttons need extra padding
+ // 24 pixels on either side
+ Add((wxWindow*)m_buttonNegative, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 12);
+ }
+
+ // extra whitespace between help/negative and cancel/ok buttons
+ Add(0, 0, 1, wxEXPAND, 0);
+
+ if (m_buttonCancel){
+ Add((wxWindow*)m_buttonCancel, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 6);
+ // Cancel or help should be default
+ // m_buttonCancel->SetDefaultButton();
+ }
+
+ // Ugh, Mac doesn't really have apply dialogs, so I'll just
+ // figure the best place is between Cancel and OK
+ if (m_buttonApply)
+ Add((wxWindow*)m_buttonApply, 0, wxALIGN_CENTRE | wxLEFT | wxRIGHT, 6);
+
+ if (m_buttonAffirmative){
+ Add((wxWindow*)m_buttonAffirmative, 0, wxALIGN_CENTRE | wxLEFT, 6);
+
+ if (m_buttonAffirmative->GetId() == wxID_SAVE){
+ // these buttons have set labels under Mac so we should use them
+ m_buttonAffirmative->SetLabel(_("Save"));
+ if (m_buttonNegative)
+ m_buttonNegative->SetLabel(_("Don't Save"));
+ }
+ }
+
+ // Extra space around and at the right
+ Add(12, 40);
+#elif defined(__WXGTK20__)
+ // http://library.gnome.org/devel/hig-book/stable/windows-alert.html.en
+ // describes the margins and the buttons order but basically it is
+ //
+ // [Help] [Alternative] [Cancel] [Affirmative]
+ //
+ // in general case but, somewhat confusingly, the native message box
+ // uses "No Yes Cancel" with these particular buttons so do we as well.
+
+ // Flags ensuring that margins between the buttons are 6 pixels.
+ const wxSizerFlags
+ flagsBtn = wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 3);
+
+ // Margin around the entire sizer button should be 12.
+ AddSpacer(9);
+
+ if (m_buttonHelp)
+ Add(m_buttonHelp, flagsBtn);
+
+ // Align the rest of the buttons to the right.
+ AddStretchSpacer();
+
+ // "No Yes Cancel" is an exception to the general rule according to
+ // which the affirmative buttons goes after "Cancel" so treat it
+ // separately
+ if ( IsStdButtonWithStdText(m_buttonNegative, wxID_NO, "No") &&
+ IsStdButtonWithStdText(m_buttonAffirmative, wxID_YES, "Yes") &&
+ IsStdButtonWithStdText(m_buttonCancel, wxID_CANCEL, "Cancel") )