Commit 214f363041053a01ead590d0527dc6c08f7fe961

Authored by Xiangyin Ma
1 parent 7a4fb5b4

Remove the usage of deprecated Button APIS

Exclude SetLabelText() which will be replaced after the LABEL property supports both MAP and STRING type.

Change-Id: I7aae9bdacbe85ff8b07f0e0ac122db2f50bf24bc
Showing 31 changed files with 322 additions and 240 deletions
examples/animated-images/animated-images-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -16,6 +16,7 @@
16 16 */
17 17  
18 18 #include <dali-toolkit/dali-toolkit.h>
  19 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
19 20  
20 21 #include "shared/utility.h"
21 22  
... ... @@ -87,8 +88,8 @@ public:
87 88  
88 89 // Create a push button, and add it as child of the image view
89 90 Toolkit::PushButton animateButton = Toolkit::PushButton::New();
90   - animateButton.SetUnselectedImage( PLAY_ICON );
91   - animateButton.SetSelectedImage( PLAY_ICON_SELECTED );
  91 + animateButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON );
  92 + animateButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED );
92 93 animateButton.SetParentOrigin( ParentOrigin::CENTER );
93 94 animateButton.SetAnchorPoint( AnchorPoint::CENTER );
94 95 animateButton.ClickedSignal().Connect( this, &AnimatedImageController::OnPlayButtonClicked );
... ...
examples/atlas/atlas-example.cpp
1 1 /*
2   - * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -17,6 +17,7 @@
17 17  
18 18 #include <dali/dali.h>
19 19 #include <dali/devel-api/images/atlas.h>
  20 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
20 21  
21 22 #include "shared/view.h"
22 23 #include <iostream>
... ... @@ -72,8 +73,8 @@ public:
72 73 "Atlas" );
73 74  
74 75 mLoseContextButton = Toolkit::PushButton::New();
75   - mLoseContextButton.SetUnselectedImage( LOSE_CONTEXT_IMAGE );
76   - mLoseContextButton.SetSelectedImage( LOSE_CONTEXT_IMAGE_SELECTED );
  76 + mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE );
  77 + mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE_SELECTED );
77 78 mLoseContextButton.ClickedSignal().Connect( this, &AtlasController::OnLoseContextButtonClicked );
78 79 mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
79 80  
... ...
examples/bubble-effect/bubble-effect-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -18,6 +18,7 @@
18 18 #include <dali/dali.h>
19 19 #include <dali-toolkit/dali-toolkit.h>
20 20 #include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
  21 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
21 22 #include "shared/view.h"
22 23 #include "shared/utility.h"
23 24  
... ... @@ -108,8 +109,8 @@ private:
108 109  
109 110 // Add a button to change background. (right of toolbar)
110 111 mChangeBackgroundButton = Toolkit::PushButton::New();
111   - mChangeBackgroundButton.SetUnselectedImage( CHANGE_BACKGROUND_ICON );
112   - mChangeBackgroundButton.SetSelectedImage( CHANGE_BACKGROUND_ICON_SELECTED );
  112 + mChangeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON );
  113 + mChangeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON_SELECTED );
113 114 mChangeBackgroundButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked );
114 115 toolBar.AddControl( mChangeBackgroundButton,
115 116 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ... @@ -117,8 +118,8 @@ private:
117 118 DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
118 119 // Add a button to change bubble shape. ( left of bar )
119 120 mChangeBubbleShapeButton = Toolkit::PushButton::New();
120   - mChangeBubbleShapeButton.SetUnselectedImage( CHANGE_BUBBLE_SHAPE_ICON );
121   - mChangeBubbleShapeButton.SetSelectedImage( CHANGE_BUBBLE_SHAPE_ICON_SELECTED );
  121 + mChangeBubbleShapeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BUBBLE_SHAPE_ICON );
  122 + mChangeBubbleShapeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BUBBLE_SHAPE_ICON_SELECTED );
122 123 mChangeBubbleShapeButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked );
123 124 toolBar.AddControl( mChangeBubbleShapeButton,
124 125 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ...
examples/builder/examples.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -25,6 +25,7 @@
25 25 #include <dali-toolkit/devel-api/builder/builder.h>
26 26 #include <dali-toolkit/devel-api/builder/tree-node.h>
27 27 #include <dali-toolkit/devel-api/builder/json-parser.h>
  28 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
28 29 #include <dali-toolkit/devel-api/controls/popup/popup.h>
29 30 #include <dali-toolkit/devel-api/controls/navigation-view/navigation-view.h>
30 31  
... ... @@ -472,8 +473,8 @@ public:
472 473  
473 474 // Create an edit mode button. (left of toolbar)
474 475 Toolkit::PushButton backButton = Toolkit::PushButton::New();
475   - backButton.SetUnselectedImage( EDIT_IMAGE );
476   - backButton.SetSelectedImage( EDIT_IMAGE_SELECTED );
  476 + backButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE );
  477 + backButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED );
477 478 backButton.ClickedSignal().Connect( this, &ExampleApp::OnBackButtonPressed);
478 479 backButton.SetLeaveRequired( true );
479 480 mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ...
examples/buttons/buttons-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -164,7 +164,7 @@ class ButtonsController: public ConnectionTracker
164 164 mRadioButtonImage1.SetParentOrigin( ParentOrigin::TOP_LEFT );
165 165 mRadioButtonImage1.SetAnchorPoint( AnchorPoint::TOP_LEFT );
166 166 mRadioButtonImage1.SetPosition( 0, DP(radioY) );
167   - mRadioButtonImage1.SetSelected( true );
  167 + mRadioButtonImage1.SetProperty( Toolkit::Button::Property::SELECTED, true );
168 168  
169 169 imageSelectTableView.AddChild( mRadioButtonImage1, Toolkit::TableView::CellPosition( 0, 0 ) );
170 170 imageSelectTableView.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
... ... @@ -267,7 +267,7 @@ class ButtonsController: public ConnectionTracker
267 267 radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
268 268 radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
269 269 radioButton.SetPosition( 0, 0 );
270   - radioButton.SetSelected( true );
  270 + radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
271 271  
272 272 radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton );
273 273  
... ... @@ -315,7 +315,8 @@ class ButtonsController: public ConnectionTracker
315 315 mCheckboxButton2 = Toolkit::CheckBoxButton::New();
316 316 mCheckboxButton2.SetName( "checkbox2" );
317 317 mCheckboxButton2.SetLabelText( "CheckBox2 is selected" );
318   - mCheckboxButton2.SetSelected( true );
  318 + mCheckboxButton2.SetProperty( Toolkit::Button::Property::SELECTED, true );
  319 +
319 320 mCheckboxButton2.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
320 321 mCheckboxButton2.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
321 322  
... ... @@ -347,7 +348,7 @@ class ButtonsController: public ConnectionTracker
347 348 contentTable.Add( toggleBackground );
348 349  
349 350 mToggleButton = Toolkit::PushButton::New();
350   - mToggleButton.SetTogglableButton( true );
  351 + mToggleButton.SetProperty( Toolkit::Button::Property::TOGGLABLE, true );
351 352 mToggleButton.SetLabelText( "Unselected" );
352 353 mToggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
353 354 mToggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
... ... @@ -373,7 +374,8 @@ class ButtonsController: public ConnectionTracker
373 374 Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button );
374 375 if( pushButton )
375 376 {
376   - if( button.IsSelected() )
  377 + bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
  378 + if( isSelected )
377 379 {
378 380 pushButton.SetLabelText( "Selected" );
379 381 }
... ... @@ -388,33 +390,39 @@ class ButtonsController: public ConnectionTracker
388 390  
389 391 bool EnableSelectButton( Toolkit::Button button )
390 392 {
391   - if( button.GetName() == "radioSelectEnable" && button.IsSelected() == true )
  393 + bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
  394 + if( !isSelected )
  395 + {
  396 + return true;
  397 + }
  398 +
  399 + if( button.GetName() == "radioSelectEnable" )
392 400 {
393   - mUpdateButton.SetDisabled( false );
  401 + mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, false );
394 402  
395   - mRadioButtonImage1.SetDisabled( false );
396   - mRadioButtonImage2.SetDisabled( false );
397   - mRadioButtonImage3.SetDisabled( false );
  403 + mRadioButtonImage1.SetProperty( Toolkit::Button::Property::DISABLED, false );
  404 + mRadioButtonImage2.SetProperty( Toolkit::Button::Property::DISABLED, false );
  405 + mRadioButtonImage3.SetProperty( Toolkit::Button::Property::DISABLED, false );
398 406  
399   - mCheckboxButton1.SetDisabled( false );
400   - mCheckboxButton2.SetDisabled( false );
401   - mCheckboxButton3.SetDisabled( false );
  407 + mCheckboxButton1.SetProperty( Toolkit::Button::Property::DISABLED, false );
  408 + mCheckboxButton2.SetProperty( Toolkit::Button::Property::DISABLED, false );
  409 + mCheckboxButton3.SetProperty( Toolkit::Button::Property::DISABLED, false );
402 410  
403   - mToggleButton.SetDisabled( false );
  411 + mToggleButton.SetProperty( Toolkit::Button::Property::DISABLED, false );
404 412 }
405   - else if( button.GetName() == "radioSelectDisable" && button.IsSelected() == true )
  413 + else if( button.GetName() == "radioSelectDisable" )
406 414 {
407   - mUpdateButton.SetDisabled( true );
  415 + mUpdateButton.SetProperty( Toolkit::Button::Property::DISABLED, true );
408 416  
409   - mRadioButtonImage1.SetDisabled( true );
410   - mRadioButtonImage2.SetDisabled( true );
411   - mRadioButtonImage3.SetDisabled( true );
  417 + mRadioButtonImage1.SetProperty( Toolkit::Button::Property::DISABLED, true );
  418 + mRadioButtonImage2.SetProperty( Toolkit::Button::Property::DISABLED, true );
  419 + mRadioButtonImage3.SetProperty( Toolkit::Button::Property::DISABLED, true );
412 420  
413   - mCheckboxButton1.SetDisabled( true );
414   - mCheckboxButton2.SetDisabled( true );
415   - mCheckboxButton3.SetDisabled( true );
  421 + mCheckboxButton1.SetProperty( Toolkit::Button::Property::DISABLED, true );
  422 + mCheckboxButton2.SetProperty( Toolkit::Button::Property::DISABLED, true );
  423 + mCheckboxButton3.SetProperty( Toolkit::Button::Property::DISABLED, true );
416 424  
417   - mToggleButton.SetDisabled( true );
  425 + mToggleButton.SetProperty( Toolkit::Button::Property::DISABLED, true );
418 426 }
419 427  
420 428 return true;
... ... @@ -422,15 +430,15 @@ class ButtonsController: public ConnectionTracker
422 430  
423 431 bool OnButtonClicked(Toolkit::Button button)
424 432 {
425   - if( mRadioButtonImage1.IsSelected() )
  433 + if( mRadioButtonImage1.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
426 434 {
427 435 mImage.SetImage( BIG_IMAGE_1 );
428 436 }
429   - else if( mRadioButtonImage2.IsSelected() )
  437 + else if( mRadioButtonImage2.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
430 438 {
431 439 mImage.SetImage( BIG_IMAGE_2 );
432 440 }
433   - else if( mRadioButtonImage3.IsSelected() )
  441 + else if( mRadioButtonImage3.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
434 442 {
435 443 mImage.SetImage( BIG_IMAGE_3 );
436 444 }
... ... @@ -439,9 +447,10 @@ class ButtonsController: public ConnectionTracker
439 447  
440 448 bool OnCheckBoxesSelected( Toolkit::Button button )
441 449 {
  450 + bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
442 451 if( button.GetName() == "checkbox1" )
443 452 {
444   - if( button.IsSelected() )
  453 + if( isSelected )
445 454 {
446 455 button.SetLabelText("CheckBox1 is selected");
447 456 }
... ... @@ -453,7 +462,7 @@ class ButtonsController: public ConnectionTracker
453 462  
454 463 if( button.GetName() == "checkbox2" )
455 464 {
456   - if( button.IsSelected() )
  465 + if( isSelected )
457 466 {
458 467 button.SetLabelText("CheckBox2 is selected");
459 468 }
... ... @@ -465,7 +474,7 @@ class ButtonsController: public ConnectionTracker
465 474  
466 475 if( button.GetName() == "checkbox3" )
467 476 {
468   - if( button.IsSelected() )
  477 + if( isSelected )
469 478 {
470 479 button.SetLabelText("CheckBox3 is selected");
471 480 }
... ...
examples/cube-transition-effect/cube-transition-effect-example.cpp
1 1 /*
2   - * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -24,6 +24,7 @@
24 24  
25 25 #include <dali/dali.h>
26 26 #include <dali-toolkit/dali-toolkit.h>
  27 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
27 28 #include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
28 29 #include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
29 30 #include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
... ... @@ -219,8 +220,8 @@ void CubeTransitionApp::OnInit( Application&amp; application )
219 220  
220 221 // Add an effect-changing button on the right of the tool bar.
221 222 mEffectChangeButton = Toolkit::PushButton::New();
222   - mEffectChangeButton.SetUnselectedImage( EFFECT_WAVE_IMAGE );
223   - mEffectChangeButton.SetSelectedImage( EFFECT_WAVE_IMAGE_SELECTED );
  223 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE );
  224 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE_SELECTED );
224 225 mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked );
225 226 mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
226 227  
... ... @@ -230,8 +231,8 @@ void CubeTransitionApp::OnInit( Application&amp; application )
230 231  
231 232 //Add an slideshow icon on the right of the title
232 233 mSlideshowButton = Toolkit::PushButton::New();
233   - mSlideshowButton.SetUnselectedImage( SLIDE_SHOW_START_ICON );
234   - mSlideshowButton.SetSelectedImage( SLIDE_SHOW_START_ICON_SELECTED );
  234 + mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON );
  235 + mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON_SELECTED );
235 236 mSlideshowButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnSildeshowButtonClicked );
236 237 mToolBar.AddControl( mSlideshowButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
237 238  
... ... @@ -324,23 +325,23 @@ bool CubeTransitionApp::OnEffectButtonClicked( Toolkit::Button button )
324 325 {
325 326 mCurrentEffect = mCubeCrossEffect;
326 327 mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_CROSS) );
327   - mEffectChangeButton.SetUnselectedImage( EFFECT_CROSS_IMAGE );
328   - mEffectChangeButton.SetSelectedImage( EFFECT_CROSS_IMAGE_SELECTED );
  328 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_CROSS_IMAGE );
  329 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_CROSS_IMAGE_SELECTED );
329 330  
330 331 }
331 332 else if(mCurrentEffect == mCubeCrossEffect)
332 333 {
333 334 mCurrentEffect = mCubeFoldEffect;
334 335 mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_FOLD) );
335   - mEffectChangeButton.SetUnselectedImage( EFFECT_FOLD_IMAGE );
336   - mEffectChangeButton.SetSelectedImage( EFFECT_FOLD_IMAGE_SELECTED );
  336 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_FOLD_IMAGE );
  337 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_FOLD_IMAGE_SELECTED );
337 338 }
338 339 else
339 340 {
340 341 mCurrentEffect = mCubeWaveEffect;
341 342 mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_WAVE) );
342   - mEffectChangeButton.SetUnselectedImage( EFFECT_WAVE_IMAGE );
343   - mEffectChangeButton.SetSelectedImage( EFFECT_WAVE_IMAGE_SELECTED );
  343 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE );
  344 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_WAVE_IMAGE_SELECTED );
344 345 }
345 346 mContent.Add( mCurrentEffect );
346 347  
... ... @@ -356,8 +357,8 @@ bool CubeTransitionApp::OnSildeshowButtonClicked( Toolkit::Button button )
356 357 if( mSlideshow )
357 358 {
358 359 mPanGestureDetector.Detach( mContent );
359   - mSlideshowButton.SetUnselectedImage( SLIDE_SHOW_STOP_ICON );
360   - mSlideshowButton.SetSelectedImage( SLIDE_SHOW_STOP_ICON_SELECTED );
  360 + mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_STOP_ICON );
  361 + mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_STOP_ICON_SELECTED );
361 362 mPanPosition = Vector2( mViewSize.width, mViewSize.height*0.5f );
362 363 mPanDisplacement = Vector2( -10.f, 0.f );
363 364 mViewTimer.Start();
... ... @@ -365,8 +366,8 @@ bool CubeTransitionApp::OnSildeshowButtonClicked( Toolkit::Button button )
365 366 else
366 367 {
367 368 mPanGestureDetector.Attach( mContent );
368   - mSlideshowButton.SetUnselectedImage( SLIDE_SHOW_START_ICON );
369   - mSlideshowButton.SetSelectedImage( SLIDE_SHOW_START_ICON_SELECTED );
  369 + mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON );
  370 + mSlideshowButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SLIDE_SHOW_START_ICON_SELECTED );
370 371 mViewTimer.Stop();
371 372 }
372 373 return true;
... ...
examples/dissolve-effect/dissolve-effect-example.cpp
1 1 /*
2   - * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -23,6 +23,7 @@
23 23  
24 24 #include <dali/dali.h>
25 25 #include <dali-toolkit/dali-toolkit.h>
  26 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
26 27 #include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h>
27 28  
28 29 using namespace Dali;
... ... @@ -221,8 +222,8 @@ void DissolveEffectApp::OnInit( Application&amp; application )
221 222  
222 223 // Add an effect-changing button on the right of the tool bar.
223 224 mEffectChangeButton = Toolkit::PushButton::New();
224   - mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE );
225   - mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE_SELECTED );
  225 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE );
  226 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE_SELECTED );
226 227 mEffectChangeButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnEffectButtonClicked );
227 228 mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
228 229  
... ... @@ -232,8 +233,8 @@ void DissolveEffectApp::OnInit( Application&amp; application )
232 233  
233 234 // Add an slide-show button on the right of the title
234 235 mPlayStopButton = Toolkit::PushButton::New();
235   - mPlayStopButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, PLAY_ICON );
236   - mPlayStopButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, PLAY_ICON_SELECTED );
  236 + mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON );
  237 + mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED );
237 238 mPlayStopButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnSildeshowButtonClicked );
238 239 mToolBar.AddControl( mPlayStopButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
239 240  
... ... @@ -341,14 +342,14 @@ bool DissolveEffectApp::OnEffectButtonClicked( Toolkit::Button button )
341 342 if(mUseHighPrecision)
342 343 {
343 344 mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_HIGHP) );
344   - mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE );
345   - mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE_SELECTED );
  345 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE );
  346 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_HIGHP_IMAGE_SELECTED );
346 347 }
347 348 else
348 349 {
349 350 mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_MEDIUMP) );
350   - mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_MEDIUMP_IMAGE );
351   - mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_MEDIUMP_IMAGE_SELECTED );
  351 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECT_MEDIUMP_IMAGE );
  352 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECT_MEDIUMP_IMAGE_SELECTED );
352 353 }
353 354  
354 355 return true;
... ... @@ -359,16 +360,16 @@ bool DissolveEffectApp::OnSildeshowButtonClicked( Toolkit::Button button )
359 360 mSlideshow = !mSlideshow;
360 361 if( mSlideshow )
361 362 {
362   - mPlayStopButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, STOP_ICON );
363   - mPlayStopButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, STOP_ICON_SELECTED );
  363 + mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, STOP_ICON );
  364 + mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, STOP_ICON_SELECTED );
364 365 mPanGestureDetector.Detach( mParent );
365 366 mViewTimer.Start();
366 367 mTimerReady = false;
367 368 }
368 369 else
369 370 {
370   - mPlayStopButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, PLAY_ICON );
371   - mPlayStopButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, PLAY_ICON_SELECTED );
  371 + mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_ICON );
  372 + mPlayStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_ICON_SELECTED );
372 373 mTimerReady = true;
373 374 mPanGestureDetector.Attach( mParent );
374 375 }
... ...
examples/effects-view/effects-view-example.cpp
1 1 //
2   -// Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 +// Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 //
4 4 // Licensed under the Flora License, Version 1.0 (the License);
5 5 // you may not use this file except in compliance with the License.
... ... @@ -21,6 +21,7 @@
21 21  
22 22 #include <dali/dali.h>
23 23 #include <dali-toolkit/dali-toolkit.h>
  24 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
24 25 #include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
25 26 #include <sstream>
26 27  
... ... @@ -131,8 +132,8 @@ void EffectsViewApp::OnAppInitialize( Application&amp; application )
131 132  
132 133 // Creates view change button.
133 134 Toolkit::PushButton viewButton = Toolkit::PushButton::New();
134   - viewButton.SetUnselectedImage( VIEW_SWAP_IMAGE );
135   - viewButton.SetSelectedImage( VIEW_SWAP_SELECTED_IMAGE );
  135 + viewButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, VIEW_SWAP_IMAGE );
  136 + viewButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, VIEW_SWAP_SELECTED_IMAGE );
136 137 // Connects the view change button clicked signal to the OnView method.
137 138 viewButton.ClickedSignal().Connect( this, &EffectsViewApp::ChangeEffectSize );
138 139 mToolBar.AddControl( viewButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ...
examples/flex-container/flex-container-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -20,6 +20,7 @@
20 20  
21 21 #include <dali/dali.h>
22 22 #include <dali-toolkit/dali-toolkit.h>
  23 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
23 24  
24 25 using namespace Dali;
25 26 using namespace Dali::Toolkit;
... ... @@ -137,8 +138,8 @@ public:
137 138 // Create a flex direction toggle button. (left of toolbar)
138 139 mFlexDirectionButton = Toolkit::PushButton::New();
139 140 mFlexDirectionButton.SetName("mFlexDirectionButton");
140   - mFlexDirectionButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-change.png" );
141   - mFlexDirectionButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-change-selected.png" );
  141 + mFlexDirectionButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change.png" );
  142 + mFlexDirectionButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-change-selected.png" );
142 143 mFlexDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexDirectionButtonClicked);
143 144 mFlexDirectionButton.SetLeaveRequired( true );
144 145 mToolBar.AddControl( mFlexDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -146,8 +147,8 @@ public:
146 147 // Create a flex wrap toggle button. (left of toolbar)
147 148 mFlexWrapButton = Toolkit::PushButton::New();
148 149 mFlexWrapButton.SetName("mFlexWrapButton");
149   - mFlexWrapButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-edit.png" );
150   - mFlexWrapButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-edit-selected.png" );
  150 + mFlexWrapButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit.png" );
  151 + mFlexWrapButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-edit-selected.png" );
151 152 mFlexWrapButton.ClickedSignal().Connect( this, &FlexContainerExample::OnFlexWrapButtonClicked);
152 153 mFlexWrapButton.SetLeaveRequired( true );
153 154 mToolBar.AddControl( mFlexWrapButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -155,8 +156,8 @@ public:
155 156 // Create a content direction toggle button. (left of toolbar)
156 157 mContentDirectionButton = Toolkit::PushButton::New();
157 158 mContentDirectionButton.SetName("mContentDirectionButton");
158   - mContentDirectionButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-replace.png" );
159   - mContentDirectionButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-replace-selected.png" );
  159 + mContentDirectionButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace.png" );
  160 + mContentDirectionButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-replace-selected.png" );
160 161 mContentDirectionButton.ClickedSignal().Connect( this, &FlexContainerExample::OnContentDirectionButtonClicked);
161 162 mContentDirectionButton.SetLeaveRequired( true );
162 163 mToolBar.AddControl( mContentDirectionButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -164,8 +165,8 @@ public:
164 165 // Create a justify content toggle button. (right of toolbar)
165 166 mJustifyContentButton = Toolkit::PushButton::New();
166 167 mJustifyContentButton.SetName("mJustifyContentButton");
167   - mJustifyContentButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-reset.png" );
168   - mJustifyContentButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-reset-selected.png" );
  168 + mJustifyContentButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset.png" );
  169 + mJustifyContentButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-reset-selected.png" );
169 170 mJustifyContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnJustifyContentButtonClicked);
170 171 mJustifyContentButton.SetLeaveRequired( true );
171 172 mToolBar.AddControl( mJustifyContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -173,8 +174,8 @@ public:
173 174 // Create a align items toggle button. (right of toolbar)
174 175 mAlignItemsButton = Toolkit::PushButton::New();
175 176 mAlignItemsButton.SetName("mAlignItemsButton");
176   - mAlignItemsButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-highp.png" );
177   - mAlignItemsButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-highp-selected.png" );
  177 + mAlignItemsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp.png" );
  178 + mAlignItemsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-highp-selected.png" );
178 179 mAlignItemsButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignItemsButtonClicked);
179 180 mAlignItemsButton.SetLeaveRequired( true );
180 181 mToolBar.AddControl( mAlignItemsButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -182,8 +183,8 @@ public:
182 183 // Create a align content toggle button. (right of toolbar)
183 184 mAlignContentButton = Toolkit::PushButton::New();
184 185 mAlignContentButton.SetName("mAlignContentButton");
185   - mAlignContentButton.SetUnselectedImage( DEMO_IMAGE_DIR "icon-effect-cross.png" );
186   - mAlignContentButton.SetSelectedImage( DEMO_IMAGE_DIR "icon-effect-cross-selected.png" );
  186 + mAlignContentButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross.png" );
  187 + mAlignContentButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEMO_IMAGE_DIR "icon-effect-cross-selected.png" );
187 188 mAlignContentButton.ClickedSignal().Connect( this, &FlexContainerExample::OnAlignContentButtonClicked);
188 189 mAlignContentButton.SetLeaveRequired( true );
189 190 mToolBar.AddControl( mAlignContentButton, VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -224,8 +225,8 @@ public:
224 225  
225 226 // Set different background colour to help to identify different items
226 227 flexItem.SetBackgroundColor(Vector4(static_cast<float>(i) / NUM_FLEX_ITEMS, static_cast<float>(NUM_FLEX_ITEMS - i) / NUM_FLEX_ITEMS, 1.0f, 1.0f));
227   - flexItem.SetUnselectedImage("");
228   - flexItem.SetSelectedImage("");
  228 + flexItem.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, "" );
  229 + flexItem.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, "" );
229 230  
230 231 // Add a label to the button so that we can identify each item more easily
231 232 std::ostringstream index;
... ...
examples/fpp-game/fpp-game-tutorial-controller.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -20,7 +20,10 @@
20 20 #include <dali/public-api/events/touch-data.h>
21 21 #include <dali/public-api/animation/animation.h>
22 22 #include <dali/public-api/actors/camera-actor.h>
  23 +#include <dali/public-api/object/property-map.h>
23 24 #include <dali/public-api/render-tasks/render-task-list.h>
  25 +#include <dali-toolkit/public-api/visuals/visual-properties.h>
  26 +#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
24 27  
25 28 using namespace Dali;
26 29 using namespace Dali::Toolkit;
... ... @@ -111,7 +114,9 @@ void FppGameTutorialController::DisplayTutorial()
111 114 mLeftLabel.SetAnchorPoint( AnchorPoint::CENTER );
112 115 mLeftLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
113 116 mLeftLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
114   - mLeftLabel.SetProperty( Toolkit::Control::Property::BACKGROUND_COLOR, Vector4( 0.0, 0.0, 0.7, 0.2 ));
  117 + mLeftLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
  118 + Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
  119 + .Add( ColorVisual::Property::MIX_COLOR, Vector4( 0.0, 0.0, 0.7, 0.2 ) ) );
115 120 mLeftLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
116 121 mLeftLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
117 122 mLeftLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
... ... @@ -122,7 +127,9 @@ void FppGameTutorialController::DisplayTutorial()
122 127 mRightLabel.SetAnchorPoint( AnchorPoint::CENTER );
123 128 mRightLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
124 129 mRightLabel.SetSize( Vector3( stageSize.x*0.5, stageSize.y, 1.0f ) );
125   - mRightLabel.SetProperty( Toolkit::Control::Property::BACKGROUND_COLOR, Vector4( 0.5, 0.0, 0.0, 0.2 ));
  130 + mRightLabel.SetProperty( Toolkit::Control::Property::BACKGROUND,
  131 + Property::Map().Add( Visual::Property::TYPE, Visual::COLOR )
  132 + .Add( ColorVisual::Property::MIX_COLOR, Vector4( 0.5, 0.0, 0.0, 0.2 ) ) );
126 133 mRightLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
127 134 mRightLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
128 135 mRightLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
... ...
examples/gradients/gradients-example.cpp
1 1 /*
2   - * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -16,6 +16,7 @@
16 16 */
17 17  
18 18 #include <dali-toolkit/dali-toolkit.h>
  19 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
