OpenASIP  2.0
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  */
46  EditorCommand(ProDeConstants::CMD_NAME_EDIT_OPTIONS) {
47 
48 }
49 
50 
51 /**
52  * The Destructor.
53  */
55 }
56 
57 
58 /**
59  * Executes the command.
60  *
61  * @return True, if the command was succesfully executed, false otherwise.
62  */
63 bool
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
86 }
87 
88 
89 /**
90  * Creates and returns a new instance of this command.
91  *
92  * @return Newly created instance of this command.
93  */
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
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
119 }
120 
121 
122 /**
123  * This command is always executable.
124  *
125  * @return Always true.
126  */
127 bool
129  return true;
130 }
ProDeConstants::CMD_ICON_EDIT_OPTIONS
static const std::string CMD_ICON_EDIT_OPTIONS
Icon location for the "Edit Options" command.
Definition: ProDeConstants.hh:320
EditOptionsCmd
Definition: EditOptionsCmd.hh:42
ProDe.hh
EditOptionsCmd::shortName
virtual std::string shortName() const
Definition: EditOptionsCmd.cc:106
EditOptionsCmd::id
virtual int id() const
Definition: EditOptionsCmd.cc:84
ProDeConstants::COMMAND_EDIT_OPTIONS
@ COMMAND_EDIT_OPTIONS
Definition: ProDeConstants.hh:462
ProDeOptionsDialog
Definition: ProDeOptionsDialog.hh:48
EditOptionsCmd.hh
EditOptionsCmd::~EditOptionsCmd
virtual ~EditOptionsCmd()
Definition: EditOptionsCmd.cc:54
EditOptionsCmd::Do
virtual bool Do()
Definition: EditOptionsCmd.cc:64
ProDeConstants::CMD_SNAME_EDIT_OPTIONS
static const std::string CMD_SNAME_EDIT_OPTIONS
Command name for the "Edit Options" command.
Definition: ProDeConstants.hh:256
EditOptionsCmd::create
virtual EditOptionsCmd * create() const
Definition: EditOptionsCmd.cc:95
ProDeConstants.hh
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
EditOptionsCmd::isEnabled
virtual bool isEnabled()
Definition: EditOptionsCmd.cc:128
MainFrame.hh
ProDeOptions.hh
EditOptionsCmd::EditOptionsCmd
EditOptionsCmd()
Definition: EditOptionsCmd.cc:45
EditorCommand
Definition: EditorCommand.hh:46
EditOptionsCmd::icon
virtual std::string icon() const
Definition: EditOptionsCmd.cc:117
ProDeConstants
Definition: ProDeConstants.hh:43
ProDeOptionsDialog.hh
GUICommand::parentWindow
wxWindow * parentWindow() const
Definition: GUICommand.cc:75