+ virtual bool SetYesNoCancelLabels(const ButtonLabel& yes,
+ const ButtonLabel& no,
+ const ButtonLabel& cancel)
+ {
+ DoSetCustomLabel(m_yes, yes);
+ DoSetCustomLabel(m_no, no);
+ DoSetCustomLabel(m_cancel, cancel);
+ return true;
+ }
+
+ virtual bool SetOKLabel(const ButtonLabel& ok)
+ {
+ DoSetCustomLabel(m_ok, ok);
+ return true;
+ }
+
+ virtual bool SetOKCancelLabels(const ButtonLabel& ok,
+ const ButtonLabel& cancel)
+ {
+ DoSetCustomLabel(m_ok, ok);
+ DoSetCustomLabel(m_cancel, cancel);
+ return true;
+ }
+
+ virtual bool SetHelpLabel(const ButtonLabel& help)
+ {
+ DoSetCustomLabel(m_help, help);
+ return true;
+ }
+
+ // test if any custom labels were set
+ bool HasCustomLabels() const
+ {
+ return !(m_ok.empty() && m_cancel.empty() && m_help.empty() &&
+ m_yes.empty() && m_no.empty());
+ }
+
+ // these functions return the label to be used for the button which is
+ // either a custom label explicitly set by the user or the default label,
+ // i.e. they always return a valid string
+ wxString GetYesLabel() const
+ { return m_yes.empty() ? GetDefaultYesLabel() : m_yes; }
+ wxString GetNoLabel() const
+ { return m_no.empty() ? GetDefaultNoLabel() : m_no; }
+ wxString GetOKLabel() const
+ { return m_ok.empty() ? GetDefaultOKLabel() : m_ok; }
+ wxString GetCancelLabel() const
+ { return m_cancel.empty() ? GetDefaultCancelLabel() : m_cancel; }
+ wxString GetHelpLabel() const
+ { return m_help.empty() ? GetDefaultHelpLabel() : m_help; }
+
+ // based on message dialog style, returns exactly one of: wxICON_NONE,
+ // wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION
+ long GetEffectiveIcon() const
+ {
+ if ( m_dialogStyle & wxICON_NONE )
+ return wxICON_NONE;
+ else if ( m_dialogStyle & wxICON_ERROR )
+ return wxICON_ERROR;
+ else if ( m_dialogStyle & wxICON_WARNING )
+ return wxICON_WARNING;
+ else if ( m_dialogStyle & wxICON_QUESTION )
+ return wxICON_QUESTION;
+ else if ( m_dialogStyle & wxICON_INFORMATION )
+ return wxICON_INFORMATION;
+ else if ( m_dialogStyle & wxYES )
+ return wxICON_QUESTION;
+ else
+ return wxICON_INFORMATION;
+ }
+
+protected:
+ // for the platforms not supporting separate main and extended messages
+ // this function should be used to combine both of them in a single string
+ wxString GetFullMessage() const
+ {
+ wxString msg = m_message;
+ if ( !m_extendedMessage.empty() )
+ msg << "\n\n" << m_extendedMessage;
+
+ return msg;
+ }
+
+ wxString m_message,
+ m_extendedMessage,
+ m_caption;