33 #include <boost/format.hpp>
34 #include <wx/statline.h>
35 #include <wx/listctrl.h>
70 wxDialog(parent, -1, _T(""), wxDefaultPosition),
73 createContents(
this,
true,
true);
75 slotList_ =
dynamic_cast<wxListCtrl*
>(
FindWindow(ID_SLOT_LIST));
78 wxTextValidator(wxFILTER_ASCII, &slotName_));
104 format fmt = prodeTexts->
text(
125 wxLIST_FORMAT_LEFT, 300);
137 slotList_->DeleteAllItems();
139 machine_->immediateSlotNavigator();
141 for (
int i = 0; i < navigator.
count(); i++) {
142 slotList_->InsertItem(
146 return wxDialog::TransferDataToWindow();
155 if (slotList_->GetSelectedItemCount() == 1) {
171 item = slotList_->GetNextItem(
172 item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
179 machine_->immediateSlotNavigator().item(item);
183 TransferDataToWindow();
185 onSlotSelection(
dummy);
195 if (!TransferDataFromWindow()) {
213 if (machine_->immediateSlotNavigator().hasItem(trimmedName)) {
217 message % trimmedName;
228 if (machine_->busNavigator().hasItem(trimmedName)) {
232 message % trimmedName;
243 TransferDataToWindow();
254 if (!TransferDataFromWindow()) {
258 wxString trimmedName = slotName_.Trim(
false).Trim(
true);
259 if (trimmedName == _T(
"")) {
277 wxWindow *parent,
bool call_fit,
bool set_sizer) {
280 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
282 wxListCtrl *item1 =
new wxListCtrl( parent, ID_SLOT_LIST, wxDefaultPosition, wxSize(300,200), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
283 item0->Add( item1, 0, wxGROW|wxALL, 5 );
285 wxBoxSizer *item2 =
new wxBoxSizer( wxVERTICAL );
287 wxBoxSizer *item3 =
new wxBoxSizer( wxHORIZONTAL );
289 wxBoxSizer *item4 =
new wxBoxSizer( wxHORIZONTAL );
291 wxStaticText *item5 =
new wxStaticText( parent, ID_LABEL_NAME, wxT(
"Name:"), wxDefaultPosition, wxDefaultSize, 0 );
292 item4->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
294 wxTextCtrl *item6 =
new wxTextCtrl( parent, ID_NAME, wxT(
""), wxDefaultPosition, wxSize(120,-1), 0 );
295 item4->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
297 item3->Add( item4, 0, wxGROW|wxALL, 5 );
299 wxBoxSizer *item7 =
new wxBoxSizer( wxHORIZONTAL );
301 wxButton *item8 =
new wxButton( parent, ID_ADD_SLOT, wxT(
"Add"), wxDefaultPosition, wxDefaultSize, 0 );
302 item7->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
304 wxButton *item9 =
new wxButton( parent, ID_DELETE_SLOT, wxT(
"Delete"), wxDefaultPosition, wxDefaultSize, 0 );
305 item7->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 );
307 item3->Add( item7, 0, wxALIGN_CENTER, 5 );
309 item2->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
311 item0->Add( item2, 0, wxGROW|wxALL, 5 );
313 wxStaticLine *item10 =
new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
314 item0->Add( item10, 0, wxGROW|wxALL, 5 );
316 wxGridSizer *item11 =
new wxGridSizer( 2, 0, 0 );
318 wxButton *item12 =
new wxButton( parent, ID_HELP, wxT(
"&Help"), wxDefaultPosition, wxDefaultSize, 0 );
319 item11->Add( item12, 0, wxALL, 5 );
321 wxBoxSizer *item13 =
new wxBoxSizer( wxHORIZONTAL );
323 wxButton *item14 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
324 item13->Add( item14, 0, wxALIGN_CENTER|wxALL, 5 );
326 wxButton *item15 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
327 item13->Add( item15, 0, wxALIGN_CENTER|wxALL, 5 );
329 item11->Add( item13, 0, 0, 5 );
331 item0->Add( item11, 0, wxGROW, 5 );
335 parent->SetSizer( item0 );
337 item0->SetSizeHints( parent );