1 /////////////////////////////////////////////////////////////////////////////
2 // Name: configbrowser.cpp
3 // Purpose: Configuration browser
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
22 #include "wx/splitter.h"
23 #include "wx/treectrl.h"
27 #include "configbrowser.h"
33 * ctConfigurationBrowserWindow type definition
36 IMPLEMENT_CLASS( ctConfigurationBrowserWindow
, wxPanel
)
39 * ctConfigurationBrowserWindow event table definition
42 BEGIN_EVENT_TABLE( ctConfigurationBrowserWindow
, wxPanel
)
44 ////@begin ctConfigurationBrowserWindow event table entries
45 EVT_TREE_SEL_CHANGED( ID_CONFIGURATION_BROWSER_TREECTRL
, ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl
)
47 ////@end ctConfigurationBrowserWindow event table entries
52 * ctConfigurationBrowserWindow constructor
55 ctConfigurationBrowserWindow::ctConfigurationBrowserWindow( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
57 ////@begin ctConfigurationBrowserWindow member initialisation
58 ////@end ctConfigurationBrowserWindow member initialisation
60 wxPanel::Create( parent
, id
, pos
, size
, style
);
66 * Control creation for ctConfigurationBrowserWindow
69 void ctConfigurationBrowserWindow::CreateControls()
71 ////@begin ctConfigurationBrowserWindow content construction
73 ctConfigurationBrowserWindow
* item1
= this;
75 wxBoxSizer
* item2
= new wxBoxSizer(wxVERTICAL
);
76 item1
->SetSizer(item2
);
78 wxSplitterWindow
* item3
= new wxSplitterWindow(item1
, ID_CONFIGBROWSER_SPLITTERWINDOW
, wxDefaultPosition
, wxSize(400, 400), wxSP_3DBORDER
|wxSP_3DSASH
|wxNO_BORDER
|wxNO_FULL_REPAINT_ON_RESIZE
|wxSP_NO_XP_THEME
);
79 wxTreeCtrl
* item4
= new wxTreeCtrl(item3
, ID_CONFIGURATION_BROWSER_TREECTRL
, wxDefaultPosition
, wxSize(100, 100), wxTR_SINGLE
|wxNO_BORDER
);
80 ctConfigurationBrowserControlPanel
* item5
= new ctConfigurationBrowserControlPanel(item3
, ID_PANEL
, wxDefaultPosition
, wxSize(100, 80), wxNO_BORDER
|wxTAB_TRAVERSAL
);
81 item3
->SplitVertically(item4
, item5
, 200);
82 item2
->Add(item3
, 1, wxGROW
, 5);
84 ////@end ctConfigurationBrowserWindow content construction
88 * Event handler for ID_CONFIGURATION_BROWSER_TREECTRL
91 void ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl( wxTreeEvent
& event
)
93 // Replace with custom code
98 * Should we show tooltips?
101 bool ctConfigurationBrowserWindow::ShowToolTips()
107 * ctConfigurationBrowserControlPanel type definition
110 IMPLEMENT_CLASS( ctConfigurationBrowserControlPanel
, wxPanel
)
113 * ctConfigurationBrowserControlPanel event table definition
116 BEGIN_EVENT_TABLE( ctConfigurationBrowserControlPanel
, wxPanel
)
118 ////@begin ctConfigurationBrowserControlPanel event table entries
119 EVT_BUTTON( ID_ADD_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnAddConfiguration
)
120 EVT_UPDATE_UI( ID_ADD_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration
)
122 EVT_BUTTON( ID_REMOVE_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnRemoveConfiguration
)
123 EVT_UPDATE_UI( ID_REMOVE_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration
)
125 EVT_BUTTON( ID_RENAME_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnRenameConfiguration
)
126 EVT_UPDATE_UI( ID_RENAME_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration
)
128 ////@end ctConfigurationBrowserControlPanel event table entries
133 * ctConfigurationBrowserControlPanel constructor
136 ctConfigurationBrowserControlPanel::ctConfigurationBrowserControlPanel( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
138 ////@begin ctConfigurationBrowserControlPanel member initialisation
139 ////@end ctConfigurationBrowserControlPanel member initialisation
141 ////@begin ctConfigurationBrowserControlPanel creation
142 wxPanel::Create( parent
, id
, pos
, size
, style
);
145 ////@end ctConfigurationBrowserControlPanel creation
149 * Control creation for ctConfigurationBrowserControlPanel
152 void ctConfigurationBrowserControlPanel::CreateControls()
154 ////@begin ctConfigurationBrowserControlPanel content construction
156 ctConfigurationBrowserControlPanel
* item5
= this;
158 wxBoxSizer
* item6
= new wxBoxSizer(wxVERTICAL
);
159 item5
->SetSizer(item6
);
161 wxStaticText
* item7
= new wxStaticText(item5
, wxID_STATIC
, _("Browse, add and remove configurations"), wxDefaultPosition
, wxDefaultSize
, 0);
162 item6
->Add(item7
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
|wxADJUST_MINSIZE
, 5);
164 item6
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
166 wxButton
* item9
= new wxButton(item5
, ID_ADD_CONFIGURATION
, _("&Add..."), wxDefaultPosition
, wxDefaultSize
, 0);
167 item6
->Add(item9
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
169 wxButton
* item10
= new wxButton(item5
, ID_REMOVE_CONFIGURATION
, _("&Remove..."), wxDefaultPosition
, wxDefaultSize
, 0);
170 item6
->Add(item10
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
172 wxButton
* item11
= new wxButton(item5
, ID_RENAME_CONFIGURATION
, _("&Rename..."), wxDefaultPosition
, wxDefaultSize
, 0);
173 item6
->Add(item11
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
175 item6
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
177 wxStaticText
* item13
= new wxStaticText(item5
, ID_CONFIGURATION_NAME
, _("Configuration:"), wxDefaultPosition
, wxDefaultSize
, 0);
178 item6
->Add(item13
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
180 wxTextCtrl
* item14
= new wxTextCtrl(item5
, ID_CONFIGURATION_DESCRIPTION
, wxEmptyString
, wxDefaultPosition
, wxDefaultSize
, wxTE_MULTILINE
|wxTE_RICH
);
181 item6
->Add(item14
, 1, wxGROW
|wxALL
, 5);
183 ////@end ctConfigurationBrowserControlPanel content construction
187 * Event handler for ID_ADD_CONFIGURATION
190 void ctConfigurationBrowserControlPanel::OnAddConfiguration( wxCommandEvent
& event
)
192 // Replace with custom code
197 * Update event handler for ID_ADD_CONFIGURATION
200 void ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration( wxUpdateUIEvent
& event
)
202 // Replace with custom code
207 * Event handler for ID_REMOVE_CONFIGURATION
210 void ctConfigurationBrowserControlPanel::OnRemoveConfiguration( wxCommandEvent
& event
)
212 // Replace with custom code
217 * Update event handler for ID_REMOVE_CONFIGURATION
220 void ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration( wxUpdateUIEvent
& event
)
222 // Replace with custom code
227 * Event handler for ID_RENAME_CONFIGURATION
230 void ctConfigurationBrowserControlPanel::OnRenameConfiguration( wxCommandEvent
& event
)
232 // Replace with custom code
237 * Update event handler for ID_RENAME_CONFIGURATION
240 void ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration( wxUpdateUIEvent
& event
)
242 // Replace with custom code
247 * Should we show tooltips?
250 bool ctConfigurationBrowserControlPanel::ShowToolTips()