+// Returns true only if the button is non-NULL and has the given id and text
+// (possible translated).
+bool IsStdButtonWithStdText(wxButton *btn, wxWindowID id, const char *label)
+{
+ if ( !btn )
+ return false;
+
+ if ( btn->GetId() != id )
+ return false;
+
+ const wxString labelText = btn->GetLabelText();
+ return labelText == label || labelText == wxGetTranslation(label);
+}
+
+} // anonymous namespace
+
+#endif // __WXGTK20__
+
+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);