]> git.saurik.com Git - wxWidgets.git/blob - contrib/samples/foldbar/foldpanelbar/foldtestpanel.cpp
GetNumberOfLines on GTK doesn't count wrapped lines again...
[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 // For compilers that support precompilation, includes "wx/wx.h".
14 #include "wx/wxprec.h"
15
16 #ifdef __BORLANDC__
17 #pragma hdrstop
18 #endif
19
20 #ifndef WX_PRECOMP
21 #include "wx/wx.h"
22 #endif
23
24 ////@begin includes
25 ////@end includes
26
27 #include "foldtestpanel.h"
28
29
30 ////@begin XPM images
31 ////@end XPM images
32
33 /*!
34 * FoldTestPanel type definition
35 */
36
37 IMPLEMENT_CLASS( FoldTestPanel, wxPanel )
38
39 /*!
40 * FoldTestPanel event table definition
41 */
42 BEGIN_EVENT_TABLE( FoldTestPanel, wxPanel )
43
44 ////@begin FoldTestPanel event table entries
45 ////@end FoldTestPanel event table entries
46
47 //EVT_CAPTIONBAR(wxID_ANY, FoldTestPanel::OnCaptionPanel)
48 EVT_CAPTIONBAR(wxID_ANY, FoldTestPanel::OnCaptionPanel)
49
50
51 END_EVENT_TABLE()
52
53 /*!
54 * FoldTestPanel constructors
55 */
56
57 FoldTestPanel::FoldTestPanel( )
58 {
59 delete m_images;
60 }
61
62 FoldTestPanel::FoldTestPanel( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
63 {
64 Create(parent, id, caption, pos, size, style);
65 }
66
67 /*!
68 * FoldTestPanel creator
69 */
70
71 bool FoldTestPanel::Create( wxWindow* parent, wxWindowID id, const wxString& WXUNUSED(caption), const wxPoint& pos, const wxSize& size, long style )
72 {
73 ////@begin FoldTestPanel member initialisation
74 blaat = NULL;
75 ////@end FoldTestPanel member initialisation
76
77 ////@begin FoldTestPanel creation
78 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
79 wxPanel::Create( parent, id, pos, size, style );
80
81 CreateControls();
82 GetSizer()->Fit(this);
83 GetSizer()->SetSizeHints(this);
84 Centre();
85 ////@end FoldTestPanel creation
86 return true;
87 }
88
89 /*!
90 * Control creation for FoldTestPanel
91 */
92
93 void FoldTestPanel::CreateControls()
94 {
95
96 ////@begin FoldTestPanel content construction
97
98 FoldTestPanel* item1 = this;
99
100 wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
101 blaat = item2;
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[] = {
111 _("One"),
112 _("Two"),
113 _("Three")
114 };
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
126 }
127
128 void FoldTestPanel::OnCaptionPanel(wxCaptionBarEvent &WXUNUSED(event))
129 {
130 // TODO: What else
131 }
132
133 /*!
134 * Should we show tooltips?
135 */
136
137 bool FoldTestPanel::ShowToolTips()
138 {
139 return true;
140 }
141
142 /*!
143 * Get bitmap resources
144 */
145
146 wxBitmap FoldTestPanel::GetBitmapResource( const wxString& WXUNUSED(name) )
147 {
148 // Bitmap retrieval
149 ////@begin FoldTestPanel bitmap retrieval
150 return wxNullBitmap;
151 ////@end FoldTestPanel bitmap retrieval
152 }
153
154 /*!
155 * Get icon resources
156 */
157
158 wxIcon FoldTestPanel::GetIconResource( const wxString& WXUNUSED(name) )
159 {
160 // Icon retrieval
161 ////@begin FoldTestPanel icon retrieval
162 return wxNullIcon;
163 ////@end FoldTestPanel icon retrieval
164 }
165