Commit ad1313b2bb8ee3449d4faea7340cc8c2fbedf40f
[dali_1.0.48] Merge branch 'devel/master'
Change-Id: I8cf011d2c88f6a1547393af7a3d7d34951feb9f6
Showing
53 changed files
with
246 additions
and
191 deletions
examples/atlas/atlas-example.cpp
| ... | ... | @@ -31,6 +31,7 @@ namespace |
| 31 | 31 | const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-gradient.jpg" ); |
| 32 | 32 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 33 | 33 | const char * const LOSE_CONTEXT_IMAGE( DALI_IMAGE_DIR "icon-cluster-wobble.png" ); |
| 34 | +const char * const LOSE_CONTEXT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-cluster-wobble-selected.png" ); | |
| 34 | 35 | |
| 35 | 36 | Application gApplication; |
| 36 | 37 | AtlasController* gAtlasController(NULL); |
| ... | ... | @@ -71,7 +72,8 @@ public: |
| 71 | 72 | "Atlas" ); |
| 72 | 73 | |
| 73 | 74 | mLoseContextButton = Toolkit::PushButton::New(); |
| 74 | - mLoseContextButton.SetBackgroundImage( ResourceImage::New( LOSE_CONTEXT_IMAGE ) ); | |
| 75 | + mLoseContextButton.SetButtonImage( ResourceImage::New( LOSE_CONTEXT_IMAGE ) ); | |
| 76 | + mLoseContextButton.SetSelectedImage( ResourceImage::New( LOSE_CONTEXT_IMAGE_SELECTED ) ); | |
| 75 | 77 | mLoseContextButton.ClickedSignal().Connect( this, &AtlasController::OnLoseContextButtonClicked ); |
| 76 | 78 | mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 77 | 79 | ... | ... |
examples/bubble-effect/bubble-effect-example.cpp
| ... | ... | @@ -27,7 +27,9 @@ namespace |
| 27 | 27 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 28 | 28 | const char * const APPLICATION_TITLE( "Bubble Effect" ); |
| 29 | 29 | const char * const CHANGE_BACKGROUND_ICON( DALI_IMAGE_DIR "icon-change.png" ); |
| 30 | +const char * const CHANGE_BACKGROUND_ICON_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); | |
| 30 | 31 | const char * const CHANGE_BUBBLE_SHAPE_ICON( DALI_IMAGE_DIR "icon-replace.png" ); |
| 32 | +const char * const CHANGE_BUBBLE_SHAPE_ICON_SELECTED( DALI_IMAGE_DIR "icon-replace-selected.png" ); | |
| 31 | 33 | |
| 32 | 34 | const char* BACKGROUND_IMAGES[]= |
| 33 | 35 | { |
| ... | ... | @@ -109,7 +111,8 @@ private: |
| 109 | 111 | |
| 110 | 112 | // Add a button to change background. (right of toolbar) |
| 111 | 113 | mChangeBackgroundButton = Toolkit::PushButton::New(); |
| 112 | - mChangeBackgroundButton.SetBackgroundImage( ResourceImage::New( CHANGE_BACKGROUND_ICON ) ); | |
| 114 | + mChangeBackgroundButton.SetButtonImage( ResourceImage::New( CHANGE_BACKGROUND_ICON ) ); | |
| 115 | + mChangeBackgroundButton.SetSelectedImage( ResourceImage::New( CHANGE_BACKGROUND_ICON_SELECTED ) ); | |
| 113 | 116 | mChangeBackgroundButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked ); |
| 114 | 117 | toolBar.AddControl( mChangeBackgroundButton, |
| 115 | 118 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -117,7 +120,8 @@ private: |
| 117 | 120 | DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 118 | 121 | // Add a button to change bubble shape. ( left of bar ) |
| 119 | 122 | mChangeBubbleShapeButton = Toolkit::PushButton::New(); |
| 120 | - mChangeBubbleShapeButton.SetBackgroundImage( ResourceImage::New( CHANGE_BUBBLE_SHAPE_ICON ) ); | |
| 123 | + mChangeBubbleShapeButton.SetButtonImage( ResourceImage::New( CHANGE_BUBBLE_SHAPE_ICON ) ); | |
| 124 | + mChangeBubbleShapeButton.SetSelectedImage( ResourceImage::New( CHANGE_BUBBLE_SHAPE_ICON_SELECTED ) ); | |
| 121 | 125 | mChangeBubbleShapeButton.ClickedSignal().Connect( this, &BubbleEffectExample::OnChangeIconClicked ); |
| 122 | 126 | toolBar.AddControl( mChangeBubbleShapeButton, |
| 123 | 127 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, | ... | ... |
examples/builder/examples.cpp
| ... | ... | @@ -53,6 +53,7 @@ namespace |
| 53 | 53 | const char* BACKGROUND_IMAGE( "" ); |
| 54 | 54 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 55 | 55 | const char* EDIT_IMAGE( DALI_IMAGE_DIR "icon-change.png" ); |
| 56 | +const char* EDIT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); | |
| 56 | 57 | |
| 57 | 58 | std::string USER_DIRECTORY; |
| 58 | 59 | |
| ... | ... | @@ -512,7 +513,8 @@ public: |
| 512 | 513 | |
| 513 | 514 | // Create an edit mode button. (left of toolbar) |
| 514 | 515 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| 515 | - editButton.SetBackgroundImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 516 | + editButton.SetButtonImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 517 | + editButton.SetSelectedImage( ResourceImage::New( EDIT_IMAGE_SELECTED ) ); | |
| 516 | 518 | editButton.ClickedSignal().Connect( this, &ExampleApp::OnToolSelectLayout); |
| 517 | 519 | editButton.SetLeaveRequired( true ); |
| 518 | 520 | mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); | ... | ... |
examples/buttons/buttons-example.cpp
| ... | ... | @@ -45,13 +45,6 @@ const char* const BIG_IMAGE_3 = DALI_IMAGE_DIR "gallery-large-13.jpg"; |
| 45 | 45 | |
| 46 | 46 | const char* const ENABLED_IMAGE = DALI_IMAGE_DIR "item-select-check.png"; |
| 47 | 47 | |
| 48 | -const char* const PUSHBUTTON_PRESS_IMAGE = DALI_IMAGE_DIR "button-down.9.png"; | |
| 49 | -const char* const PUSHBUTTON_DISABLED_IMAGE = DALI_IMAGE_DIR "button-disabled.9.png"; | |
| 50 | -const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; | |
| 51 | - | |
| 52 | -const char* const CHECKBOX_UNSELECTED_IMAGE = DALI_IMAGE_DIR "checkbox-unselected.png"; | |
| 53 | -const char* const CHECKBOX_SELECTED_IMAGE = DALI_IMAGE_DIR "checkbox-selected.png"; | |
| 54 | - | |
| 55 | 48 | const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f ); |
| 56 | 49 | |
| 57 | 50 | // Layout sizes |
| ... | ... | @@ -198,10 +191,6 @@ class ButtonsController: public ConnectionTracker |
| 198 | 191 | mUpdateButton.SetLabel( "Select" ); |
| 199 | 192 | mUpdateButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); |
| 200 | 193 | |
| 201 | - mUpdateButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 202 | - mUpdateButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 203 | - mUpdateButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 204 | - | |
| 205 | 194 | mUpdateButton.ClickedSignal().Connect( this, &ButtonsController::OnButtonClicked ); |
| 206 | 195 | |
| 207 | 196 | radioGroup2Background.AddChild( mUpdateButton, Toolkit::TableView::CellPosition( 1, 0 ) ); |
| ... | ... | @@ -296,41 +285,32 @@ class ButtonsController: public ConnectionTracker |
| 296 | 285 | |
| 297 | 286 | contentTable.Add( checkBoxBackground ); |
| 298 | 287 | |
| 299 | - Dali::Image unselected = Dali::ResourceImage::New( CHECKBOX_UNSELECTED_IMAGE ); | |
| 300 | - Dali::Image selected = Dali::ResourceImage::New( CHECKBOX_SELECTED_IMAGE ); | |
| 301 | - | |
| 302 | 288 | { |
| 303 | - Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New(); | |
| 304 | - checkBox.SetName( "checkbox1" ); | |
| 305 | - checkBox.SetBackgroundImage( unselected ); | |
| 306 | - checkBox.SetSelectedImage( selected ); | |
| 307 | - checkBox.SetLabel( "CheckBox1 is unselected" ); | |
| 308 | - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 309 | - | |
| 310 | - checkBoxBackground.Add( checkBox ); | |
| 289 | + mCheckboxButton1 = Toolkit::CheckBoxButton::New(); | |
| 290 | + mCheckboxButton1.SetName( "checkbox1" ); | |
| 291 | + mCheckboxButton1.SetLabel( "CheckBox1 is unselected" ); | |
| 292 | + mCheckboxButton1.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 293 | + | |
| 294 | + checkBoxBackground.Add( mCheckboxButton1 ); | |
| 311 | 295 | } |
| 312 | 296 | |
| 313 | 297 | { |
| 314 | - Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New(); | |
| 315 | - checkBox.SetName( "checkbox2" ); | |
| 316 | - checkBox.SetBackgroundImage( unselected ); | |
| 317 | - checkBox.SetSelectedImage( selected ); | |
| 318 | - checkBox.SetLabel( "CheckBox2 is selected" ); | |
| 319 | - checkBox.SetSelected( true ); | |
| 320 | - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 321 | - | |
| 322 | - checkBoxBackground.Add( checkBox ); | |
| 298 | + mCheckboxButton2 = Toolkit::CheckBoxButton::New(); | |
| 299 | + mCheckboxButton2.SetName( "checkbox2" ); | |
| 300 | + mCheckboxButton2.SetLabel( "CheckBox2 is selected" ); | |
| 301 | + mCheckboxButton2.SetSelected( true ); | |
| 302 | + mCheckboxButton2.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 303 | + | |
| 304 | + checkBoxBackground.Add( mCheckboxButton2 ); | |
| 323 | 305 | } |
| 324 | 306 | |
| 325 | 307 | { |
| 326 | - Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New(); | |
| 327 | - checkBox.SetName( "checkbox3" ); | |
| 328 | - checkBox.SetBackgroundImage( unselected ); | |
| 329 | - checkBox.SetSelectedImage( selected ); | |
| 330 | - checkBox.SetLabel( "CheckBox3 is unselected" ); | |
| 331 | - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 332 | - | |
| 333 | - checkBoxBackground.Add( checkBox ); | |
| 308 | + mCheckboxButton3 = Toolkit::CheckBoxButton::New(); | |
| 309 | + mCheckboxButton3.SetName( "checkbox3" ); | |
| 310 | + mCheckboxButton3.SetLabel( "CheckBox3 is unselected" ); | |
| 311 | + mCheckboxButton3.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); | |
| 312 | + | |
| 313 | + checkBoxBackground.Add( mCheckboxButton3 ); | |
| 334 | 314 | } |
| 335 | 315 | |
| 336 | 316 | // Create togglabe button |
| ... | ... | @@ -347,19 +327,14 @@ class ButtonsController: public ConnectionTracker |
| 347 | 327 | |
| 348 | 328 | contentTable.Add( toggleBackground ); |
| 349 | 329 | |
| 350 | - Toolkit::PushButton toggleButton = Toolkit::PushButton::New(); | |
| 351 | - toggleButton.SetTogglableButton( true ); | |
| 352 | - toggleButton.SetLabel( "Unselected" ); | |
| 353 | - toggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); | |
| 354 | - toggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); | |
| 355 | - | |
| 356 | - toggleButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 357 | - toggleButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 358 | - toggleButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 330 | + mToggleButton = Toolkit::PushButton::New(); | |
| 331 | + mToggleButton.SetTogglableButton( true ); | |
| 332 | + mToggleButton.SetLabel( "Unselected" ); | |
| 333 | + mToggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); | |
| 334 | + mToggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); | |
| 335 | + mToggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonSelected ); | |
| 359 | 336 | |
| 360 | - toggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonSelected ); | |
| 361 | - | |
| 362 | - toggleBackground.Add( toggleButton ); | |
| 337 | + toggleBackground.Add( mToggleButton ); | |
| 363 | 338 | } |
| 364 | 339 | |
| 365 | 340 | void OnKeyEvent( const KeyEvent& event ) |
| ... | ... | @@ -397,10 +372,30 @@ class ButtonsController: public ConnectionTracker |
| 397 | 372 | if( button.GetName() == "radio-select-enable" && button.IsSelected() == true ) |
| 398 | 373 | { |
| 399 | 374 | mUpdateButton.SetDisabled( false ); |
| 375 | + | |
| 376 | + mRadioButtonImage1.SetDisabled( false ); | |
| 377 | + mRadioButtonImage2.SetDisabled( false ); | |
| 378 | + mRadioButtonImage3.SetDisabled( false ); | |
| 379 | + | |
| 380 | + mCheckboxButton1.SetDisabled( false ); | |
| 381 | + mCheckboxButton2.SetDisabled( false ); | |
| 382 | + mCheckboxButton3.SetDisabled( false ); | |
| 383 | + | |
| 384 | + mToggleButton.SetDisabled( false ); | |
| 400 | 385 | } |
| 401 | 386 | else if( button.GetName() == "radio-select-disable" && button.IsSelected() == true ) |
| 402 | 387 | { |
| 403 | 388 | mUpdateButton.SetDisabled( true ); |
| 389 | + | |
| 390 | + mRadioButtonImage1.SetDisabled( true ); | |
| 391 | + mRadioButtonImage2.SetDisabled( true ); | |
| 392 | + mRadioButtonImage3.SetDisabled( true ); | |
| 393 | + | |
| 394 | + mCheckboxButton1.SetDisabled( true ); | |
| 395 | + mCheckboxButton2.SetDisabled( true ); | |
| 396 | + mCheckboxButton3.SetDisabled( true ); | |
| 397 | + | |
| 398 | + mToggleButton.SetDisabled( true ); | |
| 404 | 399 | } |
| 405 | 400 | |
| 406 | 401 | return true; |
| ... | ... | @@ -504,6 +499,11 @@ class ButtonsController: public ConnectionTracker |
| 504 | 499 | Toolkit::RadioButton mRadioButtonImage3; |
| 505 | 500 | |
| 506 | 501 | Toolkit::PushButton mUpdateButton; |
| 502 | + Toolkit::PushButton mToggleButton; | |
| 503 | + | |
| 504 | + Toolkit::CheckBoxButton mCheckboxButton1; | |
| 505 | + Toolkit::CheckBoxButton mCheckboxButton2; | |
| 506 | + Toolkit::CheckBoxButton mCheckboxButton3; | |
| 507 | 507 | |
| 508 | 508 | Animation mAnimation; |
| 509 | 509 | float mLastPoint; | ... | ... |
examples/cluster/cluster-example.cpp
| ... | ... | @@ -41,9 +41,13 @@ const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" ); |
| 41 | 41 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 42 | 42 | const char * const APPLICATION_TITLE( "Clusters" ); |
| 43 | 43 | const char * const LAYOUT_NONE_IMAGE( DALI_IMAGE_DIR "icon-cluster-none.png" ); |
| 44 | +const char * const LAYOUT_NONE_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-cluster-none-selected.png" ); | |
| 44 | 45 | const char * const LAYOUT_MOTION_BLUR_IMAGE( DALI_IMAGE_DIR "icon-cluster-wobble.png" ); |
| 46 | +const char * const LAYOUT_MOTION_BLUR_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-cluster-wobble-selected.png" ); | |
| 45 | 47 | const char * const LAYOUT_CAROUSEL_IMAGE( DALI_IMAGE_DIR "icon-cluster-carousel.png" ); |
| 48 | +const char * const LAYOUT_CAROUSEL_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-cluster-carousel-selected.png" ); | |
| 46 | 49 | const char * const LAYOUT_SPHERE_IMAGE( DALI_IMAGE_DIR "icon-cluster-sphere.png" ); |
| 50 | +const char * const LAYOUT_SPHERE_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-cluster-sphere-selected.png" ); | |
| 47 | 51 | |
| 48 | 52 | enum ClusterType |
| 49 | 53 | { |
| ... | ... | @@ -151,11 +155,11 @@ const float SPHERE_EFFECT_VERTICAL_DOMAIN = 0.15f; ///< In Sphere Effec |
| 151 | 155 | */ |
| 152 | 156 | enum ExampleEffectType |
| 153 | 157 | { |
| 154 | - NO_EFFECT, | |
| 158 | + NO_EFFECT = 0, | |
| 155 | 159 | MOTION_BLUR_EFFECT, |
| 156 | 160 | CAROUSEL_EFFECT, |
| 157 | 161 | SPHERE_EFFECT, |
| 158 | - TOTAL_EFFECTS | |
| 162 | + TOTAL_EFFECTS, | |
| 159 | 163 | }; |
| 160 | 164 | |
| 161 | 165 | /** |
| ... | ... | @@ -319,6 +323,13 @@ struct ShrinkConstraint |
| 319 | 323 | } |
| 320 | 324 | }; |
| 321 | 325 | |
| 326 | +struct ButtonImages | |
| 327 | +{ | |
| 328 | + Image mButtonImage; | |
| 329 | + Image mSelectedImage; | |
| 330 | +}; | |
| 331 | + | |
| 332 | + | |
| 322 | 333 | } // unnamed namespace |
| 323 | 334 | |
| 324 | 335 | /** |
| ... | ... | @@ -379,10 +390,14 @@ public: |
| 379 | 390 | mContentLayer.SetProperty(Layer::Property::BEHAVIOR, "Dali::Layer::LAYER_3D"); |
| 380 | 391 | |
| 381 | 392 | // Create a effect toggle button. (right of toolbar) |
| 382 | - mLayoutButtonImages[ NO_EFFECT ] = ResourceImage::New( LAYOUT_NONE_IMAGE ); | |
| 383 | - mLayoutButtonImages[ MOTION_BLUR_EFFECT ] = ResourceImage::New( LAYOUT_MOTION_BLUR_IMAGE ); | |
| 384 | - mLayoutButtonImages[ CAROUSEL_EFFECT ] = ResourceImage::New( LAYOUT_CAROUSEL_IMAGE ); | |
| 385 | - mLayoutButtonImages[ SPHERE_EFFECT ] = ResourceImage::New( LAYOUT_SPHERE_IMAGE ); | |
| 393 | + mLayoutButtonImages[ NO_EFFECT ].mButtonImage = ResourceImage::New( LAYOUT_NONE_IMAGE ); | |
| 394 | + mLayoutButtonImages[ NO_EFFECT ].mSelectedImage = ResourceImage::New( LAYOUT_NONE_IMAGE_SELECTED ); | |
| 395 | + mLayoutButtonImages[ MOTION_BLUR_EFFECT ].mButtonImage = ResourceImage::New( LAYOUT_MOTION_BLUR_IMAGE ); | |
| 396 | + mLayoutButtonImages[ MOTION_BLUR_EFFECT ].mSelectedImage = ResourceImage::New( LAYOUT_MOTION_BLUR_IMAGE_SELECTED ); | |
| 397 | + mLayoutButtonImages[ CAROUSEL_EFFECT ].mButtonImage = ResourceImage::New( LAYOUT_CAROUSEL_IMAGE ); | |
| 398 | + mLayoutButtonImages[ CAROUSEL_EFFECT ].mSelectedImage = ResourceImage::New( LAYOUT_CAROUSEL_IMAGE_SELECTED ); | |
| 399 | + mLayoutButtonImages[ SPHERE_EFFECT ].mButtonImage = ResourceImage::New( LAYOUT_SPHERE_IMAGE ); | |
| 400 | + mLayoutButtonImages[ SPHERE_EFFECT ].mSelectedImage = ResourceImage::New( LAYOUT_SPHERE_IMAGE_SELECTED ); | |
| 386 | 401 | |
| 387 | 402 | mLayoutButton = Toolkit::PushButton::New(); |
| 388 | 403 | mLayoutButton.ClickedSignal().Connect( this, &ClusterController::OnEffectTouched ); |
| ... | ... | @@ -616,7 +631,8 @@ public: |
| 616 | 631 | // Remove all shader-effects from mScrollView and it's children (the clusters) |
| 617 | 632 | mScrollView.SetPosition(Vector3::ZERO); |
| 618 | 633 | |
| 619 | - mLayoutButton.SetBackgroundImage( mLayoutButtonImages[ type ] ); | |
| 634 | + mLayoutButton.SetButtonImage( mLayoutButtonImages[ type ].mButtonImage ); | |
| 635 | + mLayoutButton.SetSelectedImage( mLayoutButtonImages[ type ].mSelectedImage ); | |
| 620 | 636 | |
| 621 | 637 | for( std::vector<ClusterInfo>::iterator i = mClusterInfo.begin(); i != mClusterInfo.end(); ++i ) |
| 622 | 638 | { |
| ... | ... | @@ -768,23 +784,16 @@ private: |
| 768 | 784 | ExampleEffectType mExampleEffect; ///< Current example effect. |
| 769 | 785 | |
| 770 | 786 | Toolkit::PushButton mLayoutButton; ///< The layout button |
| 771 | - Image mLayoutButtonImages[TOTAL_EFFECTS]; ///< Image when no layout | |
| 787 | + ButtonImages mLayoutButtonImages[TOTAL_EFFECTS]; ///< Image when no layout | |
| 772 | 788 | }; |
| 773 | 789 | |
| 774 | -void RunTest(Application& app) | |
| 775 | -{ | |
| 776 | - ClusterController test(app); | |
| 777 | - | |
| 778 | - app.MainLoop(); | |
| 779 | -} | |
| 780 | - | |
| 781 | 790 | // Entry point for Linux & Tizen applications |
| 782 | 791 | // |
| 783 | 792 | int main(int argc, char **argv) |
| 784 | 793 | { |
| 785 | 794 | Application app = Application::New(&argc, &argv, DALI_DEMO_THEME_PATH); |
| 786 | - | |
| 787 | - RunTest(app); | |
| 795 | + ClusterController test(app); | |
| 796 | + app.MainLoop(); | |
| 788 | 797 | |
| 789 | 798 | return 0; |
| 790 | 799 | } | ... | ... |
examples/cube-transition-effect/cube-transition-effect-example.cpp
| ... | ... | @@ -42,10 +42,15 @@ const char * const APPLICATION_TITLE_WAVE( "Cube Transition: Wave" ); |
| 42 | 42 | const char * const APPLICATION_TITLE_CROSS( "Cube Transition: Cross" ); |
| 43 | 43 | const char * const APPLICATION_TITLE_FOLD( "Cube Transition: Fold" ); |
| 44 | 44 | const char * const EFFECT_WAVE_IMAGE( DALI_IMAGE_DIR "icon-effect-wave.png" ); |
| 45 | +const char * const EFFECT_WAVE_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-effect-wave-selected.png" ); | |
| 45 | 46 | const char * const EFFECT_CROSS_IMAGE( DALI_IMAGE_DIR "icon-effect-cross.png" ); |
| 47 | +const char * const EFFECT_CROSS_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-effect-cross-selected.png" ); | |
| 46 | 48 | const char * const EFFECT_FOLD_IMAGE( DALI_IMAGE_DIR "icon-effect-fold.png" ); |
| 49 | +const char * const EFFECT_FOLD_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-effect-fold-selected.png" ); | |
| 47 | 50 | const char * const SLIDE_SHOW_START_ICON( DALI_IMAGE_DIR "icon-play.png" ); |
| 51 | +const char * const SLIDE_SHOW_START_ICON_SELECTED( DALI_IMAGE_DIR "icon-play-selected.png" ); | |
| 48 | 52 | const char * const SLIDE_SHOW_STOP_ICON( DALI_IMAGE_DIR "icon-stop.png" ); |
| 53 | +const char * const SLIDE_SHOW_STOP_ICON_SELECTED( DALI_IMAGE_DIR "icon-stop-selected.png" ); | |
| 49 | 54 | |
| 50 | 55 | const char* IMAGES[] = |
| 51 | 56 | { |
| ... | ... | @@ -197,14 +202,19 @@ private: |
| 197 | 202 | Timer mViewTimer; |
| 198 | 203 | Toolkit::PushButton mSlideshowButton; |
| 199 | 204 | Image mIconSlideshowStart; |
| 205 | + Image mIconSlideshowStartSelected; | |
| 200 | 206 | Image mIconSlideshowStop; |
| 207 | + Image mIconSlideshowStopSelected; | |
| 201 | 208 | |
| 202 | 209 | Vector2 mPanPosition; |
| 203 | 210 | Vector2 mPanDisplacement; |
| 204 | 211 | |
| 205 | 212 | Image mImageWave; |
| 213 | + Image mImageWaveSelected; | |
| 206 | 214 | Image mImageCross; |
| 215 | + Image mImageCrossSelected; | |
| 207 | 216 | Image mImageFold; |
| 217 | + Image mImageFoldSelected; | |
| 208 | 218 | Toolkit::PushButton mEffectChangeButton; |
| 209 | 219 | }; |
| 210 | 220 | |
| ... | ... | @@ -231,10 +241,14 @@ void CubeTransitionApp::OnInit( Application& application ) |
| 231 | 241 | |
| 232 | 242 | // Add an effect-changing button on the right of the tool bar. |
| 233 | 243 | mImageWave = ResourceImage::New( EFFECT_WAVE_IMAGE ); |
| 244 | + mImageWaveSelected = ResourceImage::New( EFFECT_WAVE_IMAGE_SELECTED ); | |
| 234 | 245 | mImageCross = ResourceImage::New( EFFECT_CROSS_IMAGE ); |
| 246 | + mImageCrossSelected = ResourceImage::New( EFFECT_CROSS_IMAGE_SELECTED ); | |
| 235 | 247 | mImageFold = ResourceImage::New( EFFECT_FOLD_IMAGE ); |
| 248 | + mImageFoldSelected = ResourceImage::New( EFFECT_FOLD_IMAGE_SELECTED ); | |
| 236 | 249 | mEffectChangeButton = Toolkit::PushButton::New(); |
| 237 | - mEffectChangeButton.SetBackgroundImage(mImageWave); | |
| 250 | + mEffectChangeButton.SetButtonImage( mImageWave ); | |
| 251 | + mEffectChangeButton.SetSelectedImage( mImageWaveSelected ); | |
| 238 | 252 | mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked ); |
| 239 | 253 | mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 240 | 254 | |
| ... | ... | @@ -244,9 +258,12 @@ void CubeTransitionApp::OnInit( Application& application ) |
| 244 | 258 | |
| 245 | 259 | //Add an slideshow icon on the right of the title |
| 246 | 260 | mIconSlideshowStart = ResourceImage::New( SLIDE_SHOW_START_ICON ); |
| 261 | + mIconSlideshowStartSelected = ResourceImage::New( SLIDE_SHOW_START_ICON_SELECTED ); | |
| 247 | 262 | mIconSlideshowStop = ResourceImage::New( SLIDE_SHOW_STOP_ICON ); |
| 263 | + mIconSlideshowStopSelected = ResourceImage::New( SLIDE_SHOW_STOP_ICON_SELECTED ); | |
| 248 | 264 | mSlideshowButton = Toolkit::PushButton::New(); |
| 249 | - mSlideshowButton.SetBackgroundImage( mIconSlideshowStart ); | |
| 265 | + mSlideshowButton.SetButtonImage( mIconSlideshowStart ); | |
| 266 | + mSlideshowButton.SetSelectedImage( mIconSlideshowStartSelected ); | |
| 250 | 267 | mSlideshowButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnSildeshowButtonClicked ); |
| 251 | 268 | mToolBar.AddControl( mSlideshowButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING ); |
| 252 | 269 | |
| ... | ... | @@ -357,20 +374,23 @@ bool CubeTransitionApp::OnEffectButtonClicked( Toolkit::Button button ) |
| 357 | 374 | { |
| 358 | 375 | mCurrentEffect = mCubeCrossEffect; |
| 359 | 376 | mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_CROSS) ); |
| 360 | - mEffectChangeButton.SetBackgroundImage(mImageCross); | |
| 377 | + mEffectChangeButton.SetButtonImage( mImageCross ); | |
| 378 | + mEffectChangeButton.SetSelectedImage( mImageCrossSelected ); | |
| 361 | 379 | |
| 362 | 380 | } |
| 363 | 381 | else if(mCurrentEffect == mCubeCrossEffect) |
| 364 | 382 | { |
| 365 | 383 | mCurrentEffect = mCubeFoldEffect; |
| 366 | 384 | mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_FOLD) ); |
| 367 | - mEffectChangeButton.SetBackgroundImage(mImageFold); | |
| 385 | + mEffectChangeButton.SetButtonImage( mImageFold ); | |
| 386 | + mEffectChangeButton.SetSelectedImage( mImageFoldSelected ); | |
| 368 | 387 | } |
| 369 | 388 | else |
| 370 | 389 | { |
| 371 | 390 | mCurrentEffect = mCubeWaveEffect; |
| 372 | 391 | mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_WAVE) ); |
| 373 | - mEffectChangeButton.SetBackgroundImage(mImageWave); | |
| 392 | + mEffectChangeButton.SetButtonImage( mImageWave ); | |
| 393 | + mEffectChangeButton.SetSelectedImage( mImageWaveSelected ); | |
| 374 | 394 | } |
| 375 | 395 | |
| 376 | 396 | // Set the current image to cube transition effect |
| ... | ... | @@ -385,7 +405,8 @@ bool CubeTransitionApp::OnSildeshowButtonClicked( Toolkit::Button button ) |
| 385 | 405 | if( mSlideshow ) |
| 386 | 406 | { |
| 387 | 407 | mPanGestureDetector.Detach( mParent ); |
| 388 | - mSlideshowButton.SetBackgroundImage( mIconSlideshowStop ); | |
| 408 | + mSlideshowButton.SetButtonImage( mIconSlideshowStop ); | |
| 409 | + mSlideshowButton.SetSelectedImage( mIconSlideshowStopSelected ); | |
| 389 | 410 | mPanPosition = Vector2( mViewSize.width, mViewSize.height*0.5f ); |
| 390 | 411 | mPanDisplacement = Vector2( -10.f, 0.f ); |
| 391 | 412 | mViewTimer.Start(); |
| ... | ... | @@ -393,7 +414,8 @@ bool CubeTransitionApp::OnSildeshowButtonClicked( Toolkit::Button button ) |
| 393 | 414 | else |
| 394 | 415 | { |
| 395 | 416 | mPanGestureDetector.Attach( mParent ); |
| 396 | - mSlideshowButton.SetBackgroundImage( mIconSlideshowStart ); | |
| 417 | + mSlideshowButton.SetButtonImage( mIconSlideshowStart ); | |
| 418 | + mSlideshowButton.SetSelectedImage( mIconSlideshowStartSelected ); | |
| 397 | 419 | mViewTimer.Stop(); |
| 398 | 420 | } |
| 399 | 421 | return true; | ... | ... |
examples/dissolve-effect/dissolve-effect-example.cpp
| ... | ... | @@ -37,9 +37,13 @@ const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 37 | 37 | const char * const APPLICATION_TITLE_HIGHP( "Dissolve Effect(highp)" ); |
| 38 | 38 | const char * const APPLICATION_TITLE_MEDIUMP( "Dissolve Effect(mediump)" ); |
| 39 | 39 | const char * const EFFECT_HIGHP_IMAGE( DALI_IMAGE_DIR "icon-highp.png" ); |
| 40 | +const char * const EFFECT_HIGHP_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-highp-selected.png" ); | |
| 40 | 41 | const char * const EFFECT_MEDIUMP_IMAGE( DALI_IMAGE_DIR "icon-mediump.png" ); |
| 42 | +const char * const EFFECT_MEDIUMP_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-mediump-selected.png" ); | |
| 41 | 43 | const char * const PLAY_ICON( DALI_IMAGE_DIR "icon-play.png" ); |
| 44 | +const char * const PLAY_ICON_SELECTED( DALI_IMAGE_DIR "icon-play-selected.png" ); | |
| 42 | 45 | const char * const STOP_ICON( DALI_IMAGE_DIR "icon-stop.png" ); |
| 46 | +const char * const STOP_ICON_SELECTED( DALI_IMAGE_DIR "icon-stop-selected.png" ); | |
| 43 | 47 | |
| 44 | 48 | const char* IMAGES[] = |
| 45 | 49 | { |
| ... | ... | @@ -177,11 +181,15 @@ private: |
| 177 | 181 | unsigned int mCentralLineIndex; |
| 178 | 182 | |
| 179 | 183 | Image mIconPlay; |
| 184 | + Image mIconPlaySelected; | |
| 180 | 185 | Image mIconStop; |
| 186 | + Image mIconStopSelected; | |
| 181 | 187 | Toolkit::PushButton mPlayStopButton; |
| 182 | 188 | |
| 183 | 189 | Image mIconHighP; |
| 190 | + Image mIconHighPSelected; | |
| 184 | 191 | Image mIconMediumP; |
| 192 | + Image mIconMediumPSelected; | |
| 185 | 193 | Toolkit::PushButton mEffectChangeButton; |
| 186 | 194 | }; |
| 187 | 195 | |
| ... | ... | @@ -211,9 +219,12 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 211 | 219 | |
| 212 | 220 | // Add an effect-changing button on the right of the tool bar. |
| 213 | 221 | mIconHighP = ResourceImage::New( EFFECT_HIGHP_IMAGE ); |
| 222 | + mIconHighPSelected = ResourceImage::New( EFFECT_HIGHP_IMAGE_SELECTED ); | |
| 214 | 223 | mIconMediumP = ResourceImage::New( EFFECT_MEDIUMP_IMAGE ); |
| 224 | + mIconMediumPSelected = ResourceImage::New( EFFECT_MEDIUMP_IMAGE_SELECTED ); | |
| 215 | 225 | mEffectChangeButton = Toolkit::PushButton::New(); |
| 216 | - mEffectChangeButton.SetBackgroundImage(mIconHighP); | |
| 226 | + mEffectChangeButton.SetButtonImage( mIconHighP ); | |
| 227 | + mEffectChangeButton.SetSelectedImage( mIconHighPSelected ); | |
| 217 | 228 | mEffectChangeButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnEffectButtonClicked ); |
| 218 | 229 | mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 219 | 230 | |
| ... | ... | @@ -223,9 +234,12 @@ void DissolveEffectApp::OnInit( Application& application ) |
| 223 | 234 | |
| 224 | 235 | // Add an slide-show button on the right of the title |
| 225 | 236 | mIconPlay = ResourceImage::New( PLAY_ICON ); |
| 237 | + mIconPlaySelected = ResourceImage::New( PLAY_ICON_SELECTED ); | |
| 226 | 238 | mIconStop = ResourceImage::New( STOP_ICON ); |
| 239 | + mIconStopSelected = ResourceImage::New( STOP_ICON_SELECTED ); | |
| 227 | 240 | mPlayStopButton = Toolkit::PushButton::New(); |
| 228 | - mPlayStopButton.SetBackgroundImage( mIconPlay ); | |
| 241 | + mPlayStopButton.SetButtonImage( mIconPlay ); | |
| 242 | + mPlayStopButton.SetSelectedImage( mIconPlaySelected ); | |
| 229 | 243 | mPlayStopButton.ClickedSignal().Connect( this, &DissolveEffectApp::OnSildeshowButtonClicked ); |
| 230 | 244 | mToolBar.AddControl( mPlayStopButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING ); |
| 231 | 245 | |
| ... | ... | @@ -336,12 +350,14 @@ bool DissolveEffectApp::OnEffectButtonClicked( Toolkit::Button button ) |
| 336 | 350 | if(mUseHighPrecision) |
| 337 | 351 | { |
| 338 | 352 | mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_HIGHP) ); |
| 339 | - mEffectChangeButton.SetBackgroundImage(mIconHighP); | |
| 353 | + mEffectChangeButton.SetButtonImage( mIconHighP ); | |
| 354 | + mEffectChangeButton.SetSelectedImage( mIconHighPSelected ); | |
| 340 | 355 | } |
| 341 | 356 | else |
| 342 | 357 | { |
| 343 | 358 | mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_MEDIUMP) ); |
| 344 | - mEffectChangeButton.SetBackgroundImage(mIconMediumP); | |
| 359 | + mEffectChangeButton.SetButtonImage( mIconMediumP ); | |
| 360 | + mEffectChangeButton.SetSelectedImage( mIconMediumPSelected ); | |
| 345 | 361 | } |
| 346 | 362 | |
| 347 | 363 | return true; |
| ... | ... | @@ -352,14 +368,16 @@ bool DissolveEffectApp::OnSildeshowButtonClicked( Toolkit::Button button ) |
| 352 | 368 | mSlideshow = !mSlideshow; |
| 353 | 369 | if( mSlideshow ) |
| 354 | 370 | { |
| 355 | - mPlayStopButton.SetBackgroundImage( mIconStop ); | |
| 371 | + mPlayStopButton.SetButtonImage( mIconStop ); | |
| 372 | + mPlayStopButton.SetSelectedImage( mIconStopSelected ); | |
| 356 | 373 | mPanGestureDetector.Detach( mParent ); |
| 357 | 374 | mViewTimer.Start(); |
| 358 | 375 | mTimerReady = false; |
| 359 | 376 | } |
| 360 | 377 | else |
| 361 | 378 | { |
| 362 | - mPlayStopButton.SetBackgroundImage( mIconPlay ); | |
| 379 | + mPlayStopButton.SetButtonImage( mIconPlay ); | |
| 380 | + mPlayStopButton.SetSelectedImage( mIconPlaySelected ); | |
| 363 | 381 | mTimerReady = true; |
| 364 | 382 | mPanGestureDetector.Attach( mParent ); |
| 365 | 383 | } | ... | ... |
examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp
| ... | ... | @@ -36,10 +36,6 @@ const char* const NEXT_BUTTON_ID = "NEXT_BUTTON"; |
| 36 | 36 | const char* const PREVIOUS_BUTTON_ID = "PREVIOUS_BUTTON"; |
| 37 | 37 | const char * const DALI_ICON_PLAY = DALI_IMAGE_DIR "icon-play.png"; |
| 38 | 38 | |
| 39 | -const char* const PUSHBUTTON_PRESS_IMAGE = DALI_IMAGE_DIR "button-down.9.png"; | |
| 40 | -const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; | |
| 41 | -const char* const PUSHBUTTON_DISABLED_IMAGE = DALI_IMAGE_DIR "button-disabled.9.png"; | |
| 42 | - | |
| 43 | 39 | const char* const FITTING_BUTTON_ID = "FITTING_BUTTON"; |
| 44 | 40 | const char* const SAMPLING_BUTTON_ID = "SAMPLING_BUTTON"; |
| 45 | 41 | const char* const FITTING_BUTTON_TEXT = "Fitting"; |
| ... | ... | @@ -229,9 +225,6 @@ public: |
| 229 | 225 | mGrabCorner = Toolkit::PushButton::New(); |
| 230 | 226 | mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH ); |
| 231 | 227 | mGrabCorner.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 232 | - mGrabCorner.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 233 | - mGrabCorner.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 234 | - mGrabCorner.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 235 | 228 | mGrabCorner.SetName( "GrabCorner" ); |
| 236 | 229 | mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); |
| 237 | 230 | mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT ); |
| ... | ... | @@ -382,9 +375,6 @@ public: |
| 382 | 375 | button.SetLabel( label ); |
| 383 | 376 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 384 | 377 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 385 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 386 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 387 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 388 | 378 | button.ClickedSignal().Connect( this, &ImageScalingAndFilteringController::OnButtonClicked ); |
| 389 | 379 | return button; |
| 390 | 380 | } |
| ... | ... | @@ -412,8 +402,6 @@ public: |
| 412 | 402 | Toolkit::PushButton button = Toolkit::PushButton::New(); |
| 413 | 403 | button.SetName( id ); |
| 414 | 404 | button.SetLabel( id ); |
| 415 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 416 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 417 | 405 | Toolkit::TextLabel textLabel = Toolkit::TextLabel::DownCast( button.GetLabel() ); |
| 418 | 406 | textLabel.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f ); |
| 419 | 407 | ... | ... |
examples/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp
| ... | ... | @@ -65,6 +65,7 @@ const char* BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-gradient.jpg" ); |
| 65 | 65 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 66 | 66 | const char* APPLICATION_TITLE( "Image Scaling Modes" ); |
| 67 | 67 | const char* TOGGLE_SCALING_IMAGE( DALI_IMAGE_DIR "icon-change.png" ); |
| 68 | +const char* TOGGLE_SCALING_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); | |
| 68 | 69 | |
| 69 | 70 | /** The width of the grid in whole grid cells. */ |
| 70 | 71 | const unsigned GRID_WIDTH = 9; |
| ... | ... | @@ -306,8 +307,10 @@ public: |
| 306 | 307 | |
| 307 | 308 | // Create an image scaling toggle button. (right of toolbar) |
| 308 | 309 | Image toggleScalingImage = ResourceImage::New( TOGGLE_SCALING_IMAGE ); |
| 310 | + Image toggleScalingImageSelected = ResourceImage::New( TOGGLE_SCALING_IMAGE_SELECTED ); | |
| 309 | 311 | Toolkit::PushButton toggleScalingButton = Toolkit::PushButton::New(); |
| 310 | - toggleScalingButton.SetBackgroundImage( toggleScalingImage ); | |
| 312 | + toggleScalingButton.SetButtonImage( toggleScalingImage ); | |
| 313 | + toggleScalingButton.SetSelectedImage( toggleScalingImageSelected ); | |
| 311 | 314 | toggleScalingButton.ClickedSignal().Connect( this, &ImageScalingIrregularGridController::OnToggleScalingTouched ); |
| 312 | 315 | mToolBar.AddControl( toggleScalingButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 313 | 316 | ... | ... |
examples/item-view/item-view-example.cpp
| ... | ... | @@ -107,12 +107,19 @@ const unsigned int NUM_IMAGE_PER_ROW_IN_ATLAS = 8; |
| 107 | 107 | const char* BACKGROUND_IMAGE( "" ); |
| 108 | 108 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 109 | 109 | const char* EDIT_IMAGE( DALI_IMAGE_DIR "icon-edit.png" ); |
| 110 | +const char* EDIT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-edit-selected.png" ); | |
| 110 | 111 | const char* SPIRAL_LAYOUT_IMAGE( DALI_IMAGE_DIR "icon-item-view-layout-spiral.png" ); |
| 112 | +const char* SPIRAL_LAYOUT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-item-view-layout-spiral-selected.png" ); | |
| 111 | 113 | const char* GRID_LAYOUT_IMAGE( DALI_IMAGE_DIR "icon-item-view-layout-grid.png" ); |
| 114 | +const char* GRID_LAYOUT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-item-view-layout-grid-selected.png" ); | |
| 112 | 115 | const char* DEPTH_LAYOUT_IMAGE( DALI_IMAGE_DIR "icon-item-view-layout-depth.png" ); |
| 116 | +const char* DEPTH_LAYOUT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-item-view-layout-depth-selected.png" ); | |
| 113 | 117 | const char* DELETE_IMAGE( DALI_IMAGE_DIR "icon-delete.png" ); |
| 118 | +const char* DELETE_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-delete-selected.png" ); | |
| 114 | 119 | const char* REPLACE_IMAGE( DALI_IMAGE_DIR "icon-replace.png" ); |
| 120 | +const char* REPLACE_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-replace-selected.png" ); | |
| 115 | 121 | const char* INSERT_IMAGE( DALI_IMAGE_DIR "icon-insert.png" ); |
| 122 | +const char* INSERT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-insert-selected.png" ); | |
| 116 | 123 | const char* SELECTED_IMAGE( DALI_IMAGE_DIR "item-select-check.png" ); |
| 117 | 124 | const char* APPLICATION_TITLE( "ItemView" ); |
| 118 | 125 | |
| ... | ... | @@ -224,14 +231,16 @@ public: |
| 224 | 231 | |
| 225 | 232 | // Create an edit mode button. (left of toolbar) |
| 226 | 233 | Toolkit::PushButton editButton = Toolkit::PushButton::New(); |
| 227 | - editButton.SetBackgroundImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 234 | + editButton.SetButtonImage( ResourceImage::New( EDIT_IMAGE ) ); | |
| 235 | + editButton.SetSelectedImage( ResourceImage::New( EDIT_IMAGE_SELECTED ) ); | |
| 228 | 236 | editButton.ClickedSignal().Connect( this, &ItemViewExample::OnModeButtonClicked); |
| 229 | 237 | editButton.SetLeaveRequired( true ); |
| 230 | 238 | mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 231 | 239 | |
| 232 | 240 | // Create a layout toggle button. (right of toolbar) |
| 233 | 241 | mLayoutButton = Toolkit::PushButton::New(); |
| 234 | - mLayoutButton.SetBackgroundImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 242 | + mLayoutButton.SetButtonImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 243 | + mLayoutButton.SetSelectedImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE_SELECTED ) ); | |
| 235 | 244 | mLayoutButton.ClickedSignal().Connect( this, &ItemViewExample::OnLayoutButtonClicked); |
| 236 | 245 | mLayoutButton.SetLeaveRequired( true ); |
| 237 | 246 | mToolBar.AddControl( mLayoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| ... | ... | @@ -243,6 +252,7 @@ public: |
| 243 | 252 | mDeleteButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 244 | 253 | mDeleteButton.SetDrawMode( DrawMode::OVERLAY ); |
| 245 | 254 | mDeleteButton.SetButtonImage( ResourceImage::New( DELETE_IMAGE ) ); |
| 255 | + mDeleteButton.SetSelectedImage( ResourceImage::New( DELETE_IMAGE_SELECTED ) ); | |
| 246 | 256 | mDeleteButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); |
| 247 | 257 | mDeleteButton.SetSize( Vector2( stageSize.width * 0.15f, stageSize.width * 0.15f ) ); |
| 248 | 258 | mDeleteButton.ClickedSignal().Connect( this, &ItemViewExample::OnDeleteButtonClicked); |
| ... | ... | @@ -257,6 +267,7 @@ public: |
| 257 | 267 | mInsertButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 258 | 268 | mInsertButton.SetDrawMode( DrawMode::OVERLAY ); |
| 259 | 269 | mInsertButton.SetButtonImage( ResourceImage::New( INSERT_IMAGE ) ); |
| 270 | + mInsertButton.SetSelectedImage( ResourceImage::New( INSERT_IMAGE_SELECTED ) ); | |
| 260 | 271 | mInsertButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); |
| 261 | 272 | mInsertButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 262 | 273 | mInsertButton.ClickedSignal().Connect( this, &ItemViewExample::OnInsertButtonClicked); |
| ... | ... | @@ -271,6 +282,7 @@ public: |
| 271 | 282 | mReplaceButton.SetPosition( BUTTON_BORDER, BUTTON_BORDER ); |
| 272 | 283 | mReplaceButton.SetDrawMode( DrawMode::OVERLAY ); |
| 273 | 284 | mReplaceButton.SetButtonImage( ResourceImage::New( REPLACE_IMAGE ) ); |
| 285 | + mReplaceButton.SetSelectedImage( ResourceImage::New( REPLACE_IMAGE_SELECTED ) ); | |
| 274 | 286 | mReplaceButton.SetBackgroundImage( ResourceImage::New( TOOLBAR_IMAGE ) ); |
| 275 | 287 | mReplaceButton.SetSize( stageSize.width * 0.15f, stageSize.width * 0.15f ); |
| 276 | 288 | mReplaceButton.ClickedSignal().Connect( this, &ItemViewExample::OnReplaceButtonClicked); |
| ... | ... | @@ -799,19 +811,22 @@ public: |
| 799 | 811 | { |
| 800 | 812 | case SPIRAL_LAYOUT: |
| 801 | 813 | { |
| 802 | - mLayoutButton.SetBackgroundImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 814 | + mLayoutButton.SetButtonImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE ) ); | |
| 815 | + mLayoutButton.SetSelectedImage( ResourceImage::New( SPIRAL_LAYOUT_IMAGE_SELECTED ) ); | |
| 803 | 816 | break; |
| 804 | 817 | } |
| 805 | 818 | |
| 806 | 819 | case GRID_LAYOUT: |
| 807 | 820 | { |
| 808 | - mLayoutButton.SetBackgroundImage( ResourceImage::New( GRID_LAYOUT_IMAGE ) ); | |
| 821 | + mLayoutButton.SetButtonImage( ResourceImage::New( GRID_LAYOUT_IMAGE ) ); | |
| 822 | + mLayoutButton.SetSelectedImage( ResourceImage::New( GRID_LAYOUT_IMAGE_SELECTED ) ); | |
| 809 | 823 | break; |
| 810 | 824 | } |
| 811 | 825 | |
| 812 | 826 | case DEPTH_LAYOUT: |
| 813 | 827 | { |
| 814 | - mLayoutButton.SetBackgroundImage( ResourceImage::New( DEPTH_LAYOUT_IMAGE ) ); | |
| 828 | + mLayoutButton.SetButtonImage( ResourceImage::New( DEPTH_LAYOUT_IMAGE ) ); | |
| 829 | + mLayoutButton.SetSelectedImage( ResourceImage::New( DEPTH_LAYOUT_IMAGE_SELECTED ) ); | |
| 815 | 830 | break; |
| 816 | 831 | } |
| 817 | 832 | ... | ... |
examples/logging/logging-example.cpp
| ... | ... | @@ -65,10 +65,6 @@ const int BUTTON_HEIGHT = LOGGER_GROUP_HEIGHT - MARGIN_SIZE * 2; |
| 65 | 65 | |
| 66 | 66 | const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f ); |
| 67 | 67 | |
| 68 | -const char* const PUSHBUTTON_PRESS_IMAGE = DALI_IMAGE_DIR "button-down.9.png"; | |
| 69 | -const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; | |
| 70 | -const char* const PUSHBUTTON_DISABLED_IMAGE = DALI_IMAGE_DIR "button-disabled.9.png"; | |
| 71 | - | |
| 72 | 68 | // Button IDs |
| 73 | 69 | const char* const LOGGER_1_RADIO_ID = "LOGGER_1_RADIO"; |
| 74 | 70 | const char* const LOGGER_2_RADIO_ID = "LOGGER_2_RADIO"; |
| ... | ... | @@ -292,11 +288,6 @@ class LoggingController: public ConnectionTracker |
| 292 | 288 | button.SetLabel( CREATE_BUTTON_TEXT ); |
| 293 | 289 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 294 | 290 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 295 | - | |
| 296 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 297 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 298 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 299 | - | |
| 300 | 291 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 301 | 292 | |
| 302 | 293 | createGroupBackground.Add( button ); |
| ... | ... | @@ -308,11 +299,6 @@ class LoggingController: public ConnectionTracker |
| 308 | 299 | button.SetLabel( DELETE_BUTTON_TEXT ); |
| 309 | 300 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 310 | 301 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 311 | - | |
| 312 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 313 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 314 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 315 | - | |
| 316 | 302 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 317 | 303 | |
| 318 | 304 | createGroupBackground.Add( button ); |
| ... | ... | @@ -335,11 +321,6 @@ class LoggingController: public ConnectionTracker |
| 335 | 321 | button.SetLabel( START_BUTTON_TEXT ); |
| 336 | 322 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 337 | 323 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 338 | - | |
| 339 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 340 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 341 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 342 | - | |
| 343 | 324 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 344 | 325 | |
| 345 | 326 | timingGroupBackground.Add( button ); |
| ... | ... | @@ -351,11 +332,6 @@ class LoggingController: public ConnectionTracker |
| 351 | 332 | button.SetLabel( STOP_BUTTON_TEXT ); |
| 352 | 333 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 353 | 334 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 354 | - | |
| 355 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 356 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 357 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 358 | - | |
| 359 | 335 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 360 | 336 | |
| 361 | 337 | timingGroupBackground.Add( button ); |
| ... | ... | @@ -377,11 +353,6 @@ class LoggingController: public ConnectionTracker |
| 377 | 353 | button.SetLabel( ENABLE_BUTTON_TEXT ); |
| 378 | 354 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 379 | 355 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 380 | - | |
| 381 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 382 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 383 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 384 | - | |
| 385 | 356 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 386 | 357 | |
| 387 | 358 | enableGroupBackground.Add( button ); |
| ... | ... | @@ -393,11 +364,6 @@ class LoggingController: public ConnectionTracker |
| 393 | 364 | button.SetLabel( DISABLE_BUTTON_TEXT ); |
| 394 | 365 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 395 | 366 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 396 | - | |
| 397 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 398 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 399 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 400 | - | |
| 401 | 367 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 402 | 368 | |
| 403 | 369 | enableGroupBackground.Add( button ); |
| ... | ... | @@ -481,11 +447,6 @@ class LoggingController: public ConnectionTracker |
| 481 | 447 | button.SetLabel( VSYNC_BUTTON_TEXT ); |
| 482 | 448 | button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH ); |
| 483 | 449 | button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); |
| 484 | - | |
| 485 | - button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 486 | - button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 487 | - button.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) ); | |
| 488 | - | |
| 489 | 450 | button.ClickedSignal().Connect( this, &LoggingController::OnButtonClicked ); |
| 490 | 451 | |
| 491 | 452 | vsyncGroupBackground.Add( button ); | ... | ... |
examples/motion-blur/motion-blur-example.cpp
| ... | ... | @@ -76,9 +76,12 @@ const char* BACKGROUND_IMAGE_PATH = DALI_IMAGE_DIR "background-default.png"; |
| 76 | 76 | |
| 77 | 77 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 78 | 78 | const char* LAYOUT_IMAGE( DALI_IMAGE_DIR "icon-change.png" ); |
| 79 | +const char* LAYOUT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); | |
| 79 | 80 | const char* APPLICATION_TITLE( "Motion Blur" ); |
| 80 | 81 | const char* EFFECTS_OFF_ICON( DALI_IMAGE_DIR "icon-effects-off.png" ); |
| 82 | +const char* EFFECTS_OFF_ICON_SELECTED( DALI_IMAGE_DIR "icon-effects-off-selected.png" ); | |
| 81 | 83 | const char* EFFECTS_ON_ICON( DALI_IMAGE_DIR "icon-effects-on.png" ); |
| 84 | +const char* EFFECTS_ON_ICON_SELECTED( DALI_IMAGE_DIR "icon-effects-on-selected.png" ); | |
| 82 | 85 | |
| 83 | 86 | const float UI_MARGIN = 4.0f; ///< Screen Margin for placement of UI buttons |
| 84 | 87 | |
| ... | ... | @@ -164,17 +167,22 @@ public: |
| 164 | 167 | |
| 165 | 168 | //Add an effects icon on the right of the title |
| 166 | 169 | mIconEffectsOff = ResourceImage::New( EFFECTS_OFF_ICON ); |
| 170 | + mIconEffectsOffSelected = ResourceImage::New( EFFECTS_OFF_ICON_SELECTED ); | |
| 167 | 171 | mIconEffectsOn = ResourceImage::New( EFFECTS_ON_ICON ); |
| 172 | + mIconEffectsOnSelected = ResourceImage::New( EFFECTS_ON_ICON_SELECTED ); | |
| 168 | 173 | mActorEffectsButton = Toolkit::PushButton::New(); |
| 169 | - mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); | |
| 174 | + mActorEffectsButton.SetButtonImage( mIconEffectsOff ); | |
| 175 | + mActorEffectsButton.SetSelectedImage( mIconEffectsOffSelected ); | |
| 170 | 176 | mActorEffectsButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnEffectButtonClicked ); |
| 171 | 177 | mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING ); |
| 172 | 178 | |
| 173 | 179 | // Creates a mode button. |
| 174 | 180 | // Create a effect toggle button. (right of toolbar) |
| 175 | 181 | Image imageLayout = ResourceImage::New( LAYOUT_IMAGE ); |
| 182 | + Image imageLayoutSelected = ResourceImage::New( LAYOUT_IMAGE_SELECTED ); | |
| 176 | 183 | Toolkit::PushButton layoutButton = Toolkit::PushButton::New(); |
| 177 | - layoutButton.SetBackgroundImage(imageLayout); | |
| 184 | + layoutButton.SetButtonImage( imageLayout ); | |
| 185 | + layoutButton.SetSelectedImage( imageLayoutSelected ); | |
| 178 | 186 | layoutButton.ClickedSignal().Connect( this, &MotionBlurExampleApp::OnLayoutButtonClicked); |
| 179 | 187 | layoutButton.SetLeaveRequired( true ); |
| 180 | 188 | mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| ... | ... | @@ -447,12 +455,14 @@ public: |
| 447 | 455 | if(!mActorEffectsEnabled) |
| 448 | 456 | { |
| 449 | 457 | mActorEffectsEnabled = true; |
| 450 | - mActorEffectsButton.SetBackgroundImage( mIconEffectsOn ); | |
| 458 | + mActorEffectsButton.SetButtonImage( mIconEffectsOn ); | |
| 459 | + mActorEffectsButton.SetSelectedImage( mIconEffectsOnSelected ); | |
| 451 | 460 | } |
| 452 | 461 | else |
| 453 | 462 | { |
| 454 | 463 | mActorEffectsEnabled = false; |
| 455 | - mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); | |
| 464 | + mActorEffectsButton.SetButtonImage( mIconEffectsOff ); | |
| 465 | + mActorEffectsButton.SetSelectedImage( mIconEffectsOffSelected ); | |
| 456 | 466 | } |
| 457 | 467 | } |
| 458 | 468 | |
| ... | ... | @@ -513,7 +523,9 @@ private: |
| 513 | 523 | Toolkit::Control mView; |
| 514 | 524 | Toolkit::ToolBar mToolBar; |
| 515 | 525 | Image mIconEffectsOff; |
| 526 | + Image mIconEffectsOffSelected; | |
| 516 | 527 | Image mIconEffectsOn; |
| 528 | + Image mIconEffectsOnSelected; | |
| 517 | 529 | |
| 518 | 530 | Layer mContentLayer; ///< Content layer (contains actor for this blur demo) |
| 519 | 531 | ... | ... |
examples/motion-stretch/motion-stretch-example.cpp
| ... | ... | @@ -62,9 +62,12 @@ const char* BACKGROUND_IMAGE_PATH = DALI_IMAGE_DIR "background-default.png"; |
| 62 | 62 | |
| 63 | 63 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 64 | 64 | const char* LAYOUT_IMAGE( DALI_IMAGE_DIR "icon-change.png" ); |
| 65 | +const char* LAYOUT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); | |
| 65 | 66 | const char* APPLICATION_TITLE( "Motion Stretch" ); |
| 66 | 67 | const char* EFFECTS_OFF_ICON( DALI_IMAGE_DIR "icon-effects-off.png" ); |
| 68 | +const char* EFFECTS_OFF_ICON_SELECTED( DALI_IMAGE_DIR "icon-effects-off-selected.png" ); | |
| 67 | 69 | const char* EFFECTS_ON_ICON( DALI_IMAGE_DIR "icon-effects-on.png" ); |
| 70 | +const char* EFFECTS_ON_ICON_SELECTED( DALI_IMAGE_DIR "icon-effects-on-selected.png" ); | |
| 68 | 71 | |
| 69 | 72 | // These values depend on the button background image |
| 70 | 73 | const Vector4 BUTTON_IMAGE_BORDER( Vector4::ONE * 3.0f ); |
| ... | ... | @@ -138,17 +141,22 @@ public: |
| 138 | 141 | |
| 139 | 142 | //Add an slideshow icon on the right of the title |
| 140 | 143 | mIconEffectsOff = ResourceImage::New( EFFECTS_OFF_ICON ); |
| 144 | + mIconEffectsOffSelected = ResourceImage::New( EFFECTS_OFF_ICON_SELECTED ); | |
| 141 | 145 | mIconEffectsOn = ResourceImage::New( EFFECTS_ON_ICON ); |
| 146 | + mIconEffectsOnSelected = ResourceImage::New( EFFECTS_ON_ICON_SELECTED ); | |
| 142 | 147 | mActorEffectsButton = Toolkit::PushButton::New(); |
| 143 | - mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); | |
| 148 | + mActorEffectsButton.SetButtonImage( mIconEffectsOff ); | |
| 149 | + mActorEffectsButton.SetSelectedImage( mIconEffectsOffSelected ); | |
| 144 | 150 | mActorEffectsButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnEffectButtonClicked ); |
| 145 | 151 | mToolBar.AddControl( mActorEffectsButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING ); |
| 146 | 152 | |
| 147 | 153 | // Creates a mode button. |
| 148 | 154 | // Create a effect toggle button. (right of toolbar) |
| 149 | 155 | Image imageLayout = ResourceImage::New( LAYOUT_IMAGE ); |
| 156 | + Image imageLayoutSelected = ResourceImage::New( LAYOUT_IMAGE_SELECTED ); | |
| 150 | 157 | Toolkit::PushButton layoutButton = Toolkit::PushButton::New(); |
| 151 | - layoutButton.SetBackgroundImage(imageLayout); | |
| 158 | + layoutButton.SetButtonImage( imageLayout ); | |
| 159 | + layoutButton.SetSelectedImage( imageLayoutSelected ); | |
| 152 | 160 | layoutButton.ClickedSignal().Connect( this, &MotionStretchExampleApp::OnLayoutButtonClicked); |
| 153 | 161 | layoutButton.SetLeaveRequired( true ); |
| 154 | 162 | mToolBar.AddControl( layoutButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| ... | ... | @@ -341,12 +349,14 @@ public: |
| 341 | 349 | if(!mActorEffectsEnabled) |
| 342 | 350 | { |
| 343 | 351 | mActorEffectsEnabled = true; |
| 344 | - mActorEffectsButton.SetBackgroundImage( mIconEffectsOn ); | |
| 352 | + mActorEffectsButton.SetButtonImage( mIconEffectsOn ); | |
| 353 | + mActorEffectsButton.SetSelectedImage( mIconEffectsOnSelected ); | |
| 345 | 354 | } |
| 346 | 355 | else |
| 347 | 356 | { |
| 348 | 357 | mActorEffectsEnabled = false; |
| 349 | - mActorEffectsButton.SetBackgroundImage( mIconEffectsOff ); | |
| 358 | + mActorEffectsButton.SetButtonImage( mIconEffectsOff ); | |
| 359 | + mActorEffectsButton.SetSelectedImage( mIconEffectsOffSelected ); | |
| 350 | 360 | } |
| 351 | 361 | } |
| 352 | 362 | |
| ... | ... | @@ -407,7 +417,9 @@ private: |
| 407 | 417 | Toolkit::Control mView; |
| 408 | 418 | Toolkit::ToolBar mToolBar; |
| 409 | 419 | Image mIconEffectsOff; |
| 420 | + Image mIconEffectsOffSelected; | |
| 410 | 421 | Image mIconEffectsOn; |
| 422 | + Image mIconEffectsOnSelected; | |
| 411 | 423 | Layer mContentLayer; ///< Content layer (contains actor for this stretch demo) |
| 412 | 424 | |
| 413 | 425 | PushButton mActorEffectsButton; ///< The actor effects toggling Button. | ... | ... |
examples/new-window/new-window-example.cpp
| ... | ... | @@ -35,6 +35,7 @@ namespace |
| 35 | 35 | const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-2.jpg" ); |
| 36 | 36 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 37 | 37 | const char * const LOSE_CONTEXT_IMAGE( DALI_IMAGE_DIR "icon-cluster-wobble.png" ); |
| 38 | +const char * const LOSE_CONTEXT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-cluster-wobble-selected.png" ); | |
| 38 | 39 | const char * const BASE_IMAGE( DALI_IMAGE_DIR "gallery-large-14.jpg" ); |
| 39 | 40 | const char * const EFFECT_IMAGE( DALI_IMAGE_DIR "gallery-large-18.jpg" ); |
| 40 | 41 | const char * const LOGO_IMAGE(DALI_IMAGE_DIR "dali-logo.png"); |
| ... | ... | @@ -198,7 +199,8 @@ void NewWindowController::Create( Application& app ) |
| 198 | 199 | } |
| 199 | 200 | |
| 200 | 201 | mLoseContextButton = Toolkit::PushButton::New(); |
| 201 | - mLoseContextButton.SetBackgroundImage( ResourceImage::New( LOSE_CONTEXT_IMAGE ) ); | |
| 202 | + mLoseContextButton.SetButtonImage( ResourceImage::New( LOSE_CONTEXT_IMAGE ) ); | |
| 203 | + mLoseContextButton.SetSelectedImage( ResourceImage::New( LOSE_CONTEXT_IMAGE_SELECTED ) ); | |
| 202 | 204 | mLoseContextButton.ClickedSignal().Connect( this, &NewWindowController::OnLoseContextButtonClicked ); |
| 203 | 205 | mToolBar.AddControl( mLoseContextButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 204 | 206 | ... | ... |
examples/radial-menu/radial-menu-example.cpp
| ... | ... | @@ -33,7 +33,9 @@ const char* TEST_DIAL_FILENAME = DALI_IMAGE_DIR "layer4.png"; // Image to be mas |
| 33 | 33 | const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); // Background for toolbar |
| 34 | 34 | const char* APPLICATION_TITLE( "Radial Menu" ); |
| 35 | 35 | const char * const PLAY_ICON( DALI_IMAGE_DIR "icon-play.png" ); |
| 36 | +const char * const PLAY_ICON_SELECTED( DALI_IMAGE_DIR "icon-play-selected.png" ); | |
| 36 | 37 | const char * const STOP_ICON( DALI_IMAGE_DIR "icon-stop.png" ); |
| 38 | +const char * const STOP_ICON_SELECTED( DALI_IMAGE_DIR "icon-stop-selected.png" ); | |
| 37 | 39 | } |
| 38 | 40 | |
| 39 | 41 | |
| ... | ... | @@ -107,7 +109,9 @@ private: // Member variables |
| 107 | 109 | AnimState mAnimationState; |
| 108 | 110 | |
| 109 | 111 | Image mIconPlay; |
| 112 | + Image mIconPlaySelected; | |
| 110 | 113 | Image mIconStop; |
| 114 | + Image mIconStopSelected; | |
| 111 | 115 | Toolkit::PushButton mPlayStopButton; |
| 112 | 116 | ImageActor mDialActor; |
| 113 | 117 | RadialSweepView mRadialSweepView1; |
| ... | ... | @@ -145,9 +149,12 @@ void RadialMenuExample::OnInit(Application& app) |
| 145 | 149 | APPLICATION_TITLE ); |
| 146 | 150 | |
| 147 | 151 | mIconPlay = ResourceImage::New( PLAY_ICON ); |
| 152 | + mIconPlaySelected = ResourceImage::New( PLAY_ICON_SELECTED ); | |
| 148 | 153 | mIconStop = ResourceImage::New( STOP_ICON ); |
| 154 | + mIconStopSelected = ResourceImage::New( STOP_ICON_SELECTED ); | |
| 149 | 155 | mPlayStopButton = Toolkit::PushButton::New(); |
| 150 | - mPlayStopButton.SetBackgroundImage( mIconStop ); | |
| 156 | + mPlayStopButton.SetButtonImage( mIconStop ); | |
| 157 | + mPlayStopButton.SetSelectedImage( mIconStopSelected ); | |
| 151 | 158 | |
| 152 | 159 | mPlayStopButton.ClickedSignal().Connect( this, &RadialMenuExample::OnButtonClicked ); |
| 153 | 160 | |
| ... | ... | @@ -216,7 +223,8 @@ bool RadialMenuExample::OnButtonClicked( Toolkit::Button button ) |
| 216 | 223 | { |
| 217 | 224 | mAnimation.Pause(); |
| 218 | 225 | mAnimationState = PAUSED; |
| 219 | - mPlayStopButton.SetBackgroundImage( mIconPlay ); | |
| 226 | + mPlayStopButton.SetButtonImage( mIconPlay ); | |
| 227 | + mPlayStopButton.SetSelectedImage( mIconPlaySelected ); | |
| 220 | 228 | } |
| 221 | 229 | break; |
| 222 | 230 | |
| ... | ... | @@ -224,13 +232,15 @@ bool RadialMenuExample::OnButtonClicked( Toolkit::Button button ) |
| 224 | 232 | { |
| 225 | 233 | mAnimation.Play(); |
| 226 | 234 | mAnimationState = PLAYING; |
| 227 | - mPlayStopButton.SetBackgroundImage( mIconStop ); | |
| 235 | + mPlayStopButton.SetButtonImage( mIconStop ); | |
| 236 | + mPlayStopButton.SetSelectedImage( mIconStopSelected ); | |
| 228 | 237 | } |
| 229 | 238 | break; |
| 230 | 239 | |
| 231 | 240 | case STOPPED: |
| 232 | 241 | { |
| 233 | - mPlayStopButton.SetBackgroundImage( mIconStop ); | |
| 242 | + mPlayStopButton.SetButtonImage( mIconStop ); | |
| 243 | + mPlayStopButton.SetSelectedImage( mIconStopSelected ); | |
| 234 | 244 | mRadialSweepView1.Deactivate(); |
| 235 | 245 | mRadialSweepView2.Deactivate(); |
| 236 | 246 | mRadialSweepView3.Deactivate(); |
| ... | ... | @@ -243,7 +253,8 @@ bool RadialMenuExample::OnButtonClicked( Toolkit::Button button ) |
| 243 | 253 | void RadialMenuExample::OnAnimationFinished( Animation& source ) |
| 244 | 254 | { |
| 245 | 255 | mAnimationState = STOPPED; |
| 246 | - mPlayStopButton.SetBackgroundImage( mIconPlay ); | |
| 256 | + mPlayStopButton.SetButtonImage( mIconPlay ); | |
| 257 | + mPlayStopButton.SetSelectedImage( mIconPlaySelected ); | |
| 247 | 258 | } |
| 248 | 259 | |
| 249 | 260 | RadialSweepView RadialMenuExample::CreateSweepView( std::string imageName, | ... | ... |
examples/refraction-effect/refraction-effect-example.cpp
| ... | ... | @@ -34,7 +34,9 @@ namespace |
| 34 | 34 | const char * const APPLICATION_TITLE( "Refraction Effect" ); |
| 35 | 35 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 36 | 36 | const char * const CHANGE_TEXTURE_ICON( DALI_IMAGE_DIR "icon-change.png" ); |
| 37 | +const char * const CHANGE_TEXTURE_ICON_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); | |
| 37 | 38 | const char * const CHANGE_MESH_ICON( DALI_IMAGE_DIR "icon-replace.png" ); |
| 39 | +const char * const CHANGE_MESH_ICON_SELECTED( DALI_IMAGE_DIR "icon-replace-selected.png" ); | |
| 38 | 40 | |
| 39 | 41 | const char* MESH_FILES[] = |
| 40 | 42 | { |
| ... | ... | @@ -255,7 +257,8 @@ private: |
| 255 | 257 | |
| 256 | 258 | // Add a button to change background. (right of toolbar) |
| 257 | 259 | mChangeTextureButton = Toolkit::PushButton::New(); |
| 258 | - mChangeTextureButton.SetBackgroundImage( ResourceImage::New( CHANGE_TEXTURE_ICON ) ); | |
| 260 | + mChangeTextureButton.SetButtonImage( ResourceImage::New( CHANGE_TEXTURE_ICON ) ); | |
| 261 | + mChangeTextureButton.SetSelectedImage( ResourceImage::New( CHANGE_TEXTURE_ICON_SELECTED ) ); | |
| 259 | 262 | mChangeTextureButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeTexture ); |
| 260 | 263 | toolBar.AddControl( mChangeTextureButton, |
| 261 | 264 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, |
| ... | ... | @@ -263,7 +266,8 @@ private: |
| 263 | 266 | DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 264 | 267 | // Add a button to change mesh pattern. ( left of bar ) |
| 265 | 268 | mChangeMeshButton = Toolkit::PushButton::New(); |
| 266 | - mChangeMeshButton.SetBackgroundImage( ResourceImage::New( CHANGE_MESH_ICON ) ); | |
| 269 | + mChangeMeshButton.SetButtonImage( ResourceImage::New( CHANGE_MESH_ICON ) ); | |
| 270 | + mChangeMeshButton.SetSelectedImage( ResourceImage::New( CHANGE_MESH_ICON_SELECTED ) ); | |
| 267 | 271 | mChangeMeshButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeMesh ); |
| 268 | 272 | toolBar.AddControl( mChangeMeshButton, |
| 269 | 273 | DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, | ... | ... |
examples/scroll-view/scroll-view-example.cpp
| ... | ... | @@ -32,6 +32,7 @@ const char * const BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" ); |
| 32 | 32 | const char * const TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" ); |
| 33 | 33 | const char * const APPLICATION_TITLE( "ScrollView" ); |
| 34 | 34 | const char * const EFFECT_CAROUSEL_IMAGE( DALI_IMAGE_DIR "icon-scroll-view-carousel.png" ); |
| 35 | +const char * const EFFECT_CAROUSEL_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-scroll-view-carousel-selected.png" ); | |
| 35 | 36 | |
| 36 | 37 | const Vector3 ICON_SIZE(100.0f, 100.0f, 0.0f); |
| 37 | 38 | |
| ... | ... | @@ -173,9 +174,13 @@ public: |
| 173 | 174 | "" ); |
| 174 | 175 | |
| 175 | 176 | mEffectIcon[ PageCarouselEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); |
| 177 | + mEffectIconSelected[ PageCarouselEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE_SELECTED ); | |
| 176 | 178 | mEffectIcon[ PageCubeEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); |
| 179 | + mEffectIconSelected[ PageCubeEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE_SELECTED ); | |
| 177 | 180 | mEffectIcon[ PageSpiralEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); |
| 181 | + mEffectIconSelected[ PageSpiralEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE_SELECTED ); | |
| 178 | 182 | mEffectIcon[ PageWaveEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE ); |
| 183 | + mEffectIconSelected[ PageWaveEffect ] = ResourceImage::New( EFFECT_CAROUSEL_IMAGE_SELECTED ); | |
| 179 | 184 | |
| 180 | 185 | // Create a effect change button. (right of toolbar) |
| 181 | 186 | mEffectChangeButton = Toolkit::PushButton::New(); |
| ... | ... | @@ -239,7 +244,8 @@ private: |
| 239 | 244 | ss << APPLICATION_TITLE << ": " << EFFECT_MODE_NAME[mEffectMode]; |
| 240 | 245 | SetTitle(ss.str()); |
| 241 | 246 | |
| 242 | - mEffectChangeButton.SetBackgroundImage( mEffectIcon[ mEffectMode ] ); | |
| 247 | + mEffectChangeButton.SetButtonImage( mEffectIcon[ mEffectMode ] ); | |
| 248 | + mEffectChangeButton.SetSelectedImage( mEffectIconSelected[ mEffectMode ] ); | |
| 243 | 249 | |
| 244 | 250 | // remove old Effect if exists. |
| 245 | 251 | if(mScrollViewEffect) |
| ... | ... | @@ -577,6 +583,7 @@ private: |
| 577 | 583 | EffectMode mEffectMode; ///< Current Effect mode |
| 578 | 584 | |
| 579 | 585 | Image mEffectIcon[Total]; ///< Icons for the effect button |
| 586 | + Image mEffectIconSelected[Total]; ///< Icons for the effect button when its selected | |
| 580 | 587 | Toolkit::PushButton mEffectChangeButton; ///< Effect Change Button |
| 581 | 588 | }; |
| 582 | 589 | ... | ... |
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
| ... | ... | @@ -39,7 +39,9 @@ const char* APPLICATION_TITLE_PAN_OBJECT( "Lighting: Rotate Object" ); |
| 39 | 39 | const char* APPLICATION_TITLE_PAN_SCENE( "Lighting: Pan Scene" ); |
| 40 | 40 | const char* APPLICATION_TITLE_ROTATE_SCENE( "Lighting: Rotate Scene" ); |
| 41 | 41 | const char* CHANGE_EFFECT_IMAGE( DALI_IMAGE_DIR "icon-change.png" ); |
| 42 | +const char* CHANGE_EFFECT_IMAGE_SELECTED( DALI_IMAGE_DIR "icon-change-selected.png" ); | |
| 42 | 43 | const char* RESET_ICON( DALI_IMAGE_DIR "icon-reset.png" ); |
| 44 | +const char* RESET_ICON_SELECTED( DALI_IMAGE_DIR "icon-reset-selected.png" ); | |
| 43 | 45 | |
| 44 | 46 | const char* SCENE_IMAGE_1( DALI_IMAGE_DIR "gallery-small-10.jpg"); |
| 45 | 47 | const char* SCENE_IMAGE_2( DALI_IMAGE_DIR "gallery-small-42.jpg"); |
| ... | ... | @@ -145,8 +147,10 @@ public: |
| 145 | 147 | |
| 146 | 148 | // Add an effect-changing button on the right of the tool bar. |
| 147 | 149 | Image imageChangeEffect = ResourceImage::New( CHANGE_EFFECT_IMAGE ); |
| 150 | + Image imageChangeEffectSelected = ResourceImage::New( CHANGE_EFFECT_IMAGE_SELECTED ); | |
| 148 | 151 | Toolkit::PushButton effectChangeButton = Toolkit::PushButton::New(); |
| 149 | - effectChangeButton.SetBackgroundImage(imageChangeEffect); | |
| 152 | + effectChangeButton.SetButtonImage( imageChangeEffect ); | |
| 153 | + effectChangeButton.SetSelectedImage( imageChangeEffectSelected ); | |
| 150 | 154 | effectChangeButton.ClickedSignal().Connect( this, &TestApp::OnEffectButtonClicked ); |
| 151 | 155 | toolBar.AddControl( effectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 152 | 156 | |
| ... | ... | @@ -159,8 +163,10 @@ public: |
| 159 | 163 | |
| 160 | 164 | //Add a reset button |
| 161 | 165 | Image resetImage = ResourceImage::New( RESET_ICON ); |
| 166 | + Image resetImageSelected = ResourceImage::New( RESET_ICON_SELECTED ); | |
| 162 | 167 | Toolkit::PushButton resetButton = Toolkit::PushButton::New(); |
| 163 | - resetButton.SetBackgroundImage( resetImage ); | |
| 168 | + resetButton.SetButtonImage( resetImage ); | |
| 169 | + resetButton.SetSelectedImage( resetImageSelected ); | |
| 164 | 170 | resetButton.ClickedSignal().Connect( this, &TestApp::OnResetPressed ); |
| 165 | 171 | toolBar.AddControl( resetButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalCenter, DemoHelper::DEFAULT_PLAY_PADDING ); |
| 166 | 172 | ... | ... |
examples/size-negotiation/size-negotiation-example.cpp
| ... | ... | @@ -45,9 +45,7 @@ const char* const TOOLBAR_TITLE = "Negotiate Size"; |
| 45 | 45 | const int TOOLBAR_HEIGHT = 62; |
| 46 | 46 | |
| 47 | 47 | const char* MENU_ICON_IMAGE = DALI_IMAGE_DIR "icon-cluster-none.png"; |
| 48 | - | |
| 49 | -const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; | |
| 50 | -const char* const PUSHBUTTON_PRESS_IMAGE = DALI_IMAGE_DIR "button-down.9.png"; | |
| 48 | +const char* MENU_ICON_IMAGE_SELECTED = DALI_IMAGE_DIR "icon-cluster-none-selected.png"; | |
| 51 | 49 | |
| 52 | 50 | const char* const POPUPS_MENU_ID = "POPUPS_MENU"; |
| 53 | 51 | const char* const TABLEVIEW_MENU_ID = "TABLEVIEW_MENU"; |
| ... | ... | @@ -178,7 +176,8 @@ public: |
| 178 | 176 | |
| 179 | 177 | // Create menu button |
| 180 | 178 | Toolkit::PushButton viewButton = Toolkit::PushButton::New(); |
| 181 | - viewButton.SetBackgroundImage( ResourceImage::New( MENU_ICON_IMAGE ) ); | |
| 179 | + viewButton.SetButtonImage( ResourceImage::New( MENU_ICON_IMAGE ) ); | |
| 180 | + viewButton.SetSelectedImage( ResourceImage::New( MENU_ICON_IMAGE_SELECTED ) ); | |
| 182 | 181 | viewButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnMenu ); |
| 183 | 182 | mToolBar.AddControl( viewButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); |
| 184 | 183 | |
| ... | ... | @@ -261,6 +260,8 @@ public: |
| 261 | 260 | Toolkit::PushButton menuButton = Toolkit::PushButton::New(); |
| 262 | 261 | menuButton.SetName( MENU_ITEMS[ i ].name ); |
| 263 | 262 | menuButton.SetLabel( MENU_ITEMS[ i ].text ); |
| 263 | + menuButton.SetButtonImage( Actor() ); | |
| 264 | + menuButton.SetSelectedImage( Actor() ); | |
| 264 | 265 | menuButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnMenuSelect ); |
| 265 | 266 | |
| 266 | 267 | tableView.Add( menuButton ); |
| ... | ... | @@ -354,8 +355,6 @@ public: |
| 354 | 355 | Toolkit::PushButton okayButton = Toolkit::PushButton::New(); |
| 355 | 356 | okayButton.SetName( OKAY_BUTTON_ID ); |
| 356 | 357 | okayButton.SetLabel( "OK!" ); |
| 357 | - okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 358 | - okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 359 | 358 | |
| 360 | 359 | okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 361 | 360 | |
| ... | ... | @@ -370,8 +369,6 @@ public: |
| 370 | 369 | Toolkit::PushButton cancelButton = Toolkit::PushButton::New(); |
| 371 | 370 | cancelButton.SetName( CANCEL_BUTTON_ID ); |
| 372 | 371 | cancelButton.SetLabel( "Cancel" ); |
| 373 | - cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 374 | - cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 375 | 372 | |
| 376 | 373 | cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 377 | 374 | |
| ... | ... | @@ -380,8 +377,6 @@ public: |
| 380 | 377 | Toolkit::PushButton okayButton = Toolkit::PushButton::New(); |
| 381 | 378 | okayButton.SetName( OKAY_BUTTON_ID ); |
| 382 | 379 | okayButton.SetLabel( "OK!" ); |
| 383 | - okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 384 | - okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 385 | 380 | |
| 386 | 381 | okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 387 | 382 | |
| ... | ... | @@ -397,8 +392,6 @@ public: |
| 397 | 392 | Toolkit::PushButton cancelButton = Toolkit::PushButton::New(); |
| 398 | 393 | cancelButton.SetName( CANCEL_BUTTON_ID ); |
| 399 | 394 | cancelButton.SetLabel( "Cancel" ); |
| 400 | - cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 401 | - cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 402 | 395 | |
| 403 | 396 | cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 404 | 397 | |
| ... | ... | @@ -407,8 +400,6 @@ public: |
| 407 | 400 | Toolkit::PushButton okayButton = Toolkit::PushButton::New(); |
| 408 | 401 | okayButton.SetName( OKAY_BUTTON_ID ); |
| 409 | 402 | okayButton.SetLabel( "OK!" ); |
| 410 | - okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 411 | - okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 412 | 403 | |
| 413 | 404 | okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 414 | 405 | |
| ... | ... | @@ -523,8 +514,6 @@ public: |
| 523 | 514 | Toolkit::PushButton cancelButton = Toolkit::PushButton::New(); |
| 524 | 515 | cancelButton.SetName( CANCEL_BUTTON_ID ); |
| 525 | 516 | cancelButton.SetLabel( "Cancel" ); |
| 526 | - cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 527 | - cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 528 | 517 | |
| 529 | 518 | cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 530 | 519 | |
| ... | ... | @@ -533,8 +522,6 @@ public: |
| 533 | 522 | Toolkit::PushButton okayButton = Toolkit::PushButton::New(); |
| 534 | 523 | okayButton.SetName( OKAY_BUTTON_ID ); |
| 535 | 524 | okayButton.SetLabel( "OK!" ); |
| 536 | - okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 537 | - okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 538 | 525 | |
| 539 | 526 | okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 540 | 527 | |
| ... | ... | @@ -585,11 +572,7 @@ public: |
| 585 | 572 | root.SetFitWidth( 0 ); |
| 586 | 573 | root.SetPadding( Padding( 0.0f, 0.0f, 0.0f, 20.0f ) ); |
| 587 | 574 | |
| 588 | - Dali::Image unchecked = Dali::ResourceImage::New( CHECKBOX_UNCHECKED_IMAGE ); | |
| 589 | - Dali::Image checked = Dali::ResourceImage::New( CHECKBOX_CHECKED_IMAGE ); | |
| 590 | 575 | Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New(); |
| 591 | - checkBox.SetBackgroundImage( unchecked ); | |
| 592 | - checkBox.SetSelectedImage( checked ); | |
| 593 | 576 | checkBox.SetSize( 48, 48 ); |
| 594 | 577 | |
| 595 | 578 | root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) ); |
| ... | ... | @@ -609,8 +592,6 @@ public: |
| 609 | 592 | Toolkit::PushButton cancelButton = Toolkit::PushButton::New(); |
| 610 | 593 | cancelButton.SetName( CANCEL_BUTTON_ID ); |
| 611 | 594 | cancelButton.SetLabel( "Cancel" ); |
| 612 | - cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 613 | - cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 614 | 595 | |
| 615 | 596 | cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 616 | 597 | |
| ... | ... | @@ -619,8 +600,6 @@ public: |
| 619 | 600 | Toolkit::PushButton okayButton = Toolkit::PushButton::New(); |
| 620 | 601 | okayButton.SetName( OKAY_BUTTON_ID ); |
| 621 | 602 | okayButton.SetLabel( "OK!" ); |
| 622 | - okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 623 | - okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 624 | 603 | |
| 625 | 604 | okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 626 | 605 | |
| ... | ... | @@ -1250,9 +1229,6 @@ public: // From ItemFactory |
| 1250 | 1229 | popupButton.SetLabel( buttonDataArray[ itemId ].text ); |
| 1251 | 1230 | popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); |
| 1252 | 1231 | |
| 1253 | - popupButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) ); | |
| 1254 | - popupButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) ); | |
| 1255 | - | |
| 1256 | 1232 | popupButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked ); |
| 1257 | 1233 | |
| 1258 | 1234 | return popupButton; | ... | ... |
examples/text-field/text-field-example.cpp
| ... | ... | @@ -86,6 +86,7 @@ public: |
| 86 | 86 | ImageActor folderButton = ImageActor::New( image ); |
| 87 | 87 | folderButton.SetColor( Color::WHITE ); |
| 88 | 88 | button.SetButtonImage( folderButton ); |
| 89 | + button.SetSelectedImage( Actor() ); | |
| 89 | 90 | button.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 90 | 91 | button.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); |
| 91 | 92 | button.SetSize( image.GetWidth(), image.GetHeight() ); | ... | ... |
packaging/com.samsung.dali-demo.spec
resources/images/button-disabled.9.png deleted
852 Bytes
resources/images/button-down.9.png deleted
1.01 KB
resources/images/button-up.9.png deleted
1013 Bytes
resources/images/checkbox-selected.png deleted
1.94 KB
resources/images/checkbox-unselected.png deleted
629 Bytes
resources/images/icon-change-selected.png
0 → 100644
1.96 KB
resources/images/icon-cluster-carousel-selected.png
0 → 100644
1.69 KB
resources/images/icon-cluster-none-selected.png
0 → 100644
615 Bytes
resources/images/icon-cluster-sphere-selected.png
0 → 100644
1.91 KB
resources/images/icon-cluster-wobble-selected.png
0 → 100644
1.71 KB
resources/images/icon-delete-selected.png
0 → 100644
1 KB
resources/images/icon-edit-selected.png
0 → 100644
1.66 KB
resources/images/icon-effect-cross-selected.png
0 → 100644
838 Bytes
resources/images/icon-effect-fold-selected.png
0 → 100644
2.52 KB
resources/images/icon-effect-wave-selected.png
0 → 100644
2.2 KB
resources/images/icon-effects-off-selected.png
0 → 100644
941 Bytes
resources/images/icon-effects-on-selected.png
0 → 100644
1.3 KB
resources/images/icon-highp-selected.png
0 → 100644
1.14 KB
resources/images/icon-insert-selected.png
0 → 100644
1.08 KB
resources/images/icon-item-view-layout-depth-selected.png
0 → 100644
1.15 KB
resources/images/icon-item-view-layout-grid-selected.png
0 → 100644
1.08 KB
resources/images/icon-item-view-layout-spiral-selected.png
0 → 100644
2.02 KB
resources/images/icon-mediump-selected.png
0 → 100644
1.08 KB
resources/images/icon-play-selected.png
0 → 100644
1.81 KB
resources/images/icon-replace-selected.png
0 → 100644
1.35 KB
resources/images/icon-reset-selected.png
0 → 100644
2.02 KB
resources/images/icon-scroll-view-carousel-selected.png
0 → 100644
650 Bytes
resources/images/icon-scroll-view-depth-selected.png
0 → 100644
1.11 KB
resources/images/icon-scroll-view-inner-cube-selected.png
0 → 100644
1.12 KB
resources/images/icon-scroll-view-outer-cube-selected.png
0 → 100644
1.28 KB
resources/images/icon-scroll-view-spiral-selected.png
0 → 100644
1006 Bytes
resources/images/icon-stop-selected.png
0 → 100644
1.05 KB