OpenASIP 2.2
Loading...
Searching...
No Matches
ProximMainFrame.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2016 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 ProximMainFrame.hh
26 *
27 * Declaration of ProximMainFrame class.
28 *
29 * @author Veli-Pekka Jääskeläinen 2005 (vjaaskel-no.spam-cs.tut.fi)
30 * @note rating: red
31 */
32
33#ifndef PROXIM_MAIN_FRAME_HH
34#define PROXIM_MAIN_FRAME_HH
35
36#include <vector>
37#include <wx/wx.h>
38#include <wx/splitter.h>
39#include "SimulatorEvent.hh"
40#include "Exception.hh"
41
42
43class ConsoleWindow;
45class wxProgressDialog;
46
47/**
48 * Main window of the Proxim application.
49 *
50 * ProximMainFrame is the top level window of the Proxim window hierarchy.
51 * This class is responsible for managing the simulation windows. All
52 * simulator backend events are passed to all subwindows. This class is
53 * also responsible for the menubar and executing command registry commands
54 * corresponding to the menu bar item ids. All subwindows are handled as
55 * wxPanels, and the simulator events are passed as custom wxEvents
56 * (see SimulatorEvent class).
57 */
58class ProximMainFrame : public wxFrame {
59public:
61 const wxString& title, const wxPoint& pos, const wxSize& size);
62
63 virtual ~ProximMainFrame();
64
67 void createToolbar();
68 void createMenubar();
69 void reset();
70private:
71 void initialize();
72 void dockWindow(wxWindow* window);
73
74 void onCommandEvent(wxCommandEvent& event);
75 void onToggleWindow(wxCommandEvent& event);
78 void onKeyEvent(wxKeyEvent& event);
79 void onClose(wxCloseEvent& event);
80 void onStatusTimer(wxTimerEvent& event);
81 void onReset(const SimulatorEvent& event);
82 void updateCommand(wxUpdateUIEvent& event);
83 void updateToggleItem(wxUpdateUIEvent& event);
86 wxString menuAccelerator(int id);
87
88 /// Toplevel sizer of the window managing the basic layout.
89 wxBoxSizer* sizer_;
90 /// Top level splitter window of the splitted subwindow hierarchy.
91 wxWindow* topSplitter_;
92 /// List of subwindows where to send the simulator events.
93 std::vector<ProximSimulatorWindow*> subwindows;
94
95 /// Mainframe toolbar.
96 wxToolBar* toolbar_;
97 /// True, if an instance of the stop dialog is currently visible.
99
100 /// Mutex for the resetCondition_.
101 wxMutex* resetMutex_;
102 /// Condition which is signalled when the subwindow reset is complete.
103 wxCondition* resetCondition_;
104
105 /// True if the subwindow reset is complete.
107
108 DECLARE_EVENT_TABLE()
109};
110#endif
void onStatusTimer(wxTimerEvent &event)
std::vector< ProximSimulatorWindow * > subwindows
List of subwindows where to send the simulator events.
void updateCommand(wxUpdateUIEvent &event)
void updateToggleItem(wxUpdateUIEvent &event)
void onReset(const SimulatorEvent &event)
void dockWindow(wxWindow *window)
wxToolBar * toolbar_
Mainframe toolbar.
bool stopDialogInstantiated_
True, if an instance of the stop dialog is currently visible.
wxBoxSizer * sizer_
Toplevel sizer of the window managing the basic layout.
void addSubWindow(ProximSimulatorWindow *window)
void onCommandEvent(wxCommandEvent &event)
wxWindow * topSplitter_
Top level splitter window of the splitted subwindow hierarchy.
void updateMemoryWindowMenuItem()
void onSimulatorTerminated(SimulatorEvent &event)
wxString menuAccelerator(int id)
void onToggleWindow(wxCommandEvent &event)
void onSimulatorEvent(SimulatorEvent &event)
ProximMainFrame(const wxString &title, const wxPoint &pos, const wxSize &size)
virtual ~ProximMainFrame()
void onClose(wxCloseEvent &event)
void onKeyEvent(wxKeyEvent &event)
wxCondition * resetCondition_
Condition which is signalled when the subwindow reset is complete.
void removeSubWindow(ProximSimulatorWindow *window)
wxMutex * resetMutex_
Mutex for the resetCondition_.
bool isReset_
True if the subwindow reset is complete.