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
);
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);
75 ////@end ctConfigurationBrowserWindow content construction
79 * Event handler for ID_CONFIGURATION_BROWSER_TREECTRL
82 void ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl( wxTreeEvent
& event
)
84 // Replace with custom code
89 * Should we show tooltips?
92 bool ctConfigurationBrowserWindow::ShowToolTips()
98 * ctConfigurationBrowserControlPanel type definition
101 IMPLEMENT_CLASS( ctConfigurationBrowserControlPanel
, wxPanel
)
104 * ctConfigurationBrowserControlPanel event table definition
107 BEGIN_EVENT_TABLE( ctConfigurationBrowserControlPanel
, wxPanel
)
109 ////@begin ctConfigurationBrowserControlPanel event table entries
110 EVT_BUTTON( ID_ADD_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnAddConfiguration
)
111 EVT_UPDATE_UI( ID_ADD_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration
)
113 EVT_BUTTON( ID_REMOVE_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnRemoveConfiguration
)
114 EVT_UPDATE_UI( ID_REMOVE_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration
)
116 EVT_BUTTON( ID_RENAME_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnRenameConfiguration
)
117 EVT_UPDATE_UI( ID_RENAME_CONFIGURATION
, ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration
)
119 ////@end ctConfigurationBrowserControlPanel event table entries
124 * ctConfigurationBrowserControlPanel constructor
127 ctConfigurationBrowserControlPanel::ctConfigurationBrowserControlPanel( wxWindow
* parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
)
129 ////@begin ctConfigurationBrowserControlPanel member initialisation
130 ////@end ctConfigurationBrowserControlPanel member initialisation
132 ////@begin ctConfigurationBrowserControlPanel creation
133 wxPanel::Create( parent
, id
, pos
, size
, style
);
136 ////@end ctConfigurationBrowserControlPanel creation
140 * Control creation for ctConfigurationBrowserControlPanel
143 void ctConfigurationBrowserControlPanel::CreateControls()
145 ////@begin ctConfigurationBrowserControlPanel content construction
147 ctConfigurationBrowserControlPanel
* item5
= this;
149 wxBoxSizer
* item6
= new wxBoxSizer(wxVERTICAL
);
150 item5
->SetSizer(item6
);
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);
155 item6
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
157 wxButton
* item9
= new wxButton(item5
, ID_ADD_CONFIGURATION
, _("&Add..."), wxDefaultPosition
, wxDefaultSize
, 0);
158 item6
->Add(item9
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
160 wxButton
* item10
= new wxButton(item5
, ID_REMOVE_CONFIGURATION
, _("&Remove..."), wxDefaultPosition
, wxDefaultSize
, 0);
161 item6
->Add(item10
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
163 wxButton
* item11
= new wxButton(item5
, ID_RENAME_CONFIGURATION
, _("&Rename..."), wxDefaultPosition
, wxDefaultSize
, 0);
164 item6
->Add(item11
, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
166 item6
->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL
|wxALL
, 5);
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);
171 wxTextCtrl
* item14
= new wxTextCtrl(item5
, ID_CONFIGURATION_DESCRIPTION
, wxEmptyString
, wxDefaultPosition
, wxDefaultSize
, wxTE_MULTILINE
|wxTE_RICH
);
172 item6
->Add(item14
, 1, wxGROW
|wxALL
, 5);
174 ////@end ctConfigurationBrowserControlPanel content construction
178 * Event handler for ID_ADD_CONFIGURATION
181 void ctConfigurationBrowserControlPanel::OnAddConfiguration( wxCommandEvent
& event
)
183 // Replace with custom code
188 * Update event handler for ID_ADD_CONFIGURATION
191 void ctConfigurationBrowserControlPanel::OnUpdateAddConfiguration( wxUpdateUIEvent
& event
)
193 // Replace with custom code
198 * Event handler for ID_REMOVE_CONFIGURATION
201 void ctConfigurationBrowserControlPanel::OnRemoveConfiguration( wxCommandEvent
& event
)
203 // Replace with custom code
208 * Update event handler for ID_REMOVE_CONFIGURATION
211 void ctConfigurationBrowserControlPanel::OnUpdateRemoveConfiguration( wxUpdateUIEvent
& event
)
213 // Replace with custom code
218 * Event handler for ID_RENAME_CONFIGURATION
221 void ctConfigurationBrowserControlPanel::OnRenameConfiguration( wxCommandEvent
& event
)
223 // Replace with custom code
228 * Update event handler for ID_RENAME_CONFIGURATION
231 void ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration( wxUpdateUIEvent
& event
)
233 // Replace with custom code
238 * Should we show tooltips?
241 bool ctConfigurationBrowserControlPanel::ShowToolTips()