/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/tooltip/tooltip-properties.h>
-#include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
using namespace Dali;
using namespace Dali::Toolkit;
// Add a text label at the top for information purposes
Control label = TextLabel::New( "Hover over buttons to see tooltip" );
- label.SetParentOrigin( ParentOrigin::TOP_CENTER );
- label.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+ label.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ label.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "Center" );
stage.Add( label );
SetLabel( customFromCode, "Custom From Code" );
Layout( customFromCode, stageSize );
customFromCode.SetProperty( DevelControl::Property::TOOLTIP,
- Property::Map().Add( Tooltip::Property::CONTENT,
- Property::Array().Add( Property::Map().Add( Visual::Property::TYPE, Visual::IMAGE )
- .Add( ImageVisual::Property::URL, DEMO_IMAGE_DIR "Logo-for-demo.png" ) )
- .Add( Property::Map().Add( Visual::Property::TYPE, DevelVisual::TEXT )
- .Add( TextVisual::Property::TEXT_COLOR, Color::WHITE )
- .Add( TextVisual::Property::TEXT, "Custom coded style\nat hover point" )
- .Add( TextVisual::Property::MULTI_LINE, true )
- .Add( TextVisual::Property::HORIZONTAL_ALIGNMENT, "CENTER" )
- .Add( TextVisual::Property::POINT_SIZE, 16 ) ) )
- .Add( Tooltip::Property::LAYOUT, Vector2( 2, 1 ) )
- .Add( Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT )
- .Add( Tooltip::Property::BACKGROUND,
- Property::Map().Add( Tooltip::Background::Property::VISUAL, DEMO_IMAGE_DIR "tooltip.9.png" )
- .Add( Tooltip::Background::Property::BORDER, Rect< int >( 1, 5, 5, 1 ) ) )
- );
+ { { Tooltip::Property::CONTENT,
+ Property::Array{ { { { Toolkit::Visual::Property::TYPE, Visual::IMAGE },
+ { ImageVisual::Property::URL, DEMO_IMAGE_DIR "Logo-for-demo.png" } } },
+ { { { Toolkit::Visual::Property::TYPE, Visual::TEXT },
+ { TextVisual::Property::TEXT_COLOR, Color::WHITE },
+ { TextVisual::Property::TEXT, "Custom coded style\nat hover point" },
+ { TextVisual::Property::MULTI_LINE, true },
+ { TextVisual::Property::HORIZONTAL_ALIGNMENT, "CENTER" },
+ { TextVisual::Property::POINT_SIZE, 16 } } } } },
+ { Tooltip::Property::LAYOUT, Vector2( 2, 1 ) },
+ { Tooltip::Property::POSITION, Tooltip::Position::HOVER_POINT },
+ { Tooltip::Property::BACKGROUND,
+ { { Tooltip::Background::Property::VISUAL, DEMO_IMAGE_DIR "tooltip.9.png" },
+ { Tooltip::Background::Property::BORDER, Rect< int >( 1, 5, 5, 1 ) } } }
+ } );
stage.Add( customFromCode );
}
if( control )
{
control.SetProperty( Button::Property::LABEL,
- Property::Map().Add( Visual::Property::TYPE, DevelVisual::TEXT )
+ Property::Map().Add( Toolkit::Visual::Property::TYPE, Visual::TEXT )
.Add( TextVisual::Property::TEXT, label ) );
}
}
{
previousPosition += POSITION_INCREMENTER;
control.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- control.SetSizeModeFactor( Vector3( 0.75, 0.1, 1.0 ) );
- control.SetAnchorPoint( AnchorPoint::CENTER );
- control.SetParentOrigin( ParentOrigin::TOP_CENTER );
- control.SetY( stageSize.height * previousPosition );
+ control.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( 0.75, 0.1, 1.0 ) );
+ control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER );
+ control.SetProperty( Actor::Property::POSITION_Y, stageSize.height * previousPosition );
}
}