]> git.saurik.com Git - wxWidgets.git/blob - src/generic/richmsgdlgg.cpp
9f2efd9e51c24e2a69dbb6ce0b4abe18a652702a
[wxWidgets.git] / src / generic / richmsgdlgg.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/generic/richmsgdlgg.cpp
3 // Purpose: wxGenericRichMessageDialog
4 // Author: Rickard Westerlund
5 // Created: 2010-07-04
6 // RCS-ID: $Id$
7 // Copyright: (c) 2010 wxWidgets team
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17
18 #if wxUSE_RICHMSGDLG
19
20 #ifndef WX_PRECOMP
21 #include "wx/stattext.h"
22 #include "wx/sizer.h"
23 #endif
24
25 #include "wx/collpane.h"
26 #include "wx/richmsgdlg.h"
27
28 wxIMPLEMENT_CLASS(wxRichMessageDialog, wxDialog)
29
30 // ----------------------------------------------------------------------------
31 // Events and handlers
32 // ----------------------------------------------------------------------------
33
34 BEGIN_EVENT_TABLE(wxGenericRichMessageDialog, wxRichMessageDialogBase)
35 EVT_COLLAPSIBLEPANE_CHANGED(wxID_ANY,
36 wxGenericRichMessageDialog::OnPaneChanged)
37 END_EVENT_TABLE()
38
39 void wxGenericRichMessageDialog::OnPaneChanged(wxCollapsiblePaneEvent& event)
40 {
41 if ( event.GetCollapsed() )
42 m_detailsPane->SetLabel( m_detailsExpanderCollapsedLabel );
43 else
44 m_detailsPane->SetLabel( m_detailsExpanderExpandedLabel );
45 }
46
47 // ----------------------------------------------------------------------------
48 // wxGenericRichMessageDialog
49 // ----------------------------------------------------------------------------
50
51 void wxGenericRichMessageDialog::AddMessageDialogCheckBox(wxSizer *sizer)
52 {
53 if ( !m_checkBoxText.empty() )
54 {
55 wxSizer *sizerCheckBox = new wxBoxSizer( wxHORIZONTAL );
56
57 m_checkBox = new wxCheckBox( this,
58 wxID_ANY,
59 m_checkBoxText );
60 m_checkBox->SetValue( m_checkBoxValue );
61 sizerCheckBox->Add( m_checkBox, 0, wxBOTTOM | wxALIGN_LEFT );
62
63 sizer->Add( sizerCheckBox, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 );
64 }
65 }
66
67 void wxGenericRichMessageDialog::AddMessageDialogDetails(wxSizer *sizer)
68 {
69 if ( !m_detailedText.empty() )
70 {
71 wxSizer *sizerDetails = new wxBoxSizer( wxHORIZONTAL );
72
73 m_detailsPane =
74 new wxCollapsiblePane( this, -1, m_detailsExpanderCollapsedLabel );
75
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 );
81
82 sizerDetails->Add( m_detailsPane, wxSizerFlags().Right().Expand() );
83 sizer->Add( sizerDetails, 0, wxTOP|wxLEFT|wxRIGHT | wxALIGN_LEFT, 10 );
84 }
85 }
86
87 #endif // wxUSE_RICHMSGDLG