Beispiel #1
0
bool MOPGTextureProperty::OnEvent(wxPropertyGrid* propgrid, wxWindow* window, wxEvent& e) {
	if (e.GetEventType() == wxEVT_COMMAND_BUTTON_CLICKED) {
		// Get current texture (if any)
		string tex_current = "";
		if (!IsValueUnspecified())
			tex_current = GetValueAsString();

		// Open map texture browser
		MapTextureBrowser browser(theMapEditor, textype, tex_current);
		if (browser.ShowModal() == wxID_OK && browser.getSelectedItem())
			SetValue(browser.getSelectedItem()->getName());

		// Refresh text
		RefreshEditor();
	}

	return wxStringProperty::OnEvent(propgrid, window, e);
}
Beispiel #2
0
/* MOPGTextureProperty::OnEvent
 * Called when an event is raised for the control
 *******************************************************************/
bool MOPGTextureProperty::OnEvent(wxPropertyGrid* propgrid, wxWindow* window, wxEvent& e)
{
	// '...' button clicked
	if (e.GetEventType() == wxEVT_BUTTON)
	{
		// Get current texture (if any)
		string tex_current = "";
		if (!IsValueUnspecified())
			tex_current = GetValueAsString();

		// Open map texture browser
		MapTextureBrowser browser(theMapEditor, textype, tex_current, &(theMapEditor->mapEditor().getMap()));
		if (browser.ShowModal() == wxID_OK && browser.getSelectedItem())
			GetGrid()->ChangePropertyValue(this, browser.getSelectedItem()->getName());

		// Refresh text
		RefreshEditor();
	}
	
	return wxStringProperty::OnEvent(propgrid, window, e);
}