MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / setupEditPanel

Method setupEditPanel

plugins/dm.objectives/ComponentsDialog.cpp:131–161  ·  view source on GitHub ↗

Create edit panel

Source from the content-addressed store, hash-verified

129
130// Create edit panel
131void 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
164void ComponentsDialog::populateComponents()

Callers

nothing calls this directly

Calls 6

to_stringFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
AppendMethod · 0.45
getDisplayNameMethod · 0.45
getIdMethod · 0.45

Tested by

no test coverage detected