OpenASIP
2.0
|
#include <TemplateListDialog.hh>
Public Member Functions | |
TemplateListDialog (wxWindow *parent, TTAMachine::Machine *machine) | |
virtual | ~TemplateListDialog () |
Private Types | |
enum | { ID_TEMPLATE_LIST = 10000, ID_SLOT_LIST, ID_LINE, ID_HELP, ID_ADD_TEMPLATE, ID_DELETE_TEMPLATE, ID_ADD_SLOT, ID_EDIT_SLOT, ID_DELETE_SLOT, ID_NAME, ID_LABEL_NAME } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
virtual bool | TransferDataToWindow () |
void | updateSlotList () |
void | onTemplateSelection (wxListEvent &event) |
void | onSlotSelection (wxListEvent &event) |
void | onTemplateName (wxCommandEvent &event) |
void | onAddTemplate (wxCommandEvent &event) |
void | onDeleteTemplate (wxCommandEvent &event) |
void | onAddSlot (wxCommandEvent &event) |
void | onEditSlot (wxCommandEvent &event) |
void | onDeleteSlot (wxCommandEvent &event) |
void | setTexts () |
TTAMachine::InstructionTemplate * | selectedTemplate () |
std::string | selectedSlot () |
Private Attributes | |
TTAMachine::Machine * | machine_ |
Parent machine of the instruction templates. More... | |
wxStaticBoxSizer * | templateSizer_ |
Box sizer around the template list. More... | |
wxStaticBoxSizer * | slotSizer_ |
Box sizer around the slot list. More... | |
wxListCtrl * | templateList_ |
Widget for list of templates. More... | |
wxListCtrl * | slotList_ |
Widget for list of slots in the selected template. More... | |
wxString | templateName_ |
Name of the new template. More... | |
Dialog for listing and editing instruction templates in a machine.
Definition at line 50 of file TemplateListDialog.hh.
|
private |
Enumerator | |
---|---|
ID_TEMPLATE_LIST | |
ID_SLOT_LIST | |
ID_LINE | |
ID_HELP | |
ID_ADD_TEMPLATE | |
ID_DELETE_TEMPLATE | |
ID_ADD_SLOT | |
ID_EDIT_SLOT | |
ID_DELETE_SLOT | |
ID_NAME | |
ID_LABEL_NAME |
Definition at line 85 of file TemplateListDialog.hh.
TemplateListDialog::TemplateListDialog | ( | wxWindow * | parent, |
TTAMachine::Machine * | machine | ||
) |
The Constructor.
parent | Parent window of the dialog. |
machine | Parent machine of the instruction templates. |
Definition at line 77 of file TemplateListDialog.cc.
|
virtual |
|
private |
Creates the dialog window contents.
This method was generated with 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 505 of file TemplateListDialog.cc.
|
private |
Handles the add slot button event.
Definition at line 415 of file TemplateListDialog.cc.
References assert, TTAMachine::Machine::Navigator< ComponentType >::count(), ProDeTextGenerator::instance(), TTAMachine::Machine::Navigator< ComponentType >::item(), ProDeTextGenerator::MSG_ERROR_NO_IMMEDIATE_UNITS, ProDeTextGenerator::MSG_ERROR_NO_SLOTS_AVAILABLE, Texts::TextGenerator::text(), and WxConversion::toWxString().
|
private |
Handles the Add tempalte button event.
Adds a new template to the machine.
Definition at line 349 of file TemplateListDialog.cc.
References assert, ProDeTextGenerator::COMP_A_TEMPLATE, ProDeTextGenerator::COMP_MACHINE, ProDeTextGenerator::COMP_TEMPLATE, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), ProDeTextGenerator::instance(), MachineTester::isValidComponentName(), machine, ProDeTextGenerator::MSG_ERROR_ILLEGAL_NAME, ProDeTextGenerator::MSG_ERROR_SAME_NAME, Texts::TextGenerator::text(), WxConversion::toString(), and WxConversion::toWxString().
|
private |
Handles the delete slot button event.
Definition at line 476 of file TemplateListDialog.cc.
|
private |
Deletes the selected template.
Definition at line 302 of file TemplateListDialog.cc.
References dummy.
|
private |
|
private |
Updates the edit/delete slot buttons when the slot selection changes.
Definition at line 287 of file TemplateListDialog.cc.
|
private |
Enables and disables the Add template button when text is entered in the template name widget.
Definition at line 398 of file TemplateListDialog.cc.
References assert.
|
private |
Updates the slot list when the template selection changes.
Definition at line 273 of file TemplateListDialog.cc.
|
private |
Returns name of the selected slot.
Definition at line 337 of file TemplateListDialog.cc.
References WidgetTools::lcStringSelection().
|
private |
Returns pointer to the selected InstructionTemplate.
Definition at line 316 of file TemplateListDialog.cc.
|
private |
Sets texts for widgets.
Definition at line 111 of file TemplateListDialog.cc.
References GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), GUITextGenerator::TXT_BUTTON_ADD, 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_DESTINATION, ProDeTextGenerator::TXT_COLUMN_NAME, ProDeTextGenerator::TXT_COLUMN_SLOT, ProDeTextGenerator::TXT_COLUMN_WIDTH, ProDeTextGenerator::TXT_LABEL_NAME, ProDeTextGenerator::TXT_TEMPLATES_DIALOG_TITLE, ProDeTextGenerator::TXT_TEMPLATES_SLOTS_BOX, and ProDeTextGenerator::TXT_TEMPLATES_TEMPLATES_BOX.
|
privatevirtual |
Transfers data from the machine to the dialog widgets.
Definition at line 183 of file TemplateListDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), and WxConversion::toWxString().
|
private |
Updates the template slot list.
Definition at line 202 of file TemplateListDialog.cc.
References TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::InstructionTemplate::destinationOfSlot(), dummy, TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), TTAMachine::InstructionTemplate::supportedWidth(), WxConversion::toWxString(), and TTAMachine::InstructionTemplate::usesSlot().
|
private |
Parent machine of the instruction templates.
Definition at line 72 of file TemplateListDialog.hh.
|
private |
Widget for list of slots in the selected template.
Definition at line 80 of file TemplateListDialog.hh.
|
private |
Box sizer around the slot list.
Definition at line 76 of file TemplateListDialog.hh.
|
private |
Widget for list of templates.
Definition at line 78 of file TemplateListDialog.hh.
|
private |
Name of the new template.
Definition at line 82 of file TemplateListDialog.hh.
|
private |
Box sizer around the template list.
Definition at line 74 of file TemplateListDialog.hh.