19 20 #include "shared/view.h"
20 21  
21 22 using namespace Dali;
... ... @@ -67,8 +68,8 @@ public:
67 68 APPLICATION_TITLE );
68 69  
69 70 PushButton changeButton = Toolkit::PushButton::New();
70   - changeButton.SetUnselectedImage( CHANGE_ICON );
71   - changeButton.SetSelectedImage( CHANGE_ICON_SELECTED );
  71 + changeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_ICON );
  72 + changeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_ICON_SELECTED );
72 73 changeButton.ClickedSignal().Connect( this, &GradientController::OnChangeIconClicked );
73 74 toolBar.AddControl( changeButton,
74 75 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ...
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
1 1 /*
2   - * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -45,6 +45,7 @@
45 45 #include <algorithm>
46 46 #include <map>
47 47 #include <dali-toolkit/dali-toolkit.h>
  48 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
48 49 #include <iostream>
49 50  
50 51 // INTERNAL INCLUDES
... ... @@ -307,8 +308,8 @@ public:
307 308  
308 309 // Create an image scaling toggle button. (right of toolbar)
309 310 Toolkit::PushButton toggleScalingButton = Toolkit::PushButton::New();
310   - toggleScalingButton.SetUnselectedImage( TOGGLE_SCALING_IMAGE );
311   - toggleScalingButton.SetSelectedImage( TOGGLE_SCALING_IMAGE_SELECTED );
  311 + toggleScalingButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, TOGGLE_SCALING_IMAGE );
  312 + toggleScalingButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, TOGGLE_SCALING_IMAGE_SELECTED );
312 313 toggleScalingButton.ClickedSignal().Connect( this, &ImageScalingIrregularGridController::OnToggleScalingTouched );
313 314 mToolBar.AddControl( toggleScalingButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
314 315  
... ...
examples/image-view-pixel-area/image-view-pixel-area-example.cpp
1 1 /*
2   - * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -16,6 +16,8 @@
16 16 */
17 17  
18 18 #include <dali-toolkit/dali-toolkit.h>
  19 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
  20 +
19 21 #include "shared/view.h"
20 22  
21 23 using namespace Dali;
... ... @@ -69,8 +71,8 @@ private:
69 71  
70 72 // Add a button to switch the scene. (right of toolbar)
71 73 Toolkit::PushButton switchButton = Toolkit::PushButton::New();
72   - switchButton.SetUnselectedImage( BUTTON_ICON );
73   - switchButton.SetSelectedImage( BUTTON_ICON_SELECTED );
  74 + switchButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_ICON );
  75 + switchButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BUTTON_ICON_SELECTED );
