]> git.saurik.com Git - wxWidgets.git/blob - contrib/samples/foldbar/foldpanelbar/foldtestpanel.cpp
d8688d0489a7a2356b506277f78bddcf9f2a874f
[wxWidgets.git] / contrib / samples / foldbar / foldpanelbar / foldtestpanel.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: foldtestpanel.cpp
3 // Purpose:
4 // Author: Jorgen Bodde
5 // Modified by:
6 // Created: 06/18/04 22:37:15
7 // RCS-ID:
8 // Copyright:
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma implementation "foldtestpanel.h"
14 #endif
15
16 // For compilers that support precompilation, includes "wx/wx.h".
17 #include "wx/wxprec.h"
18
19 #ifdef __BORLANDC__
20 #pragma hdrstop
21 #endif
22
23 #ifndef WX_PRECOMP
24 #include "wx/wx.h"
25 #endif
26
27 ////@begin includes
28 ////@end includes
29
30 #include "foldtestpanel.h"
31
32
33 ////@begin XPM images
34 ////@end XPM images
35
36 /*!
37 * FoldTestPanel type definition
38 */
39
40 IMPLEMENT_CLASS( FoldTestPanel, wxPanel )
41
42 /*!
43 * FoldTestPanel event table definition
44 */
45 BEGIN_EVENT_TABLE( FoldTestPanel, wxPanel )
46
47 ////@begin FoldTestPanel event table entries
48 ////@end FoldTestPanel event table entries
49
50 //EVT_CAPTIONBAR(-1, FoldTestPanel::OnCaptionPanel)
51 EVT_CAPTIONBAR(wxID_ANY, FoldTestPanel::OnCaptionPanel)
52
53
54 END_EVENT_TABLE()
55
56 /*!
57 * FoldTestPanel constructors
58 */
59
60 FoldTestPanel::FoldTestPanel( )
61 {
62 delete _images;
63 }
64
65 FoldTestPanel::FoldTestPanel( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
66 {
67 Create(parent, id, caption, pos, size, style);
68 }
69
70 /*!
71 * FoldTestPanel creator
72 */
73
74 bool FoldTestPanel::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
75 {
76 ////@begin FoldTestPanel member initialisation
77 blaat = NULL;
78 ////@end FoldTestPanel member initialisation
79
80 ////@begin FoldTestPanel creation
81 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
82 wxPanel::Create( parent, id, pos, size, style );
83
84 CreateControls();
85 GetSizer()->Fit(this);
86 GetSizer()->SetSizeHints(this);
87 Centre();
88 ////@end FoldTestPanel creation
89 return TRUE;
90 }
91
92 /*!
93 * Control creation for FoldTestPanel
94 */
95
96 void FoldTestPanel::CreateControls()
97 {
98
99 ////@begin FoldTestPanel content construction
100
101 FoldTestPanel* item1 = this;
102
103 wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
104 blaat = item2;
105 item1->SetSizer(item2);
106 item1->SetAutoLayout(TRUE);
107 /* wxPanel* item3 = new wxPanel( item1, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); */
108 wxPanel* item3 = new wxPanel( item1, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
109 item2->Add(item3, 1, wxGROW|wxADJUST_MINSIZE, 5);
110 wxBoxSizer* item4 = new wxBoxSizer(wxVERTICAL);
111 item3->SetSizer(item4);
112 item3->SetAutoLayout(TRUE);
113 wxString item5Strings[] = {
114 _("One"),
115 _("Two"),
116 _("Three")
117 };
118 wxChoice* item5 = new wxChoice( item3, ID_CHOICE, wxDefaultPosition, wxDefaultSize, 3, item5Strings, 0 );
119 item4->Add(item5, 0, wxGROW|wxALL, 5);
120 wxTextCtrl* item6 = new wxTextCtrl( item3, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
121 item4->Add(item6, 1, wxGROW|wxALL, 5);
122 wxRadioButton* item7 = new wxRadioButton( item3, ID_RADIOBUTTON, _("I like this"), wxDefaultPosition, wxDefaultSize, 0 );
123 item7->SetValue(TRUE);
124 item4->Add(item7, 0, wxALIGN_LEFT|wxALL, 5);
125 wxRadioButton* item8 = new wxRadioButton( item3, ID_RADIOBUTTON1, _("I hate it"), wxDefaultPosition, wxDefaultSize, 0 );
126 item8->SetValue(FALSE);
127 item4->Add(item8, 0, wxALIGN_LEFT|wxALL, 5);
128 ////@end FoldTestPanel content construction
129 }
130
131 void FoldTestPanel::OnCaptionPanel(wxCaptionBarEvent &event)
132 {
133 // TODO: What else
134 }
135
136 /*!
137 * Should we show tooltips?
138 */
139
140 bool FoldTestPanel::ShowToolTips()
141 {
142 return TRUE;
143 }
144
145 /*!
146 * Get bitmap resources
147 */
148
149 wxBitmap FoldTestPanel::GetBitmapResource( const wxString& name )
150 {
151 // Bitmap retrieval
152 ////@begin FoldTestPanel bitmap retrieval
153 return wxNullBitmap;
154 ////@end FoldTestPanel bitmap retrieval
155 }
156
157 /*!
158 * Get icon resources
159 */
160
161 wxIcon FoldTestPanel::GetIconResource( const wxString& name )
162 {
163 // Icon retrieval
164 ////@begin FoldTestPanel icon retrieval
165 return wxNullIcon;
166 ////@end FoldTestPanel icon retrieval
167 }
168