1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/generic/richmsgdlgg.cpp
3 // Purpose: wxGenericRichMessageDialog
4 // Author: Rickard Westerlund
7 // Copyright: (c) 2010 wxWidgets team
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
21 #include "wx/stattext.h"
25 #include "wx/collpane.h"
26 #include "wx/richmsgdlg.h"
28 wxIMPLEMENT_CLASS(wxRichMessageDialog
, wxDialog
)
30 // ----------------------------------------------------------------------------
31 // Events and handlers
32 // ----------------------------------------------------------------------------
34 BEGIN_EVENT_TABLE(wxGenericRichMessageDialog
, wxRichMessageDialogBase
)
35 EVT_COLLAPSIBLEPANE_CHANGED(wxID_ANY
,
36 wxGenericRichMessageDialog::OnPaneChanged
)
39 void wxGenericRichMessageDialog::OnPaneChanged(wxCollapsiblePaneEvent
& event
)
41 if ( event
.GetCollapsed() )
42 m_detailsPane
->SetLabel( m_detailsExpanderCollapsedLabel
);
44 m_detailsPane
->SetLabel( m_detailsExpanderExpandedLabel
);
47 // ----------------------------------------------------------------------------
48 // wxGenericRichMessageDialog
49 // ----------------------------------------------------------------------------
51 void wxGenericRichMessageDialog::AddMessageDialogCheckBox(wxSizer
*sizer
)
53 if ( !m_checkBoxText
.empty() )
55 wxSizer
*sizerCheckBox
= new wxBoxSizer( wxHORIZONTAL
);
57 m_checkBox
= new wxCheckBox( this,
60 m_checkBox
->SetValue( m_checkBoxValue
);
61 sizerCheckBox
->Add( m_checkBox
, 0, wxBOTTOM
| wxALIGN_LEFT
);
63 sizer
->Add( sizerCheckBox
, 0, wxTOP
|wxLEFT
|wxRIGHT
| wxALIGN_LEFT
, 10 );
67 void wxGenericRichMessageDialog::AddMessageDialogDetails(wxSizer
*sizer
)
69 if ( !m_detailedText
.empty() )
71 wxSizer
*sizerDetails
= new wxBoxSizer( wxHORIZONTAL
);
74 new wxCollapsiblePane( this, -1, m_detailsExpanderCollapsedLabel
);
76 // add the detailed text
77 wxWindow
*windowPane
= m_detailsPane
->GetPane();
78 wxSizer
*sizerPane
= new wxBoxSizer( wxHORIZONTAL
);
79 sizerPane
->Add( new wxStaticText( windowPane
, -1, m_detailedText
) );
80 windowPane
->SetSizer( sizerPane
);
82 sizerDetails
->Add( m_detailsPane
, wxSizerFlags().Right().Expand() );
83 sizer
->Add( sizerDetails
, 0, wxTOP
|wxLEFT
|wxRIGHT
| wxALIGN_LEFT
, 10 );
87 #endif // wxUSE_RICHMSGDLG