74 76 switchButton.ClickedSignal().Connect( this, &ImageViewPixelAreaApp::OnButtonClicked );
75 77 toolBar.AddControl( switchButton,
76 78 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ...
examples/item-view/item-view-example.cpp
1 1 /*
2   - * Copyright (c) 2014 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -20,6 +20,7 @@
20 20  
21 21 #include <dali/dali.h>
22 22 #include <dali-toolkit/dali-toolkit.h>
  23 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
23 24  
24 25 using namespace Dali;
25 26 using namespace Dali::Toolkit;
... ... @@ -213,16 +214,16 @@ public:
213 214  
214 215 // Create an edit mode button. (left of toolbar)
215 216 Toolkit::PushButton editButton = Toolkit::PushButton::New();
216   - editButton.SetUnselectedImage( EDIT_IMAGE );
217   - editButton.SetSelectedImage( EDIT_IMAGE_SELECTED );
  217 + editButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE );
  218 + editButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED );
218 219 editButton.ClickedSignal().Connect( this, &ItemViewExample::OnModeButtonClicked);
219 220 editButton.SetLeaveRequired( true );
220 221 mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
221 222  
222 223 // Create a layout toggle button. (right of toolbar)
223 224 mLayoutButton = Toolkit::PushButton::New();
224   - mLayoutButton.SetUnselectedImage( SPIRAL_LAYOUT_IMAGE );
225   - mLayoutButton.SetSelectedImage(SPIRAL_LAYOUT_IMAGE_SELECTED );
  225 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE );
  226 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE_SELECTED );
226 227 mLayoutButton.ClickedSignal().Connect( this, &ItemViewExample::OnLayoutButtonClicked);
227 228 mLayoutButton.SetLeaveRequired( true );
228 229 mToolBar.AddControl( mLayoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -233,9 +234,9 @@ public:
233 234 mDeleteButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
234 235 mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
235 236 mDeleteButton.SetDrawMode( DrawMode::OVERLAY_2D );
236   - mDeleteButton.SetUnselectedImage( DELETE_IMAGE );
237   - mDeleteButton.SetSelectedImage( DELETE_IMAGE_SELECTED );
238   - mDeleteButton.SetBackgroundImage( TOOLBAR_IMAGE );
  237 + mDeleteButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DELETE_IMAGE );
  238 + mDeleteButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DELETE_IMAGE_SELECTED );
  239 + mDeleteButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
239 240 mDeleteButton.SetSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) );
240 241 mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked);
241 242 mDeleteButton.SetLeaveRequired( true );
... ... @@ -248,9 +249,9 @@ public:
248 249 mInsertButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
249 250 mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
250 251 mInsertButton.SetDrawMode( DrawMode::OVERLAY_2D );
251   - mInsertButton.SetUnselectedImage( INSERT_IMAGE );
252   - mInsertButton.SetSelectedImage( INSERT_IMAGE_SELECTED );
253   - mInsertButton.SetBackgroundImage( TOOLBAR_IMAGE );
  252 + mInsertButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, INSERT_IMAGE );
  253 + mInsertButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, INSERT_IMAGE_SELECTED );
  254 + mInsertButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
254 255 mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
255 256 mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked);
256 257 mInsertButton.SetLeaveRequired( true );
... ... @@ -263,9 +264,9 @@ public:
263 264 mReplaceButton.SetAnchorPoint(AnchorPoint::BOTTOM_RIGHT);
264 265 mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER );
265 266 mReplaceButton.SetDrawMode( DrawMode::OVERLAY_2D );
266   - mReplaceButton.SetUnselectedImage( REPLACE_IMAGE );
267   - mReplaceButton.SetSelectedImage( REPLACE_IMAGE_SELECTED );
268   - mReplaceButton.SetBackgroundImage( TOOLBAR_IMAGE );
  267 + mReplaceButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, REPLACE_IMAGE );
  268 + mReplaceButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, REPLACE_IMAGE_SELECTED );
  269 + mReplaceButton.SetProperty( Toolkit::Control::Property::BACKGROUND, TOOLBAR_IMAGE );
269 270 mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f );
270 271 mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked);
271 272 mReplaceButton.SetLeaveRequired( true );
... ... @@ -821,22 +822,22 @@ public:
821 822 {
822 823 case SPIRAL_LAYOUT:
823 824 {
824   - mLayoutButton.SetUnselectedImage( SPIRAL_LAYOUT_IMAGE );
825   - mLayoutButton.SetSelectedImage( SPIRAL_LAYOUT_IMAGE_SELECTED );
  825 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE );
  826 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, SPIRAL_LAYOUT_IMAGE_SELECTED );
826 827 break;
827 828 }
828 829  
829 830 case GRID_LAYOUT:
830 831 {
831   - mLayoutButton.SetUnselectedImage( GRID_LAYOUT_IMAGE );
832   - mLayoutButton.SetSelectedImage( GRID_LAYOUT_IMAGE_SELECTED );
  832 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, GRID_LAYOUT_IMAGE );
  833 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, GRID_LAYOUT_IMAGE_SELECTED );
833 834 break;
834 835 }
835 836  
836 837 case DEPTH_LAYOUT:
837 838 {
838   - mLayoutButton.SetUnselectedImage( DEPTH_LAYOUT_IMAGE );
839   - mLayoutButton.SetSelectedImage( DEPTH_LAYOUT_IMAGE_SELECTED );
  839 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, DEPTH_LAYOUT_IMAGE );
  840 + mLayoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, DEPTH_LAYOUT_IMAGE_SELECTED );
840 841 break;
841 842 }
842 843  
... ...
examples/line-mesh/line-mesh-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -253,7 +253,7 @@ public:
253 253  
254 254 radio.SetParentOrigin( ParentOrigin::TOP_LEFT );
255 255 radio.SetAnchorPoint( AnchorPoint::TOP_LEFT );
256   - radio.SetSelected( i == 0 );
  256 + radio.SetProperty( Toolkit::Button::Property::SELECTED, i == 0 );
257 257 radio.PressedSignal().Connect( this, &ExampleController::OnButtonPressed );
258 258 mButtons[i] = radio;
259 259 modeSelectTableView.AddChild( radio, Toolkit::TableView::CellPosition( i, 0 ) );
... ...
examples/logging/logging-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -241,7 +241,7 @@ class LoggingController: public ConnectionTracker
241 241 radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
242 242 radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
243 243 radioButton.SetPosition( DP(radioX), DP(radioY) );
244   - radioButton.SetSelected( true );
  244 + radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
245 245  
246 246 radioButton.StateChangedSignal().Connect( this, &LoggingController::LoggingRadioSelect );
247 247  
... ... @@ -421,7 +421,7 @@ class LoggingController: public ConnectionTracker
421 421 Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_2_RADIO_TEXT );
422 422 radioButton.SetName( FREQUENCY_2_RADIO_ID );
423 423  
424   - radioButton.SetSelected( true );
  424 + radioButton.SetProperty( Toolkit::Button::Property::SELECTED, true );
425 425  
426 426 radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
427 427  
... ... @@ -479,15 +479,21 @@ class LoggingController: public ConnectionTracker
479 479  
480 480 bool LoggingRadioSelect( Toolkit::Button button )
481 481 {
482   - if( button.GetName() == LOGGER_1_RADIO_ID && button.IsSelected() == true )
  482 + bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
  483 + if( !isSelected )
  484 + {
  485 + return true;
  486 + }
  487 +
  488 + if( button.GetName() == LOGGER_1_RADIO_ID )
483 489 {
484 490 mCurrentLogger = 0;
485 491 }
486   - else if( button.GetName() == LOGGER_2_RADIO_ID && button.IsSelected() == true )
  492 + else if( button.GetName() == LOGGER_2_RADIO_ID )
487 493 {
488 494 mCurrentLogger = 1;
489 495 }
490   - else if( button.GetName() == LOGGER_3_RADIO_ID && button.IsSelected() == true )
  496 + else if( button.GetName() == LOGGER_3_RADIO_ID )
491 497 {
492 498 mCurrentLogger = 2;
493 499 }
... ... @@ -503,21 +509,27 @@ class LoggingController: public ConnectionTracker
503 509 const unsigned int frequency = mLoggerStates[mCurrentLogger].frequency;
504 510 if( frequency == HIGH_FREQUENCY )
505 511 {
506   - mFrequencyRadioButtons[0].SetSelected( true );
  512 + mFrequencyRadioButtons[0].SetProperty( Toolkit::Button::Property::SELECTED, true );
507 513 }
508 514 else if( frequency == MEDIUM_FREQUENCY )
509 515 {
510   - mFrequencyRadioButtons[1].SetSelected( true );
  516 + mFrequencyRadioButtons[1].SetProperty( Toolkit::Button::Property::SELECTED, true );
511 517 }
512 518 else if( frequency == LOW_FREQUENCY )
513 519 {
514   - mFrequencyRadioButtons[2].SetSelected( true );
  520 + mFrequencyRadioButtons[2].SetProperty( Toolkit::Button::Property::SELECTED, true );
515 521 }
516 522 }
517 523  
518 524 bool FrequencyRadioSelect( Toolkit::Button button )
519 525 {
520   - if( button.GetName() == FREQUENCY_1_RADIO_ID && button.IsSelected() == true )
  526 + bool isSelected = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
  527 + if( !isSelected )
  528 + {
  529 + return true;
  530 + }
  531 +
  532 + if( button.GetName() == FREQUENCY_1_RADIO_ID )
521 533 {
522 534 if( mPerformanceLoggers[mCurrentLogger] )
523 535 {
... ... @@ -528,7 +540,7 @@ class LoggingController: public ConnectionTracker
528 540 mLoggerStates[mCurrentLogger].frequency = HIGH_FREQUENCY;
529 541 }
530 542 }
531   - else if( button.GetName() == FREQUENCY_2_RADIO_ID && button.IsSelected() == true )
  543 + else if( button.GetName() == FREQUENCY_2_RADIO_ID )
532 544 {
533 545 if( mPerformanceLoggers[mCurrentLogger] )
534 546 {
... ... @@ -539,7 +551,7 @@ class LoggingController: public ConnectionTracker
539 551 mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY;
540 552 }
541 553 }
542   - else if( button.GetName() == FREQUENCY_3_RADIO_ID && button.IsSelected() == true )
  554 + else if( button.GetName() == FREQUENCY_3_RADIO_ID )
543 555 {
544 556 if( mPerformanceLoggers[mCurrentLogger] )
545 557 {
... ...
examples/motion-blur/motion-blur-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -21,8 +21,8 @@
21 21 #include "shared/view.h"
22 22 #include <dali/dali.h>
23 23 #include <dali-toolkit/dali-toolkit.h>
  24 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
24 25 #include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h>
25   -#include <dali-toolkit/devel-api/controls/popup/popup.h>
26 26  
27 27 using namespace Dali;
28 28 using namespace Dali::Toolkit;
... ... @@ -176,16 +176,16 @@ public:
176 176  
177 177 //Add an effects icon on the right of the title
178 178 mActorEffectsButton = Toolkit::PushButton::New();
179   - mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
180   - mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
  179 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
  180 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
181 181 mActorEffectsButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnEffectButtonClicked );
182 182 mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
183 183  
184 184 // Creates a mode button.
185 185 // Create a effect toggle button. (right of toolbar)
186 186 Toolkit::PushButton layoutButton = Toolkit::PushButton::New();
187   - layoutButton.SetUnselectedImage( LAYOUT_IMAGE );
188   - layoutButton.SetSelectedImage( LAYOUT_IMAGE_SELECTED );
  187 + layoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE );
  188 + layoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED );
189 189 layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked);
190 190 layoutButton.SetLeaveRequired( true );
191 191 mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -435,14 +435,14 @@ public:
435 435 if(!mActorEffectsEnabled)
436 436 {
437 437 mActorEffectsEnabled = true;
438   - mActorEffectsButton.SetUnselectedImage( EFFECTS_ON_ICON );
439   - mActorEffectsButton.SetSelectedImage( EFFECTS_ON_ICON_SELECTED );
  438 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON );
  439 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON_SELECTED );
440 440 }
441 441 else
442 442 {
443 443 mActorEffectsEnabled = false;
444   - mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
445   - mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
  444 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
  445 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
446 446 }
447 447 }
448 448  
... ... @@ -539,8 +539,6 @@ private:
539 539  
540 540 DeviceOrientation mOrientation; ///< Current Device orientation
541 541 Animation mRotateAnimation; ///< Animation for rotating between landscape and portrait.
542   -
543   - Popup mInstructionsPopup; ///< Info Popup
544 542 };
545 543  
546 544 void RunTest(Application& app)
... ...
examples/motion-stretch/motion-stretch-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -21,6 +21,7 @@
21 21 #include "shared/view.h"
22 22 #include <dali/dali.h>
23 23 #include <dali-toolkit/dali-toolkit.h>
  24 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
24 25 #include <dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h>
25 26  
26 27 using namespace Dali;
... ... @@ -142,16 +143,16 @@ public:
142 143  
143 144 //Add an slideshow icon on the right of the title
144 145 mActorEffectsButton = Toolkit::PushButton::New();
145   - mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
146   - mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
  146 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
  147 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
147 148 mActorEffectsButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnEffectButtonClicked );
148 149 mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
149 150  
150 151 // Creates a mode button.
151 152 // Create a effect toggle button. (right of toolbar)
152 153 Toolkit::PushButton layoutButton = Toolkit::PushButton::New();
153   - layoutButton.SetUnselectedImage( LAYOUT_IMAGE );
154   - layoutButton.SetSelectedImage( LAYOUT_IMAGE_SELECTED );
  154 + layoutButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE );
  155 + layoutButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LAYOUT_IMAGE_SELECTED );
155 156 layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked);
156 157 layoutButton.SetLeaveRequired( true );
157 158 mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
... ... @@ -333,14 +334,14 @@ public:
333 334 if(!mActorEffectsEnabled)
334 335 {
335 336 mActorEffectsEnabled = true;
336   - mActorEffectsButton.SetUnselectedImage( EFFECTS_ON_ICON );
337   - mActorEffectsButton.SetSelectedImage( EFFECTS_ON_ICON_SELECTED );
  337 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON );
  338 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_ON_ICON_SELECTED );
338 339 }
339 340 else
340 341 {
341 342 mActorEffectsEnabled = false;
342   - mActorEffectsButton.SetUnselectedImage( EFFECTS_OFF_ICON );
343   - mActorEffectsButton.SetSelectedImage( EFFECTS_OFF_ICON_SELECTED );
  343 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON );
  344 + mActorEffectsButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EFFECTS_OFF_ICON_SELECTED );
344 345 }
345 346 }
346 347  
... ...
examples/native-image-source/native-image-source-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -153,8 +153,8 @@ public:
153 153 stage.KeyEventSignal().Connect(this, &NativeImageSourceController::OnKeyEvent);
154 154  
155 155 mButtonRefreshAlways = PushButton::New();
156   - mButtonRefreshAlways.SetTogglableButton( true );
157   - mButtonRefreshAlways.SetSelected( true );
  156 + mButtonRefreshAlways.SetProperty( Button::Property::TOGGLABLE, true );
  157 + mButtonRefreshAlways.SetProperty( Button::Property::SELECTED, true );
158 158 mButtonRefreshAlways.SetLabelText( "Refresh ALWAYS" );
159 159 mButtonRefreshAlways.SetParentOrigin( ParentOrigin::TOP_LEFT );
160 160 mButtonRefreshAlways.SetAnchorPoint( AnchorPoint::TOP_LEFT );
... ... @@ -246,10 +246,12 @@ public:
246 246  
247 247 bool OnButtonSelected( Toolkit::Button button )
248 248 {
  249 + bool isSelected = mButtonRefreshAlways.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
  250 +
249 251 Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button );
250 252 if( pushButton == mButtonRefreshAlways )
251 253 {
252   - if( mButtonRefreshAlways.IsSelected() )
  254 + if( isSelected )
253 255 {
254 256 mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ALWAYS );
255 257 }
... ... @@ -260,9 +262,9 @@ public:
260 262 }
261 263 else if( pushButton == mButtonRefreshOnce )
262 264 {
263   - if( mButtonRefreshAlways.IsSelected() )
  265 + if( isSelected )
264 266 {
265   - mButtonRefreshAlways.SetSelected( false );
  267 + mButtonRefreshAlways.SetProperty( Button::Property::SELECTED, false );
266 268 }
267 269 mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
268 270 }
... ...
examples/new-window/new-window-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -19,6 +19,7 @@
19 19 #include <dali/public-api/rendering/renderer.h>
20 20 #include <dali-toolkit/dali-toolkit.h>
21 21 #include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
  22 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
22 23 #include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
23 24  
24 25 #include <cstdio>
... ... @@ -204,8 +205,8 @@ void NewWindowController::Create( Application&amp; app )
204 205 }
205 206  
206 207 mLoseContextButton = Toolkit::PushButton::New();
207   - mLoseContextButton.SetUnselectedImage( LOSE_CONTEXT_IMAGE );
208   - mLoseContextButton.SetSelectedImage( LOSE_CONTEXT_IMAGE_SELECTED );
  208 + mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE );
  209 + mLoseContextButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, LOSE_CONTEXT_IMAGE_SELECTED );
209 210 mLoseContextButton.ClickedSignal().Connect( this, &NewWindowController::OnLoseContextButtonClicked );
210 211 mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
211 212  
... ...
examples/page-turn-view/page-turn-view-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -17,6 +17,7 @@
17 17  
18 18 #include <dali/dali.h>
19 19 #include <dali-toolkit/dali-toolkit.h>
  20 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
20 21 #include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
21 22 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
22 23 #include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
... ... @@ -256,8 +257,8 @@ void PageTurnController::OnInit( Application&amp; app )
256 257 Toolkit::PushButton button = Toolkit::PushButton::New();
257 258 button.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
258 259 button.SetParentOrigin( ParentOrigin::TOP_RIGHT );
259   - button.SetUnselectedImage( CHANGE_IMAGE_ICON );
260   - button.SetSelectedImage( CHANGE_IMAGE_ICON_SELECTED );
  260 + button.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_IMAGE_ICON );
  261 + button.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_IMAGE_ICON_SELECTED );
261 262 button.SetLeaveRequired( true );
262 263 button.SetScale(1.5f);
263 264 button.PressedSignal().Connect( this, &PageTurnController::OnButtonClicked );
... ...
examples/popup/popup-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -18,6 +18,7 @@
18 18 #include "shared/view.h"
19 19 #include <dali/dali.h>
20 20 #include <dali-toolkit/dali-toolkit.h>
  21 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
21 22 #include <dali-toolkit/devel-api/controls/popup/popup.h>
22 23 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
23 24  
... ... @@ -140,17 +141,17 @@ public:
140 141  
141 142 // Create animation button.
142 143 mAnimationButton = Toolkit::PushButton::New();
143   - mAnimationButton.SetUnselectedImage( ANIMATION_FADE_ICON_IMAGE );
144   - mAnimationButton.SetSelectedImage( ANIMATION_ZOOM_ICON_IMAGE );
145   - mAnimationButton.SetTogglableButton( true );
  144 + mAnimationButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, ANIMATION_FADE_ICON_IMAGE );
  145 + mAnimationButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, ANIMATION_ZOOM_ICON_IMAGE );
  146 + mAnimationButton.SetProperty( Toolkit::Button::Property::TOGGLABLE, true );
146 147 mAnimationButton.ClickedSignal().Connect( this, &PopupExample::OnAnimationClicked );
147 148 mToolBar.AddControl( mAnimationButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
148 149  
149 150 // Create context button.
150 151 mContextButton = Toolkit::PushButton::New();
151   - mContextButton.SetUnselectedImage( CONTEXT_DISABLED_ICON_IMAGE );
152   - mContextButton.SetSelectedImage( CONTEXT_ENABLED_ICON_IMAGE );
153   - mContextButton.SetTogglableButton( true );
  152 + mContextButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CONTEXT_DISABLED_ICON_IMAGE );
  153 + mContextButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CONTEXT_ENABLED_ICON_IMAGE );
  154 + mContextButton.SetProperty( Toolkit::Button::Property::TOGGLABLE, true );
154 155 mContextButton.ClickedSignal().Connect( this, &PopupExample::OnContextClicked );
155 156 mToolBar.AddControl( mContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
156 157  
... ... @@ -176,13 +177,13 @@ public:
176 177  
177 178 bool OnContextClicked( Toolkit::Button button )
178 179 {
179   - mContextual = button.IsSelected();
  180 + mContextual = button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
180 181 return true;
181 182 }
182 183  
183 184 bool OnAnimationClicked( Toolkit::Button button )
184 185 {
185   - mAnimationFade = !button.IsSelected();
  186 + mAnimationFade = ! ( button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() );
186 187 return true;
187 188 }
188 189  
... ...
examples/primitive-shapes/primitive-shapes-example.cpp
  1 +/*
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + *
  16 + */
  17 +
1 18 #include <dali-toolkit/dali-toolkit.h>
2 19 #include <dali/public-api/object/property-map.h>
  20 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
3 21 #include <dali-toolkit/public-api/controls/slider/slider.h>
4 22  
5 23 using namespace Dali;
... ... @@ -170,8 +188,8 @@ public:
170 188 button.SetAnchorPoint( AnchorPoint::CENTER );
171 189 button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
172 190 button.SetPadding( Padding( elementPadding, elementPadding, elementPadding, elementPadding ) );
173   - button.SetProperty( Button::Property::UNSELECTED_STATE_IMAGE, Property::Value( BUTTON_IMAGE_URL[modelNumber] ) );
174   - button.SetProperty( Button::Property::SELECTED_STATE_IMAGE, Property::Value( BUTTON_IMAGE_URL[modelNumber] ) );
  191 + button.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BUTTON_IMAGE_URL[modelNumber] );
  192 + button.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BUTTON_IMAGE_URL[modelNumber] );
