]> git.saurik.com Git - wxWidgets.git/blob - utils/configtool/src/configbrowser.cpp
DMC/VC warning fix
[wxWidgets.git] / utils / configtool / src / configbrowser.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: configbrowser.cpp
3 // Purpose:
4 // Author:
5 // Modified by:
6 // Created:
7 // RCS-ID:
8 // Copyright:
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11
12 ////@begin includes
13 #include "wx/wx.h"
14 #include "wx/splitter.h"
15 #include "wx/treectrl.h"
16 ////@end includes
17
18 #include "configbrowser.h"
19
20 ////@begin XPM images
21 ////@end XPM images
22
23 /*!
24 * ctConfigurationBrowserWindow type definition
25 */
26
27 IMPLEMENT_CLASS( ctConfigurationBrowserWindow, wxPanel )
28
29 /*!
30 * ctConfigurationBrowserWindow event table definition
31 */
32
33 BEGIN_EVENT_TABLE( ctConfigurationBrowserWindow, wxPanel )
34
35 ////@begin ctConfigurationBrowserWindow event table entries
36 EVT_TREE_SEL_CHANGED( ID_CONFIGURATION_BROWSER_TREECTRL, ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl )
37
38 ////@end ctConfigurationBrowserWindow event table entries
39
40 END_EVENT_TABLE()
41
42 /*!
43 * ctConfigurationBrowserWindow constructor
44 */
45
46 ctConfigurationBrowserWindow::ctConfigurationBrowserWindow( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
47 {
48 ////@begin ctConfigurationBrowserWindow member initialisation
49 ////@end ctConfigurationBrowserWindow member initialisation
50
51 wxPanel::Create( parent, id, pos, size, style );
52
53 CreateControls();
54 }
55
56 /*!
57 * Control creation for ctConfigurationBrowserWindow
58 */
59
60 void ctConfigurationBrowserWindow::CreateControls()
61 {
62 ////@begin ctConfigurationBrowserWindow content construction
63
64 ctConfigurationBrowserWindow* item1 = this;
65
66 wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
67 item1->SetSizer(item2);
68
69 wxSplitterWindow* item3 = new wxSplitterWindow(item1, ID_CONFIGBROWSER_SPLITTERWINDOW, wxDefaultPosition, wxSize(400, 400), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE);
70 wxTreeCtrl* item4 = new wxTreeCtrl(item3, ID_CONFIGURATION_BROWSER_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE|wxNO_BORDER);
71 ctConfigurationBrowserControlPanel* item5 = new ctConfigurationBrowserControlPanel(item3, ID_PANEL, wxDefaultPosition, wxSize(100, 80), wxNO_BORDER|wxTAB_TRAVERSAL);
72 item3->SplitVertically(item4, item5, 200);
73 item2->Add(item3, 1, wxGROW, 5);
74
75 ////@end ctConfigurationBrowserWindow content construction
76 }
77
78 /*!
79 * Event handler for ID_CONFIGURATION_BROWSER_TREECTRL
80 */
81
82 void ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl( wxTreeEvent& event )
83 {
84 // Replace with custom code
85 event.Skip();
86 }
87
88 /*!
89 * Should we show tooltips?
90 */
91
92 bool ctConfigurationBrowserWindow::ShowToolTips()
93 {
94 return true;
95 }
96
97 /*!
98 * ctConfigurationBrowserControlPanel type definition
99 */
100
101 IMPLEMENT_CLASS( ctConfigurationBrowserControlPanel, wxPanel )
102
103 /*!
104 * ctConfigurationBrowserControlPanel event table definition
105 */
106
107 BEGIN_EVENT_TABLE( ctConfigurationBrowserControlPanel, wxPanel )
108
109 ////@begin ctConfigurationBrowserControlPanel event table entries
110 EVT_BUTTON( ID_ADD_CONFIGURATION, ctConfigurationBrowserControlPanel::OnAddConfiguration )
111 EVT_UPDATE_UI( ID_ADD_CONFIGURATION, ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration )
112
113 EVT_BUTTON( ID_REMOVE_CONFIGURATION, ctConfigurationBrowserControlPanel::OnRemoveConfiguration )
114 EVT_UPDATE_UI( ID_REMOVE_CONFIGURATION, ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration )
115
116 EVT_BUTTON( ID_RENAME_CONFIGURATION, ctConfigurationBrowserControlPanel::OnRenameConfiguration )
117 EVT_UPDATE_UI( ID_RENAME_CONFIGURATION, ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration )
118
119 ////@end ctConfigurationBrowserControlPanel event table entries
120
121 END_EVENT_TABLE()
122
123 /*!
124 * ctConfigurationBrowserControlPanel constructor
125 */
126
127 ctConfigurationBrowserControlPanel::ctConfigurationBrowserControlPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
128 {
129 ////@begin ctConfigurationBrowserControlPanel member initialisation
130 ////@end ctConfigurationBrowserControlPanel member initialisation
131
132 ////@begin ctConfigurationBrowserControlPanel creation
133 wxPanel::Create( parent, id, pos, size, style );
134
135 CreateControls();
136 ////@end ctConfigurationBrowserControlPanel creation
137 }
138
139 /*!
140 * Control creation for ctConfigurationBrowserControlPanel
141 */
142
143 void ctConfigurationBrowserControlPanel::CreateControls()
144 {
145 ////@begin ctConfigurationBrowserControlPanel content construction
146
147 ctConfigurationBrowserControlPanel* item5 = this;
148
149 wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL);
150 item5->SetSizer(item6);
151
152 wxStaticText* item7 = new wxStaticText(item5, wxID_STATIC, _("Browse, add and remove configurations"), wxDefaultPosition, wxDefaultSize, 0);
153 item6->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
154
155 item6->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
156
157 wxButton* item9 = new wxButton(item5, ID_ADD_CONFIGURATION, _("&Add..."), wxDefaultPosition, wxDefaultSize, 0);
158 item6->Add(item9, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
159
160 wxButton* item10 = new wxButton(item5, ID_REMOVE_CONFIGURATION, _("&Remove..."), wxDefaultPosition, wxDefaultSize, 0);
161 item6->Add(item10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
162
163 wxButton* item11 = new wxButton(item5, ID_RENAME_CONFIGURATION, _("&Rename..."), wxDefaultPosition, wxDefaultSize, 0);
164 item6->Add(item11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
165
166 item6->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
167
168 wxStaticText* item13 = new wxStaticText(item5, ID_CONFIGURATION_NAME, _("Configuration:"), wxDefaultPosition, wxDefaultSize, 0);
169 item6->Add(item13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
170
171 wxTextCtrl* item14 = new wxTextCtrl(item5, ID_CONFIGURATION_DESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
172 item6->Add(item14, 1, wxGROW|wxALL, 5);
173
174 ////@end ctConfigurationBrowserControlPanel content construction
175 }
176
177 /*!
178 * Event handler for ID_ADD_CONFIGURATION
179 */
180
181 void ctConfigurationBrowserControlPanel::OnAddConfiguration( wxCommandEvent& event )
182 {
183 // Replace with custom code
184 event.Skip();
185 }
186
187 /*!
188 * Update event handler for ID_ADD_CONFIGURATION
189 */
190
191 void ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration( wxUpdateUIEvent& event )
192 {
193 // Replace with custom code
194 event.Skip();
195 }
196
197 /*!
198 * Event handler for ID_REMOVE_CONFIGURATION
199 */
200
201 void ctConfigurationBrowserControlPanel::OnRemoveConfiguration( wxCommandEvent& event )
202 {
203 // Replace with custom code
204 event.Skip();
205 }
206
207 /*!
208 * Update event handler for ID_REMOVE_CONFIGURATION
209 */
210
211 void ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration( wxUpdateUIEvent& event )
212 {
213 // Replace with custom code
214 event.Skip();
215 }
216
217 /*!
218 * Event handler for ID_RENAME_CONFIGURATION
219 */
220
221 void ctConfigurationBrowserControlPanel::OnRenameConfiguration( wxCommandEvent& event )
222 {
223 // Replace with custom code
224 event.Skip();
225 }
226
227 /*!
228 * Update event handler for ID_RENAME_CONFIGURATION
229 */
230
231 void ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration( wxUpdateUIEvent& event )
232 {
233 // Replace with custom code
234 event.Skip();
235 }
236
237 /*!
238 * Should we show tooltips?
239 */
240
241 bool ctConfigurationBrowserControlPanel::ShowToolTips()
242 {
243 return true;
244 }