OpenASIP  2.0
MainFrame.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file MainFrame.hh
26  *
27  * Declaration of the MainFrame class.
28  *
29  * @author Veli-Pekka Jääskeläinen (vjaaskel-no.spam-cs.tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_MAIN_FRAME_HH
34 #define TTA_MAIN_FRAME_HH
35 
36 #include <wx/docmdi.h>
37 #include <wx/menu.h>
38 
39 class CommandRegistry;
40 
41 /**
42  * Main window of the editor.
43  *
44  * Contains a default menubar, toolbar, statusbar and the child frames
45  * for all open documents. Derived from the wxDocMDIParentFrame class,
46  * which handles the child frames automatically. Handles the Options
47  * and the Help menu events and the events for toggling visibility of
48  * the menubar and the toolbar.
49  */
50 class MainFrame : public wxDocMDIParentFrame {
51 public:
52  MainFrame(
53  wxDocManager* manager, wxFrame* parent, const wxString& title,
54  const wxPoint& position, const wxSize& size, long style);
55  void onKeyEvent(wxKeyEvent& event);
56  void createToolbar();
57  void createMenubar();
58  void onToggleToolbar();
59  void onToggleStatusbar();
60  void updateUI();
61  void OnExit(wxCommandEvent& WXUNUSED(event));
62 
63 private:
64  wxMenu* createOptionsMenu();
65  wxMenu* createHelpMenu();
66  void onCommandEvent(wxCommandEvent& event);
67  void onUpdateUI(wxUpdateUIEvent& event);
68 
69  wxString menuAccelerator(int id);
70 
71  /// Command registry.
73 
74  /// Toolbar.
75  wxToolBar* toolbar_;
76 
77  /// GUI element IDs.
78  enum {
79  ID_ADD_SUBMENU = 12000,
84  };
85 
86  /// Event table of the MainFrame.
87  DECLARE_EVENT_TABLE()
88 };
89 #endif
MainFrame::createMenubar
void createMenubar()
Definition: MainFrame.cc:414
MainFrame
Definition: MainFrame.hh:50
MainFrame::ID_ADD_SUBMENU
@ ID_ADD_SUBMENU
Definition: MainFrame.hh:79
MainFrame::ID_VIEW_TOOLBAR
@ ID_VIEW_TOOLBAR
Definition: MainFrame.hh:82
MainFrame::ID_ZOOM_SUBMENU
@ ID_ZOOM_SUBMENU
Definition: MainFrame.hh:81
CommandRegistry
Definition: CommandRegistry.hh:47
MainFrame::ID_ADD_FROM_HDB_SUBMENU
@ ID_ADD_FROM_HDB_SUBMENU
Definition: MainFrame.hh:80
MainFrame::onKeyEvent
void onKeyEvent(wxKeyEvent &event)
Definition: MainFrame.cc:406
MainFrame::updateUI
void updateUI()
Definition: MainFrame.cc:373
MainFrame::commandRegistry_
CommandRegistry * commandRegistry_
Command registry.
Definition: MainFrame.hh:72
MainFrame::onUpdateUI
void onUpdateUI(wxUpdateUIEvent &event)
Definition: MainFrame.cc:338
MainFrame::ID_VIEW_STATUSBAR
@ ID_VIEW_STATUSBAR
Definition: MainFrame.hh:83
MainFrame::toolbar_
wxToolBar * toolbar_
Toolbar.
Definition: MainFrame.hh:75
MainFrame::onCommandEvent
void onCommandEvent(wxCommandEvent &event)
Definition: MainFrame.cc:283
MainFrame::onToggleToolbar
void onToggleToolbar()
Definition: MainFrame.cc:196
MainFrame::createHelpMenu
wxMenu * createHelpMenu()
Definition: MainFrame.cc:260
MainFrame::onToggleStatusbar
void onToggleStatusbar()
Definition: MainFrame.cc:215
MainFrame::MainFrame
MainFrame(wxDocManager *manager, wxFrame *parent, const wxString &title, const wxPoint &position, const wxSize &size, long style)
Definition: MainFrame.cc:118
MainFrame::createToolbar
void createToolbar()
Definition: MainFrame.cc:746
MainFrame::menuAccelerator
wxString menuAccelerator(int id)
Definition: MainFrame.cc:713
MainFrame::OnExit
void OnExit(wxCommandEvent &WXUNUSED(event))
Definition: MainFrame.cc:771
MainFrame::createOptionsMenu
wxMenu * createOptionsMenu()
Definition: MainFrame.cc:237