OpenASIP
2.2
Loading...
Searching...
No Matches
src
procgen
ProDe
EditOptionsCmd.cc
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 EditOptionsCmd.cc
26
*
27
* Implementation of EditOptionsCmd class.
28
*
29
* @author Veli-Pekka Jääskeläinen (vjaaskel-no.spam-cs.tut.fi)
30
* @note rating: red
31
*/
32
33
#include "
EditOptionsCmd.hh
"
34
#include "
ProDeOptionsDialog.hh
"
35
#include "
ProDeConstants.hh
"
36
#include "
ProDeOptions.hh
"
37
#include "
ProDe.hh
"
38
#include "
MainFrame.hh
"
39
40
using
std::string;
41
42
/**
43
* The Constructor.
44
*/
45
EditOptionsCmd::EditOptionsCmd
():
46
EditorCommand
(
ProDeConstants
::CMD_NAME_EDIT_OPTIONS) {
47
48
}
49
50
51
/**
52
* The Destructor.
53
*/
54
EditOptionsCmd::~EditOptionsCmd
() {
55
}
56
57
58
/**
59
* Executes the command.
60
*
61
* @return True, if the command was succesfully executed, false otherwise.
62
*/
63
bool
64
EditOptionsCmd::Do
() {
65
66
ProDeOptionsDialog
dialog(
67
parentWindow
(), *wxGetApp().
options
(), *wxGetApp().commandRegistry());
68
if
(dialog.ShowModal() == wxID_OK) {
69
if
(wxGetApp().
options
()->toolbarVisibility()) {
70
wxGetApp().mainFrame()->createToolbar();
71
wxGetApp().mainFrame()->createMenubar();
72
}
73
}
74
return
true
;
75
}
76
77
78
/**
79
* Returns id of this command.
80
*
81
* @return ID for this command to be used in menus and toolbars.
82
*/
83
int
84
EditOptionsCmd::id
()
const
{
85
return
ProDeConstants::COMMAND_EDIT_OPTIONS
;
86
}
87
88
89
/**
90
* Creates and returns a new instance of this command.
91
*
92
* @return Newly created instance of this command.
93
*/
94
EditOptionsCmd
*
95
EditOptionsCmd::create
()
const
{
96
return
new
EditOptionsCmd
();
97
}
98
99
100
/**
101
* Returns short version of the command name.
102
*
103
* @return Short name of the command to be used in the toolbar.
104
*/
105
string
106
EditOptionsCmd::shortName
()
const
{
107
return
ProDeConstants::CMD_SNAME_EDIT_OPTIONS
;
108
}
109
110
111
/**
112
* Returns path to the command's icon file.
113
*
114
* @return Full path to the command's icon file.
115
*/
116
string
117
EditOptionsCmd::icon
()
const
{
118
return
ProDeConstants::CMD_ICON_EDIT_OPTIONS
;
119
}
120
121
122
/**
123
* This command is always executable.
124
*
125
* @return Always true.
126
*/
127
bool
128
EditOptionsCmd::isEnabled
() {
129
return
true
;
130
}
EditOptionsCmd.hh
options
static MachInfoCmdLineOptions options
Definition
MachInfo.cc:46
MainFrame.hh
ProDeConstants.hh
ProDeOptionsDialog.hh
ProDeOptions.hh
ProDe.hh
EditOptionsCmd
Definition
EditOptionsCmd.hh:42
EditOptionsCmd::create
virtual EditOptionsCmd * create() const
Definition
EditOptionsCmd.cc:95
EditOptionsCmd::icon
virtual std::string icon() const
Definition
EditOptionsCmd.cc:117
EditOptionsCmd::EditOptionsCmd
EditOptionsCmd()
Definition
EditOptionsCmd.cc:45
EditOptionsCmd::Do
virtual bool Do()
Definition
EditOptionsCmd.cc:64
EditOptionsCmd::id
virtual int id() const
Definition
EditOptionsCmd.cc:84
EditOptionsCmd::shortName
virtual std::string shortName() const
Definition
EditOptionsCmd.cc:106
EditOptionsCmd::~EditOptionsCmd
virtual ~EditOptionsCmd()
Definition
EditOptionsCmd.cc:54
EditOptionsCmd::isEnabled
virtual bool isEnabled()
Definition
EditOptionsCmd.cc:128
EditorCommand
Definition
EditorCommand.hh:46
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition
GUICommand.cc:75
ProDeConstants
Definition
ProDeConstants.hh:43
ProDeConstants::CMD_ICON_EDIT_OPTIONS
static const std::string CMD_ICON_EDIT_OPTIONS
Icon location for the "Edit Options" command.
Definition
ProDeConstants.hh:320
ProDeConstants::COMMAND_EDIT_OPTIONS
@ COMMAND_EDIT_OPTIONS
Definition
ProDeConstants.hh:462
ProDeConstants::CMD_SNAME_EDIT_OPTIONS
static const std::string CMD_SNAME_EDIT_OPTIONS
Command name for the "Edit Options" command.
Definition
ProDeConstants.hh:256
ProDeOptionsDialog
Definition
ProDeOptionsDialog.hh:48
Generated by
1.9.8