X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a1bdd4ab9bb8cdcf8a14b8a64a5f5508be48ba4c..f4ac09e8e9007b5b77b25599afed5cfe08d1d77a:/src/generic/richmsgdlgg.cpp diff --git a/src/generic/richmsgdlgg.cpp b/src/generic/richmsgdlgg.cpp index 9f2efd9e51..397cfd051a 100644 --- a/src/generic/richmsgdlgg.cpp +++ b/src/generic/richmsgdlgg.cpp @@ -3,7 +3,6 @@ // Purpose: wxGenericRichMessageDialog // Author: Rickard Westerlund // Created: 2010-07-04 -// RCS-ID: $Id$ // Copyright: (c) 2010 wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -18,6 +17,7 @@ #if wxUSE_RICHMSGDLG #ifndef WX_PRECOMP + #include "wx/checkbox.h" #include "wx/stattext.h" #include "wx/sizer.h" #endif @@ -52,15 +52,10 @@ void wxGenericRichMessageDialog::AddMessageDialogCheckBox(wxSizer *sizer) { if ( !m_checkBoxText.empty() ) { - wxSizer *sizerCheckBox = new wxBoxSizer( wxHORIZONTAL ); + m_checkBox = new wxCheckBox(this, wxID_ANY, m_checkBoxText); + m_checkBox->SetValue(m_checkBoxValue); - m_checkBox = new wxCheckBox( this, - wxID_ANY, - m_checkBoxText ); - m_checkBox->SetValue( m_checkBoxValue ); - sizerCheckBox->Add( m_checkBox, 0, wxBOTTOM | wxALIGN_LEFT ); - - sizer->Add( sizerCheckBox, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 ); + sizer->Add(m_checkBox, wxSizerFlags().Left().Border(wxLEFT|wxTOP, 10)); } } @@ -84,4 +79,11 @@ void wxGenericRichMessageDialog::AddMessageDialogDetails(wxSizer *sizer) } } +bool wxGenericRichMessageDialog::IsCheckBoxChecked() const +{ + // This function can be called before the dialog is shown and hence before + // the check box is created. + return m_checkBox ? m_checkBox->IsChecked() : m_checkBoxValue; +} + #endif // wxUSE_RICHMSGDLG