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