Exemplo n.º 1
0
float
TableCellFloatRenderer::PreferredValueWidth(Value* _value, BView* targetView)
{
	FloatValue* value = dynamic_cast<FloatValue*>(_value);
	if (value == NULL)
		return 0;

	char buffer[64];
	snprintf(buffer, sizeof(buffer), "%g", value->GetValue());

	return TableCellValueRendererUtils::PreferredStringWidth(targetView,
		buffer);
}
Exemplo n.º 2
0
void
TableCellFloatRenderer::RenderValue(Value* _value, BRect rect, BView* targetView)
{
	FloatValue* value = dynamic_cast<FloatValue*>(_value);
	if (value == NULL)
		return;

	char buffer[64];
	snprintf(buffer, sizeof(buffer), "%g", value->GetValue());

	TableCellValueRendererUtils::DrawString(targetView, rect, buffer,
		B_ALIGN_RIGHT, true);
}
Exemplo n.º 3
0
void PS::CPEDef::CollisionCutoffOnDraw(PropValue* sender, xr_string& draw_val)
{    
	FloatValue* V	= dynamic_cast<FloatValue*>(sender); VERIFY(V);
	draw_sprintf(draw_val,_sqrt(V->GetValue()),V->dec);
}
Exemplo n.º 4
0
void PS::CPEDef::CollisionFrictionOnDraw(PropValue* sender, xr_string& draw_val)
{    
	FloatValue* V	= dynamic_cast<FloatValue*>(sender); VERIFY(V);
	draw_sprintf(draw_val,1.f-V->GetValue(),V->dec);
}