+public:
+ // helper class for SetXXXLabels() methods: it makes it possible to pass
+ // either a stock id (wxID_CLOSE) or a string ("&Close") to them
+ class ButtonLabel
+ {
+ public:
+ // ctors are not explicit, objects of this class can be implicitly
+ // constructed from either stock ids or strings
+ ButtonLabel(int stockId)
+ : m_stockId(stockId)
+ {
+ wxASSERT_MSG( wxIsStockID(stockId), "invalid stock id" );
+ }
+
+ ButtonLabel(const wxString& label)
+ : m_label(label), m_stockId(wxID_NONE)
+ {
+ }
+
+ ButtonLabel(const char *label)
+ : m_label(label), m_stockId(wxID_NONE)
+ {
+ }
+
+ ButtonLabel(const wchar_t *label)
+ : m_label(label), m_stockId(wxID_NONE)
+ {
+ }
+
+ ButtonLabel(const wxCStrData& label)
+ : m_label(label), m_stockId(wxID_NONE)
+ {
+ }
+
+ // default copy ctor and dtor are ok
+
+ // get the string label, whether it was originally specified directly
+ // or as a stock id -- this is only useful for platforms without native
+ // stock items id support
+ wxString GetAsString() const
+ {
+ 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
+ int GetStockId() const { return m_stockId; }
+
+ private:
+ // the label if explicitly given or empty if this is a stock item
+ const wxString m_label;
+
+ // the stock item id or wxID_NONE if m_label should be used
+ const int m_stockId;
+ };
+
+ // ctors
+ wxMessageDialogBase() { m_dialogStyle = 0; }
+ wxMessageDialogBase(wxWindow *parent,
+ const wxString& message,
+ const wxString& caption,
+ long style)
+ : m_message(message),
+ m_caption(caption)
+ {
+ m_parent = parent;
+ SetMessageDialogStyle(style);
+ }
+
+ // virtual dtor for the base class
+ virtual ~wxMessageDialogBase() { }
+
+ wxString GetCaption() const { return m_caption; }
+
+ virtual void SetMessage(const wxString& message)
+ {
+ m_message = message;
+ }
+
+ wxString GetMessage() const { return m_message; }
+
+ void SetExtendedMessage(const wxString& extendedMessage)
+ {
+ m_extendedMessage = extendedMessage;
+ }
+
+ wxString GetExtendedMessage() const { return m_extendedMessage; }
+
+ // change the dialog style flag