OpenASIP
2.0
|
#include <MainFrame.hh>
Public Member Functions | |
MainFrame (wxDocManager *manager, wxFrame *parent, const wxString &title, const wxPoint &position, const wxSize &size, long style) | |
void | onKeyEvent (wxKeyEvent &event) |
void | createToolbar () |
void | createMenubar () |
void | onToggleToolbar () |
void | onToggleStatusbar () |
void | updateUI () |
void | OnExit (wxCommandEvent &WXUNUSED(event)) |
Private Types | |
enum | { ID_ADD_SUBMENU = 12000, ID_ADD_FROM_HDB_SUBMENU, ID_ZOOM_SUBMENU, ID_VIEW_TOOLBAR, ID_VIEW_STATUSBAR } |
GUI element IDs. More... | |
Private Member Functions | |
wxMenu * | createOptionsMenu () |
wxMenu * | createHelpMenu () |
void | onCommandEvent (wxCommandEvent &event) |
void | onUpdateUI (wxUpdateUIEvent &event) |
wxString | menuAccelerator (int id) |
Private Attributes | |
CommandRegistry * | commandRegistry_ |
Command registry. More... | |
wxToolBar * | toolbar_ |
Toolbar. More... | |
Main window of the editor.
Contains a default menubar, toolbar, statusbar and the child frames for all open documents. Derived from the wxDocMDIParentFrame class, which handles the child frames automatically. Handles the Options and the Help menu events and the events for toggling visibility of the menubar and the toolbar.
Definition at line 50 of file MainFrame.hh.
|
private |
GUI element IDs.
Enumerator | |
---|---|
ID_ADD_SUBMENU | |
ID_ADD_FROM_HDB_SUBMENU | |
ID_ZOOM_SUBMENU | |
ID_VIEW_TOOLBAR | |
ID_VIEW_STATUSBAR |
Definition at line 78 of file MainFrame.hh.
MainFrame::MainFrame | ( | wxDocManager * | manager, |
wxFrame * | parent, | ||
const wxString & | title, | ||
const wxPoint & | position, | ||
const wxSize & | size, | ||
long | style | ||
) |
The Constructor.
manager | Pointer to the editor's document manager. |
parent | Parent frame of the MainFrame. |
title | Title of the MainFrame. |
position | Position of the MainFrame on the screen. |
size | Size of the MainFrame on the screen. |
style | Style of the MainFrame. |
Definition at line 118 of file MainFrame.cc.
References assert.
|
private |
Creates and returns a new help menu.
Definition at line 260 of file MainFrame.cc.
References ProDeConstants::COMMAND_ABOUT, UserManualCmd::COMMAND_ID, and menuAccelerator().
Referenced by createMenubar().
void MainFrame::createMenubar | ( | ) |
Creates the default menubar.
Definition at line 414 of file MainFrame.cc.
References ProDeConstants::COMMAND_ADD_AS, ProDeConstants::COMMAND_ADD_BRIDGE, ProDeConstants::COMMAND_ADD_BUS, ProDeConstants::COMMAND_ADD_FU, ProDeConstants::COMMAND_ADD_FU_FROM_HDB, ProDeConstants::COMMAND_ADD_GCU, ProDeConstants::COMMAND_ADD_IU, ProDeConstants::COMMAND_ADD_IU_FROM_HDB, ProDeConstants::COMMAND_ADD_RF, ProDeConstants::COMMAND_ADD_RF_FROM_HDB, ProDeConstants::COMMAND_ADD_SOCKET, ProDeConstants::COMMAND_BLOCKS_CONNECT_IC, ProDeConstants::COMMAND_CALL_EXPLORER_PLUGIN, ProDeConstants::COMMAND_CLOSE_DOC, ProDeConstants::COMMAND_COPY, ProDeConstants::COMMAND_CUT, ProDeConstants::COMMAND_DELETE_COMP, ProDeConstants::COMMAND_EDIT_ADDRESS_SPACES, ProDeConstants::COMMAND_EDIT_BUS_ORDER, ProDeConstants::COMMAND_EDIT_CONNECTIONS, ProDeConstants::COMMAND_EDIT_IMMEDIATE_SLOTS, ProDeConstants::COMMAND_EDIT_MACHINE, ProDeConstants::COMMAND_EDIT_OTA_FORMATS, ProDeConstants::COMMAND_EDIT_TEMPLATES, ProDeConstants::COMMAND_EXPORT, ProDeConstants::COMMAND_FULLY_CONNECT_BUSSES, ProDeConstants::COMMAND_IMPLEMENTATION, ProDeConstants::COMMAND_MODIFY_COMP, ProDeConstants::COMMAND_NEW_DOC, ProDeConstants::COMMAND_OPEN_DOC, ProDeConstants::COMMAND_PASTE, ProDeConstants::COMMAND_PRINT, ProDeConstants::COMMAND_PRINT_PREVIEW, ProDeConstants::COMMAND_QUIT, ProDeConstants::COMMAND_REDO, ProDeConstants::COMMAND_SAVE_DOC, ProDeConstants::COMMAND_SAVEAS_DOC, ProDeConstants::COMMAND_SELECT, ProDeConstants::COMMAND_TOGGLE_UNIT_DETAILS, ProDeConstants::COMMAND_UNDO, ProDeConstants::COMMAND_VERIFY_MACHINE, ProDeConstants::COMMAND_VLIW_CONNECT_IC, ProDeConstants::COMMAND_ZOOM_FIT_HEI, ProDeConstants::COMMAND_ZOOM_FIT_WID, ProDeConstants::COMMAND_ZOOM_FIT_WIN, ProDeConstants::COMMAND_ZOOM_IN, ProDeConstants::COMMAND_ZOOM_OUT, createHelpMenu(), createOptionsMenu(), ID_ADD_FROM_HDB_SUBMENU, ID_ADD_SUBMENU, ID_VIEW_STATUSBAR, ID_VIEW_TOOLBAR, ID_ZOOM_SUBMENU, and menuAccelerator().
|
private |
Creates and returns a new options menu.
Definition at line 237 of file MainFrame.cc.
References ProDeConstants::COMMAND_EDIT_OPTIONS, ProDeConstants::COMMAND_SAVE_OPTIONS, and menuAccelerator().
Referenced by createMenubar().
void MainFrame::createToolbar | ( | ) |
Creates the toolbar.
Definition at line 746 of file MainFrame.cc.
References Environment::iconDirPath(), options, toolbar_, and WxConversion::toWxString().
Referenced by onToggleToolbar(), and ProDe::setOptions().
|
private |
Returns a menu accelerator string for a command.
The returned string can be appended to the menu item text to set the keyboard shortcut defined in the options for the command.
id | Command ID. |
Definition at line 713 of file MainFrame.cc.
References KeyboardShortcut::alt(), CommandRegistry::commandName(), KeyboardShortcut::ctrl(), KeyboardShortcut::fKey(), KeyboardShortcut::key(), options, and WxConversion::toWxString().
Referenced by createHelpMenu(), createMenubar(), and createOptionsMenu().
|
private |
Handles menu and toolbar events.
event | Event to handle. |
Definition at line 283 of file MainFrame.cc.
References GUICommand::Do(), ID_VIEW_STATUSBAR, ID_VIEW_TOOLBAR, GUICommand::isEnabled(), onToggleStatusbar(), onToggleToolbar(), GUICommand::setParentWindow(), EditorCommand::setView(), and updateUI().
void MainFrame::OnExit | ( | wxCommandEvent & | WXUNUSEDevent | ) |
Performs routines before exiting a program
event | Command event to handle. |
Definition at line 771 of file MainFrame.cc.
Referenced by QuitCmd::Do().
void MainFrame::onKeyEvent | ( | wxKeyEvent & | event | ) |
Handles key events on the canvas.
event | Key event to handle. |
Definition at line 406 of file MainFrame.cc.
void MainFrame::onToggleStatusbar | ( | ) |
Toggles visibility of the statusbar.
Definition at line 215 of file MainFrame.cc.
Referenced by onCommandEvent().
void MainFrame::onToggleToolbar | ( | ) |
Toggles visibility of the toolbar.
Definition at line 196 of file MainFrame.cc.
References createToolbar(), options, and toolbar_.
Referenced by onCommandEvent().
|
private |
Updates toolbar and menubar item enabled/disabled states.
event | Update event for the menu or toolbar item to be updated. |
Definition at line 338 of file MainFrame.cc.
References CommandRegistry::createCommand(), GUICommand::isChecked(), GUICommand::isEnabled(), and EditorCommand::setView().
void MainFrame::updateUI | ( | ) |
Updates enabled/disabled states of toolbar buttons and menu items.
Definition at line 373 of file MainFrame.cc.
References ToolbarButton::action(), CommandRegistry::commandId(), CommandRegistry::isEnabled(), options, and toolbar_.
Referenced by onCommandEvent().
|
private |
Command registry.
Definition at line 72 of file MainFrame.hh.
|
private |
Toolbar.
Definition at line 75 of file MainFrame.hh.
Referenced by createToolbar(), onToggleToolbar(), and updateUI().