]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/foldbar/foldpanelbar/foldtestpanel.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: foldtestpanel.cpp
4 // Author: Jorgen Bodde
5 // Modified by: ABX - 19/12/2004 : possibility of horizontal orientation
6 // : wxWidgets coding standards
9 // Copyright: (c) Jorgen Bodde
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 // For compilers that support precompilation, includes "wx/wx.h".
14 #include "wx/wxprec.h"
27 #include "foldtestpanel.h"
34 * FoldTestPanel type definition
37 IMPLEMENT_CLASS( FoldTestPanel
, wxPanel
)
40 * FoldTestPanel event table definition
42 BEGIN_EVENT_TABLE( FoldTestPanel
, wxPanel
)
44 ////@begin FoldTestPanel event table entries
45 ////@end FoldTestPanel event table entries
47 //EVT_CAPTIONBAR(wxID_ANY, FoldTestPanel::OnCaptionPanel)
48 EVT_CAPTIONBAR(wxID_ANY
, FoldTestPanel::OnCaptionPanel
)
54 * FoldTestPanel constructors
57 FoldTestPanel::FoldTestPanel( )
62 FoldTestPanel::FoldTestPanel( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
64 Create(parent
, id
, caption
, pos
, size
, style
);
68 * FoldTestPanel creator
71 bool FoldTestPanel::Create( wxWindow
* parent
, wxWindowID id
, const wxString
& WXUNUSED(caption
), const wxPoint
& pos
, const wxSize
& size
, long style
)
73 ////@begin FoldTestPanel member initialisation
75 ////@end FoldTestPanel member initialisation
77 ////@begin FoldTestPanel creation
78 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS
);
79 wxPanel::Create( parent
, id
, pos
, size
, style
);
82 GetSizer()->Fit(this);
83 GetSizer()->SetSizeHints(this);
85 ////@end FoldTestPanel creation
90 * Control creation for FoldTestPanel
93 void FoldTestPanel::CreateControls()
96 ////@begin FoldTestPanel content construction
98 FoldTestPanel
* item1
= this;
100 wxBoxSizer
* item2
= new wxBoxSizer(wxVERTICAL
);
102 item1
->SetSizer(item2
);
103 item1
->SetAutoLayout(true);
104 /* wxPanel* item3 = new wxPanel( item1, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); */
105 wxPanel
* item3
= new wxPanel( item1
, ID_PANEL
, wxDefaultPosition
, wxDefaultSize
, wxNO_BORDER
|wxTAB_TRAVERSAL
);
106 item2
->Add(item3
, 1, wxGROW
|wxADJUST_MINSIZE
, 5);
107 wxBoxSizer
* item4
= new wxBoxSizer(wxVERTICAL
);
108 item3
->SetSizer(item4
);
109 item3
->SetAutoLayout(true);
110 wxString item5Strings
[] = {
115 wxChoice
* item5
= new wxChoice( item3
, ID_CHOICE
, wxDefaultPosition
, wxDefaultSize
, 3, item5Strings
, 0 );
116 item4
->Add(item5
, 0, wxGROW
|wxALL
, 5);
117 wxTextCtrl
* item6
= new wxTextCtrl( item3
, ID_TEXTCTRL
, _T(""), wxDefaultPosition
, wxDefaultSize
, wxTE_MULTILINE
);
118 item4
->Add(item6
, 1, wxGROW
|wxALL
, 5);
119 wxRadioButton
* item7
= new wxRadioButton( item3
, ID_RADIOBUTTON
, _("I like this"), wxDefaultPosition
, wxDefaultSize
, 0 );
120 item7
->SetValue(true);
121 item4
->Add(item7
, 0, wxALIGN_LEFT
|wxALL
, 5);
122 wxRadioButton
* item8
= new wxRadioButton( item3
, ID_RADIOBUTTON1
, _("I hate it"), wxDefaultPosition
, wxDefaultSize
, 0 );
123 item8
->SetValue(false);
124 item4
->Add(item8
, 0, wxALIGN_LEFT
|wxALL
, 5);
125 ////@end FoldTestPanel content construction
128 void FoldTestPanel::OnCaptionPanel(wxCaptionBarEvent
&WXUNUSED(event
))
134 * Should we show tooltips?
137 bool FoldTestPanel::ShowToolTips()
143 * Get bitmap resources
146 wxBitmap
FoldTestPanel::GetBitmapResource( const wxString
& WXUNUSED(name
) )
149 ////@begin FoldTestPanel bitmap retrieval
151 ////@end FoldTestPanel bitmap retrieval
158 wxIcon
FoldTestPanel::GetIconResource( const wxString
& WXUNUSED(name
) )
161 ////@begin FoldTestPanel icon retrieval
163 ////@end FoldTestPanel icon retrieval