// Constructor ReadablePageReachedComponentEditor::ReadablePageReachedComponentEditor(wxWindow* parent, Component& component) : ComponentEditorBase(parent), _component(&component), _readableSpec(new SpecifierEditCombo(_panel, getChangeCallback(), SpecifierType::SET_READABLE())) { _pageNum = new wxSpinCtrl(_panel, wxID_ANY); _pageNum->SetValue(1); _pageNum->SetRange(0, 65535); _pageNum->Bind(wxEVT_SPINCTRL, [&] (wxSpinEvent& ev) { writeToComponent(); }); wxStaticText* label = new wxStaticText(_panel, wxID_ANY, _("Readable:")); label->SetFont(label->GetFont().Bold()); _panel->GetSizer()->Add(label, 0, wxBOTTOM | wxEXPAND, 6); _panel->GetSizer()->Add(_readableSpec, 0, wxBOTTOM | wxEXPAND, 6); _panel->GetSizer()->Add(new wxStaticText(_panel, wxID_ANY, _("Page Number:")), 0, wxBOTTOM, 6); _panel->GetSizer()->Add(_pageNum, 0, wxBOTTOM | wxEXPAND, 6); // Populate the SpecifierEditCombo with the first specifier _readableSpec->setSpecifier( component.getSpecifier(Specifier::FIRST_SPECIFIER) ); // Initialise the spin button with the value from the first component argument _pageNum->SetValue(string::convert<int>(component.getArgument(0))); }
// Constructor KillComponentEditor::KillComponentEditor(wxWindow* parent, Component& component) : ComponentEditorBase(parent), _component(&component), _targetCombo(new SpecifierEditCombo(_panel, getChangeCallback(), SpecifierType::SET_STANDARD_AI())) { _amount = new wxSpinCtrl(_panel, wxID_ANY); _amount->SetValue(1); _amount->SetRange(0, 65535); _amount->Bind(wxEVT_SPINCTRL, [&] (wxSpinEvent& ev) { writeToComponent(); }); wxStaticText* label = new wxStaticText(_panel, wxID_ANY, _("Kill target:")); label->SetFont(label->GetFont().Bold()); _panel->GetSizer()->Add(label, 0, wxBOTTOM, 6); _panel->GetSizer()->Add(_targetCombo, 0, wxBOTTOM | wxEXPAND, 6); _panel->GetSizer()->Add(new wxStaticText(_panel, wxID_ANY, _("Amount:")), 0, wxBOTTOM, 6); _panel->GetSizer()->Add(_amount, 0, wxBOTTOM, 6); // Populate the SpecifierEditCombo with the first specifier _targetCombo->setSpecifier( component.getSpecifier(Specifier::FIRST_SPECIFIER) ); // Initialise the spin button with the value from the first component argument _amount->SetValue(string::convert<int>(component.getArgument(0))); }
// Constructor ReadableClosedComponentEditor::ReadableClosedComponentEditor(wxWindow* parent, Component& component) : ComponentEditorBase(parent), _component(&component), _readableSpec(new SpecifierEditCombo(_panel, getChangeCallback(), SpecifierType::SET_READABLE())) { wxStaticText* label = new wxStaticText(_panel, wxID_ANY, _("Readable:")); label->SetFont(label->GetFont().Bold()); _panel->GetSizer()->Add(label, 0, wxBOTTOM | wxEXPAND, 6); _panel->GetSizer()->Add(_readableSpec, 0, wxBOTTOM | wxEXPAND, 6); // Populate the SpecifierEditCombo with the first specifier _readableSpec->setSpecifier( component.getSpecifier(Specifier::FIRST_SPECIFIER) ); }