175 193 button.RegisterProperty( "modelNumber", Property::Value( modelNumber ) );
176 194 button.ClickedSignal().Connect( this, &PrimitiveShapesController::OnChangeShapeClicked );
177 195  
... ...
examples/refraction-effect/refraction-effect-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -19,6 +19,7 @@
19 19 #include <dali/dali.h>
20 20 #include <dali/public-api/rendering/renderer.h>
21 21 #include <dali-toolkit/dali-toolkit.h>
  22 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
22 23  
23 24 #include <fstream>
24 25 #include <sstream>
... ... @@ -260,8 +261,8 @@ private:
260 261  
261 262 // Add a button to change background. (right of toolbar)
262 263 mChangeTextureButton = Toolkit::PushButton::New();
263   - mChangeTextureButton.SetUnselectedImage( CHANGE_TEXTURE_ICON );
264   - mChangeTextureButton.SetSelectedImage( CHANGE_TEXTURE_ICON_SELECTED );
  264 + mChangeTextureButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_TEXTURE_ICON );
  265 + mChangeTextureButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_TEXTURE_ICON_SELECTED );
265 266 mChangeTextureButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeTexture );
266 267 toolBar.AddControl( mChangeTextureButton,
267 268 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ... @@ -269,8 +270,8 @@ private:
269 270 DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
270 271 // Add a button to change mesh pattern. ( left of bar )
271 272 mChangeMeshButton = Toolkit::PushButton::New();
272   - mChangeMeshButton.SetUnselectedImage( CHANGE_MESH_ICON );
273   - mChangeMeshButton.SetSelectedImage( CHANGE_MESH_ICON_SELECTED );
  273 + mChangeMeshButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_MESH_ICON );
  274 + mChangeMeshButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_MESH_ICON_SELECTED );
