// -----------------------------------------------------------------------
void WxGUIAnimationProperty::OnCustomPaint( wxDC& dc, const wxRect& rect, wxPGPaintData& paintdata )
{
	wxString strAnimationName;

	if ( paintdata.m_choiceItem >= 0 &&
		paintdata.m_choiceItem < (int)m_choices.GetCount())
	{
		int colInd = m_choices[paintdata.m_choiceItem].GetValue();
		strAnimationName = m_choices.GetLabel( colInd );
	}
	else
	{
		strAnimationName = GetValueAsString();
	}

	const wxBitmap* pBitmap = CGUIResourcePool::Instance()->GetAnimationThumbnail( strAnimationName );
	if( pBitmap )
	{
		dc.DrawBitmap ( *pBitmap, rect.x, rect.y, FALSE );
		// Tell the caller how wide we drew.
		paintdata.m_drawnWidth = pBitmap->GetWidth();
	}
	else
	{
		dc.SetBrush ( *wxWHITE_BRUSH );
		dc.DrawRectangle ( rect );
	}
}
status_t
EnumFlagProperty::GetValue(PValue *pval)
{
	if (!pval)
		return B_ERROR;
	
	if (pval->type->ICompare("int") == 0)
	{
		IntValue *i = (IntValue*)pval;
		*i->value = fValue;
	}
	else if (pval->type->ICompare("bool") == 0)
	{
		BoolValue *b = (BoolValue*)pval;
		*b->value = fValue ? true : false;
	}
	else if (pval->type->ICompare("float") == 0)
	{
		FloatValue *f = (FloatValue*)pval;
		*f->value = fValue;
	}
	else if (pval->type->ICompare("string") == 0)
	{
		StringValue *s = (StringValue*)pval;
		*s->value = GetValueAsString();
	}
	else
		return B_BAD_VALUE;
	
	return B_OK;
}
Beispiel #3
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 #4
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);
}
std::string mitk::ShaderProperty::GetShaderName()
{
  return GetValueAsString();
}
NS_IMETHODIMP
nsSVGLength::GetValueString(nsAString& aValue)
{
  return GetValueAsString(aValue);
}