84 wxDialog(parent, -1, _T(""), wxDefaultPosition),
86 oppositeName_(_T("")),
87 oppositeNameCtrl_(NULL),
88 inputBusChoice_(NULL),
89 outputBusChoice_(NULL),
90 bidirectionalBox_(NULL) {
96 dynamic_cast<MDFView*
>(wxGetApp().docManager()->GetCurrentView());
101 createContents(
this,
true,
true);
104 wxTextCtrl* nameCtrl =
dynamic_cast<wxTextCtrl*
>(
FindWindow(ID_NAME));
106 nameCtrl->SetValidator(wxTextValidator(wxFILTER_ASCII, &name_));
109 dynamic_cast<wxTextCtrl*
>(
FindWindow(ID_OPPOSITE_BRIDGE));
110 assert(oppositeNameCtrl_ != 0);
111 oppositeNameCtrl_->SetValidator(wxTextValidator(wxFILTER_ASCII,
114 inputBusChoice_ =
dynamic_cast<wxChoice*
>(
FindWindow(ID_INPUT_BUS));
115 assert(inputBusChoice_ != NULL);
116 outputBusChoice_ =
dynamic_cast<wxChoice*
>(
FindWindow(ID_OUTPUT_BUS));
117 assert(outputBusChoice_ != NULL);
120 dynamic_cast<wxCheckBox*
>(
FindWindow(ID_BIDIRECTIONAL));
121 assert(bidirectionalBox_ != NULL);
129 machine_ = bridge->machine();
133 if (opposite != NULL) {
134 bidirectional_ =
true;
136 assert(opposite->sourceBus() == bridge->destinationBus());
137 assert(opposite->destinationBus() == bridge->sourceBus());
140 bidirectional_ =
false;
147 TransferDataToWindow();
471 wxBoxSizer *item0 =
new wxBoxSizer( wxVERTICAL );
473 wxBoxSizer *item1 =
new wxBoxSizer( wxHORIZONTAL );
475 wxFlexGridSizer *item2 =
new wxFlexGridSizer( 2, 0, 0 );
477 wxStaticText *item3 =
new wxStaticText( parent,
ID_LABEL_NAME, wxT(
"Name:"), wxDefaultPosition, wxDefaultSize, 0 );
478 item2->Add( item3, 0, wxALL, 5 );
480 wxTextCtrl *item4 =
new wxTextCtrl( parent,
ID_NAME, wxT(
""), wxDefaultPosition, wxSize(120,-1), 0 );
481 item2->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
483 wxStaticText *item5 =
new wxStaticText( parent,
ID_LABEL_INPUT_BUS, wxT(
"Input Bus:"), wxDefaultPosition, wxDefaultSize, 0 );
484 item2->Add( item5, 0, wxALL, 5 );
486 wxString *strs6 = (wxString*) NULL;
487 wxChoice *item6 =
new wxChoice( parent,
ID_INPUT_BUS, wxDefaultPosition, wxSize(100,-1), 0, strs6, 0 );
488 item2->Add( item6, 0, wxGROW|wxALL, 5 );
490 wxStaticText *item7 =
new wxStaticText( parent,
ID_LABEL_OUTPUT_BUS, wxT(
"Output Bus:"), wxDefaultPosition, wxDefaultSize, 0 );
491 item2->Add( item7, 0, wxALL, 5 );
493 wxString *strs8 = (wxString*) NULL;
494 wxChoice *item8 =
new wxChoice( parent,
ID_OUTPUT_BUS, wxDefaultPosition, wxSize(100,-1), 0, strs8, 0 );
495 item2->Add( item8, 0, wxGROW|wxALL, 5 );
497 item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
499 wxBoxSizer *item9 =
new wxBoxSizer( wxVERTICAL );
501 wxCheckBox *item10 =
new wxCheckBox( parent,
ID_BIDIRECTIONAL, wxT(
"Bidirectional"), wxDefaultPosition, wxDefaultSize, 0 );
502 item9->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
504 item9->Add( 20, 20, 0, wxALIGN_CENTER|wxALL, 5 );
506 wxStaticText *item11 =
new wxStaticText( parent,
ID_LABEL_OPPOSITE_NAME, wxT(
"Opposite Bridge Name:"), wxDefaultPosition, wxDefaultSize, 0 );
507 item9->Add( item11, 0, wxGROW, 15 );
509 wxTextCtrl *item12 =
new wxTextCtrl( parent,
ID_OPPOSITE_BRIDGE, wxT(
""), wxDefaultPosition, wxSize(80,-1), 0 );
510 item9->Add( item12, 0, wxGROW|wxALL, 5 );
512 item1->Add( item9, 0, wxGROW|wxALL, 5 );
514 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
516 wxStaticLine *item13 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
517 item0->Add( item13, 0, wxGROW|wxALL, 5 );
519 wxGridSizer *item14 =
new wxGridSizer( 2, 0, 0 );
521 wxButton *item15 =
new wxButton( parent,
ID_HELP, wxT(
"&Help"), wxDefaultPosition, wxDefaultSize, 0 );
522 item14->Add( item15, 0, wxALL, 5 );
524 wxBoxSizer *item16 =
new wxBoxSizer( wxHORIZONTAL );
526 wxButton *item17 =
new wxButton( parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
527 item16->Add( item17, 0, wxALIGN_CENTER|wxALL, 5 );
529 wxButton *item18 =
new wxButton( parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
530 item16->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 );
532 item14->Add( item16, 0, wxALL, 5 );
534 item0->Add( item14, 0, wxALIGN_CENTER, 5 );
538 parent->SetSizer( item0 );
540 item0->SetSizeHints( parent );