274 275 mChangeMeshButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeMesh );
275 276 toolBar.AddControl( mChangeMeshButton,
276 277 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ...
examples/scroll-view/scroll-view-example.cpp
1 1 /*
2   - * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -22,6 +22,7 @@
22 22 #include "shared/view.h"
23 23 #include <dali/dali.h>
24 24 #include <dali-toolkit/dali-toolkit.h>
  25 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
25 26  
26 27 using namespace Dali;
27 28 using namespace Dali::Toolkit;
... ... @@ -33,6 +34,12 @@ const char * const TOOLBAR_IMAGE( DEMO_IMAGE_DIR &quot;top-bar.png&quot; );
33 34 const char * const APPLICATION_TITLE( "ScrollView" );
34 35 const char * const EFFECT_CAROUSEL_IMAGE( DEMO_IMAGE_DIR "icon-scroll-view-carousel.png" );
35 36 const char * const EFFECT_CAROUSEL_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-scroll-view-carousel-selected.png" );
  37 +const char * const EFFECT_CUBE_IMAGE( DEMO_IMAGE_DIR "icon-scroll-view-inner-cube.png" );
  38 +const char * const EFFECT_CUBE_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-scroll-view-inner-cube-selected.png" );
  39 +const char * const EFFECT_SPIRAL_IMAGE( DEMO_IMAGE_DIR "icon-scroll-view-spiral.png" );
  40 +const char * const EFFECT_SPIRAL_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-scroll-view-spiral-selected.png" );
  41 +const char * const EFFECT_WAVE_IMAGE( DEMO_IMAGE_DIR "icon-effect-wave.png" );
  42 +const char * const EFFECT_WAVE_IMAGE_SELECTED( DEMO_IMAGE_DIR "icon-effect-wave-selected.png" );
36 43  
37 44 const Vector3 ICON_SIZE(100.0f, 100.0f, 0.0f);
38 45  
... ... @@ -175,12 +182,12 @@ public:
175 182  
176 183 mEffectIcon[ PageCarouselEffect ] = EFFECT_CAROUSEL_IMAGE;
177 184 mEffectIconSelected[ PageCarouselEffect ] = EFFECT_CAROUSEL_IMAGE_SELECTED;
178   - mEffectIcon[ PageCubeEffect ] = EFFECT_CAROUSEL_IMAGE;
179   - mEffectIconSelected[ PageCubeEffect ] = EFFECT_CAROUSEL_IMAGE_SELECTED;
180   - mEffectIcon[ PageSpiralEffect ] = EFFECT_CAROUSEL_IMAGE;
181   - mEffectIconSelected[ PageSpiralEffect ] = EFFECT_CAROUSEL_IMAGE_SELECTED;
182   - mEffectIcon[ PageWaveEffect ] = EFFECT_CAROUSEL_IMAGE;
183   - mEffectIconSelected[ PageWaveEffect ] = EFFECT_CAROUSEL_IMAGE_SELECTED;
  185 + mEffectIcon[ PageCubeEffect ] = EFFECT_CUBE_IMAGE;
  186 + mEffectIconSelected[ PageCubeEffect ] = EFFECT_CUBE_IMAGE_SELECTED;
  187 + mEffectIcon[ PageSpiralEffect ] = EFFECT_SPIRAL_IMAGE;
  188 + mEffectIconSelected[ PageSpiralEffect ] = EFFECT_SPIRAL_IMAGE_SELECTED;
  189 + mEffectIcon[ PageWaveEffect ] = EFFECT_WAVE_IMAGE;
  190 + mEffectIconSelected[ PageWaveEffect ] = EFFECT_WAVE_IMAGE_SELECTED;
184 191  
185 192 // Create a effect change button. (right of toolbar)
186 193 mEffectChangeButton = Toolkit::PushButton::New();
... ... @@ -244,8 +251,8 @@ private:
244 251 ss << APPLICATION_TITLE << ": " << EFFECT_MODE_NAME[mEffectMode];
245 252 SetTitle(ss.str());
246 253  
247   - mEffectChangeButton.SetUnselectedImage( mEffectIcon[ mEffectMode ] );
248   - mEffectChangeButton.SetSelectedImage( mEffectIconSelected[ mEffectMode ] );
  254 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, mEffectIcon[ mEffectMode ] );
  255 + mEffectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, mEffectIconSelected[ mEffectMode ] );
249 256  
250 257 // remove old Effect if exists.
251 258 if(mScrollViewEffect)
... ...
examples/shadows-and-lights/shadows-and-lights-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -20,6 +20,7 @@
20 20  
21 21 #include <dali/dali.h>
22 22 #include <dali-toolkit/dali-toolkit.h>
  23 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
23 24 #include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
24 25  
25 26 #include <iostream>
... ... @@ -166,8 +167,8 @@ public:
166 167  
167 168 // Add an effect-changing button on the right of the tool bar.
168 169 Toolkit::PushButton effectChangeButton = Toolkit::PushButton::New();
169   - effectChangeButton.SetUnselectedImage( CHANGE_EFFECT_IMAGE );
170   - effectChangeButton.SetSelectedImage( CHANGE_EFFECT_IMAGE_SELECTED );
  170 + effectChangeButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_EFFECT_IMAGE );
  171 + effectChangeButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_EFFECT_IMAGE_SELECTED );
171 172 effectChangeButton.ClickedSignal().Connect( this, &TestApp::OnEffectButtonClicked );
172 173 toolBar.AddControl( effectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
173 174  
... ... @@ -180,8 +181,8 @@ public:
180 181  
181 182 //Add a reset button
182 183 Toolkit::PushButton resetButton = Toolkit::PushButton::New();
183   - resetButton.SetUnselectedImage( RESET_ICON );
184   - resetButton.SetSelectedImage( RESET_ICON_SELECTED );
  184 + resetButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, RESET_ICON );
  185 + resetButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, RESET_ICON_SELECTED );
185 186 resetButton.ClickedSignal().Connect( this, &TestApp::OnResetPressed );
186 187 toolBar.AddControl( resetButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING );
187 188  
... ...
examples/styling/styling-application.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -188,7 +188,7 @@ void StylingApplication::Create( Application&amp; application )
188 188 mRadioButtons[i].SetName( radioButtonStyleName.str() );
189 189 mRadioButtons[i].SetParentOrigin( ParentOrigin::TOP_LEFT );
190 190 mRadioButtons[i].SetAnchorPoint( AnchorPoint::TOP_LEFT );
191   - mRadioButtons[i].SetSelected( false );
  191 + mRadioButtons[i].SetProperty( Button::Property::SELECTED, false );
192 192 mRadioButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnButtonStateChange );
193 193  
194 194 radioButtonsLayout.AddChild( mRadioButtons[i], TableView::CellPosition( i, 0 ) );
... ... @@ -197,7 +197,7 @@ void StylingApplication::Create( Application&amp; application )
197 197 radioButtonsLayout.SetCellAlignment( TableView::CellPosition( i, 1 ), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
198 198 }
199 199  
200   - mRadioButtons[0].SetSelected( true );
  200 + mRadioButtons[0].SetProperty( Button::Property::SELECTED, true );
201 201  
202 202 mImagePlacement = Actor::New();
203 203 mImagePlacement.SetParentOrigin( ParentOrigin::CENTER );
... ... @@ -265,7 +265,7 @@ void StylingApplication::Create( Application&amp; application )
265 265 mCheckButtons[i].SetName( checkBoxStyleName.str() );
266 266 mCheckButtons[i].SetParentOrigin( ParentOrigin::CENTER );
267 267 mCheckButtons[i].SetAnchorPoint( AnchorPoint::CENTER );
268   - mCheckButtons[i].SetSelected( true );
  268 + mCheckButtons[i].SetProperty( Button::Property::SELECTED, true );
269 269  
270 270 mCheckButtons[i].StateChangedSignal().Connect( this, &StylingApplication::OnCheckButtonChange );
271 271 mCheckButtons[i].RegisterProperty( "channel", i, Property::READ_WRITE );
... ... @@ -484,20 +484,20 @@ bool StylingApplication::OnButtonStateChange( Button button )
484 484  
485 485 // Todo: save / restore slider states per image
486 486  
487   - if( button.IsSelected() )
  487 + if( button.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
488 488 {
489 489  
490 490 ImageChannelControl prevIcc = mImageChannelControl;
491 491  
492   - if( mRadioButtons[0].IsSelected() )
  492 + if( mRadioButtons[0].GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
493 493 {
494 494 mImageChannelControl = mIcc1;
495 495 }
496   - else if( mRadioButtons[1].IsSelected() )
  496 + else if( mRadioButtons[1].GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
497 497 {
498 498 mImageChannelControl = mIcc2;
499 499 }
500   - else if( mRadioButtons[2].IsSelected() )
  500 + else if( mRadioButtons[2].GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>() )
501 501 {
502 502 mImageChannelControl = mIcc3;
503 503 }
... ...
examples/super-blur-bloom/super-blur-bloom-example.cpp
1 1 /*
2   - * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -16,8 +16,9 @@
16 16 */
17 17 #include <dali/dali.h>
18 18 #include <dali-toolkit/dali-toolkit.h>
19   -#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
20 19 #include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
  20 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
  21 +#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
21 22 #include "shared/view.h"
22 23 #include "shared/utility.h"
23 24  
... ... @@ -81,8 +82,9 @@ private:
81 82  
82 83 // Add a button to change background. (right of toolbar)
83 84 Toolkit::PushButton changeBackgroundButton = Toolkit::PushButton::New();
84   - changeBackgroundButton.SetUnselectedImage( CHANGE_BACKGROUND_ICON );
85   - changeBackgroundButton.SetSelectedImage( CHANGE_BACKGROUND_ICON_SELECTED );
  85 + changeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON );
  86 + changeBackgroundButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BACKGROUND_ICON_SELECTED );
  87 +
