diff --git a/demo/images/checkbox-checked.png b/demo/images/checkbox-selected.png index e3a8c43..e3a8c43 100644 --- a/demo/images/checkbox-checked.png +++ b/demo/images/checkbox-selected.png diff --git a/demo/images/checkbox-unchecked.png b/demo/images/checkbox-unselected.png index 58e9390..58e9390 100644 --- a/demo/images/checkbox-unchecked.png +++ b/demo/images/checkbox-unselected.png diff --git a/demo/scripts/button.json b/demo/scripts/button.json index 4a010cd..392f97d 100644 --- a/demo/scripts/button.json +++ b/demo/scripts/button.json @@ -32,7 +32,7 @@ "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png" } }, - "pressed-state-actor": { + "selected-state-actor": { "type": "ImageActor", "image": { "filename": "{DALI_IMAGE_DIR}blocks-brick-2.png" @@ -53,22 +53,22 @@ "size": [0, 200, 0], "label-actor": { "type": "TextView", - "text": "Dimmed" + "text": "Disabled" }, - "dimmed": true, + "disabled": true, "normal-state-actor": { "type": "ImageActor", "image": { "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png" } }, - "pressed-state-actor": { + "selected-state-actor": { "type": "ImageActor", "image": { "filename": "{DALI_IMAGE_DIR}blocks-brick-2.png" } }, - "dimmed-state-actor": { + "disabled-state-actor": { "type": "ImageActor", "image": { "filename": "{DALI_IMAGE_DIR}blocks-brick-3.png" @@ -97,7 +97,7 @@ "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png" } }, - "pressed-state-actor": { + "selected-state-actor": { "type": "ImageActor", "style": "STYLE_NINE_PATCH", "border": [26, 24, 26, 23], @@ -106,7 +106,7 @@ } }, "signals": [{ - "name": "toggled", + "name": "selected", "action": "set", "actor": "toggle-button", "property": "label-actor", diff --git a/demo/scripts/super-blur-view.json b/demo/scripts/super-blur-view.json index 873af00..dd31564 100644 --- a/demo/scripts/super-blur-view.json +++ b/demo/scripts/super-blur-view.json @@ -78,7 +78,7 @@ "filename": "{DALI_IMAGE_DIR}button-background.png" } }, - "pressed-state-actor": { + "selected-state-actor": { "type": "ImageActor", "style": "STYLE_NINE_PATCH", "border": [26, 24, 26, 23], diff --git a/examples/buttons/buttons-example.cpp b/examples/buttons/buttons-example.cpp index 32b6f79..770a91d 100644 --- a/examples/buttons/buttons-example.cpp +++ b/examples/buttons/buttons-example.cpp @@ -61,8 +61,8 @@ const char* const PUSHBUTTON_PRESS_IMAGE = DALI_IMAGE_DIR "button-down.9.png"; const char* const PUSHBUTTON_DISABLED_IMAGE = DALI_IMAGE_DIR "button-disabled.9.png"; const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png"; -const char* const CHECKBOX_UNCHECKED_IMAGE = DALI_IMAGE_DIR "checkbox-unchecked.png"; -const char* const CHECKBOX_CHECKED_IMAGE = DALI_IMAGE_DIR "checkbox-checked.png"; +const char* const CHECKBOX_UNSELECTED_IMAGE = DALI_IMAGE_DIR "checkbox-unselected.png"; +const char* const CHECKBOX_SELECTED_IMAGE = DALI_IMAGE_DIR "checkbox-selected.png"; const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f ); @@ -251,7 +251,7 @@ class ButtonsController: public ConnectionTracker radioButton.SetPosition( 0, 0 ); radioButton.SetSelected( true ); - radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButtonToggle ); + radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton ); radioButtonsGroup1.Add( radioButton ); } @@ -264,7 +264,7 @@ class ButtonsController: public ConnectionTracker radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); radioButton.SetPosition( 0, DP(50) ); - radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButtonToggle ); + radioButton.StateChangedSignal().Connect( this, &ButtonsController::EnableSelectButton ); radioButtonsGroup1.Add( radioButton ); } @@ -279,8 +279,8 @@ class ButtonsController: public ConnectionTracker checkBoxBackground.SetSize( DP(430), DP(GROUP3_HEIGHT) ); mContentLayer.Add( checkBoxBackground ); - Dali::Image unchecked = Dali::Image::New( CHECKBOX_UNCHECKED_IMAGE ); - Dali::Image checked = Dali::Image::New( CHECKBOX_CHECKED_IMAGE ); + Dali::Image unselected = Dali::Image::New( CHECKBOX_UNSELECTED_IMAGE ); + Dali::Image selected = Dali::Image::New( CHECKBOX_SELECTED_IMAGE ); int checkYPos = MARGIN_SIZE; @@ -290,15 +290,15 @@ class ButtonsController: public ConnectionTracker checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) ); checkBox.SetParentOrigin( ParentOrigin::TOP_LEFT ); checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - checkBox.SetBackgroundImage( unchecked ); - checkBox.SetCheckedImage( checked ); + checkBox.SetBackgroundImage( unselected ); + checkBox.SetSelectedImage( selected ); checkBox.SetSize( DP(48), DP(48) ); - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesToggled ); + checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); checkBoxBackground.Add( checkBox ); } - mCheckBox1State = Toolkit::TextView::New( "CheckBox1 is unchecked" ); + mCheckBox1State = Toolkit::TextView::New( "CheckBox1 is unselected" ); mCheckBox1State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); mCheckBox1State.SetPosition( DP(80), DP(checkYPos) ); @@ -312,16 +312,16 @@ class ButtonsController: public ConnectionTracker checkBox.SetName( "checkbox2" ); checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) ); checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - checkBox.SetBackgroundImage( unchecked ); - checkBox.SetCheckedImage( checked ); + checkBox.SetBackgroundImage( unselected ); + checkBox.SetSelectedImage( selected ); checkBox.SetSize( DP(48), DP(48) ); - checkBox.SetChecked( true ); - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesToggled ); + checkBox.SetSelected( true ); + checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); checkBoxBackground.Add( checkBox ); } - mCheckBox2State = Toolkit::TextView::New( "CheckBox2 is checked" ); + mCheckBox2State = Toolkit::TextView::New( "CheckBox2 is selected" ); mCheckBox2State.SetParentOrigin( ParentOrigin::TOP_LEFT ); mCheckBox2State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); mCheckBox2State.SetPosition( DP(80), DP(checkYPos) ); @@ -335,22 +335,22 @@ class ButtonsController: public ConnectionTracker checkBox.SetName( "checkbox3" ); checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) ); checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - checkBox.SetBackgroundImage( unchecked ); - checkBox.SetCheckedImage( checked ); + checkBox.SetBackgroundImage( unselected ); + checkBox.SetSelectedImage( selected ); checkBox.SetSize( DP(48), DP(48) ); - checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesToggled ); + checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); checkBoxBackground.Add( checkBox ); } - mCheckBox3State = Toolkit::TextView::New( "CheckBox3 is unchecked" ); + mCheckBox3State = Toolkit::TextView::New( "CheckBox3 is unselected" ); mCheckBox3State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); mCheckBox3State.SetPosition( DP(80), DP(checkYPos) ); checkBoxBackground.Add( mCheckBox3State ); - // Create toggle button + // Create togglabe button yPos += GROUP3_HEIGHT + MARGIN_SIZE; Actor toggleBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR ); @@ -361,18 +361,18 @@ class ButtonsController: public ConnectionTracker mContentLayer.Add( toggleBackground ); Toolkit::PushButton toggleButton = Toolkit::PushButton::New(); - toggleButton.SetToggleButton( true ); + toggleButton.SetTogglableButton( true ); toggleButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); toggleButton.SetAnchorPoint( AnchorPoint::TOP_LEFT ); toggleButton.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) ); - toggleButton.SetLabel( "Toggle OFF" ); + toggleButton.SetLabel( "Unselected" ); toggleButton.SetSize( DP(150), DP(BUTTON_HEIGHT) ); toggleButton.SetSelectedImage( Dali::Image::New( PUSHBUTTON_PRESS_IMAGE ) ); toggleButton.SetDisabledImage( Dali::Image::New( PUSHBUTTON_DISABLED_IMAGE ) ); toggleButton.SetButtonImage( Dali::Image::New( PUSHBUTTON_BUTTON_IMAGE ) ); - toggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonToggled ); + toggleButton.StateChangedSignal().Connect( this, &ButtonsController::OnButtonSelected ); toggleBackground.Add( toggleButton ); } @@ -389,31 +389,31 @@ class ButtonsController: public ConnectionTracker } } - bool OnButtonToggled( Toolkit::Button button, bool state ) + bool OnButtonSelected( Toolkit::Button button ) { Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button ); if( pushButton ) { - if( state ) + if( button.IsSelected() ) { - pushButton.SetLabel( "Toggle ON" ); + pushButton.SetLabel( "Selected" ); } else { - pushButton.SetLabel( "Toggle OFF" ); + pushButton.SetLabel( "Unselected" ); } } return true; } - bool EnableSelectButtonToggle( Toolkit::Button button, bool state ) + bool EnableSelectButton( Toolkit::Button button ) { - if( button.GetName() == "radio-select-enable" && state == true ) + if( button.GetName() == "radio-select-enable" && button.IsSelected() == true ) { mUpdateButton.SetDisabled( false ); } - else if( button.GetName() == "radio-select-disable" && state == true ) + else if( button.GetName() == "radio-select-disable" && button.IsSelected() == true ) { mUpdateButton.SetDisabled( true ); } @@ -438,41 +438,41 @@ class ButtonsController: public ConnectionTracker return true; } - bool OnCheckBoxesToggled( Toolkit::Button button, bool state ) + bool OnCheckBoxesSelected( Toolkit::Button button ) { if( button.GetName() == "checkbox1" ) { - if( state ) + if( button.IsSelected() ) { - mCheckBox1State.SetText("CheckBox1 is checked"); + mCheckBox1State.SetText("CheckBox1 is selected"); } else { - mCheckBox1State.SetText("CheckBox1 is unchecked"); + mCheckBox1State.SetText("CheckBox1 is unselected"); } } if( button.GetName() == "checkbox2" ) { - if( state ) + if( button.IsSelected() ) { - mCheckBox2State.SetText("CheckBox2 is checked"); + mCheckBox2State.SetText("CheckBox2 is selected"); } else { - mCheckBox2State.SetText("CheckBox2 is unchecked"); + mCheckBox2State.SetText("CheckBox2 is unselected"); } } if( button.GetName() == "checkbox3" ) { - if( state ) + if( button.IsSelected() ) { - mCheckBox3State.SetText("CheckBox3 is checked"); + mCheckBox3State.SetText("CheckBox3 is selected"); } else { - mCheckBox3State.SetText("CheckBox3 is unchecked"); + mCheckBox3State.SetText("CheckBox3 is unselected"); } } diff --git a/examples/cluster/cluster-example.cpp b/examples/cluster/cluster-example.cpp index 6af3c8d..91921f8 100644 --- a/examples/cluster/cluster-example.cpp +++ b/examples/cluster/cluster-example.cpp @@ -226,27 +226,6 @@ struct RescaleConstraint }; /** - * ClusterImageBorderSizeConstraint - */ -struct ClusterImageBorderSizeConstraint -{ - ClusterImageBorderSizeConstraint() - : mSizeOffset(Vector3(CLUSTER_IMAGE_BORDER_INDENT - 1, CLUSTER_IMAGE_BORDER_INDENT - 1, 0.0f) * 2.0f) - { - } - - Vector3 operator()(const Vector3& current, - const PropertyInput& referenceSizeProperty) - { - const Vector3& referenceSize = referenceSizeProperty.GetVector3(); - - return referenceSize + mSizeOffset; - } - - Vector3 mSizeOffset; ///< The amount to offset the size from referenceSize -}; - -/** * ShearEffectConstraint * * Constrains ShearEffect's tilt to be a function of scrollview's @@ -620,32 +599,29 @@ public: shadowActor.SetAnchorPoint(AnchorPoint::CENTER); shadowActor.SetPosition(Vector3(0.0f, 0.0f, -1.0f)); - // Apply size constraint to the image shadow - shadowActor.ApplyConstraint( Constraint::New( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( ShadowProperty::SIZE_SCALE ) ) ); - actor.Add(shadowActor); + // Apply size-relative mode to auto-size the image shadow + shadowActor.SetSizeMode( SIZE_RELATIVE_TO_PARENT ); + shadowActor.SetSizeModeFactor( ShadowProperty::SIZE_SCALE ); + actor.Add( shadowActor ); - // Add a picture image actor to actor. + // Add a picture image actor to actor (with equal size to the parent). Image image = Image::New( imagePath, attribs ); - ImageActor imageActor = ImageActor::New(image); + ImageActor imageActor = ImageActor::New( image ); imageActor.SetParentOrigin( ParentOrigin::CENTER ); imageActor.SetAnchorPoint( AnchorPoint::CENTER ); - imageActor.ApplyConstraint( Constraint::New( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) ); - actor.Add(imageActor); + imageActor.SetSizeMode( SIZE_EQUAL_TO_PARENT ); + actor.Add( imageActor ); - // Add a border image child actor - ImageActor borderActor = ImageActor::New(mClusterBorderImage); + // Add a border image child actor (with a fixed size offset from parent). + ImageActor borderActor = ImageActor::New( mClusterBorderImage ); borderActor.SetParentOrigin( ParentOrigin::CENTER ); borderActor.SetAnchorPoint( AnchorPoint::CENTER ); borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH ); borderActor.SetNinePatchBorder( CLUSTER_IMAGE_BORDER_ABSOLUTE ); - borderActor.SetPosition(Vector3(0.0f, 0.0f, 1.0f)); - - // Apply size constraint to the image border - Constraint constraint = Constraint::New(Actor::SIZE, - ParentSource(Actor::SIZE), - ClusterImageBorderSizeConstraint()); - borderActor.ApplyConstraint(constraint); - actor.Add(borderActor); + borderActor.SetPosition( Vector3( 0.0f, 0.0f, 1.0f ) ); + borderActor.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT ); + borderActor.SetSizeModeFactor( Vector3( CLUSTER_IMAGE_BORDER_INDENT - 1.0f, CLUSTER_IMAGE_BORDER_INDENT - 1.0f, 0.0f ) * 2.0f ); + actor.Add( borderActor ); return actor; } diff --git a/examples/logging/logging-example.cpp b/examples/logging/logging-example.cpp index a5e258a..34eb7f5 100644 --- a/examples/logging/logging-example.cpp +++ b/examples/logging/logging-example.cpp @@ -554,17 +554,17 @@ class LoggingController: public ConnectionTracker } } - bool LoggingRadioSelect( Toolkit::Button button, bool state ) + bool LoggingRadioSelect( Toolkit::Button button ) { - if( button.GetName() == LOGGER_1_RADIO_ID && state == true ) + if( button.GetName() == LOGGER_1_RADIO_ID && button.IsSelected() == true ) { mCurrentLogger = 0; } - else if( button.GetName() == LOGGER_2_RADIO_ID && state == true ) + else if( button.GetName() == LOGGER_2_RADIO_ID && button.IsSelected() == true ) { mCurrentLogger = 1; } - else if( button.GetName() == LOGGER_3_RADIO_ID && state == true ) + else if( button.GetName() == LOGGER_3_RADIO_ID && button.IsSelected() == true ) { mCurrentLogger = 2; } @@ -592,9 +592,9 @@ class LoggingController: public ConnectionTracker } } - bool FrequencyRadioSelect( Toolkit::Button button, bool state ) + bool FrequencyRadioSelect( Toolkit::Button button ) { - if( button.GetName() == FREQUENCY_1_RADIO_ID && state == true ) + if( button.GetName() == FREQUENCY_1_RADIO_ID && button.IsSelected() == true ) { if( mPerformanceLoggers[mCurrentLogger] ) { @@ -605,7 +605,7 @@ class LoggingController: public ConnectionTracker mLoggerStates[mCurrentLogger].frequency = HIGH_FREQUENCY; } } - else if( button.GetName() == FREQUENCY_2_RADIO_ID && state == true ) + else if( button.GetName() == FREQUENCY_2_RADIO_ID && button.IsSelected() == true ) { if( mPerformanceLoggers[mCurrentLogger] ) { @@ -616,7 +616,7 @@ class LoggingController: public ConnectionTracker mLoggerStates[mCurrentLogger].frequency = MEDIUM_FREQUENCY; } } - else if( button.GetName() == FREQUENCY_3_RADIO_ID && state == true ) + else if( button.GetName() == FREQUENCY_3_RADIO_ID && button.IsSelected() == true ) { if( mPerformanceLoggers[mCurrentLogger] ) { diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec index 6416f34..ac5e455 100755 --- a/packaging/com.samsung.dali-demo.spec +++ b/packaging/com.samsung.dali-demo.spec @@ -2,7 +2,7 @@ Name: com.samsung.dali-demo Summary: The OpenGLES Canvas Core Demo -Version: 1.0.29 +Version: 1.0.30 Release: 1 Group: System/Libraries License: Apache-2.0