1 /////////////////////////////////////////////////////////////////////////////
2 // Name: configbrowser.cpp
10 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/splitter.h"
15 #include "wx/treectrl.h"
18 #include "configbrowser.h"
24 * ctConfigurationBrowserWindow type definition
27 IMPLEMENT_CLASS( ctConfigurationBrowserWindow
, wxPanel
)
30 * ctConfigurationBrowserWindow event table definition
33 BEGIN_EVENT_TABLE( ctConfigurationBrowserWindow
, wxPanel
)
35 ////@begin ctConfigurationBrowserWindow event table entries
36 EVT_TREE_SEL_CHANGED( ID_CONFIGURATION_BROWSER_TREECTRL
, ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl
)
38 ////@end ctConfigurationBrowserWindow event table entries
43 * ctConfigurationBrowserWindow constructor
46 ctConfigurationBrowserWindow::ctConfigurationBrowserWindow( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
48 ////@begin ctConfigurationBrowserWindow member initialisation
49 ////@end ctConfigurationBrowserWindow member initialisation
51 wxPanel::Create( parent
, id
, pos
, size
, style
);
57 * Control creation for ctConfigurationBrowserWindow
60 void ctConfigurationBrowserWindow::CreateControls()
62 ////@begin ctConfigurationBrowserWindow content construction
64 ctConfigurationBrowserWindow
* item1
= this;
66 wxBoxSizer
* item2
= new wxBoxSizer(wxVERTICAL
);
67 item1
->SetSizer(item2
);
68 item1
->SetAutoLayout(TRUE
);
70 wxSplitterWindow
* item3
= new wxSplitterWindow(item1
, ID_CONFIGBROWSER_SPLITTERWINDOW
, wxDefaultPosition
, wxSize(400, 400), wxSP_3DBORDER
|wxSP_3DSASH
|wxNO_BORDER
|wxNO_FULL_REPAINT_ON_RESIZE
);
71 wxTreeCtrl
* item4
= new wxTreeCtrl(item3
, ID_CONFIGURATION_BROWSER_TREECTRL
, wxDefaultPosition
, wxSize(100, 100), wxTR_SINGLE
|wxNO_BORDER
);
72 ctConfigurationBrowserControlPanel
* item5
= new ctConfigurationBrowserControlPanel(item3
, ID_PANEL
, wxDefaultPosition
, wxSize(100, 80), wxNO_BORDER
|wxTAB_TRAVERSAL
);
73 item3
->SplitVertically(item4
, item5
, 200);
74 item2
->Add(item3
, 1, wxGROW
, 5);
76 ////@end ctConfigurationBrowserWindow content construction
80 * Event handler for ID_CONFIGURATION_BROWSER_TREECTRL
83 void ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl( wxTreeEvent
& event
)
85 // Replace with custom code
90 * Should we show tooltips?
93 bool ctConfigurationBrowserWindow::ShowToolTips()
99 * ctConfigurationBrowserControlPanel type definition
102 IMPLEMENT_CLASS( ctConfigurationBrowserControlPanel
, wxPanel
)
105 * ctConfigurationBrowserControlPanel event table definition
108 BEGIN_EVENT_TABLE( ctConfigurationBrowserControlPanel
, wxPanel
)
110 ////@begin ctConfigurationBrowserControlPanel event table entries
111 EVT_BUTTON( ID_ADD_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnAddConfiguration
)
112 EVT_UPDATE_UI( ID_ADD_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration
)
114 EVT_BUTTON( ID_REMOVE_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnRemoveConfiguration
)
115 EVT_UPDATE_UI( ID_REMOVE_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration
)
117 EVT_BUTTON( ID_RENAME_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnRenameConfiguration
)
118 EVT_UPDATE_UI( ID_RENAME_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration
)
120 ////@end ctConfigurationBrowserControlPanel event table entries
125 * ctConfigurationBrowserControlPanel constructor
128 ctConfigurationBrowserControlPanel::ctConfigurationBrowserControlPanel( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
130 ////@begin ctConfigurationBrowserControlPanel member initialisation
131 ////@end ctConfigurationBrowserControlPanel member initialisation
133 ////@begin ctConfigurationBrowserControlPanel creation
134 wxPanel::Create( parent
, id
, pos
, size
, style
);
137 ////@end ctConfigurationBrowserControlPanel creation
141 * Control creation for ctConfigurationBrowserControlPanel
144 void ctConfigurationBrowserControlPanel::CreateControls()
146 ////@begin ctConfigurationBrowserControlPanel content construction
148 ctConfigurationBrowserControlPanel
* item5
= this;
150 wxBoxSizer
* item6
= new wxBoxSizer(wxVERTICAL
);
151 item5
->SetSizer(item6
);
152 item5
->SetAutoLayout(TRUE
);
154 wxStaticText
* item7
= new wxStaticText(item5
, wxID_STATIC
, _("Browse, add and remove configurations"), wxDefaultPosition
, wxDefaultSize
, 0);
155 item6
->Add(item7
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
|wxADJUST_MINSIZE
, 5);
157 item6
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
159 wxButton
* item9
= new wxButton(item5
, ID_ADD_CONFIGURATION
, _("&Add..."), wxDefaultPosition
, wxDefaultSize
, 0);
160 item6
->Add(item9
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
162 wxButton
* item10
= new wxButton(item5
, ID_REMOVE_CONFIGURATION
, _("&Remove..."), wxDefaultPosition
, wxDefaultSize
, 0);
163 item6
->Add(item10
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
165 wxButton
* item11
= new wxButton(item5
, ID_RENAME_CONFIGURATION
, _("&Rename..."), wxDefaultPosition
, wxDefaultSize
, 0);
166 item6
->Add(item11
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
168 item6
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
170 wxStaticText
* item13
= new wxStaticText(item5
, ID_CONFIGURATION_NAME
, _("Configuration:"), wxDefaultPosition
, wxDefaultSize
, 0);
171 item6
->Add(item13
, 0, wxALIGN_LEFT
|wxLEFT
|wxRIGHT
|wxTOP
|wxADJUST_MINSIZE
, 5);
173 wxTextCtrl
* item14
= new wxTextCtrl(item5
, ID_CONFIGURATION_DESCRIPTION
, _(""), wxDefaultPosition
, wxDefaultSize
, wxTE_MULTILINE
|wxTE_RICH
);
174 item6
->Add(item14
, 1, wxGROW
|wxALL
, 5);
176 ////@end ctConfigurationBrowserControlPanel content construction
180 * Event handler for ID_ADD_CONFIGURATION
183 void ctConfigurationBrowserControlPanel::OnAddConfiguration( wxCommandEvent
& event
)
185 // Replace with custom code
190 * Update event handler for ID_ADD_CONFIGURATION
193 void ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration( wxUpdateUIEvent
& event
)
195 // Replace with custom code
200 * Event handler for ID_REMOVE_CONFIGURATION
203 void ctConfigurationBrowserControlPanel::OnRemoveConfiguration( wxCommandEvent
& event
)
205 // Replace with custom code
210 * Update event handler for ID_REMOVE_CONFIGURATION
213 void ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration( wxUpdateUIEvent
& event
)
215 // Replace with custom code
220 * Event handler for ID_RENAME_CONFIGURATION
223 void ctConfigurationBrowserControlPanel::OnRenameConfiguration( wxCommandEvent
& event
)
225 // Replace with custom code
230 * Update event handler for ID_RENAME_CONFIGURATION
233 void ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration( wxUpdateUIEvent
& event
)
235 // Replace with custom code
240 * Should we show tooltips?
243 bool ctConfigurationBrowserControlPanel::ShowToolTips()