86 88 changeBackgroundButton.ClickedSignal().Connect( this, &BlurExample::OnChangeBackgroundIconClicked );
87 89 mToolBar.AddControl( changeBackgroundButton,
88 90 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ... @@ -91,8 +93,9 @@ private:
91 93  
92 94 // Add a button to change the blur view. (left of toolbar)
93 95 Toolkit::PushButton changeBlurButton = Toolkit::PushButton::New();
94   - changeBlurButton.SetUnselectedImage( CHANGE_BLUR_ICON );
95   - changeBlurButton.SetSelectedImage( CHANGE_BLUR_ICON_SELECTED );
  96 + changeBlurButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_BLUR_ICON );
  97 + changeBlurButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_BLUR_ICON_SELECTED );
  98 +
96 99 changeBlurButton.ClickedSignal().Connect( this, &BlurExample::OnChangeBlurIconClicked );
97 100 mToolBar.AddControl( changeBlurButton,
98 101 DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
... ...
examples/text-editor/text-editor-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -22,7 +22,7 @@
22 22  
23 23 // EXTERNAL INCLUDES
24 24 #include <dali-toolkit/dali-toolkit.h>
25   -#include <iostream>
  25 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
26 26 #include <sstream>
27 27  
28 28 // INTERNAL INCLUDES
... ... @@ -140,8 +140,7 @@ public:
140 140 mColorButtonOption.SetParentOrigin( ParentOrigin::CENTER );
141 141 mColorButtonOption.SetAnchorPoint( AnchorPoint::CENTER );
142 142  
143   - mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, Color::BLACK );
144   - mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, Color::BLACK );
  143 + SetButtonColor( mColorButtonOption, Color::BLACK );
