OpenASIP  2.0
IUDialog.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 IUDialog.hh
26  *
27  * Declaration of IUDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30  */
31 
32 #ifndef TTA_IU_DIALOG_HH
33 #define TTA_IU_DIALOG_HH
34 
35 #include <wx/wx.h>
36 #include <wx/statline.h>
37 #include <wx/listctrl.h>
38 #include <wx/spinctrl.h>
39 
40 namespace TTAMachine {
41  class ImmediateUnit;
42  class Port;
43 }
44 
45 /**
46  * Dialog for editing immediate unit parameters.
47  */
48 class IUDialog : public wxDialog {
49 public:
50  IUDialog(wxWindow* parent, TTAMachine::ImmediateUnit* immediateUnit);
51  virtual ~IUDialog();
52 
53 private:
54  wxSizer* createContents(
55  wxWindow* parent,
56  bool call_fit,
57  bool set_sizer);
58 
59  virtual bool TransferDataToWindow();
61  void onOK(wxCommandEvent& event);
62  void onHelp(wxCommandEvent& event);
63  void onName(wxCommandEvent& event);
64  void onPortSelection(wxListEvent& event);
65  void onPortRightClick(wxListEvent& event);
66  void onAddPort(wxCommandEvent& event);
67  void onActivatePort(wxListEvent& event);
68  void onEditPort(wxCommandEvent& event);
69  void onDeletePort(wxCommandEvent& event);
70  void updatePortList();
71  void updateTemplateList();
72  void setTexts();
73 
74  /// Sizer containing the port list and associated buttons.
75  wxStaticBoxSizer* portListSizer_;
76  /// Sizer containing the template list.
77  wxStaticBoxSizer* templateListSizer_;
78 
79  /// Immediate unit to modify.
81  /// Name of the immediate unit.
82  wxString name_;
83  /// Number of registers.
84  int size_;
85  /// Width.
86  int width_;
87  /// Cycles.
88  int cycles_;
89 
90  /// Port list control.
91  wxListCtrl* portList_;
92  /// Template list control.
93  wxListCtrl* templateList_;
94  /// Radio box for extension.
95  wxRadioBox* extensionBox_;
96 
97  /// enumerated IDs for the dialog controls
98  enum {
99  ID_NAME = 10000,
113  };
114 
115  /// The event table for the controls of the dialog.
116  DECLARE_EVENT_TABLE()
117 };
118 #endif
IUDialog::updateTemplateList
void updateTemplateList()
Definition: IUDialog.cc:475
IUDialog::~IUDialog
virtual ~IUDialog()
Definition: IUDialog.cc:119
IUDialog::onPortRightClick
void onPortRightClick(wxListEvent &event)
Definition: IUDialog.cc:441
IUDialog::onActivatePort
void onActivatePort(wxListEvent &event)
Definition: IUDialog.cc:389
IUDialog::ID_ADD_PORT
@ ID_ADD_PORT
Definition: IUDialog.hh:104
IUDialog::extensionBox_
wxRadioBox * extensionBox_
Radio box for extension.
Definition: IUDialog.hh:95
IUDialog::IUDialog
IUDialog(wxWindow *parent, TTAMachine::ImmediateUnit *immediateUnit)
Definition: IUDialog.cc:81
IUDialog::ID_TEMPLATE_LIST
@ ID_TEMPLATE_LIST
Definition: IUDialog.hh:107
IUDialog::ID_LABEL_NAME
@ ID_LABEL_NAME
Definition: IUDialog.hh:109
IUDialog::ID_WIDTH
@ ID_WIDTH
Definition: IUDialog.hh:100
IUDialog::name_
wxString name_
Name of the immediate unit.
Definition: IUDialog.hh:82
IUDialog::ID_NAME
@ ID_NAME
Definition: IUDialog.hh:99
IUDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: IUDialog.cc:201
IUDialog::ID_LABEL_WIDTH
@ ID_LABEL_WIDTH
Definition: IUDialog.hh:110
IUDialog::ID_LINE
@ ID_LINE
Definition: IUDialog.hh:112
IUDialog::selectedPort
TTAMachine::Port * selectedPort() const
Definition: IUDialog.cc:329
IUDialog::updatePortList
void updatePortList()
Definition: IUDialog.cc:459
IUDialog::onName
void onName(wxCommandEvent &event)
Definition: IUDialog.cc:310
IUDialog::ID_HELP
@ ID_HELP
Definition: IUDialog.hh:108
IUDialog::ID_DELETE_PORT
@ ID_DELETE_PORT
Definition: IUDialog.hh:106
TTAMachine::Port
Definition: Port.hh:54
IUDialog::ID_PORT_LIST
@ ID_PORT_LIST
Definition: IUDialog.hh:103
IUDialog::setTexts
void setTexts()
Definition: IUDialog.cc:127
IUDialog::ID_EXTENSION
@ ID_EXTENSION
Definition: IUDialog.hh:102
IUDialog::onDeletePort
void onDeletePort(wxCommandEvent &event)
Definition: IUDialog.cc:377
IUDialog::onOK
void onOK(wxCommandEvent &event)
Definition: IUDialog.cc:235
IUDialog::width_
int width_
Width.
Definition: IUDialog.hh:86
IUDialog::ID_EDIT_PORT
@ ID_EDIT_PORT
Definition: IUDialog.hh:105
IUDialog::immediateUnit_
TTAMachine::ImmediateUnit * immediateUnit_
Immediate unit to modify.
Definition: IUDialog.hh:80
IUDialog::portList_
wxListCtrl * portList_
Port list control.
Definition: IUDialog.hh:91
IUDialog
Definition: IUDialog.hh:48
IUDialog::onHelp
void onHelp(wxCommandEvent &event)
IUDialog::ID_SIZE
@ ID_SIZE
Definition: IUDialog.hh:101
IUDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: IUDialog.cc:503
IUDialog::onEditPort
void onEditPort(wxCommandEvent &event)
Definition: IUDialog.cc:401
IUDialog::onPortSelection
void onPortSelection(wxListEvent &event)
Definition: IUDialog.cc:424
IUDialog::size_
int size_
Number of registers.
Definition: IUDialog.hh:84
IUDialog::templateList_
wxListCtrl * templateList_
Template list control.
Definition: IUDialog.hh:93
IUDialog::cycles_
int cycles_
Cycles.
Definition: IUDialog.hh:88
TTAMachine
Definition: Assembler.hh:48
IUDialog::ID_LABEL_SIZE
@ ID_LABEL_SIZE
Definition: IUDialog.hh:111
IUDialog::portListSizer_
wxStaticBoxSizer * portListSizer_
Sizer containing the port list and associated buttons.
Definition: IUDialog.hh:75
IUDialog::onAddPort
void onAddPort(wxCommandEvent &event)
Definition: IUDialog.cc:351
IUDialog::templateListSizer_
wxStaticBoxSizer * templateListSizer_
Sizer containing the template list.
Definition: IUDialog.hh:77
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50