// stock items id support
wxString GetAsString() const
{
- return m_stockId == wxID_NONE ? m_label
- : wxGetStockLabel(m_stockId);
+ return m_stockId == wxID_NONE
+ ? m_label
+ : wxGetStockLabel(m_stockId, wxSTOCK_FOR_BUTTON);
}
// return the stock id or wxID_NONE if this is not a stock label
wxASSERT_MSG( (style & wxID_OK) != wxID_OK,
"wxMessageBox: Did you mean wxOK (and not wxID_OK)?" );
- if ((style & wxNO_DEFAULT) != 0 && (style & wxNO) == 0)
- wxFAIL_MSG("wxNO_DEFAULT is invalid without wxNO");
+ wxASSERT_MSG( !(style & wxNO_DEFAULT) || (style & wxNO),
+ "wxNO_DEFAULT is invalid without wxNO" );
- if ((style & wxCANCEL_DEFAULT) != 0 && (style & wxCANCEL) == 0)
- wxFAIL_MSG("wxCANCEL_DEFAULT is invalid without wxCANCEL");
+ wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || (style & wxCANCEL),
+ "wxCANCEL_DEFAULT is invalid without wxCANCEL" );
- if ((style & wxCANCEL_DEFAULT) != 0 && (style & wxNO_DEFAULT) != 0)
- wxFAIL_MSG("only one default button can be specified");
+ wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || !(style & wxNO_DEFAULT),
+ "only one default button can be specified" );
m_dialogStyle = style;
}
private:
// these functions may be overridden to provide different defaults for the
// default button labels (this is used by wxGTK)
- virtual wxString GetDefaultYesLabel() const { return _("Yes"); }
- virtual wxString GetDefaultNoLabel() const { return _("No"); }
- virtual wxString GetDefaultOKLabel() const { return _("OK"); }
- virtual wxString GetDefaultCancelLabel() const { return _("Cancel"); }
+ virtual wxString GetDefaultYesLabel() const { return wxGetTranslation("Yes"); }
+ virtual wxString GetDefaultNoLabel() const { return wxGetTranslation("No"); }
+ virtual wxString GetDefaultOKLabel() const { return wxGetTranslation("OK"); }
+ virtual wxString GetDefaultCancelLabel() const { return wxGetTranslation("Cancel"); }
// labels for the buttons, initially empty meaning that the defaults should
// be used, use GetYes/No/OK/CancelLabel() to access them