Create edit panel
| 129 | |
| 130 | // Create edit panel |
| 131 | void ComponentsDialog::setupEditPanel() |
| 132 | { |
| 133 | // Table |
| 134 | _editPanel = findNamedObject<wxPanel>(this, "ObjCompComponentEditPanel"); |
| 135 | _editPanel->Enable(false); // disabled at start |
| 136 | |
| 137 | // Component type dropdown |
| 138 | _typeCombo = findNamedObject<wxChoice>(this, "ObjCompComponentType"); |
| 139 | _typeCombo->Connect(wxEVT_CHOICE, wxCommandEventHandler(ComponentsDialog::_onTypeChanged), NULL, this); |
| 140 | |
| 141 | // Populate the combo box. The set is in ID order. |
| 142 | for (ComponentTypeSet::const_iterator i = ComponentType::SET_ALL().begin(); |
| 143 | i != ComponentType::SET_ALL().end(); |
| 144 | ++i) |
| 145 | { |
| 146 | _typeCombo->Append(i->getDisplayName(), new wxStringClientData(string::to_string(i->getId()))); |
| 147 | } |
| 148 | |
| 149 | // Flags hbox |
| 150 | _stateFlag = findNamedObject<wxCheckBox>(this, "ObjCompSatisfiedAtStart"); |
| 151 | _irreversibleFlag = findNamedObject<wxCheckBox>(this, "ObjCompIrreversible"); |
| 152 | _invertedFlag = findNamedObject<wxCheckBox>(this, "ObjCompBooleanNOT"); |
| 153 | _playerResponsibleFlag = findNamedObject<wxCheckBox>(this, "ObjCompPlayerResponsible"); |
| 154 | |
| 155 | _stateFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); |
| 156 | _irreversibleFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); |
| 157 | _invertedFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); |
| 158 | _playerResponsibleFlag->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(ComponentsDialog::_onCompToggleChanged), NULL, this); |
| 159 | |
| 160 | _compEditorPanel = findNamedObject<wxPanel>(this, "ObjCompEditorContainer"); |
| 161 | } |
| 162 | |
| 163 | // Populate the component list |
| 164 | void ComponentsDialog::populateComponents() |