OpenASIP
2.0
|
#include <InputOperandDialog.hh>
Public Member Functions | |
InputOperandDialog (wxWindow *parent, Operand *operand, int numberOfOperands, int operandIndex) | |
virtual | ~InputOperandDialog () |
Private Types | |
enum | { ID_MEM_ADDRESS = 1000, ID_MEM_DATA, ID_SWAP_LIST, ID_OPERAND_CHOICE, ID_OPERATION_INPUT_TYPES, ID_ADD_BUTTON, ID_DELETE_BUTTON, ID_ELEMENT_WIDTH, ID_ELEMENT_COUNT, ID_TEXT_WIDTH, ID_TEXT_COUNT } |
Private Member Functions | |
InputOperandDialog (const InputOperandDialog &) | |
Copying not allowed. More... | |
InputOperandDialog & | operator= (const InputOperandDialog &) |
Assignment not allowed. More... | |
wxSizer * | createContents (wxWindow *parent, bool call_fit, bool set_sizer) |
virtual bool | TransferDataToWindow () |
void | updateList () |
void | onAddSwap (wxCommandEvent &event) |
void | onDeleteSwap (wxCommandEvent &event) |
void | onSelection (wxListEvent &event) |
void | onOk (wxCommandEvent &event) |
void | updateOperand () |
void | onType (wxCommandEvent &event) |
void | onElementWidth (wxSpinEvent &event) |
void | onElementCount (wxCommandEvent &event) |
void | updateTypes () |
void | updateElementWidths () |
void | updateElementCounts () |
void | setTexts () |
Private Attributes | |
wxListCtrl * | swapList_ |
List of can swap operands. More... | |
wxChoice * | swapChoice_ |
Choice list for can swap operands. More... | |
wxStaticBoxSizer * | swapSizer_ |
Pointer to can swap sizer. More... | |
Operand * | operand_ |
Operand to be created or modified. More... | |
bool | memAddress_ |
Flag indicating if operand is memory address. More... | |
bool | memData_ |
Flag indicating if operand is memory data. More... | |
wxChoice * | inputTypesComboBox_ |
Choice box for operation input types. More... | |
wxSpinCtrl * | elementWidthSpinCtrl_ |
Spin ctrl for operand element width. More... | |
wxChoice * | elementCountChoice_ |
Choice box for operand element count. More... | |
std::set< int > | canSwap_ |
Operands that can be swapped with this operand. More... | |
int | numberOfOperands_ |
Numberof input operands. More... | |
int | index_ |
Index of the input operand currently modified. More... | |
int | type_ |
Current operand type in choice box. More... | |
int | elemWidth_ |
Current element width in choice box. More... | |
int | elemCount_ |
Current element count in choice box. More... | |
std::vector< std::string > | inputTypes_ |
Input types. More... | |
Operand::OperandType | operandTypes_ [9] |
Dialog for adding or modifying input operands.
Definition at line 47 of file InputOperandDialog.hh.
|
private |
Component ids.
Enumerator | |
---|---|
ID_MEM_ADDRESS | |
ID_MEM_DATA | |
ID_SWAP_LIST | |
ID_OPERAND_CHOICE | |
ID_OPERATION_INPUT_TYPES | |
ID_ADD_BUTTON | |
ID_DELETE_BUTTON | |
ID_ELEMENT_WIDTH | |
ID_ELEMENT_COUNT | |
ID_TEXT_WIDTH | |
ID_TEXT_COUNT |
Definition at line 83 of file InputOperandDialog.hh.
InputOperandDialog::InputOperandDialog | ( | wxWindow * | parent, |
Operand * | operand, | ||
int | numberOfOperands, | ||
int | operandIndex | ||
) |
Constructor.
parent | The parent window. |
operand | Operand to be added or modified. |
numberOfOperands | The number of input operands. |
Definition at line 76 of file InputOperandDialog.cc.
References Operand::BOOL, Operand::BOOL_STRING, Operand::DOUBLE_WORD, Operand::DOUBLE_WORD_STRING, Operand::FLOAT_WORD, Operand::FLOAT_WORD_STRING, Operand::HALF_FLOAT_WORD, Operand::HALF_FLOAT_WORD_STRING, Operand::RAW_DATA, Operand::RAW_DATA_STRING, Operand::SINT_WORD, Operand::SINT_WORD_STRING, Operand::SLONG_WORD, Operand::SLONG_WORD_STRING, Operand::UINT_WORD, Operand::UINT_WORD_STRING, Operand::ULONG_WORD, and Operand::ULONG_WORD_STRING.
|
virtual |
Destructor.
Definition at line 142 of file InputOperandDialog.cc.
References DialogPosition::DIALOG_INPUT_OPERAND, and DialogPosition::setPosition().
|
private |
Copying not allowed.
|
private |
Creates the contents of dialog.
NOTE! This function is generated by wxDesigner, that is why it is ugly.
parent | The parent window. |
call_fir | If true, fits the contents of the dialog inside dialog. |
set_sizer | If true, sets the main sizer as the contents of the dialog. |
Definition at line 513 of file InputOperandDialog.cc.
References ID_ADD_BUTTON, ID_DELETE_BUTTON, ID_ELEMENT_COUNT, ID_ELEMENT_WIDTH, ID_MEM_ADDRESS, ID_MEM_DATA, ID_OPERAND_CHOICE, ID_OPERATION_INPUT_TYPES, ID_SWAP_LIST, ID_TEXT_COUNT, ID_TEXT_WIDTH, and swapSizer_.
|
private |
Handles the event when id is added to can swap list.
Definition at line 362 of file InputOperandDialog.cc.
References canSwap_, swapChoice_, Conversion::toInt(), WxConversion::toString(), and updateList().
|
private |
Handles the event when id is deleted from can swap list.
It is also possible to delete multible ids from the list.
Definition at line 375 of file InputOperandDialog.cc.
References canSwap_, swapList_, Conversion::toInt(), WxConversion::toString(), and updateList().
|
private |
Event handler for element count choice box.
Definition at line 224 of file InputOperandDialog.cc.
References elemCount_, elementCountChoice_, and updateElementWidths().
|
private |
Event handler for element width spin ctrl.
Definition at line 214 of file InputOperandDialog.cc.
References elementWidthSpinCtrl_, elemWidth_, and updateElementCounts().
|
private |
Handles the event when OK button is pushed.
Definition at line 413 of file InputOperandDialog.cc.
References updateOperand().
|
private |
Definition at line 494 of file InputOperandDialog.cc.
References ID_DELETE_BUTTON, and swapList_.
Referenced by updateList().
|
private |
Event handler for operand type choice box.
Definition at line 199 of file InputOperandDialog.cc.
References Operand::defaultElementWidth(), elemCount_, elemWidth_, inputTypesComboBox_, type_, updateElementCounts(), and updateElementWidths().
|
private |
Assignment not allowed.
|
private |
Set texts to widgets.
Definition at line 153 of file InputOperandDialog.cc.
References OSEdConstants::DEFAULT_COLUMN_WIDTH, ID_ADD_BUTTON, ID_DELETE_BUTTON, ID_MEM_ADDRESS, ID_MEM_DATA, index_, OSEdTextGenerator::instance(), GUITextGenerator::instance(), WidgetTools::setLabel(), WidgetTools::setWidgetLabel(), swapList_, swapSizer_, Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_BOX_CAN_SWAP, GUITextGenerator::TXT_BUTTON_ADD, GUITextGenerator::TXT_BUTTON_CANCEL, GUITextGenerator::TXT_BUTTON_DELETE, GUITextGenerator::TXT_BUTTON_OK, OSEdTextGenerator::TXT_CHECKBOX_MEM_ADDRESS, OSEdTextGenerator::TXT_CHECKBOX_MEM_DATA, OSEdTextGenerator::TXT_COLUMN_OPERAND, and OSEdTextGenerator::TXT_INPUT_OPERAND_DIALOG_TITLE.
|
privatevirtual |
Transfers data to window.
Definition at line 318 of file InputOperandDialog.cc.
References updateList().
|
private |
Updates the element count choice box list.
Definition at line 294 of file InputOperandDialog.cc.
References elemCount_, elementCountChoice_, elemWidth_, SIMD_WORD_WIDTH, and WxConversion::toWxString().
Referenced by onElementWidth(), and onType().
|
private |
Updates the element width choice box list.
Definition at line 260 of file InputOperandDialog.cc.
References elemCount_, elementWidthSpinCtrl_, elemWidth_, Operand::RAW_DATA, SIMD_WORD_WIDTH, Operand::SINT_WORD, type_, and Operand::UINT_WORD.
Referenced by onElementCount(), and onType().
|
private |
Updates the list of can swap operands.
Definition at line 327 of file InputOperandDialog.cc.
References canSwap_, dummy, ID_ADD_BUTTON, index_, numberOfOperands_, onSelection(), swapChoice_, swapList_, and WxConversion::toWxString().
Referenced by onAddSwap(), onDeleteSwap(), and TransferDataToWindow().
|
private |
Loads the properties to the modified/created operand.
Definition at line 423 of file InputOperandDialog.cc.
References ObjectState::addChild(), Operand::BOOL, Operand::BOOL_STRING, canSwap_, Operand::DOUBLE_WORD, Operand::DOUBLE_WORD_STRING, elemCount_, elemWidth_, Operand::FLOAT_WORD, Operand::FLOAT_WORD_STRING, Operand::HALF_FLOAT_WORD, Operand::HALF_FLOAT_WORD_STRING, inputTypesComboBox_, Operand::loadState(), memAddress_, memData_, numberOfOperands_, operand_, operandTypes_, Operand::OPRND_CAN_SWAP, Operand::OPRND_ELEM_COUNT, Operand::OPRND_ELEM_WIDTH, Operand::OPRND_ID, Operand::OPRND_IN, Operand::OPRND_MEM_ADDRESS, Operand::OPRND_MEM_DATA, Operand::OPRND_TYPE, Operand::RAW_DATA, Operand::RAW_DATA_STRING, ObjectState::setAttribute(), Operand::SINT_WORD, Operand::SINT_WORD_STRING, Operand::SLONG_WORD, Operand::SLONG_WORD_STRING, Operand::UINT_WORD, Operand::UINT_WORD_STRING, Operand::ULONG_WORD, and Operand::ULONG_WORD_STRING.
Referenced by onOk().
|
private |
Updates the type lists.
Definition at line 244 of file InputOperandDialog.cc.
References inputTypes_, inputTypesComboBox_, WxConversion::toWxString(), and type_.
|
private |
Operands that can be swapped with this operand.
Definition at line 116 of file InputOperandDialog.hh.
Referenced by onAddSwap(), onDeleteSwap(), updateList(), and updateOperand().
|
private |
Current element count in choice box.
Definition at line 126 of file InputOperandDialog.hh.
Referenced by onElementCount(), onType(), updateElementCounts(), updateElementWidths(), and updateOperand().
|
private |
Choice box for operand element count.
Definition at line 114 of file InputOperandDialog.hh.
Referenced by onElementCount(), and updateElementCounts().
|
private |
Spin ctrl for operand element width.
Definition at line 112 of file InputOperandDialog.hh.
Referenced by onElementWidth(), and updateElementWidths().
|
private |
Current element width in choice box.
Definition at line 124 of file InputOperandDialog.hh.
Referenced by onElementWidth(), onType(), updateElementCounts(), updateElementWidths(), and updateOperand().
|
private |
Index of the input operand currently modified.
Definition at line 120 of file InputOperandDialog.hh.
Referenced by setTexts(), and updateList().
|
private |
|
private |
Choice box for operation input types.
Definition at line 110 of file InputOperandDialog.hh.
Referenced by onType(), updateOperand(), and updateTypes().
|
private |
Flag indicating if operand is memory address.
Definition at line 106 of file InputOperandDialog.hh.
Referenced by updateOperand().
|
private |
Flag indicating if operand is memory data.
Definition at line 108 of file InputOperandDialog.hh.
Referenced by updateOperand().
|
private |
Numberof input operands.
Definition at line 118 of file InputOperandDialog.hh.
Referenced by updateList(), and updateOperand().
|
private |
Operand to be created or modified.
Definition at line 104 of file InputOperandDialog.hh.
Referenced by updateOperand().
|
private |
Definition at line 131 of file InputOperandDialog.hh.
Referenced by updateOperand().
|
private |
Choice list for can swap operands.
Definition at line 100 of file InputOperandDialog.hh.
Referenced by onAddSwap(), and updateList().
|
private |
List of can swap operands.
Definition at line 98 of file InputOperandDialog.hh.
Referenced by onDeleteSwap(), onSelection(), setTexts(), and updateList().
|
private |
Pointer to can swap sizer.
Definition at line 102 of file InputOperandDialog.hh.
Referenced by createContents(), and setTexts().
|
private |
Current operand type in choice box.
Definition at line 122 of file InputOperandDialog.hh.
Referenced by onType(), updateElementWidths(), and updateTypes().