コード例 #1
0
ファイル: MOPGProperty.cpp プロジェクト: doomtech/slade
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));
}
コード例 #2
0
ファイル: MOPGProperty.cpp プロジェクト: doomtech/slade
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));
}
コード例 #3
0
/*! \brief Write a property value.
 *
 * \param Object wxsPropertyContainer*
 * \param Grid wxPropertyGridManager*
 * \param Id wxPGId
 * \param Index long
 * \return bool
 *
 */
bool wxsEditEnumProperty::PGWrite(wxsPropertyContainer *Object, wxPropertyGridManager *Grid, wxPGId Id, long Index)
{
    wxString Fixed = VALUE;

    Fixed.Replace(_T("\n"), _T("\\n"));
   if ( UpdateEntries )
    {
        #if wxCHECK_VERSION(2, 9, 0)
        wxPGChoices(Id->GetChoices()).Set(Names,Values);
        #else
        Grid->GetPropertyChoices(Id).Set(Names,Values);
        #endif
    }
    Grid->SetPropertyValue(Id, Fixed);
    return true;
}
コード例 #4
0
ファイル: MOPGProperty.cpp プロジェクト: Genghoidal/SLADE
/* 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);
}