OpenASIP 2.2
|
#include <AddressSpacesDialog.hh>
Public Member Functions | |
AddressSpacesDialog (wxWindow *parent, TTAMachine::Machine *machine) | |
~AddressSpacesDialog () | |
Private Types | |
enum | { ID_ADD = 10000 , ID_EDIT , ID_HELP , ID_DELETE , ID_LIST , ID_LINE } |
Private Member Functions | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
TTAMachine::AddressSpace * | selectedAS () |
void | updateASList () |
void | onAdd (wxCommandEvent &event) |
void | onActivateAS (wxListEvent &event) |
void | onEdit (wxCommandEvent &event) |
void | onDelete (wxCommandEvent &event) |
void | onASSelection (wxListEvent &event) |
void | onASRightClick (wxListEvent &event) |
void | setTexts () |
Private Attributes | |
TTAMachine::Machine * | machine_ |
Machine containing the address spaces to list. | |
wxListCtrl * | asList_ |
List control for listing the address spaces. | |
Dialog for listing and editing address spaces of the machine.
Definition at line 48 of file AddressSpacesDialog.hh.
|
private |
AddressSpacesDialog::AddressSpacesDialog | ( | wxWindow * | parent, |
TTAMachine::Machine * | machine | ||
) |
The Constructor.
parent | Parent window of the dialog. |
machine | Machine containing the address spaces. |
Definition at line 81 of file AddressSpacesDialog.cc.
AddressSpacesDialog::~AddressSpacesDialog | ( | ) |
|
private |
Creates the dialog window contents.
This method was generated with wxDesigner, thus the ugly code and too long lines.
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 352 of file AddressSpacesDialog.cc.
References ID_ADD, ID_DELETE, ID_EDIT, ID_HELP, ID_LINE, and ID_LIST.
|
private |
Handles left mouse button double click on the address space list.
Opens the clicked address space in an AddressSpaceDialog.
Definition at line 233 of file AddressSpacesDialog.cc.
References dummy, and onEdit().
|
private |
Creates and shows an address space dialog with default values set for adding an address space.
Definition at line 194 of file AddressSpacesDialog.cc.
References TTAMachine::Machine::addressSpaceNavigator(), ProDeConstants::COMP_NEW_NAME_PREFIX_AS, ModelConstants::DEFAULT_AS_MAU_WIDTH, ModelConstants::DEFAULT_AS_MAX_ADDRESS, ModelConstants::DEFAULT_AS_MIN_ADDRESS, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), machine_, Conversion::toString(), and updateASList().
|
private |
Opens a pop-up menu when right mouse button is pressed on the list.
event | Information about right mouse click event. |
Definition at line 320 of file AddressSpacesDialog.cc.
References asList_, ID_DELETE, ID_EDIT, ProDeTextGenerator::instance(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_LABEL_BUTTON_DELETE, and ProDeTextGenerator::TXT_LABEL_BUTTON_EDIT.
|
private |
Disables and enables Edit and Delete buttons under the address space list.
If an address space is selected, buttons are enabled. If no address space is selected the buttons will be disabled.
Definition at line 280 of file AddressSpacesDialog.cc.
|
private |
Handles the 'Delete' button event.
Deletes the selected address space.
Definition at line 267 of file AddressSpacesDialog.cc.
References selectedAS(), and updateASList().
|
private |
Handles the 'Edit' button event.
Opens an AddressSpaceDialog with the selected address space's attributes set.
Definition at line 246 of file AddressSpacesDialog.cc.
References machine_, selectedAS(), and updateASList().
Referenced by onActivateAS().
|
private |
Returns pointer to the AddressSpace, which is selected on the list.
Definition at line 166 of file AddressSpacesDialog.cc.
References TTAMachine::Machine::addressSpaceNavigator(), asList_, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine_, and WxConversion::toString().
Referenced by onDelete(), and onEdit().
|
private |
Sets texts for widgets.
Definition at line 112 of file AddressSpacesDialog.cc.
References ID_ADD, ID_DELETE, ID_EDIT, ID_HELP, ID_LIST, GUITextGenerator::instance(), ProDeTextGenerator::instance(), WidgetTools::setLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), ProDeTextGenerator::TXT_ADDRESS_SPACES_DIALOG_TITLE, 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_BIT_WIDTH, ProDeTextGenerator::TXT_COLUMN_MAU, ProDeTextGenerator::TXT_COLUMN_MAX_ADDRESS, ProDeTextGenerator::TXT_COLUMN_MIN_ADDRESS, and ProDeTextGenerator::TXT_COLUMN_NAME.
|
private |
Updates the address space list.
Definition at line 295 of file AddressSpacesDialog.cc.
References TTAMachine::Machine::addressSpaceNavigator(), asList_, TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::AddressSpace::end(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine_, TTAMachine::Component::name(), MathTools::requiredBits(), TTAMachine::AddressSpace::start(), WxConversion::toWxString(), and TTAMachine::AddressSpace::width().
Referenced by onAdd(), onDelete(), and onEdit().
|
private |
List control for listing the address spaces.
Definition at line 68 of file AddressSpacesDialog.hh.
Referenced by onASRightClick(), onASSelection(), selectedAS(), and updateASList().
|
private |
Machine containing the address spaces to list.
Definition at line 66 of file AddressSpacesDialog.hh.
Referenced by onAdd(), onEdit(), selectedAS(), and updateASList().