OpenASIP
2.0
|
#include <IUDialog.hh>
Public Member Functions | |
IUDialog (wxWindow *parent, TTAMachine::ImmediateUnit *immediateUnit) | |
virtual | ~IUDialog () |
Private Types | |
enum | { ID_NAME = 10000, ID_WIDTH, ID_SIZE, ID_EXTENSION, ID_PORT_LIST, ID_ADD_PORT, ID_EDIT_PORT, ID_DELETE_PORT, ID_TEMPLATE_LIST, ID_HELP, ID_LABEL_NAME, ID_LABEL_WIDTH, ID_LABEL_SIZE, ID_LINE } |
enumerated IDs for the dialog controls More... | |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
virtual bool | TransferDataToWindow () |
TTAMachine::Port * | selectedPort () const |
void | onOK (wxCommandEvent &event) |
void | onHelp (wxCommandEvent &event) |
void | onName (wxCommandEvent &event) |
void | onPortSelection (wxListEvent &event) |
void | onPortRightClick (wxListEvent &event) |
void | onAddPort (wxCommandEvent &event) |
void | onActivatePort (wxListEvent &event) |
void | onEditPort (wxCommandEvent &event) |
void | onDeletePort (wxCommandEvent &event) |
void | updatePortList () |
void | updateTemplateList () |
void | setTexts () |
Private Attributes | |
wxStaticBoxSizer * | portListSizer_ |
Sizer containing the port list and associated buttons. More... | |
wxStaticBoxSizer * | templateListSizer_ |
Sizer containing the template list. More... | |
TTAMachine::ImmediateUnit * | immediateUnit_ |
Immediate unit to modify. More... | |
wxString | name_ |
Name of the immediate unit. More... | |
int | size_ |
Number of registers. More... | |
int | width_ |
Width. More... | |
int | cycles_ |
Cycles. More... | |
wxListCtrl * | portList_ |
Port list control. More... | |
wxListCtrl * | templateList_ |
Template list control. More... | |
wxRadioBox * | extensionBox_ |
Radio box for extension. More... | |
Dialog for editing immediate unit parameters.
Definition at line 48 of file IUDialog.hh.
|
private |
enumerated IDs for the dialog controls
Enumerator | |
---|---|
ID_NAME | |
ID_WIDTH | |
ID_SIZE | |
ID_EXTENSION | |
ID_PORT_LIST | |
ID_ADD_PORT | |
ID_EDIT_PORT | |
ID_DELETE_PORT | |
ID_TEMPLATE_LIST | |
ID_HELP | |
ID_LABEL_NAME | |
ID_LABEL_WIDTH | |
ID_LABEL_SIZE | |
ID_LINE |
Definition at line 98 of file IUDialog.hh.
IUDialog::IUDialog | ( | wxWindow * | parent, |
TTAMachine::ImmediateUnit * | immediateUnit | ||
) |
The Constructor.
parent | Parent window of the dialog. |
immediateUnit | Immediate unit to be modified with the dialog. |
Definition at line 81 of file IUDialog.cc.
|
virtual |
|
private |
Creates the dialog window contents.
Code generated by wxDesigner.
parent | The dialog window. |
call_fit | If true, fits the contents inside the dialog. |
set_sizer | If true, sets the main sizer as dialog contents. |
Definition at line 503 of file IUDialog.cc.
|
private |
Handles left mouse button double click on the port list.
Definition at line 389 of file IUDialog.cc.
References dummy.
|
private |
Creates and shows an empty IUPortDialog for adding ports.
Definition at line 351 of file IUDialog.cc.
References ProDeConstants::COMP_NEW_NAME_PREFIX_PORT, and Conversion::toString().
|
private |
Deletes selected port from the port list.
Definition at line 377 of file IUDialog.cc.
References assert.
|
private |
Handles the 'Edit Port' button event.
Opens a IUPortDialog with the selected port's attributes set.
Definition at line 401 of file IUDialog.cc.
|
private |
|
private |
Checks whether name field is empty and disables OK button of the dialog if it is.
Definition at line 310 of file IUDialog.cc.
References assert.
|
private |
Validates input in the controls, and updates the ImmediateUnit.
Definition at line 235 of file IUDialog.cc.
References assert, ProDeTextGenerator::COMP_AN_IMMEDIATE_UNIT, ProDeTextGenerator::COMP_IMMEDIATE_UNIT, ProDeTextGenerator::COMP_MACHINE, TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeConstants::EXTENSION_SIGN, ProDeConstants::EXTENSION_ZERO, ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, TTAMachine::Component::name(), TTAMachine::Machine::SIGN, Texts::TextGenerator::text(), WxConversion::toString(), WxConversion::toWxString(), and TTAMachine::Machine::ZERO.
|
private |
Opens a pop-up menu when right mouse button was pressed.
event | Information about right mouse click event. |
Definition at line 441 of file IUDialog.cc.
|
private |
Disables and enables Edit and Delete buttons under the port list.
If a port is selected, buttons are enabled. If no port is selected the buttons will be disabled.
event | ListEvent, which may have changed the selection. |
Definition at line 424 of file IUDialog.cc.
|
private |
Returns pointer to the port which is selected on the port list.
Definition at line 329 of file IUDialog.cc.
References WxConversion::toString().
|
private |
Sets texts for widgets.
Definition at line 127 of file IUDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), GUITextGenerator::TXT_BUTTON_ADD_DIALOG, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_DELETE, GUITextGenerator::TXT_BUTTON_EDIT_DIALOG, GUITextGenerator::TXT_BUTTON_HELP, GUITextGenerator::TXT_BUTTON_OK, ProDeTextGenerator::TXT_COLUMN_NAME, ProDeTextGenerator::TXT_IU_DIALOG_TITLE, ProDeTextGenerator::TXT_IU_PORTS_BOX, ProDeTextGenerator::TXT_IU_TEMPLATES_BOX, ProDeTextGenerator::TXT_LABEL_EXTENSION, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_LABEL_SIZE, ProDeTextGenerator::TXT_LABEL_WIDTH, ProDeTextGenerator::TXT_RADIO_EXTENSION_SIGN, and ProDeTextGenerator::TXT_RADIO_EXTENSION_ZERO.
|
privatevirtual |
Transfers data from the ImmediateUnit object to the dialog widgets.
Definition at line 201 of file IUDialog.cc.
References assert, ProDeConstants::EXTENSION_SIGN, ProDeConstants::EXTENSION_ZERO, TTAMachine::Machine::SIGN, WxConversion::toWxString(), and TTAMachine::Machine::ZERO.
|
private |
Updates 'Ports' list control.
Clears all items from the choicer and adds all ports.
Definition at line 459 of file IUDialog.cc.
References WxConversion::toWxString().
|
private |
Updates 'Templates' list control.
Definition at line 475 of file IUDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), and WxConversion::toWxString().
|
private |
Cycles.
Definition at line 88 of file IUDialog.hh.
|
private |
Radio box for extension.
Definition at line 95 of file IUDialog.hh.
|
private |
Immediate unit to modify.
Definition at line 80 of file IUDialog.hh.
|
private |
Name of the immediate unit.
Definition at line 82 of file IUDialog.hh.
|
private |
Port list control.
Definition at line 91 of file IUDialog.hh.
|
private |
Sizer containing the port list and associated buttons.
Definition at line 75 of file IUDialog.hh.
|
private |
Number of registers.
Definition at line 84 of file IUDialog.hh.
|
private |
Template list control.
Definition at line 93 of file IUDialog.hh.
|
private |
Sizer containing the template list.
Definition at line 77 of file IUDialog.hh.
|
private |
Width.
Definition at line 86 of file IUDialog.hh.