145 144  
146 145 mColorButtonOption.ClickedSignal().Connect( this, &TextEditorExample::OnChangeColorButtonClicked );
147 146 mColorContainer.Add( mColorButtonOption );
... ... @@ -208,8 +207,7 @@ public:
208 207 s << "color" << index;
209 208 button.SetName( s.str() );
210 209  
211   - button.SetProperty( Button::Property::UNSELECTED_COLOR, COLORS[index] );
212   - button.SetProperty( Button::Property::SELECTED_COLOR, COLORS[index] );
  210 + SetButtonColor( button, COLORS[index] );
213 211  
214 212 button.ClickedSignal().Connect( this, &TextEditorExample::OnColorButtonClicked );
215 213  
... ... @@ -253,8 +251,7 @@ public:
253 251 mEditor.SetProperty( TextEditor::Property::INPUT_COLOR, color );
254 252 }
255 253  
256   - mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, color );
257   - mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, color );
  254 + SetButtonColor( mColorButtonOption, color );
258 255  
259 256 mButtonContainer.SetVisible( false );
260 257 mButtonContainer.SetSensitive( false );
... ... @@ -267,14 +264,22 @@ public:
267 264 if( TextEditor::InputStyle::NONE != static_cast<TextEditor::InputStyle::Mask>( mask & TextEditor::InputStyle::COLOR ) )
268 265 {
269 266 const Vector4 color = editor.GetProperty( TextEditor::Property::INPUT_COLOR ).Get<Vector4>();
270   -
271   - mColorButtonOption.SetProperty( Button::Property::UNSELECTED_COLOR, color );
272   - mColorButtonOption.SetProperty( Button::Property::SELECTED_COLOR, color );
  267 + SetButtonColor( mColorButtonOption, color );
273 268 }
274 269  
275 270 editor.Reset();
276 271 }
277 272  
  273 + void SetButtonColor( Button& button, const Vector4& color )
  274 + {
  275 + Property::Map colorVisualMap;
  276 + colorVisualMap.Add( Visual::Property::TYPE, Visual::COLOR )
  277 + .Add( ColorVisual::Property::MIX_COLOR, color );
  278 +
  279 + button.SetProperty( DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, colorVisualMap );
  280 + button.SetProperty( DevelButton::Property::SELECTED_BACKGROUND_VISUAL, colorVisualMap );
  281 + }
  282 +
