OpenASIP 2.2
Loading...
Searching...
No Matches
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
39class 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 */
50class MainFrame : public wxDocMDIParentFrame {
51public:
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
63private:
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 {
84 };
85
86 /// Event table of the MainFrame.
87 DECLARE_EVENT_TABLE()
88};
89#endif
CommandRegistry * commandRegistry_
Command registry.
Definition MainFrame.hh:72
wxMenu * createOptionsMenu()
Definition MainFrame.cc:237
@ ID_ADD_FROM_HDB_SUBMENU
Definition MainFrame.hh:80
@ ID_VIEW_STATUSBAR
Definition MainFrame.hh:83
@ ID_ZOOM_SUBMENU
Definition MainFrame.hh:81
@ ID_ADD_SUBMENU
Definition MainFrame.hh:79
@ ID_VIEW_TOOLBAR
Definition MainFrame.hh:82
wxToolBar * toolbar_
Toolbar.
Definition MainFrame.hh:75
wxMenu * createHelpMenu()
Definition MainFrame.cc:260
wxString menuAccelerator(int id)
Definition MainFrame.cc:713
void onKeyEvent(wxKeyEvent &event)
Definition MainFrame.cc:406
void onToggleStatusbar()
Definition MainFrame.cc:215
void createMenubar()
Definition MainFrame.cc:414
void updateUI()
Definition MainFrame.cc:373
void createToolbar()
Definition MainFrame.cc:746
void onToggleToolbar()
Definition MainFrame.cc:196
void OnExit(wxCommandEvent &WXUNUSED(event))
Definition MainFrame.cc:771
void onUpdateUI(wxUpdateUIEvent &event)
Definition MainFrame.cc:338
void onCommandEvent(wxCommandEvent &event)
Definition MainFrame.cc:283