}
}
- // TODO
+ if( mHandleValueTextLabel )
+ {
+ std::stringstream ss;
+ ss.precision( GetValuePrecision() );
+ ss << std::fixed << clampledValue;
+
+ mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() );
+ }
}
void Slider::SetMarks( const MarkList& marks )
return arrow;
}
-//Toolkit::TextView Slider::CreatePopupText()
-//{
-//}
+Toolkit::TextLabel Slider::CreatePopupText()
+{
+ Toolkit::TextLabel textLabel = Toolkit::TextLabel::New();
+ textLabel.SetParentOrigin( ParentOrigin::CENTER );
+ textLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ textLabel.SetZ( VALUE_DISPLAY_TEXT_Z );
+ return textLabel;
+}
ImageActor Slider::CreatePopup()
{
void Slider::CreateHandleValueDisplay()
{
+ if( mHandle && !mHandleValueTextLabel )
+ {
+ mHandleValueTextLabel = Toolkit::TextLabel::New();
+ mHandleValueTextLabel.SetParentOrigin( ParentOrigin::CENTER );
+ mHandleValueTextLabel.SetAnchorPoint( AnchorPoint::CENTER );
+ mHandleValueTextLabel.SetDrawMode( DrawMode::OVERLAY );
+ mHandle.Add( mHandleValueTextLabel );
+ }
}
void Slider::DestroyHandleValueDisplay()
{
+ UnparentAndReset(mHandleValueTextLabel);
}
void Slider::SetPopupTextColor( const Vector4& color )
void Slider::DisplayPopup( float value )
{
+ // Value displayDoConnectSignal
+ if( mValueTextLabel )
+ {
+ std::stringstream ss;
+ ss.precision( GetValuePrecision() );
+ ss << std::fixed << value;
+ mValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() );
+
+ if( mValueDisplay )
+ {
+ mValueDisplay.SetVisible( true );
+
+ mValueTimer.SetInterval( VALUE_VIEW_SHOW_DURATION );
+ }
+ }
}
void Slider::SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )