Example #1
0
MOPGAngleProperty::MOPGAngleProperty(const wxString& label, const wxString& name)
: wxEditEnumProperty(label, name), MOPGProperty(MOPGProperty::TYPE_ANGLE) {
	// Set to combo box editor
	//SetEditor(wxPGEditor_ComboBox);

	// Setup combo box choices
	wxArrayString labels;
	wxArrayInt values;
	labels.Add("0: East");
	values.Add(0);
	labels.Add("45: Northeast");
	values.Add(45);
	labels.Add("90: North");
	values.Add(90);
	labels.Add("135: Northwest");
	values.Add(135);
	labels.Add("180: West");
	values.Add(180);
	labels.Add("225: Southwest");
	values.Add(225);
	labels.Add("270: South");
	values.Add(270);
	labels.Add("315: Southeast");
	values.Add(315);

	SetChoices(wxPGChoices(labels, values));
}
Example #2
0
MOPGSPACTriggerProperty::MOPGSPACTriggerProperty(const wxString& label, const wxString& name)
: wxEnumProperty(label, name), MOPGProperty(MOPGProperty::TYPE_SPAC) {
	// Set to combo box editor
	SetEditor(wxPGEditor_ComboBox);

	// Setup combo box choices
	wxArrayString labels = theGameConfiguration->allSpacTriggers();
	SetChoices(wxPGChoices(labels));
}
Example #3
0
/* MOPGStringProperty::setUDMFProp
 * Load a list of possible choices from the given UDMF prop, if any
 *******************************************************************/
void MOPGStringProperty::setUDMFProp(UDMFProperty* prop)
{
	MOPGProperty::setUDMFProp(prop);

	// If this is a soft enum (e.g. renderstyle can be "translucent" or "add",
	// but we don't want to enforce that strictly), use a combobox populated
	// with the possible values
	if (prop && prop->hasPossibleValues())
	{
		const vector<Property> values = prop->getPossibleValues();
		wxPGChoices choices = wxPGChoices();

		for (unsigned n = 0; n < values.size(); n++)
			choices.Add(values[n].getStringValue());

		SetChoices(choices);
		SetEditor(wxPGEditor_ComboBox);
	}
	//else
	//	SetEditor(wxPGEditor_TextCtrl);
}