35 #include <wx/valgen.h>
36 #include <boost/format.hpp>
70 wxDialog(parent, -1, _T(""),
72 operand_(operand), memData_(
false), index_(index) {
74 memData_ = operand_->isMemoryData();
75 createContents(
this,
true,
true);
77 outputTypesComboBox_ =
78 dynamic_cast<wxChoice*
>(
FindWindow(ID_OPERATION_OUTPUT_TYPES));
80 elementWidthSpinCtrl_ =
81 dynamic_cast<wxSpinCtrl*
>(
FindWindow(ID_ELEMENT_WIDTH));
84 dynamic_cast<wxChoice*
>(
FindWindow(ID_ELEMENT_COUNT));
86 FindWindow(ID_MEM_DATA)->SetValidator(wxGenericValidator(&memData_));
110 type_ = operand_->type();
111 elemWidth_ = operand_->elementWidth();
112 elemCount_ = operand_->elementCount();
114 updateElementWidths();
115 updateElementCounts();
164 if(!number.ToLong(&value)) {
183 for (
unsigned int i = 0; i <
outputTypes_.size(); i++) {
203 int lastValidWidth = 1;
205 lastValidWidth = elemWidth;
237 int elemCountIndex = 0;
280 TransferDataFromWindow();
352 wxBoxSizer *item0 =
new wxBoxSizer(wxVERTICAL);
354 wxBoxSizer *item1 =
new wxBoxSizer(wxHORIZONTAL);
362 wxChoice *itemOutputTypes =
new wxChoice(parent,
ID_OPERATION_OUTPUT_TYPES, wxDefaultPosition, wxSize(100,-1), 1, strs9);
363 item1->Add(itemOutputTypes, 0, wxALIGN_CENTER|wxALL, 5);
365 wxStaticText *itemTextWidth =
new wxStaticText(parent,
ID_TEXT_WIDTH, wxT(
"Element width:"), wxDefaultPosition, wxDefaultSize, 0);
366 item1->Add(itemTextWidth, 0, wxALIGN_CENTER|wxALL, 5);
367 wxSpinCtrl *itemElemWidth =
new wxSpinCtrl(parent,
ID_ELEMENT_WIDTH, wxT(
""), wxDefaultPosition, wxSize(-1,-1), 1);
368 item1->Add(itemElemWidth, 0, wxALIGN_CENTER|wxALL, 5);
369 wxStaticText *itemTextCount =
new wxStaticText(parent,
ID_TEXT_COUNT, wxT(
"Element count:"), wxDefaultPosition, wxDefaultSize, 0);
370 item1->Add(itemTextCount, 0, wxALIGN_CENTER|wxALL, 5);
371 wxChoice *itemElemCount =
new wxChoice(parent,
ID_ELEMENT_COUNT, wxDefaultPosition, wxSize(70,-1), 1, strs9);
372 item1->Add(itemElemCount, 0, wxALIGN_CENTER|wxALL, 5);
374 wxBoxSizer *item1b =
new wxBoxSizer(wxHORIZONTAL);
375 wxCheckBox *item3 =
new wxCheckBox(parent,
ID_MEM_DATA, wxT(
"Memory data"), wxDefaultPosition, wxDefaultSize, 0);
376 item1b->Add(item3, 0, wxALIGN_CENTER|wxALL, 5);
378 item0->Add(item1, 0, wxALIGN_CENTER|wxALL, 5);
379 item0->Add(item1b, 0, wxALIGN_CENTER|wxALL, 5);
381 wxBoxSizer *item4 =
new wxBoxSizer(wxHORIZONTAL);
383 wxButton *item5 =
new wxButton(parent, wxID_OK, wxT(
"&OK"), wxDefaultPosition, wxDefaultSize, 0);
384 item4->Add(item5, 0, wxALIGN_CENTER|wxALL, 5);
386 wxButton *item6 =
new wxButton(parent, wxID_CANCEL, wxT(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0);
387 item4->Add(item6, 0, wxALIGN_CENTER|wxALL, 5);
389 item0->Add(item4, 0, wxALIGN_CENTER|wxALL, 5);
393 parent->SetSizer(item0);
395 item0->SetSizeHints(parent);