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); }
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); }
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); }
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); }