278 283 private:
279 284  
280 285 Application& mApplication;
... ...
examples/text-field/text-field-example.cpp
1 1 /*
2   - * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -22,6 +22,7 @@
22 22  
23 23 // EXTERNAL INCLUDES
24 24 #include <dali-toolkit/dali-toolkit.h>
  25 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
25 26 #include <dali-toolkit/devel-api/controls/popup/popup.h>
26 27 #include <iostream>
27 28 #include <dali/public-api/events/touch-point.h>
... ... @@ -86,8 +87,8 @@ public:
86 87 PushButton CreateFolderButton()
87 88 {
88 89 PushButton button = PushButton::New();
89   - button.SetUnselectedImage( FOLDER_ICON_IMAGE );
90   - button.SetSelectedImage( FOLDER_OPEN_ICON_IMAGE );
  90 + button.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, FOLDER_ICON_IMAGE );
  91 + button.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, FOLDER_OPEN_ICON_IMAGE );
91 92 button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
92 93 button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
93 94 ImageDimensions imageSize = ResourceImage::GetImageSize( FOLDER_ICON_IMAGE );
... ...
examples/video-view/video-view-example.cpp
1 1 /*
2   - * Copyright (c) 2016 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -17,6 +17,7 @@
17 17  
18 18 #include <dali/dali.h>
19 19 #include <dali-toolkit/dali-toolkit.h>
  20 +#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
20 21  
21 22 using namespace Dali;
22 23 using namespace Toolkit;
... ... @@ -150,20 +151,20 @@ class VideoViewController: public ConnectionTracker
150 151 mResetButton.SetVisible( false );
151 152 mResetButton.SetDisabled( true );
152 153  
153   - mPlayButton.SetUnselectedImage( PLAY_IMAGE );
154   - mPlayButton.SetSelectedImage( PLAY_IMAGE );
155   - mPauseButton.SetUnselectedImage( PAUSE_IMAGE );
156   - mPauseButton.SetSelectedImage( PAUSE_IMAGE );
  154 + mPlayButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PLAY_IMAGE );
  155 + mPlayButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PLAY_IMAGE );
  156 + mPauseButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, PAUSE_IMAGE );
  157 + mPauseButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, PAUSE_IMAGE );
157 158  
158   - mStopButton.SetUnselectedImage( STOP_IMAGE );
159   - mStopButton.SetSelectedImage( STOP_IMAGE );
160   - mResetButton.SetUnselectedImage( RESET_IMAGE );
161   - mResetButton.SetSelectedImage( RESET_IMAGE );
  159 + mStopButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, STOP_IMAGE );
  160 + mStopButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, STOP_IMAGE );
  161 + mResetButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, RESET_IMAGE );
  162 + mResetButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, RESET_IMAGE );
162 163  
163   - mBackwardButton.SetUnselectedImage( BACKWARD_IMAGE );
164   - mBackwardButton.SetSelectedImage( BACKWARD_IMAGE );
165   - mForwardButton.SetUnselectedImage( FORWARD_IMAGE );
166   - mForwardButton.SetSelectedImage( FORWARD_IMAGE );
  164 + mBackwardButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, BACKWARD_IMAGE );
  165 + mBackwardButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, BACKWARD_IMAGE );
  166 + mForwardButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, FORWARD_IMAGE );
  167 + mForwardButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, FORWARD_IMAGE );
167 168  
168 169 mPanGestureDetector = PanGestureDetector::New();
169 170 mPanGestureDetector.Attach( mVideoView );
... ...