34 #include <wx/statusbr.h>
100 BEGIN_EVENT_TABLE(
MainFrame, wxDocMDIParentFrame)
119 wxDocManager* manager,
121 const wxString& title,
122 const wxPoint& position,
125 wxDocMDIParentFrame(manager, parent, -1, title,
126 position, size, style, _T("
MainFrame")) {
128 commandRegistry_ = wxGetApp().commandRegistry();
129 assert(commandRegistry_ != NULL);
135 commandRegistry_->addCommand(
new PrintCmd());
138 commandRegistry_->addCommand(
new QuitCmd());
139 commandRegistry_->addCommand(
new UndoCmd());
140 commandRegistry_->addCommand(
new RedoCmd());
141 commandRegistry_->addCommand(
new AddFUCmd());
142 commandRegistry_->addCommand(
new AddRFCmd());
143 commandRegistry_->addCommand(
new AddBusCmd());
146 commandRegistry_->addCommand(
new AddIUCmd());
147 commandRegistry_->addCommand(
new AddGCUCmd());
148 commandRegistry_->addCommand(
new AddASCmd());
164 commandRegistry_->addCommand(
new SelectCmd());
166 commandRegistry_->addCommand(
new ZoomInCmd());
167 commandRegistry_->addCommand(
new ZoomOutCmd());
178 commandRegistry_->addCommand(
new AboutCmd());
184 int widths[2] = {-2, -1};
185 SetStatusWidths(2, widths);
199 options->setToolbarVisibility(
false);
204 options->setToolbarVisibility(
true);
216 wxStatusBar* statusbar = GetStatusBar();
217 if (statusbar != NULL) {
223 int widths[2] = {-4, -1};
224 SetStatusWidths(2, widths);
238 wxMenu* optionsMenu =
new wxMenu;
244 optionsMenu->AppendSeparator();
261 wxMenu* helpMenu =
new wxMenu;
265 _T(
"&User Manual...")));
295 GUICommand* command = wxGetApp().commandRegistry()
296 ->createCommand(event.GetId());
298 if (command == NULL) {
300 _T(
"No handler found for the command event!"));
310 wxView* view = wxGetApp().docManager()->GetCurrentView();
314 if (editorCmd != NULL) {
343 if (command == NULL) {
348 wxView* view = wxGetApp().docManager()->GetCurrentView();
351 if (editorCmd != NULL) {
375 wxMenuBar* menubar = GetMenuBar();
376 for (
unsigned i = 0; i < menubar->GetMenuCount(); i++) {
377 menubar->GetMenu(i)->UpdateUI();
388 while (tool != NULL) {
395 tool =
options->nextToolbarButton();
416 wxMenu* fileMenu =
new wxMenu;
442 fileMenu->AppendSeparator();
452 _T(
"Print Pre&view...")));
459 fileMenu->AppendSeparator();
466 wxMenu* editMenu =
new wxMenu;
467 wxMenu* addSubMenu =
new wxMenu;
468 wxMenu* addFromHDBSubMenu =
new wxMenu;
480 editMenu->AppendSeparator();
496 editMenu->AppendSeparator();
501 _T(
"&Function Unit...")));
506 _T(
"&Register File...")));
511 _T(
"&Transport Bus...")));
526 _T(
"&Immediate Unit...")));
531 _T(
"&Global Control Unit...")));
536 _T(
"&Address Space...")));
540 addFromHDBSubMenu->Append(
543 _T(
"&Function Unit...")));
545 addFromHDBSubMenu->Append(
548 _T(
"&Immediate Unit...")));
550 addFromHDBSubMenu->Append(
553 _T(
"&Register File...")));
557 _T(
"Add From &HDB"), addFromHDBSubMenu);
569 editMenu->AppendSeparator();
573 _T(
"Address &Spaces...")));
578 _T(
"Instruction &Templates...")));
583 .Prepend(_T(
"OTA Formats...")));
588 _T(
"&Immediate Slots...")));
593 _T(
"Transport Bus &Order...")));
598 _T(
"Architecture Features...")));
601 wxMenu* viewMenu =
new wxMenu;
602 wxMenu* zoomSubMenu =
new wxMenu;
613 zoomSubMenu->AppendSeparator();
630 viewMenu->AppendSeparator();
631 viewMenu->AppendCheckItem(
634 _T(
"Unit &Details")));
636 viewMenu->AppendSeparator();
643 wxMenu* toolMenu =
new wxMenu;
652 _T(
"&Edit Connections")));
654 toolMenu->AppendSeparator();
658 _T(
"&Fully Connect IC")));
663 _T(
"&VLIW Connect IC")));
668 .Prepend(_T(
"&Blocks Connect IC")));
678 _T(
"&Processor Implementation...")));
683 _T(
"&Call Explorer Plugin...")));
692 wxMenuBar* menuBar =
new wxMenuBar;
693 menuBar->Append(fileMenu, _T(
"&File"));
694 menuBar->Append(editMenu, _T(
"&Edit"));
695 menuBar->Append(viewMenu, _T(
"&View"));
696 menuBar->Append(toolMenu, _T(
"&Tools"));
697 menuBar->Append(optionsMenu, _T(
"&Options"));
698 menuBar->Append(helpMenu, _T(
"&Help"));
721 wxString accel = _T(
"\t");
723 accel.Append(_T(
"Ctrl-"));
726 }
else if (sc->
alt()) {
727 accel.Append(_T(
"Alt-"));
730 }
else if (sc->
fKey() > 0) {
731 accel.Append(_T(
"F"));