const float VALUE_POPUP_MARGIN = 10.0f;
const float VALUE_POPUP_HEIGHT = 81.0f;
const float VALUE_POPUP_MIN_WIDTH = 54.0f;
+const Vector2 VALUE_POPUP_ARROW_SIZE( 18.0f, 18.0f );
const float DEFAULT_LOWER_BOUND = 0.0f;
const float DEFAULT_UPPER_BOUND = 1.0f;
void Slider::OnSizeSet( const Vector3& size )
{
-}
-
-void Slider::OnRelayout( const Vector2& size, RelayoutContainer& container )
-{
+ // Factor in handle overshoot into size of track
SetHitRegion( Vector2( size.x, GetHitRegion().y ) );
- // Factor in handle overshoot into size of backing
SetTrackRegion( Vector2( size.x - GetHandleSize().x, GetTrackRegion().y ) );
- Control::OnRelayout( size, container );
}
bool Slider::OnTouch(Actor actor, const TouchData& touch)
Toolkit::ImageView Slider::CreateTrack()
{
Toolkit::ImageView track = Toolkit::ImageView::New();
- track.SetName("SliderTrack");
track.SetParentOrigin( ParentOrigin::CENTER );
track.SetAnchorPoint( AnchorPoint::CENTER );
+
return track;
}
Toolkit::ImageView Slider::CreateProgress()
{
Toolkit::ImageView progress = Toolkit::ImageView::New();
- progress.SetName("SliderProgress");
progress.SetParentOrigin( ParentOrigin::CENTER_LEFT );
progress.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
Toolkit::ImageView Slider::CreateHandle()
{
Toolkit::ImageView handle = Toolkit::ImageView::New();
- handle.SetName("SliderHandle");
handle.SetParentOrigin( ParentOrigin::CENTER_LEFT );
handle.SetAnchorPoint( AnchorPoint::CENTER );
Toolkit::ImageView Slider::CreatePopupArrow()
{
Toolkit::ImageView arrow = Toolkit::ImageView::New();
- arrow.SetStyleName("SliderPopupArrow");
- arrow.SetName("SliderPopupArrow");
arrow.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
arrow.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
Toolkit::TextLabel Slider::CreatePopupText()
{
Toolkit::TextLabel textLabel = Toolkit::TextLabel::New();
- textLabel.SetName( "SliderPopupTextLabel" );
- textLabel.SetStyleName( "SliderPopupTextLabel" );
textLabel.SetParentOrigin( ParentOrigin::CENTER );
textLabel.SetAnchorPoint( AnchorPoint::CENTER );
textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Toolkit::ImageView Slider::CreatePopup()
{
Toolkit::ImageView popup = Toolkit::ImageView::New();
- popup.SetName( "SliderPopup" );
popup.SetParentOrigin( ParentOrigin::TOP_CENTER );
popup.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH );
if( mHandle && !mHandleValueTextLabel )
{
mHandleValueTextLabel = Toolkit::TextLabel::New();
- mHandleValueTextLabel.SetName("SliderHandleTextLabel");
- mHandleValueTextLabel.SetStyleName("SliderHandleTextLabel");
mHandleValueTextLabel.SetParentOrigin( ParentOrigin::CENTER );
mHandleValueTextLabel.SetAnchorPoint( AnchorPoint::CENTER );
mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
{
"pointSize":25
},
- "radiobutton":
- {
- "unselectedStateImage":"{DALI_IMAGE_DIR}radio-button-unselected.png",
- "selectedStateImage":"{DALI_IMAGE_DIR}radio-button-selected.png",
- "disabledUnselectedStateImage":"{DALI_IMAGE_DIR}radio-button-unselected-disabled.png",
- "disabledSelectedStateImage":"{DALI_IMAGE_DIR}radio-button-selected-disabled.png"
- },
"textfield":
{
"confirmationpopup":
{
"popupBackgroundImage":"{DALI_IMAGE_DIR}00_popup_bg.9.png"
- },
- "slider":
- {
- "showPopup": true,
- "showValue": true,
- "valuePrecision": 0,
- "trackVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin.9.png",
- "size":[27,27]
- },
- "progressVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin-progress.9.png",
- "size":[27,27]
- },
- "handleVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin-handle.png",
- "size":[72,72]
- },
- "popupVisual":"{DALI_IMAGE_DIR}slider-popup.9.png",
- "popupArrowVisual":"{DALI_IMAGE_DIR}slider-popup-arrow.9.png",
- "disableColor":[0.5, 0.5, 0.5, 1.0],
- "popupTextColor":[0.5,0.5,0.5,1.0],
- "hitRegion":[0, 72],
- "marks":[],
- "snapToMarks":false,
- "markTolerance":0.05
- },
- "SliderHandleTextLabel":
- {
- "textColor":[0.8,0.8,1,1]
}
}
}
{
"pointSize":25
},
- "radiobutton":
- {
- "unselectedStateImage":"{DALI_IMAGE_DIR}radio-button-unselected.png",
- "selectedStateImage":"{DALI_IMAGE_DIR}radio-button-selected.png",
- "disabledUnselectedStateImage":"{DALI_IMAGE_DIR}radio-button-unselected-disabled.png",
- "disabledSelectedStateImage":"{DALI_IMAGE_DIR}radio-button-selected-disabled.png"
- },
"textfield":
{
"grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
"selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
"selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" }
- },
- "popup":
- {
- "popupBackgroundImage":"{DALI_IMAGE_DIR}00_popup_bg.9.png"
- },
- "confirmationpopup":
- {
- "popupBackgroundImage":"{DALI_IMAGE_DIR}00_popup_bg.9.png"
- },
- "slider":
- {
- "showPopup": true,
- "showValue": true,
- "valuePrecision": 0,
- "trackVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin.9.png",
- "size":[27,27]
- },
- "progressVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin-progress.9.png",
- "size":[27,27]
- },
- "handleVisual":{
- "url":"{DALI_IMAGE_DIR}slider-skin-handle.png",
- "size":[72,72]
- },
- "popupVisual":"{DALI_IMAGE_DIR}slider-popup.9.png",
- "popupArrowVisual":"{DALI_IMAGE_DIR}slider-popup-arrow.9.png",
- "disableColor":[0.5, 0.5, 0.5, 1.0],
- "popupTextColor":[0.5,0.5,0.5,1.0],
- "hitRegion":[0, 72],
- "marks":[],
- "snapToMarks":false,
- "markTolerance":0.05
- },
- "SliderHandleTextLabel":
- {
- "textColor":[0.8,0.8,1,1]
}
}
}