PushButton button = PushButton::New();
Stage::GetCurrent().Add( button );
- // PushButton::PROPERTY_AUTO_REPEATING
+ // Button::PROPERTY_AUTO_REPEATING
button.SetAutoRepeating( false );
- DALI_TEST_CHECK( ! button.GetProperty< bool >( PushButton::PROPERTY_AUTO_REPEATING ) );
- button.SetProperty( PushButton::PROPERTY_AUTO_REPEATING, true );
+ DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_AUTO_REPEATING ) );
+ button.SetProperty( Button::PROPERTY_AUTO_REPEATING, true );
DALI_TEST_CHECK( button.IsAutoRepeating() ) ;
- DALI_TEST_CHECK( button.GetProperty< bool >( PushButton::PROPERTY_AUTO_REPEATING ) );
+ DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_AUTO_REPEATING ) );
- // PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY
+ // Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY
button.SetInitialAutoRepeatingDelay( 10.0f );
- DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
- button.SetProperty( PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, 25.0f );
+ DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ button.SetProperty( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, 25.0f );
DALI_TEST_EQUALS( 25.0f, button.GetInitialAutoRepeatingDelay(), TEST_LOCATION );
- DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
- // PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY
+ // Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY
button.SetNextAutoRepeatingDelay( 3.0f );
- DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
- button.SetProperty( PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY, 4.0f );
+ DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ button.SetProperty( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY, 4.0f );
DALI_TEST_EQUALS( 4.0f, button.GetNextAutoRepeatingDelay(), TEST_LOCATION );
- DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
- // PushButton::PROPERTY_TOGGLABLE
+ // Button::PROPERTY_TOGGLABLE
button.SetToggleButton( false );
- DALI_TEST_CHECK( ! button.GetProperty< bool >( PushButton::PROPERTY_TOGGLABLE ) );
- button.SetProperty( PushButton::PROPERTY_TOGGLABLE, true );
+ DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_TOGGLABLE ) );
+ button.SetProperty( Button::PROPERTY_TOGGLABLE, true );
DALI_TEST_CHECK( button.IsToggleButton() ) ;
- DALI_TEST_CHECK( button.GetProperty< bool >( PushButton::PROPERTY_TOGGLABLE ) );
+ DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_TOGGLABLE ) );
- // PushButton::PROPERTY_TOGGLE
+ // Button::PROPERTY_TOGGLED
button.SetToggled( false );
- DALI_TEST_CHECK( ! button.GetProperty< bool >( PushButton::PROPERTY_TOGGLE ) );
- button.SetProperty( PushButton::PROPERTY_TOGGLE, true );
+ DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_TOGGLED ) );
+ button.SetProperty( Button::PROPERTY_TOGGLED, true );
DALI_TEST_CHECK( button.IsToggled() ) ;
- DALI_TEST_CHECK( button.GetProperty< bool >( PushButton::PROPERTY_TOGGLE ) );
+ DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_TOGGLED ) );
- // PushButton::PROPERTY_NORMAL_STATE_ACTOR
+ // Button::PROPERTY_NORMAL_STATE_ACTOR
{
button.SetButtonImage( Image::New( "IMAGE_PATH_1") );
- DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "ImageActor";
- button.SetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "ImageActor", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ button.SetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR, map );
+ DALI_TEST_EQUALS( "ImageActor", button.GetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
}
- // PushButton::PROPERTY_PRESSED_IMAGE
+ // Button::PROPERTY_SELECTED_STATE_ACTOR
{
- button.SetPressedImage( Image::New( "IMAGE_PATH_2") );
- DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+ button.SetSelectedImage( Image::New( "IMAGE_PATH_2") );
+ DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "Actor";
- button.SetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
- DALI_TEST_CHECK( "ImageActor" != button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
+ button.SetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR, map );
+ DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_CHECK( "ImageActor" != button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
}
- // PushButton::PROPERTY_DIMMED_STATE_ACTOR
+ // Button::PROPERTY_DISABLED_STATE_ACTOR
{
button.SetDimmedImage( Image::New( "IMAGE_PATH_3") );
- DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+ DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "Actor";
- button.SetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ button.SetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR, map );
+ DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
}
- // PushButton::PROPERTY_LABEL_ACTOR
+ // Button::PROPERTY_LABEL_ACTOR
{
- button.SetLabelText( "LABEL_TEXT_CUSTOM" );
- DALI_TEST_EQUALS( "TextView", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ button.SetLabel( "LABEL_TEXT_CUSTOM" );
+ DALI_TEST_EQUALS( "TextView", button.GetProperty( Button::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
map[ "type" ] = "Actor";
- button.SetProperty( PushButton::PROPERTY_LABEL_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+ button.SetProperty( Button::PROPERTY_LABEL_ACTOR, map );
+ DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
}
END_TEST;
}
tet_infoline(" UtcDaliCheckBoxButtonSetGetChecked");
CheckBoxButton checkBoxButton = CheckBoxButton::New();
- checkBoxButton.ToggledSignal().Connect( &CheckBoxButtonClicked );
+ checkBoxButton.StateChangedSignal().Connect( &CheckBoxButtonClicked );
// global var used to check if CheckBoxButtonClicked is called;
gCheckBoxButtonState = false;
radioButton.SetPosition( 0.0f, 0.0f );
// Default active
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
// Setting false active
- radioButton.SetProperty( RadioButton::PROPERTY_ACTIVE, false );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
+ radioButton.SetProperty( Button::PROPERTY_TOGGLED, false );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
// Setting true active
- radioButton.SetProperty( RadioButton::PROPERTY_ACTIVE, true );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == true );
+ radioButton.SetProperty( Button::PROPERTY_TOGGLED, true );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == true );
// Setting false again
- radioButton.SetProperty( RadioButton::PROPERTY_ACTIVE, false );
- DALI_TEST_CHECK( radioButton.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
+ radioButton.SetProperty( Button::PROPERTY_TOGGLED, false );
+ DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
// Test selecting radio buttons
RadioButton radioButton2 = RadioButton::New( "label" );
application.Render();
// Simulate touch events
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
// Select first radio
{
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == true );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == true );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
}
// Select an already selected radio
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == true );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == true );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
}
// Select second radio
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == true );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == true );
}
// Select outside radio group
application.SendNotification();
application.Render();
- DALI_TEST_CHECK( radioButton2.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == false );
- DALI_TEST_CHECK( radioButton3.GetProperty<bool>( RadioButton::PROPERTY_ACTIVE ) == true );
+ DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == false );
+ DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_TOGGLED ) == true );
}
END_TEST;
PushButton pushButton = PushButton::New();
pushButton.SetToggleButton( true );
- pushButton.ToggledSignal().Connect( &PushButtonToggled );
+ pushButton.StateChangedSignal().Connect( &PushButtonToggled );
gPushButtonToggleState = false;
pushButton.SetToggled( true );
PushButton pushButton = PushButton::New();
pushButton.SetToggleButton( false );
- pushButton.ToggledSignal().Connect( &PushButtonToggled );
+ pushButton.StateChangedSignal().Connect( &PushButtonToggled );
gPushButtonToggleState = false;
pushButton.SetToggled( true );
DALI_TEST_EQUALS( size.width, 40.f, TEST_LOCATION );
DALI_TEST_EQUALS( size.height, 40.f, TEST_LOCATION );
- pushButton.SetPressedImage( image03 );
+ pushButton.SetSelectedImage( image03 );
application.SendNotification();
application.Render();
- size = pushButton.GetPressedImage().GetCurrentSize();
+ size = pushButton.GetSelectedImage().GetCurrentSize();
DALI_TEST_EQUALS( size.width, 50.f, TEST_LOCATION );
DALI_TEST_EQUALS( size.height, 50.f, TEST_LOCATION );
- pushButton.SetPressedImage( imageActor03 );
+ pushButton.SetSelectedImage( imageActor03 );
application.SendNotification();
application.Render();
- size = pushButton.GetPressedImage().GetCurrentSize();
+ size = pushButton.GetSelectedImage().GetCurrentSize();
DALI_TEST_EQUALS( size.width, 60.f, TEST_LOCATION );
DALI_TEST_EQUALS( size.height, 60.f, TEST_LOCATION );
TextView textView;
- pushButton.SetLabelText( STR );
+ pushButton.SetLabel( STR );
- textView = TextView::DownCast( pushButton.GetLabelText() );
+ textView = TextView::DownCast( pushButton.GetLabel() );
DALI_TEST_CHECK( STR == textView.GetText() );
TextView text = TextView::New( STR );
- pushButton.SetLabelText( text );
+ pushButton.SetLabel( text );
- textView = TextView::DownCast( pushButton.GetLabelText() );
+ textView = TextView::DownCast( pushButton.GetLabel() );
DALI_TEST_CHECK( STR == textView.GetText() );
END_TEST;
}
application.Render();
// connect to its touch signal
- pushButton.ToggledSignal().Connect( &PushButtonToggled );
+ pushButton.StateChangedSignal().Connect( &PushButtonToggled );
Dali::Integration::TouchEvent event;
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/object/type-registry.h>
-namespace
-{
-const char* const PROPERTY_DIMMED = "dimmed";
-} // unnamed namespace
-
namespace Dali
{
namespace Toolkit
{
-const Property::Index Button::PROPERTY_DIMMED( Internal::Button::BUTTON_PROPERTY_START_INDEX );
+const Property::Index Button::PROPERTY_DISABLED = Internal::Button::BUTTON_PROPERTY_START_INDEX;
+const Property::Index Button::PROPERTY_AUTO_REPEATING = Internal::Button::BUTTON_PROPERTY_START_INDEX + 1;
+const Property::Index Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_START_INDEX + 2;
+const Property::Index Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_START_INDEX + 3;
+const Property::Index Button::PROPERTY_TOGGLABLE = Internal::Button::BUTTON_PROPERTY_START_INDEX + 4;
+const Property::Index Button::PROPERTY_TOGGLED = Internal::Button::BUTTON_PROPERTY_START_INDEX + 5;
+const Property::Index Button::PROPERTY_NORMAL_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 6;
+const Property::Index Button::PROPERTY_SELECTED_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 7;
+const Property::Index Button::PROPERTY_DISABLED_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 8;
+const Property::Index Button::PROPERTY_LABEL_ACTOR = Internal::Button::BUTTON_PROPERTY_START_INDEX + 9;
namespace Internal
{
TypeRegistration typeRegistration( typeid(Toolkit::Button), typeid(Toolkit::Control), Create );
SignalConnectorType signalConnector1( typeRegistration, Toolkit::Button::SIGNAL_CLICKED, &Button::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, Toolkit::Button::SIGNAL_TOGGLED, &Button::DoConnectSignal );
-
-PropertyRegistration property1( typeRegistration, "dimmed", Toolkit::Button::PROPERTY_DIMMED, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
+SignalConnectorType signalConnector2( typeRegistration, Toolkit::Button::SIGNAL_STATE_CHANGED, &Button::DoConnectSignal );
+
+PropertyRegistration property1( typeRegistration, "disabled", Toolkit::Button::PROPERTY_DISABLED, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property2( typeRegistration, "auto-repeating", Toolkit::Button::PROPERTY_AUTO_REPEATING, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property3( typeRegistration, "initial-auto-repeating-delay", Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, Property::FLOAT, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property4( typeRegistration, "next-auto-repeating-delay", Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY, Property::FLOAT, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property5( typeRegistration, "togglable", Toolkit::Button::PROPERTY_TOGGLABLE, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property6( typeRegistration, "toggled", Toolkit::Button::PROPERTY_TOGGLED, Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property7( typeRegistration, "normal-state-actor", Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property8( typeRegistration, "selected-state-actor", Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property9( typeRegistration, "disabled-state-actor", Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
+PropertyRegistration property10( typeRegistration, "label-actor", Toolkit::Button::PROPERTY_LABEL_ACTOR, Property::MAP, &Button::SetProperty, &Button::GetProperty );
} // unnamed namespace
Button::Button()
: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+ mPainter( NULL ),
mState( ButtonUp ),
- mDimmed( false ),
- mPainter( NULL )
+ mDisabled( false )
{
}
{
}
-void Button::SetDimmed( bool dimmed )
+void Button::SetDisabled( bool disabled )
{
- mDimmed = dimmed;
+ mDisabled = disabled;
// Notifies the painter.
Toolkit::Button handle( GetOwner() );
if( mPainter )
{
- mPainter->SetDimmed( handle, mDimmed );
+ mPainter->SetDisabled( handle, mDisabled );
}
}
-bool Button::IsDimmed() const
+bool Button::IsDisabled() const
{
- return mDimmed;
+ return mDisabled;
}
void Button::SetAnimationTime( float animationTime )
// nothing to do.
}
+void Button::OnButtonDown()
+{
+
+}
+
+void Button::OnButtonUp()
+{
+
+}
+
float Button::OnAnimationTimeRequested() const
{
return 0.f;
return mClickedSignal;
}
-Toolkit::Button::ToggledSignalType& Button::ToggledSignal()
+Toolkit::Button::StateChangedSignalType& Button::StateChangedSignal()
{
- return mToggledSignal;
+ return mStateChangedSignal;
}
bool Button::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
button.ClickedSignal().Connect( tracker, functor );
}
- else if( Dali::Toolkit::Button::SIGNAL_TOGGLED == signalName )
+ else if( Dali::Toolkit::Button::SIGNAL_STATE_CHANGED == signalName )
{
- button.ToggledSignal().Connect( tracker, functor );
+ button.StateChangedSignal().Connect( tracker, functor );
}
else
{
bool Button::OnTouchEvent(const TouchEvent& event)
{
- // Only events are processed when the button is not dimmed and the touch event has only
+ // Only events are processed when the button is not disabled and the touch event has only
// one touch point.
- if( ( !mDimmed ) && ( 1 == event.GetPointCount() ) )
+ if( ( !mDisabled ) && ( 1 == event.GetPointCount() ) )
{
switch( event.GetPoint(0).state )
{
{
Toolkit::Button button = Toolkit::Button::DownCast( Dali::BaseHandle( object ) );
- if ( button && ( index == Toolkit::Button::PROPERTY_DIMMED ) )
+ if ( button && ( index == Toolkit::Button::PROPERTY_DISABLED ) )
{
- GetImplementation( button ).SetDimmed( value.Get<bool>() );
+ GetImplementation( button ).SetDisabled( value.Get<bool>() );
}
}
{
Toolkit::Button button = Toolkit::Button::DownCast( Dali::BaseHandle( object ) );
- if ( button && ( propertyIndex == Toolkit::Button::PROPERTY_DIMMED ) )
+ if ( button && ( propertyIndex == Toolkit::Button::PROPERTY_DISABLED ) )
{
- return Property::Value( GetImplementation( button ).mDimmed );
+ return Property::Value( GetImplementation( button ).mDisabled );
}
return Property::Value();
public:
/**
- * @copydoc Dali::Toolkit::Button::SetDimmed( bool dimmed )
+ * @copydoc Dali::Toolkit::Button::SetDisabled( bool disabled )
*/
- void SetDimmed( bool dimmed );
+ void SetDisabled( bool disabled );
/**
- * @copydoc Dali::Toolkit::Button::IsDimmed() const
+ * @copydoc Dali::Toolkit::Button::IsDisabled() const
*/
- bool IsDimmed() const;
+ bool IsDisabled() const;
/**
* @copydoc Dali::Toolkit::Button::SetAnimationTime()
* This method is called from the OnTouchEvent method when the button is down.
* Could be reimplemented in subclasses to provide specific behaviour.
*/
- virtual void OnButtonDown() { }
+ virtual void OnButtonDown();
/**
* This method is called from the OnTouchEvent method when the button is up.
* Could be reimplemented in subclasses to provide specific behaviour.
*/
- virtual void OnButtonUp() { }
+ virtual void OnButtonUp();
/**
* This method is called from the OnTouchEvent method when the touch point leaves the boundary of the button or
Toolkit::Button::ClickedSignalType& ClickedSignal();
/**
- * @copydoc Dali::Toolkit::Button::ToggledSignal()
+ * @copydoc Dali::Toolkit::Button::StateChangedSignal()
*/
- Toolkit::Button::ToggledSignalType& ToggledSignal();
+ Toolkit::Button::StateChangedSignalType& StateChangedSignal();
/**
* Connects a callback function with the object's signals.
// Undefined
Button& operator = ( const Button& );
-protected: // Signals
+protected:
enum ButtonState
{
ButtonDown, ///< The button is down.
};
- ButtonState mState; ///< Stores the button state.
-
- bool mDimmed; ///< Stores the dimmed property.
-
ButtonPainterPtr mPainter; ///< Pointer to a ButtonPainter base class.
- Toolkit::Button::ClickedSignalType mClickedSignal; ///< Signal emitted when the button is clicked.
- Toolkit::Button::ToggledSignalType mToggledSignal; ///< Signal emitted when the button is toggled.
+ Toolkit::Button::ClickedSignalType mClickedSignal; ///< Signal emitted when the button is clicked.
+ Toolkit::Button::StateChangedSignalType mStateChangedSignal; ///< Signal emitted when the button's state is changed.
TapGestureDetector mTapDetector;
+
+ ButtonState mState; ///< Stores the button state.
+
+ bool mDisabled; ///< Stores the disabled property.
};
} // namespace Internal
virtual void SetSize( Toolkit::Button& button, const Vector3& size ) = 0;
/**
- * This method is called from the Dali::Toolkit::Internal::PushButton when the \e dimmed property changes.
+ * This method is called from the Dali::Toolkit::Internal::PushButton when the \e disabled property changes.
*
* @param[inout] button The button in which all actors that form its appearance are going to be added.
- * @param[in] dimmed The dimmed state.
+ * @param[in] disabled The disabled state.
*/
- virtual void SetDimmed( Toolkit::Button& button, bool dimmed ) = 0;
+ virtual void SetDisabled( Toolkit::Button& button, bool disabled ) = 0;
/**
* Sets the animation time.
const float ANIMATION_TIME( 0.26f ); // EFL checkbox tick time
-const std::string PERCENTAGE_PARENT_SIZE_PROPERTY_NAME( "percentage-parent-size" );
-
-
/**
* Constraint to wrap an actor in y that is moving vertically
*/
CheckBoxButtonDefaultPainter::CheckBoxButtonDefaultPainter()
: CheckBoxButtonPainter(),
- mDimmed( false ),
+ mDisabled( false ),
mPaintState( UncheckedState ),
mButton(NULL),
- mAnimationTime( ANIMATION_TIME ),
- mPercentageParentSizeProperty( Property::INVALID_INDEX )
+ mAnimationTime( ANIMATION_TIME )
{
}
}
break;
}
- case DimmedUncheckedTransition: // FALLTHROUGH
- case DimmedCheckedTransition:
+ case DisabledUncheckedTransition: // FALLTHROUGH
+ case DisabledCheckedTransition:
{
StopCheckInAnimation();
checkBox.Remove( backgroundImage );
StartCheckInAnimation();
break;
}
- case CheckedDimmedTransition: // FALLTHROUGH
- case UncheckedDimmedTransition:
+ case CheckedDisabledTransition: // FALLTHROUGH
+ case UncheckedDisabledTransition:
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
break;
}
case UncheckedCheckedTransition: // FALLTHROUGH
- case DimmedCheckedTransition:
+ case DisabledCheckedTransition:
{
StopCheckInAnimation();
checkBox.Remove( checkedImage );
break;
}
case CheckedUncheckedTransition: // FALLTHROUGH
- case CheckedDimmedTransition:
+ case CheckedDisabledTransition:
{
float opacity = 1.f;
if( fadeOutCheckedImage )
ApplyCheckedConstraint( checkedImage, FOREGROUND_DEPTH );
}
-void CheckBoxButtonDefaultPainter::SetDimmedCheckedImage( Toolkit::CheckBoxButton& checkBox, Actor image )
+void CheckBoxButtonDefaultPainter::SetDisabledCheckedImage( Toolkit::CheckBoxButton& checkBox, Actor image )
{
Toolkit::Internal::CheckBoxButton& checkBoxImpl = GetImplementation( checkBox );
- Actor& dimmedCheckedImage = checkBoxImpl.GetDimmedCheckedImage();
+ Actor& disabledCheckedImage = checkBoxImpl.GetDisabledCheckedImage();
Actor& fadeOutCheckedImage = checkBoxImpl.GetFadeOutCheckedImage();
switch( mPaintState )
{
- case DimmedCheckedState:
+ case DisabledCheckedState:
{
- if( dimmedCheckedImage && dimmedCheckedImage.GetParent() )
+ if( disabledCheckedImage && disabledCheckedImage.GetParent() )
{
StopCheckOutAnimation( checkBox );
- FadeOutImage( checkBox, Foreground, dimmedCheckedImage );
+ FadeOutImage( checkBox, Foreground, disabledCheckedImage );
- dimmedCheckedImage = image;
+ disabledCheckedImage = image;
- FadeInImage( checkBox, dimmedCheckedImage );
+ FadeInImage( checkBox, disabledCheckedImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
}
else
{
- dimmedCheckedImage = image;
- checkBox.Add( dimmedCheckedImage );
+ disabledCheckedImage = image;
+ checkBox.Add( disabledCheckedImage );
}
break;
}
- case CheckedDimmedTransition:
+ case CheckedDisabledTransition:
{
StopCheckInAnimation();
- checkBox.Remove( dimmedCheckedImage );
+ checkBox.Remove( disabledCheckedImage );
- dimmedCheckedImage = image;
+ disabledCheckedImage = image;
- FadeInImage( checkBox, dimmedCheckedImage );
+ FadeInImage( checkBox, disabledCheckedImage );
StartCheckInAnimation();
break;
}
- case DimmedCheckedTransition:
+ case DisabledCheckedTransition:
{
float opacity = 1.f;
if( fadeOutCheckedImage )
StopCheckOutAnimation( checkBox );
// Replaces the button image.
- dimmedCheckedImage = image;
+ disabledCheckedImage = image;
- checkBox.Add( dimmedCheckedImage );
- FadeOutImage( checkBox, Foreground, dimmedCheckedImage, opacity );
+ checkBox.Add( disabledCheckedImage );
+ FadeOutImage( checkBox, Foreground, disabledCheckedImage, opacity );
StartCheckOutAnimation( checkBox );
break;
}
default:
{
- dimmedCheckedImage = image;
+ disabledCheckedImage = image;
break;
}
}
- dimmedCheckedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- dimmedCheckedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- ApplyConstraint( dimmedCheckedImage, FOREGROUND_DEPTH );
+ disabledCheckedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ disabledCheckedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ ApplyConstraint( disabledCheckedImage, FOREGROUND_DEPTH );
}
-void CheckBoxButtonDefaultPainter::SetDimmedBackgroundImage( Toolkit::CheckBoxButton& checkBox, Actor image )
+void CheckBoxButtonDefaultPainter::SetDisabledBackgroundImage( Toolkit::CheckBoxButton& checkBox, Actor image )
{
Toolkit::Internal::CheckBoxButton& checkBoxImpl = GetImplementation( checkBox );
- Actor& dimmedBackgroundImage = checkBoxImpl.GetDimmedBackgroundImage();
+ Actor& disabledBackgroundImage = checkBoxImpl.GetDisabledBackgroundImage();
Actor& fadeOutBackgroundImage = checkBoxImpl.GetFadeOutBackgroundImage();
switch( mPaintState )
{
- case DimmedCheckedState: // FALLTHROUGH
- case DimmedUncheckedState:
+ case DisabledCheckedState: // FALLTHROUGH
+ case DisabledUncheckedState:
{
- if( dimmedBackgroundImage && dimmedBackgroundImage.GetParent() )
+ if( disabledBackgroundImage && disabledBackgroundImage.GetParent() )
{
StopCheckOutAnimation( checkBox );
- FadeOutImage( checkBox, Background, dimmedBackgroundImage );
+ FadeOutImage( checkBox, Background, disabledBackgroundImage );
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
- FadeInImage( checkBox, dimmedBackgroundImage );
+ FadeInImage( checkBox, disabledBackgroundImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
}
else
{
- dimmedBackgroundImage = image;
- checkBox.Add( dimmedBackgroundImage );
+ disabledBackgroundImage = image;
+ checkBox.Add( disabledBackgroundImage );
}
break;
}
- case UncheckedDimmedTransition: // FALLTHROUGH
- case CheckedDimmedTransition:
+ case UncheckedDisabledTransition: // FALLTHROUGH
+ case CheckedDisabledTransition:
{
StopCheckInAnimation();
- checkBox.Remove( dimmedBackgroundImage );
+ checkBox.Remove( disabledBackgroundImage );
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
- FadeInImage( checkBox, dimmedBackgroundImage );
+ FadeInImage( checkBox, disabledBackgroundImage );
StartCheckInAnimation();
break;
}
- case DimmedUncheckedTransition: // FALLTHROUGH
- case DimmedCheckedTransition:
+ case DisabledUncheckedTransition: // FALLTHROUGH
+ case DisabledCheckedTransition:
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
StopCheckOutAnimation( checkBox );
// Replaces the button image.
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
- checkBox.Add( dimmedBackgroundImage );
- FadeOutImage( checkBox, Background, dimmedBackgroundImage, opacity );
+ checkBox.Add( disabledBackgroundImage );
+ FadeOutImage( checkBox, Background, disabledBackgroundImage, opacity );
StartCheckOutAnimation( checkBox );
break;
}
default:
{
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
break;
}
}
- dimmedBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- dimmedBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- ApplyConstraint( dimmedBackgroundImage, BACKGROUND_DEPTH );
+ disabledBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ disabledBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ ApplyConstraint( disabledBackgroundImage, BACKGROUND_DEPTH );
}
void CheckBoxButtonDefaultPainter::Initialize( Toolkit::Button& button )
Toolkit::Internal::CheckBoxButton& buttonImpl = GetCheckBoxButtonImpl( button );
Actor& backgroundImage = buttonImpl.GetBackgroundImage();
Actor& checkedImage = buttonImpl.GetCheckedImage();
- Actor& dimmedBackgroundImage = buttonImpl.GetDimmedBackgroundImage();
- Actor& dimmedCheckedImage = buttonImpl.GetDimmedCheckedImage();
+ Actor& disabledBackgroundImage = buttonImpl.GetDisabledBackgroundImage();
+ Actor& disabledCheckedImage = buttonImpl.GetDisabledCheckedImage();
Toolkit::CheckBoxButton& checkBox = static_cast<Toolkit::CheckBoxButton&>( button );
SetCheckedImage( checkBox, checkedImage );
}
- if( dimmedBackgroundImage )
+ if( disabledBackgroundImage )
{
- SetDimmedBackgroundImage( checkBox, dimmedBackgroundImage );
+ SetDisabledBackgroundImage( checkBox, disabledBackgroundImage );
}
- if( dimmedCheckedImage )
+ if( disabledCheckedImage )
{
- SetDimmedCheckedImage( checkBox, dimmedCheckedImage );
+ SetDisabledCheckedImage( checkBox, disabledCheckedImage );
}
- SetDimmed( button, mDimmed );
+ SetDisabled( button, mDisabled );
}
void CheckBoxButtonDefaultPainter::SetSize( Toolkit::Button& button, const Vector3& size )
Toolkit::Internal::CheckBoxButton& buttonImpl = GetCheckBoxButtonImpl( button );
Actor& backgroundImage = buttonImpl.GetBackgroundImage();
Actor& checkedImage = buttonImpl.GetCheckedImage();
- Actor& dimmedBackgroundImage = buttonImpl.GetDimmedBackgroundImage();
- Actor& dimmedCheckedImage = buttonImpl.GetDimmedCheckedImage();
+ Actor& disabledBackgroundImage = buttonImpl.GetDisabledBackgroundImage();
+ Actor& disabledCheckedImage = buttonImpl.GetDisabledCheckedImage();
ApplyCheckedConstraint( checkedImage, FOREGROUND_DEPTH );
ApplyConstraint( backgroundImage, BACKGROUND_DEPTH );
- ApplyConstraint( dimmedCheckedImage, FOREGROUND_DEPTH );
- ApplyConstraint( dimmedBackgroundImage, BACKGROUND_DEPTH );
+ ApplyConstraint( disabledCheckedImage, FOREGROUND_DEPTH );
+ ApplyConstraint( disabledBackgroundImage, BACKGROUND_DEPTH );
}
-void CheckBoxButtonDefaultPainter::SetDimmed( Toolkit::Button& button, bool dimmed )
+void CheckBoxButtonDefaultPainter::SetDisabled( Toolkit::Button& button, bool disabled )
{
- mDimmed = dimmed;
+ mDisabled = disabled;
Toolkit::Internal::CheckBoxButton& buttonImpl = GetCheckBoxButtonImpl( button );
Actor& backgroundImage = buttonImpl.GetBackgroundImage();
Actor& checkedImage = buttonImpl.GetCheckedImage();
- Actor& dimmedBackgroundImage = buttonImpl.GetDimmedBackgroundImage();
- Actor& dimmedCheckedImage = buttonImpl.GetDimmedCheckedImage();
+ Actor& disabledBackgroundImage = buttonImpl.GetDisabledBackgroundImage();
+ Actor& disabledCheckedImage = buttonImpl.GetDisabledCheckedImage();
Actor& fadeOutCheckedImage = buttonImpl.GetFadeOutCheckedImage();
Actor& fadeOutBackgroundImage = buttonImpl.GetFadeOutBackgroundImage();
{
case UncheckedState:
{
- if( dimmed )
+ if( disabled )
{
StopCheckOutAnimation( checkBox );
FadeOutImage( checkBox, Background, backgroundImage );
- FadeInImage( checkBox, dimmedBackgroundImage );
+ FadeInImage( checkBox, disabledBackgroundImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = UncheckedDimmedTransition;
+ mPaintState = UncheckedDisabledTransition;
}
break;
}
case CheckedState:
{
- if( dimmed )
+ if( disabled )
{
StopCheckOutAnimation( checkBox );
FadeOutImage( checkBox, Background, backgroundImage );
FadeOutImage( checkBox, Foreground, checkedImage );
- FadeInImage( checkBox, dimmedCheckedImage );
- FadeInImage( checkBox, dimmedBackgroundImage );
+ FadeInImage( checkBox, disabledCheckedImage );
+ FadeInImage( checkBox, disabledBackgroundImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = CheckedDimmedTransition;
+ mPaintState = CheckedDisabledTransition;
}
break;
}
- case DimmedUncheckedState:
+ case DisabledUncheckedState:
{
- if( !dimmed )
+ if( !disabled )
{
StopCheckOutAnimation( checkBox );
- FadeOutImage( checkBox, Background, dimmedBackgroundImage );
+ FadeOutImage( checkBox, Background, disabledBackgroundImage );
FadeInImage( checkBox, backgroundImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = DimmedUncheckedTransition;
+ mPaintState = DisabledUncheckedTransition;
}
break;
}
- case DimmedCheckedState:
+ case DisabledCheckedState:
{
- if( !dimmed )
+ if( !disabled )
{
StopCheckOutAnimation( checkBox );
- FadeOutImage( checkBox, Background, dimmedBackgroundImage );
- FadeOutImage( checkBox, Foreground, dimmedCheckedImage );
+ FadeOutImage( checkBox, Background, disabledBackgroundImage );
+ FadeOutImage( checkBox, Foreground, disabledCheckedImage );
FadeInImage( checkBox, backgroundImage );
FadeInImage( checkBox, checkedImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = DimmedCheckedTransition;
+ mPaintState = DisabledCheckedTransition;
}
break;
}
case UncheckedCheckedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( checkedImage )
FadeOutImage( checkBox, Foreground, checkedImage, opacity );
FadeOutImage( checkBox, Background, backgroundImage );
- FadeInImage( checkBox, dimmedCheckedImage );
- FadeInImage( checkBox, dimmedBackgroundImage );
+ FadeInImage( checkBox, disabledCheckedImage );
+ FadeInImage( checkBox, disabledBackgroundImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = CheckedDimmedTransition;
+ mPaintState = CheckedDisabledTransition;
}
break;
}
case CheckedUncheckedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( fadeOutCheckedImage )
StopCheckOutAnimation( checkBox );
StopCheckInAnimation();
- button.Add( dimmedCheckedImage );
- FadeOutImage( checkBox, Foreground, dimmedCheckedImage, opacity );
+ button.Add( disabledCheckedImage );
+ FadeOutImage( checkBox, Foreground, disabledCheckedImage, opacity );
FadeOutImage( checkBox, Background, backgroundImage );
- FadeInImage( checkBox, dimmedBackgroundImage );
+ FadeInImage( checkBox, disabledBackgroundImage );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = UncheckedDimmedTransition;
+ mPaintState = UncheckedDisabledTransition;
}
break;
}
- case UncheckedDimmedTransition:
+ case UncheckedDisabledTransition:
{
- if( !dimmed )
+ if( !disabled )
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
StopCheckOutAnimation( checkBox, false );
StopCheckInAnimation();
- FadeOutImage( checkBox, Background, dimmedBackgroundImage, 1.f - opacity );
+ FadeOutImage( checkBox, Background, disabledBackgroundImage, 1.f - opacity );
FadeInImage( checkBox, backgroundImage, opacity );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = DimmedUncheckedTransition;
+ mPaintState = DisabledUncheckedTransition;
}
break;
}
- case DimmedUncheckedTransition:
+ case DisabledUncheckedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
StopCheckInAnimation();
FadeOutImage( checkBox, Background, backgroundImage, 1.f - opacity );
- FadeInImage( checkBox, dimmedBackgroundImage, opacity );
+ FadeInImage( checkBox, disabledBackgroundImage, opacity );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = UncheckedDimmedTransition;
+ mPaintState = UncheckedDisabledTransition;
}
break;
}
- case CheckedDimmedTransition:
+ case CheckedDisabledTransition:
{
- if( !dimmed )
+ if( !disabled )
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
StopCheckOutAnimation( checkBox, false );
StopCheckInAnimation();
- FadeOutImage( checkBox, Foreground, dimmedCheckedImage, 1.f - opacity );
- FadeOutImage( checkBox, Background, dimmedBackgroundImage, 1.f - opacity );
+ FadeOutImage( checkBox, Foreground, disabledCheckedImage, 1.f - opacity );
+ FadeOutImage( checkBox, Background, disabledBackgroundImage, 1.f - opacity );
FadeInImage( checkBox, checkedImage, opacity );
FadeInImage( checkBox, backgroundImage, opacity );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = DimmedCheckedTransition;
+ mPaintState = DisabledCheckedTransition;
}
break;
}
- case DimmedCheckedTransition:
+ case DisabledCheckedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
FadeOutImage( checkBox, Foreground, checkedImage, 1.f - opacity );
FadeOutImage( checkBox, Background, backgroundImage, 1.f - opacity );
- FadeInImage( checkBox, dimmedCheckedImage, opacity );
- FadeInImage( checkBox, dimmedBackgroundImage, opacity );
+ FadeInImage( checkBox, disabledCheckedImage, opacity );
+ FadeInImage( checkBox, disabledBackgroundImage, opacity );
StartCheckOutAnimation( checkBox );
StartCheckInAnimation();
- mPaintState = CheckedDimmedTransition;
+ mPaintState = CheckedDisabledTransition;
}
break;
}
FadeOutImage( button, Foreground, checkedImage );
StartCheckOutAnimation( button );
- if( button.GetProperty<bool>( button.GetPropertyIndex( Toolkit::CheckBoxButton::USE_FADE_ANIMATION_PROPERTY_NAME ) ) )
- {
- mPaintState = CheckedUncheckedTransition;
- }
- else
- {
- mPaintState = UncheckedState;
- }
+ mPaintState = UncheckedState;
break;
}
case UncheckedCheckedTransition:
FadeOutImage( button, Foreground, checkedImage, opacity );
StartCheckOutAnimation( button );
- if( button.GetProperty<bool>( button.GetPropertyIndex( Toolkit::CheckBoxButton::USE_FADE_ANIMATION_PROPERTY_NAME ) ) )
- {
- mPaintState = CheckedUncheckedTransition;
- }
- else
- {
- mPaintState = UncheckedState;
- }
+ mPaintState = UncheckedState;
break;
}
case CheckedUncheckedTransition:
{
if( actor )
{
- if( mPercentageParentSizeProperty == Property::INVALID_INDEX )
- {
- mPercentageParentSizeProperty = actor.RegisterProperty( PERCENTAGE_PARENT_SIZE_PROPERTY_NAME, 1.0f );
- }
-
actor.RemoveConstraints();
- actor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE,
- LocalSource( mPercentageParentSizeProperty ),
- ParentSource( Actor::SIZE ),
- EqualToPercentageWidthConstraint ) );
+ actor.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
actor.SetZ( depth );
}
}
checkBox.Add( image );
}
- if( checkBox.GetProperty<bool>( checkBox.GetPropertyIndex( Toolkit::CheckBoxButton::USE_FADE_ANIMATION_PROPERTY_NAME ) ) )
- {
- image.SetOpacity( opacity );
- AddToFadeInAnimation( image );
- }
- else
- {
- image.SetOpacity( 1.0f );
- }
+ image.SetOpacity( 1.0f );
}
}
actorLayer = image;
- if( checkBox.GetProperty<bool>( checkBox.GetPropertyIndex( Toolkit::CheckBoxButton::USE_FADE_ANIMATION_PROPERTY_NAME ) ) )
- {
- actorLayer.SetOpacity( opacity );
- AddToFadeOutAnimation( actorLayer );
- }
- else
- {
- actorLayer.SetOpacity( 0.0f );
- }
+ actorLayer.SetOpacity( 0.0f );
}
}
// Actor size anim
Handle handle = actor; // Get rid of const
- mCheckInAnimation.AnimateTo( Property( handle, mPercentageParentSizeProperty ), 1.0f );
+ mCheckInAnimation.AnimateTo( Property( handle, Actor::SCALE_X ), 1.0f);
}
void CheckBoxButtonDefaultPainter::SetupCheckedAnimation( Toolkit::CheckBoxButton& checkBox, Actor& image )
{
- if( checkBox.GetProperty<bool>( checkBox.GetPropertyIndex( Toolkit::CheckBoxButton::USE_CHECK_ANIMATION_PROPERTY_NAME ) ) && image )
+ if( image )
{
if( !mTickUVEffect )
{
imageActor.SetShaderEffect( mTickUVEffect );
}
- // Register a custom property to animate size of tick over
- if( mPercentageParentSizeProperty != Property::INVALID_INDEX )
- {
- image.SetProperty( mPercentageParentSizeProperty, 0.0f );
- }
+ image.SetScale( Vector3( 0.0f, 1.0f, 1.0f ) );
mTickUVEffect.SetBottomRight( Vector2( 0.0f, 1.0f ) );
mPaintState = UncheckedState;
break;
}
- case UncheckedDimmedTransition:
+ case UncheckedDisabledTransition:
{
- mPaintState = DimmedUncheckedState;
+ mPaintState = DisabledUncheckedState;
break;
}
- case DimmedUncheckedTransition:
+ case DisabledUncheckedTransition:
{
mPaintState = UncheckedState;
break;
}
- case CheckedDimmedTransition:
+ case CheckedDisabledTransition:
{
- mPaintState = DimmedCheckedState;
+ mPaintState = DisabledCheckedState;
break;
}
- case DimmedCheckedTransition:
+ case DisabledCheckedTransition:
{
mPaintState = CheckedState;
break;
mPaintState = UncheckedState;
break;
}
- case UncheckedDimmedTransition:
+ case UncheckedDisabledTransition:
{
- mPaintState = DimmedUncheckedState;
+ mPaintState = DisabledUncheckedState;
break;
}
- case DimmedUncheckedTransition:
+ case DisabledUncheckedTransition:
{
mPaintState = UncheckedState;
break;
}
- case CheckedDimmedTransition:
+ case CheckedDisabledTransition:
{
- mPaintState = DimmedCheckedState;
+ mPaintState = DisabledCheckedState;
break;
}
- case DimmedCheckedTransition:
+ case DisabledCheckedTransition:
{
mPaintState = CheckedState;
break;
void SetCheckedImage( Toolkit::CheckBoxButton& checkBox, Actor image );
/**
- * Sets the dimmed backgroundimage.
+ * Sets the disabled backgroundimage.
*
- * It adds the dimmed backgroundimage to the root actor and creates the image transition if needed.
+ * It adds the disabled backgroundimage to the root actor and creates the image transition if needed.
*
* @param[inout] checkBox The button in which all actors that form its appearance are going to be added.
- * @param[in] image The dimmed backgroundimage.
+ * @param[in] image The disabled backgroundimage.
*/
- void SetDimmedBackgroundImage( Toolkit::CheckBoxButton& checkBox, Actor image );
+ void SetDisabledBackgroundImage( Toolkit::CheckBoxButton& checkBox, Actor image );
/**
- * Sets the dimmed checked image.
+ * Sets the disabled checked image.
*
- * It adds the dimmed checked image to the root actor and creates the image transition if needed.
+ * It adds the disabled checked image to the root actor and creates the image transition if needed.
*
* @param[inout] checkBox The button in which all actors that form its appearance are going to be added.
- * @param[in] image The dimmed checked image.
+ * @param[in] image The disabled checked image.
*/
- void SetDimmedCheckedImage( Toolkit::CheckBoxButton& checkBox, Actor image );
+ void SetDisabledCheckedImage( Toolkit::CheckBoxButton& checkBox, Actor image );
/////////////////////////////////////////////////////////////////////////////
// ButtonPainter interface
void SetSize( Toolkit::Button& button, const Vector3& size );
/**
- * Changes the Vega::Toolkit::CheckBoxButton for the given dimmed state.
+ * Changes the Vega::Toolkit::CheckBoxButton for the given disabled state.
*
* It creates the image transition if needed.
*
* @param[inout] button The button in which all actors that form its appearance are going to be added.
- * @param[in] dimmed The dimmed state.
+ * @param[in] disabled The disabled state.
*/
- void SetDimmed( Toolkit::Button& button, bool dimmed );
+ void SetDisabled( Toolkit::Button& button, bool disabled );
/**
* Sets the animation time.
*/
enum PaintState
{
- UncheckedState, ///< The check box button is unchecked.
- CheckedState, ///< The check box button is checked.
- DimmedUncheckedState, ///< The check box button is dimmed and unchecked.
- DimmedCheckedState, ///< The check box button is dimmed and checked.
- UncheckedCheckedTransition, ///< The check box button is in transition from unchecked to checked.
- CheckedUncheckedTransition, ///< The check box button is in transition from checked to unchecked.
- UncheckedDimmedTransition, ///< The check box button is in transition from unchecked to dimmed.
- DimmedUncheckedTransition, ///< The check box button is in transition from dimmed to unchecked.
- CheckedDimmedTransition, ///< The check box button is in transition from checked to dimmed.
- DimmedCheckedTransition ///< The check box button is in transition from dimmed to checked.
+ UncheckedState, ///< The check box button is unchecked.
+ CheckedState, ///< The check box button is checked.
+ DisabledUncheckedState, ///< The check box button is disabled and unchecked.
+ DisabledCheckedState, ///< The check box button is disabled and checked.
+ UncheckedCheckedTransition, ///< The check box button is in transition from unchecked to checked.
+ CheckedUncheckedTransition, ///< The check box button is in transition from checked to unchecked.
+ UncheckedDisabledTransition, ///< The check box button is in transition from unchecked to disabled.
+ DisabledUncheckedTransition, ///< The check box button is in transition from disabled to unchecked.
+ CheckedDisabledTransition, ///< The check box button is in transition from checked to disabled.
+ DisabledCheckedTransition ///< The check box button is in transition from disabled to checked.
};
/**
void CheckInAnimationFinished( Dali::Animation& source );
private:
- bool mDimmed; ///< Stores the dimmed property.
+ bool mDisabled; ///< Stores the disabled property.
PaintState mPaintState; ///< The painter state.
void CheckBoxButton::SetChecked( bool checked )
{
- if( !mDimmed && ( checked != mChecked ) )
+ if( !mDisabled && ( checked != mChecked ) )
{
// Stores the state.
mChecked = checked;
// Notifies the painter the checkbox has been checked.
GetCheckBoxButtonPainter( mPainter )->Checked( handle );
- // Raise toggled signal
- mToggledSignal.Emit( handle, mChecked );
+ // Raise state changed signal
+ mStateChangedSignal.Emit( handle, mChecked );
}
}
return mCheckedImage;
}
-void CheckBoxButton::SetDimmedBackgroundImage( Image image )
+void CheckBoxButton::SetDisabledBackgroundImage( Image image )
{
- SetDimmedBackgroundImage( ImageActor::New( image ) );
+ SetDisabledBackgroundImage( ImageActor::New( image ) );
}
-void CheckBoxButton::SetDimmedBackgroundImage( Actor image )
+void CheckBoxButton::SetDisabledBackgroundImage( Actor image )
{
Toolkit::CheckBoxButton handle( GetOwner() );
- GetCheckBoxButtonPainter( mPainter )->SetDimmedBackgroundImage( handle, image );
+ GetCheckBoxButtonPainter( mPainter )->SetDisabledBackgroundImage( handle, image );
}
-Actor& CheckBoxButton::GetDimmedBackgroundImage()
+Actor& CheckBoxButton::GetDisabledBackgroundImage()
{
- return mDimmedBackgroundImage;
+ return mDisabledBackgroundImage;
}
-Actor CheckBoxButton::GetDimmedBackgroundImage() const
+Actor CheckBoxButton::GetDisabledBackgroundImage() const
{
- return mDimmedBackgroundImage;
+ return mDisabledBackgroundImage;
}
-void CheckBoxButton::SetDimmedCheckedImage( Image image )
+void CheckBoxButton::SetDisabledCheckedImage( Image image )
{
- SetDimmedCheckedImage( ImageActor::New( image ) );
+ SetDisabledCheckedImage( ImageActor::New( image ) );
}
-void CheckBoxButton::SetDimmedCheckedImage( Actor image )
+void CheckBoxButton::SetDisabledCheckedImage( Actor image )
{
Toolkit::CheckBoxButton handle( GetOwner() );
- GetCheckBoxButtonPainter( mPainter )->SetDimmedCheckedImage( handle, image );
+ GetCheckBoxButtonPainter( mPainter )->SetDisabledCheckedImage( handle, image );
}
-Actor& CheckBoxButton::GetDimmedCheckedImage()
+Actor& CheckBoxButton::GetDisabledCheckedImage()
{
- return mDimmedCheckedImage;
+ return mDisabledCheckedImage;
}
-Actor CheckBoxButton::GetDimmedCheckedImage() const
+Actor CheckBoxButton::GetDisabledCheckedImage() const
{
- return mDimmedCheckedImage;
+ return mDisabledCheckedImage;
}
Actor& CheckBoxButton::GetFadeOutBackgroundImage()
void CheckBoxButton::OnButtonInitialize()
{
- mUseFadeAnimationProperty = Self().RegisterProperty( Toolkit::CheckBoxButton::USE_FADE_ANIMATION_PROPERTY_NAME, false );
- mUseCheckAnimationProperty = Self().RegisterProperty( Toolkit::CheckBoxButton::USE_CHECK_ANIMATION_PROPERTY_NAME, true );
}
void CheckBoxButton::OnButtonUp()
CheckBoxButton::CheckBoxButton()
: Button(),
mChecked( false ),
- mClickActionPerforming(false),
- mUseFadeAnimationProperty(Property::INVALID_INDEX),
- mUseCheckAnimationProperty(Property::INVALID_INDEX)
+ mClickActionPerforming(false)
{
// Creates specific painter.
mPainter = new CheckBoxButtonDefaultPainter();
Actor GetCheckedImage() const;
/**
- * @copydoc Dali::Toolkit::CheckBoxButton::SetDimmedBackgroundImage( Image image )
+ * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledBackgroundImage( Image image )
*/
- void SetDimmedBackgroundImage( Image image );
+ void SetDisabledBackgroundImage( Image image );
/**
- * @copydoc Dali::Toolkit::CheckBoxButton::SetDimmedBackgroundImage( Actor image )
+ * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledBackgroundImage( Actor image )
*/
- void SetDimmedBackgroundImage( Actor image );
+ void SetDisabledBackgroundImage( Actor image );
/**
* Used by the painter only.
- * @return A reference to the dimmed background image.
+ * @return A reference to the disabled background image.
*/
- Actor& GetDimmedBackgroundImage();
+ Actor& GetDisabledBackgroundImage();
/**
- * @copydoc Dali::Toolkit::CheckBoxButton::GetDimmedBackgroundImage()
+ * @copydoc Dali::Toolkit::CheckBoxButton::GetDisabledBackgroundImage()
*/
- Actor GetDimmedBackgroundImage() const;
+ Actor GetDisabledBackgroundImage() const;
/**
- * @copydoc Dali::Toolkit::CheckBoxButton::SetDimmedCheckedImage( Image image )
+ * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledCheckedImage( Image image )
*/
- void SetDimmedCheckedImage( Image image );
+ void SetDisabledCheckedImage( Image image );
/**
- * @copydoc Dali::Toolkit::CheckBoxButton::SetDimmedCheckedImage( Actor image )
+ * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledCheckedImage( Actor image )
*/
- void SetDimmedCheckedImage( Actor image );
+ void SetDisabledCheckedImage( Actor image );
/**
* Used by the painter only.
- * @return A reference to the dimmed checked image.
+ * @return A reference to the disabled checked image.
*/
- Actor& GetDimmedCheckedImage();
+ Actor& GetDisabledCheckedImage();
/**
- * @copydoc Dali::Toolkit::CheckBoxButton::GetDimmedCheckedImage()
+ * @copydoc Dali::Toolkit::CheckBoxButton::GetDisabledCheckedImage()
*/
- Actor GetDimmedCheckedImage() const;
+ Actor GetDisabledCheckedImage() const;
/**
* Used by the painter only.
Actor mBackgroundImage; ///< Stores the background image.
Actor mCheckedImage; ///< Stores the checked image.
- Actor mDimmedCheckedImage; ///< Stores the dimmed checked image.
- Actor mDimmedBackgroundImage; ///< Stores the dimmed background image.
+ Actor mDisabledCheckedImage; ///< Stores the disabled checked image.
+ Actor mDisabledBackgroundImage; ///< Stores the disabled background image.
Actor mFadeOutBackgroundImage; ///< Stores a background image, which is in a fade out animation, to be removed when the animation finishes.
Actor mFadeOutCheckedImage; ///< Stores a foreground image, which is in a fade out animation, to be removed when the animation finishes.
// Actions
bool mClickActionPerforming;
-
- // Properties
- Property::Index mUseFadeAnimationProperty;
- Property::Index mUseCheckAnimationProperty;
};
} // namespace Internal
virtual void SetSize( Toolkit::Button& button, const Vector3& size ) = 0;
/**
- * @copydoc ButtonPainter::SetDimmed( Toolkit::Button& button, bool dimmed )
+ * @copydoc ButtonPainter::SetDisabled( Toolkit::Button& button, bool disabled )
*/
- virtual void SetDimmed( Toolkit::Button& button, bool dimmed ) = 0;
+ virtual void SetDisabled( Toolkit::Button& button, bool disabled ) = 0;
/**
* @copydoc ButtonPainter::SetAnimationTime()
PushButtonDefaultPainter::PushButtonDefaultPainter()
: PushButtonPainter(),
mAutoRepeating( false ),
- mDimmed( false ),
+ mDisabled( false ),
mPaintState( ReleasedState ),
mButton( NULL ),
mAnimationTime( ANIMATION_TIME ),
break;
}
case ReleasedPressedTransition: // FALLTHROUGH
- case ReleasedDimmedTransition:
+ case ReleasedDisabledTransition:
{
float opacity = 1.f;
if( fadeOutButtonImage )
break;
}
case PressedReleasedTransition: // FALLTHROUGH
- case DimmedReleasedTransition:
+ case DisabledReleasedTransition:
{
StopFadeInAnimation();
pushButton.Remove( buttonImage );
}
break;
}
- case ReleasedDimmedTransition: // FALLTHROUGH
- case PressedDimmedTransition:
+ case ReleasedDisabledTransition: // FALLTHROUGH
+ case PressedDisabledTransition:
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
StartFadeOutAnimation( pushButton );
break;
}
- case DimmedReleasedTransition: // FALLTHROUGH
- case DimmedPressedTransition:
+ case DisabledReleasedTransition: // FALLTHROUGH
+ case DisabledPressedTransition:
{
StopFadeInAnimation();
pushButton.Remove( backgroundImage );
ApplyConstraint( backgroundImage, BACKGROUND_DEPTH );
}
-void PushButtonDefaultPainter::SetPressedImage( Toolkit::PushButton& pushButton, Actor image )
+void PushButtonDefaultPainter::SetSelectedImage( Toolkit::PushButton& pushButton, Actor image )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetImplementation( pushButton );
- Actor& pressedImage = pushButtonImpl.GetPressedImage();
+ Actor& selectedImage = pushButtonImpl.GetSelectedImage();
Actor& fadeOutButtonImage = pushButtonImpl.GetFadeOutButtonImage();
switch( mPaintState )
{
case PressedState:
{
- if( pressedImage && pressedImage.GetParent() )
+ if( selectedImage && selectedImage.GetParent() )
{
StopFadeOutAnimation( pushButton );
- FadeOutImage( pushButton, Foreground, pressedImage );
+ FadeOutImage( pushButton, Foreground, selectedImage );
- pressedImage = image;
+ selectedImage = image;
- FadeInImage( pushButton, pressedImage );
+ FadeInImage( pushButton, selectedImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
}
else
{
- pressedImage = image;
- pushButton.Add( pressedImage );
+ selectedImage = image;
+ pushButton.Add( selectedImage );
}
break;
}
case PressedReleasedTransition: // FALLTHROUGH
- case PressedDimmedTransition:
+ case PressedDisabledTransition:
{
float opacity = 1.f;
if( fadeOutButtonImage )
StopFadeOutAnimation( pushButton );
// Replaces the button image.
- pressedImage = image;
+ selectedImage = image;
- pushButton.Add( pressedImage );
- FadeOutImage( pushButton, Foreground, pressedImage, opacity );
+ pushButton.Add( selectedImage );
+ FadeOutImage( pushButton, Foreground, selectedImage, opacity );
StartFadeOutAnimation( pushButton );
break;
}
case ReleasedPressedTransition: // FALLTHROUGH
- case DimmedPressedTransition:
+ case DisabledPressedTransition:
{
StopFadeInAnimation();
- pushButton.Remove( pressedImage );
+ pushButton.Remove( selectedImage );
- pressedImage = image;
+ selectedImage = image;
- FadeInImage( pushButton, pressedImage );
+ FadeInImage( pushButton, selectedImage );
StartFadeInAnimation();
break;
}
default:
- pressedImage = image;
+ selectedImage = image;
break;
}
- pressedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- pressedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- ApplyConstraint( pressedImage, FOREGROUND_DEPTH );
+ selectedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ selectedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ ApplyConstraint( selectedImage, FOREGROUND_DEPTH );
}
-void PushButtonDefaultPainter::SetDimmedImage( Toolkit::PushButton& pushButton, Actor image )
+void PushButtonDefaultPainter::SetDisabledImage( Toolkit::PushButton& pushButton, Actor image )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetImplementation( pushButton );
- Actor& dimmedImage = pushButtonImpl.GetDimmedImage();
+ Actor& disabledImage = pushButtonImpl.GetDisabledImage();
Actor& fadeOutButtonImage = pushButtonImpl.GetFadeOutButtonImage();
switch( mPaintState )
{
- case DimmedReleasedState: // FALLTHROUGH
- case DimmedPressedState:
+ case DisabledReleasedState: // FALLTHROUGH
+ case DisabledPressedState:
{
- if( dimmedImage && dimmedImage.GetParent() )
+ if( disabledImage && disabledImage.GetParent() )
{
StopFadeOutAnimation( pushButton );
- FadeOutImage( pushButton, Foreground, dimmedImage );
+ FadeOutImage( pushButton, Foreground, disabledImage );
- dimmedImage = image;
+ disabledImage = image;
- FadeInImage( pushButton, dimmedImage );
+ FadeInImage( pushButton, disabledImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
}
else
{
- dimmedImage = image;
- pushButton.Add( dimmedImage );
+ disabledImage = image;
+ pushButton.Add( disabledImage );
}
break;
}
- case ReleasedDimmedTransition: // FALLTHROUGH
- case PressedDimmedTransition:
+ case ReleasedDisabledTransition: // FALLTHROUGH
+ case PressedDisabledTransition:
{
StopFadeInAnimation();
- pushButton.Remove( dimmedImage );
+ pushButton.Remove( disabledImage );
- dimmedImage = image;
+ disabledImage = image;
- FadeInImage( pushButton, dimmedImage );
+ FadeInImage( pushButton, disabledImage );
StartFadeInAnimation();
break;
}
- case DimmedReleasedTransition: // FALLTHROUGH
- case DimmedPressedTransition:
+ case DisabledReleasedTransition: // FALLTHROUGH
+ case DisabledPressedTransition:
{
float opacity = 1.f;
if( fadeOutButtonImage )
StopFadeOutAnimation( pushButton );
// Replaces the button image.
- dimmedImage = image;
+ disabledImage = image;
- pushButton.Add( dimmedImage );
- FadeOutImage( pushButton, Foreground, dimmedImage, opacity );
+ pushButton.Add( disabledImage );
+ FadeOutImage( pushButton, Foreground, disabledImage, opacity );
StartFadeOutAnimation( pushButton );
break;
}
default:
- dimmedImage = image;
+ disabledImage = image;
break;
}
- dimmedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- dimmedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- ApplyConstraint( dimmedImage, FOREGROUND_DEPTH );
+ disabledImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ disabledImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ ApplyConstraint( disabledImage, FOREGROUND_DEPTH );
}
-void PushButtonDefaultPainter::SetDimmedBackgroundImage( Toolkit::PushButton& pushButton, Actor image )
+void PushButtonDefaultPainter::SetDisabledBackgroundImage( Toolkit::PushButton& pushButton, Actor image )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetImplementation( pushButton );
- Actor& dimmedBackgroundImage = pushButtonImpl.GetDimmedBackgroundImage();
+ Actor& disabledBackgroundImage = pushButtonImpl.GetDisabledBackgroundImage();
Actor& fadeOutBackgroundImage = pushButtonImpl.GetFadeOutBackgroundImage();
switch( mPaintState )
{
- case DimmedReleasedState: // FALLTHROUGH
- case DimmedPressedState:
+ case DisabledReleasedState: // FALLTHROUGH
+ case DisabledPressedState:
{
- if( dimmedBackgroundImage && dimmedBackgroundImage.GetParent() )
+ if( disabledBackgroundImage && disabledBackgroundImage.GetParent() )
{
StopFadeOutAnimation( pushButton );
- FadeOutImage( pushButton, Background, dimmedBackgroundImage );
+ FadeOutImage( pushButton, Background, disabledBackgroundImage );
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
- FadeInImage( pushButton, dimmedBackgroundImage );
+ FadeInImage( pushButton, disabledBackgroundImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
}
else
{
- dimmedBackgroundImage = image;
- pushButton.Add( dimmedBackgroundImage );
+ disabledBackgroundImage = image;
+ pushButton.Add( disabledBackgroundImage );
}
break;
}
- case ReleasedDimmedTransition: // FALLTHROUGH
- case PressedDimmedTransition:
+ case ReleasedDisabledTransition: // FALLTHROUGH
+ case PressedDisabledTransition:
{
StopFadeInAnimation();
- pushButton.Remove( dimmedBackgroundImage );
+ pushButton.Remove( disabledBackgroundImage );
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
- FadeInImage( pushButton, dimmedBackgroundImage );
+ FadeInImage( pushButton, disabledBackgroundImage );
StartFadeInAnimation();
break;
}
- case DimmedReleasedTransition: // FALLTHROUGH
- case DimmedPressedTransition:
+ case DisabledReleasedTransition: // FALLTHROUGH
+ case DisabledPressedTransition:
{
float opacity = 1.f;
if( fadeOutBackgroundImage )
StopFadeOutAnimation( pushButton );
// Replaces the button image.
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
- pushButton.Add( dimmedBackgroundImage );
- FadeOutImage( pushButton, Background, dimmedBackgroundImage, opacity );
+ pushButton.Add( disabledBackgroundImage );
+ FadeOutImage( pushButton, Background, disabledBackgroundImage, opacity );
StartFadeOutAnimation( pushButton );
break;
}
default:
- dimmedBackgroundImage = image;
+ disabledBackgroundImage = image;
break;
}
- dimmedBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- dimmedBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- ApplyConstraint( dimmedBackgroundImage, BACKGROUND_DEPTH );
+ disabledBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ disabledBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ ApplyConstraint( disabledBackgroundImage, BACKGROUND_DEPTH );
}
-void PushButtonDefaultPainter::SetLabelText( Toolkit::PushButton& pushButton, Actor text )
+void PushButtonDefaultPainter::SetLabel( Toolkit::PushButton& pushButton, Actor label )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetImplementation( pushButton );
- Actor& label = pushButtonImpl.GetLabel();
+ Actor& labelActor = pushButtonImpl.GetLabel();
- if( label && label.GetParent() )
+ if( labelActor && labelActor.GetParent() )
{
- label.GetParent().Remove( label );
+ labelActor.GetParent().Remove( labelActor );
}
- label = text;
- label.SetAnchorPoint( AnchorPoint::CENTER );
- label.SetParentOrigin( ParentOrigin::CENTER );
+ labelActor = label;
+ labelActor.SetAnchorPoint( AnchorPoint::CENTER );
+ labelActor.SetParentOrigin( ParentOrigin::CENTER );
- label.SetPosition( 0.f, 0.f, LABEL_DEPTH );
- label.SetSize( mSize );
+ labelActor.SetPosition( 0.f, 0.f, LABEL_DEPTH );
+ labelActor.SetSize( mSize );
- pushButton.Add( label );
+ pushButton.Add( labelActor );
}
void PushButtonDefaultPainter::Initialize( Toolkit::Button& button )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetPushButtonImpl( button );
Actor& buttonImage = pushButtonImpl.GetButtonImage();
- Actor& pressedImage = pushButtonImpl.GetPressedImage();
+ Actor& selectedImage = pushButtonImpl.GetSelectedImage();
Actor& backgroundImage = pushButtonImpl.GetBackgroundImage();
- Actor& dimmedImage = pushButtonImpl.GetDimmedImage();
- Actor& dimmedBackgroundImage = pushButtonImpl.GetDimmedBackgroundImage();
+ Actor& disabledImage = pushButtonImpl.GetDisabledImage();
+ Actor& disabledBackgroundImage = pushButtonImpl.GetDisabledBackgroundImage();
Actor& label = pushButtonImpl.GetLabel();
Toolkit::PushButton& pushButton = static_cast<Toolkit::PushButton&>( button );
SetBackgroundImage( pushButton, backgroundImage );
}
- if( pressedImage )
+ if( selectedImage )
{
- SetPressedImage( pushButton, pressedImage );
+ SetSelectedImage( pushButton, selectedImage );
}
- if( dimmedImage )
+ if( disabledImage )
{
- SetDimmedImage( pushButton, dimmedImage );
+ SetDisabledImage( pushButton, disabledImage );
}
- if( dimmedBackgroundImage )
+ if( disabledBackgroundImage )
{
- SetDimmedBackgroundImage( pushButton, dimmedBackgroundImage );
+ SetDisabledBackgroundImage( pushButton, disabledBackgroundImage );
}
if( label )
{
- SetLabelText( pushButton, label );
+ SetLabel( pushButton, label );
}
- SetDimmed( pushButton, mDimmed );
+ SetDisabled( pushButton, mDisabled );
}
void PushButtonDefaultPainter::SetSize( Toolkit::Button& button, const Vector3& size )
Toolkit::Internal::PushButton& pushButtonImpl = GetPushButtonImpl( button );
Actor& buttonImage = pushButtonImpl.GetButtonImage();
- Actor& pressedImage = pushButtonImpl.GetPressedImage();
+ Actor& selectedImage = pushButtonImpl.GetSelectedImage();
Actor& backgroundImage = pushButtonImpl.GetBackgroundImage();
- Actor& dimmedImage = pushButtonImpl.GetDimmedImage();
- Actor& dimmedBackgroundImage = pushButtonImpl.GetDimmedBackgroundImage();
+ Actor& disabledImage = pushButtonImpl.GetDisabledImage();
+ Actor& disabledBackgroundImage = pushButtonImpl.GetDisabledBackgroundImage();
Actor& label = pushButtonImpl.GetLabel();
ApplyConstraint( buttonImage, FOREGROUND_DEPTH );
ApplyConstraint( backgroundImage, BACKGROUND_DEPTH );
- ApplyConstraint( pressedImage, FOREGROUND_DEPTH );
- ApplyConstraint( dimmedImage, FOREGROUND_DEPTH );
- ApplyConstraint( dimmedBackgroundImage, BACKGROUND_DEPTH );
+ ApplyConstraint( selectedImage, FOREGROUND_DEPTH );
+ ApplyConstraint( disabledImage, FOREGROUND_DEPTH );
+ ApplyConstraint( disabledBackgroundImage, BACKGROUND_DEPTH );
if( label )
{
}
}
-void PushButtonDefaultPainter::SetDimmed( Toolkit::Button& button, bool dimmed )
+void PushButtonDefaultPainter::SetDisabled( Toolkit::Button& button, bool disabled )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetPushButtonImpl( button );
Actor& buttonImage = pushButtonImpl.GetButtonImage();
- Actor& pressedImage = pushButtonImpl.GetPressedImage();
+ Actor& selectedImage = pushButtonImpl.GetSelectedImage();
Actor& backgroundImage = pushButtonImpl.GetBackgroundImage();
- Actor& dimmedImage = pushButtonImpl.GetDimmedImage();
- Actor& dimmedBackgroundImage = pushButtonImpl.GetDimmedBackgroundImage();
+ Actor& disabledImage = pushButtonImpl.GetDisabledImage();
+ Actor& disabledBackgroundImage = pushButtonImpl.GetDisabledBackgroundImage();
Actor& fadeOutButtonImage = pushButtonImpl.GetFadeOutButtonImage();
Toolkit::PushButton& pushButton = static_cast<Toolkit::PushButton&>( button );
- mDimmed = dimmed;
+ mDisabled = disabled;
switch( mPaintState )
{
case ReleasedState:
{
- if( dimmed )
+ if( disabled )
{
StopFadeOutAnimation( pushButton );
FadeOutImage( pushButton, Background, backgroundImage );
FadeOutImage( pushButton, Foreground, buttonImage );
- FadeInImage( pushButton, dimmedBackgroundImage );
- FadeInImage( pushButton, dimmedImage );
+ FadeInImage( pushButton, disabledBackgroundImage );
+ FadeInImage( pushButton, disabledImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( buttonImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = ReleasedDimmedTransition;
+ mPaintState = ReleasedDisabledTransition;
}
else
{
- mPaintState = DimmedReleasedState;
+ mPaintState = DisabledReleasedState;
}
}
break;
}
case PressedState:
{
- if( dimmed )
+ if( disabled )
{
StopFadeOutAnimation( pushButton );
FadeOutImage( pushButton, Background, backgroundImage );
- FadeOutImage( pushButton, Foreground, pressedImage );
- FadeInImage( pushButton, dimmedBackgroundImage );
- FadeInImage( pushButton, dimmedImage );
+ FadeOutImage( pushButton, Foreground, selectedImage );
+ FadeInImage( pushButton, disabledBackgroundImage );
+ FadeInImage( pushButton, disabledImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( pressedImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = PressedDimmedTransition;
+ mPaintState = PressedDisabledTransition;
}
else
{
- mPaintState = DimmedPressedState;
+ mPaintState = DisabledPressedState;
}
}
break;
}
- case DimmedReleasedState:
+ case DisabledReleasedState:
{
- if( !dimmed )
+ if( !disabled )
{
StopFadeOutAnimation( pushButton );
- FadeOutImage( pushButton, Background, dimmedBackgroundImage );
- FadeOutImage( pushButton, Foreground, dimmedImage );
+ FadeOutImage( pushButton, Background, disabledBackgroundImage );
+ FadeOutImage( pushButton, Foreground, disabledImage );
FadeInImage( pushButton, backgroundImage );
FadeInImage( pushButton, buttonImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( buttonImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = DimmedReleasedTransition;
+ mPaintState = DisabledReleasedTransition;
}
else
{
}
break;
}
- case DimmedPressedState:
+ case DisabledPressedState:
{
- if( !dimmed )
+ if( !disabled )
{
StopFadeOutAnimation( pushButton );
- FadeOutImage( pushButton, Background, dimmedBackgroundImage );
- FadeOutImage( pushButton, Foreground, dimmedImage );
+ FadeOutImage( pushButton, Background, disabledBackgroundImage );
+ FadeOutImage( pushButton, Foreground, disabledImage );
FadeInImage( pushButton, backgroundImage );
- FadeInImage( pushButton, pressedImage );
+ FadeInImage( pushButton, selectedImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( pressedImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = DimmedPressedTransition;
+ mPaintState = DisabledPressedTransition;
}
else
{
}
case ReleasedPressedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( fadeOutButtonImage )
StopFadeOutAnimation( pushButton );
StopFadeInAnimation();
- FadeOutImage( pushButton, Foreground, pressedImage, 1.f - opacity );
+ FadeOutImage( pushButton, Foreground, selectedImage, 1.f - opacity );
FadeOutImage( pushButton, Background, backgroundImage );
- FadeInImage( pushButton, dimmedImage );
- FadeInImage( pushButton, dimmedBackgroundImage );
+ FadeInImage( pushButton, disabledImage );
+ FadeInImage( pushButton, disabledBackgroundImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( pressedImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = PressedDimmedTransition;
+ mPaintState = PressedDisabledTransition;
}
else
{
- mPaintState = DimmedPressedState;
+ mPaintState = DisabledPressedState;
}
}
break;
}
case PressedReleasedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( fadeOutButtonImage )
FadeOutImage( pushButton, Foreground, buttonImage, 1.f - opacity );
FadeOutImage( pushButton, Background, backgroundImage );
- FadeInImage( pushButton, dimmedImage );
- FadeInImage( pushButton, dimmedBackgroundImage );
+ FadeInImage( pushButton, disabledImage );
+ FadeInImage( pushButton, disabledBackgroundImage );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( buttonImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = ReleasedDimmedTransition;
+ mPaintState = ReleasedDisabledTransition;
}
else
{
- mPaintState = DimmedReleasedState;
+ mPaintState = DisabledReleasedState;
}
}
break;
}
- case ReleasedDimmedTransition:
+ case ReleasedDisabledTransition:
{
- if( !dimmed )
+ if( !disabled )
{
float opacity = 1.f;
if( fadeOutButtonImage )
StopFadeOutAnimation( pushButton, false );
StopFadeInAnimation();
- FadeOutImage( pushButton, Foreground, dimmedImage, 1.f - opacity );
- FadeOutImage( pushButton, Background, dimmedBackgroundImage, 1.f - opacity );
+ FadeOutImage( pushButton, Foreground, disabledImage, 1.f - opacity );
+ FadeOutImage( pushButton, Background, disabledBackgroundImage, 1.f - opacity );
FadeInImage( pushButton, buttonImage, opacity );
FadeInImage( pushButton, backgroundImage, opacity );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( buttonImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = DimmedReleasedTransition;
+ mPaintState = DisabledReleasedTransition;
}
else
{
}
break;
}
- case DimmedReleasedTransition:
+ case DisabledReleasedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( fadeOutButtonImage )
FadeOutImage( pushButton, Foreground, buttonImage, 1.f - opacity );
FadeOutImage( pushButton, Background, backgroundImage, 1.f - opacity );
- FadeInImage( pushButton, dimmedImage, opacity );
- FadeInImage( pushButton, dimmedBackgroundImage, opacity );
+ FadeInImage( pushButton, disabledImage, opacity );
+ FadeInImage( pushButton, disabledBackgroundImage, opacity );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( buttonImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = ReleasedDimmedTransition;
+ mPaintState = ReleasedDisabledTransition;
}
else
{
- mPaintState = DimmedReleasedState;
+ mPaintState = DisabledReleasedState;
}
}
break;
}
- case PressedDimmedTransition:
+ case PressedDisabledTransition:
{
- if( !dimmed )
+ if( !disabled )
{
float opacity = 1.f;
if( fadeOutButtonImage )
StopFadeOutAnimation( pushButton, false );
StopFadeInAnimation();
- FadeOutImage( pushButton, Foreground, dimmedImage, 1.f - opacity );
- FadeOutImage( pushButton, Background, dimmedBackgroundImage, 1.f - opacity );
- FadeInImage( pushButton, pressedImage, opacity );
+ FadeOutImage( pushButton, Foreground, disabledImage, 1.f - opacity );
+ FadeOutImage( pushButton, Background, disabledBackgroundImage, 1.f - opacity );
+ FadeInImage( pushButton, selectedImage, opacity );
FadeInImage( pushButton, backgroundImage, opacity );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( pressedImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = DimmedPressedTransition;
+ mPaintState = DisabledPressedTransition;
}
else
{
}
break;
}
- case DimmedPressedTransition:
+ case DisabledPressedTransition:
{
- if( dimmed )
+ if( disabled )
{
float opacity = 1.f;
if( fadeOutButtonImage )
StopFadeOutAnimation( pushButton, false );
StopFadeInAnimation();
- FadeOutImage( pushButton, Foreground, pressedImage, 1.f - opacity );
+ FadeOutImage( pushButton, Foreground, selectedImage, 1.f - opacity );
FadeOutImage( pushButton, Background, backgroundImage, 1.f - opacity );
- FadeInImage( pushButton, dimmedImage, opacity );
- FadeInImage( pushButton, dimmedBackgroundImage, opacity );
+ FadeInImage( pushButton, disabledImage, opacity );
+ FadeInImage( pushButton, disabledBackgroundImage, opacity );
StartFadeOutAnimation( pushButton );
StartFadeInAnimation();
- if( pressedImage || dimmedImage || backgroundImage || dimmedBackgroundImage )
+ if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
{
- mPaintState = PressedDimmedTransition;
+ mPaintState = PressedDisabledTransition;
}
else
{
- mPaintState = DimmedPressedState;
+ mPaintState = DisabledPressedState;
}
}
break;
void PushButtonDefaultPainter::Pressed( Toolkit::PushButton& button )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetPushButtonImpl( button );
- Actor& pressedImage = pushButtonImpl.GetPressedImage();
+ Actor& selectedImage = pushButtonImpl.GetSelectedImage();
Actor& buttonImage = pushButtonImpl.GetButtonImage();
Actor& fadeOutButtonImage = pushButtonImpl.GetFadeOutButtonImage();
{
StopFadeOutAnimation( button );
FadeOutImage( button, Foreground, buttonImage );
- FadeInImage( button, pressedImage );
+ FadeInImage( button, selectedImage );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = ReleasedPressedTransition;
}
StopFadeInAnimation();
FadeOutImage( button, Foreground, buttonImage, 1.f - opacity );
- FadeInImage( button, pressedImage, opacity );
+ FadeInImage( button, selectedImage, opacity );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = ReleasedPressedTransition;
}
void PushButtonDefaultPainter::Released( Toolkit::PushButton& button )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetPushButtonImpl( button );
- Actor& pressedImage = pushButtonImpl.GetPressedImage();
+ Actor& selectedImage = pushButtonImpl.GetSelectedImage();
Actor& buttonImage = pushButtonImpl.GetButtonImage();
Actor& fadeOutButtonImage = pushButtonImpl.GetFadeOutButtonImage();
case PressedState:
{
StopFadeOutAnimation( button );
- FadeOutImage( button, Foreground, pressedImage );
+ FadeOutImage( button, Foreground, selectedImage );
FadeInImage( button, buttonImage );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = PressedReleasedTransition;
}
StopFadeOutAnimation( button, false );
StopFadeInAnimation();
- FadeOutImage( button, Foreground, pressedImage, 1.f - opacity );
+ FadeOutImage( button, Foreground, selectedImage, 1.f - opacity );
FadeInImage( button, buttonImage, opacity );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = PressedReleasedTransition;
}
void PushButtonDefaultPainter::Toggled( Toolkit::PushButton& button )
{
Toolkit::Internal::PushButton& pushButtonImpl = GetPushButtonImpl( button );
- Actor& pressedImage = pushButtonImpl.GetPressedImage();
+ Actor& selectedImage = pushButtonImpl.GetSelectedImage();
Actor& buttonImage = pushButtonImpl.GetButtonImage();
Actor& fadeOutButtonImage = pushButtonImpl.GetFadeOutButtonImage();
{
StopFadeOutAnimation( button );
FadeOutImage( button, Foreground, buttonImage );
- FadeInImage( button, pressedImage );
+ FadeInImage( button, selectedImage );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = ReleasedPressedTransition;
}
case PressedState:
{
StopFadeOutAnimation( button );
- FadeOutImage( button, Foreground, pressedImage );
+ FadeOutImage( button, Foreground, selectedImage );
FadeInImage( button, buttonImage );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = PressedReleasedTransition;
}
StopFadeOutAnimation( button, false );
StopFadeInAnimation();
- FadeOutImage( button, Foreground, pressedImage, 1.f - opacity );
+ FadeOutImage( button, Foreground, selectedImage, 1.f - opacity );
FadeInImage( button, buttonImage, opacity );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = PressedReleasedTransition;
}
StopFadeInAnimation();
FadeOutImage( button, Foreground, buttonImage, 1.f - opacity );
- FadeInImage( button, pressedImage, opacity );
+ FadeInImage( button, selectedImage, opacity );
StartFadeOutAnimation( button );
StartFadeInAnimation();
- if( buttonImage || pressedImage )
+ if( buttonImage || selectedImage )
{
mPaintState = ReleasedPressedTransition;
}
mPaintState = ReleasedState;
break;
}
- case ReleasedDimmedTransition:
+ case ReleasedDisabledTransition:
{
- mPaintState = DimmedReleasedState;
+ mPaintState = DisabledReleasedState;
break;
}
- case DimmedReleasedTransition:
+ case DisabledReleasedTransition:
{
mPaintState = ReleasedState;
break;
}
- case PressedDimmedTransition:
+ case PressedDisabledTransition:
{
- mPaintState = DimmedPressedState;
+ mPaintState = DisabledPressedState;
break;
}
- case DimmedPressedTransition:
+ case DisabledPressedTransition:
{
mPaintState = PressedState;
break;
mPaintState = ReleasedState;
break;
}
- case ReleasedDimmedTransition:
+ case ReleasedDisabledTransition:
{
- mPaintState = DimmedReleasedState;
+ mPaintState = DisabledReleasedState;
break;
}
- case DimmedReleasedTransition:
+ case DisabledReleasedTransition:
{
mPaintState = ReleasedState;
break;
}
- case PressedDimmedTransition:
+ case PressedDisabledTransition:
{
- mPaintState = DimmedPressedState;
+ mPaintState = DisabledPressedState;
break;
}
- case DimmedPressedTransition:
+ case DisabledPressedTransition:
{
mPaintState = PressedState;
break;
void SetBackgroundImage( Toolkit::PushButton& pushButton, Actor image );
/**
- * Sets the pressed image.
+ * Sets the selected image.
*
- * It adds the pressed image to the root actor and creates the image transition if needed.
+ * It adds the selected image to the root actor and creates the image transition if needed.
*
* @param[inout] pushButton The button in which all actors that form its appearance are going to be added.
- * @param[in] image The pressed image.
+ * @param[in] image The selected image.
*/
- void SetPressedImage( Toolkit::PushButton& pushButton, Actor image );
+ void SetSelectedImage( Toolkit::PushButton& pushButton, Actor image );
/**
- * Sets the dimmed background image.
+ * Sets the disabled background image.
*
- * It adds the dimmed background image to the root actor and creates the image transition if needed.
+ * It adds the disabled background image to the root actor and creates the image transition if needed.
*
* @param[inout] pushButton The button in which all actors that form its appearance are going to be added.
- * @param[in] image The dimmed background image.
+ * @param[in] image The disabled background image.
*/
- void SetDimmedBackgroundImage( Toolkit::PushButton& pushButton, Actor image );
+ void SetDisabledBackgroundImage( Toolkit::PushButton& pushButton, Actor image );
/**
- * Sets the dimmed image.
+ * Sets the disabled image.
*
- * It adds the dimmed image to the root actor and creates the image transition if needed.
+ * It adds the disabled image to the root actor and creates the image transition if needed.
*
* @param[inout] pushButton The button in which all actors that form its appearance are going to be added.
* @param[in] image The image.
*/
- void SetDimmedImage( Toolkit::PushButton& pushButton, Actor image );
+ void SetDisabledImage( Toolkit::PushButton& pushButton, Actor image );
/**
- * Sets the text label.
+ * Sets the label.
*
- * It adds the text to the root actor.
+ * It adds the label to the root actor.
*
* @param[inout] pushButton The button in which all actors that form its appearance are going to be added.
- * @param[in] text Label text.
+ * @param[in] label Button label.
*/
- void SetLabelText( Toolkit::PushButton& pushButton, Actor text );
+ void SetLabel( Toolkit::PushButton& pushButton, Actor label );
/////////////////////////////////////////////////////////////////////////////
// ButtonPainter interface
void SetSize( Toolkit::Button& button, const Vector3& size );
/**
- * This method is called when the \e dimmed property in the Dali::Toolkit::PushButton changes.
+ * This method is called when the \e disabled property in the Dali::Toolkit::PushButton changes.
*
* Creates image transitions if needed.
*
* @param[inout] button The button in which all actors that form its appearance are going to be added.
- * @param[in] dimmed property.
+ * @param[in] disabled property.
*/
- void SetDimmed( Toolkit::Button& button, bool dimmed );
+ void SetDisabled( Toolkit::Button& button, bool disabled );
/**
* Sets the animation time.
/**
* This method is called when the Dali::Toolkit::Internal::PushButton in which this object is registered
- * is pressed. It changes to the pressed image with a transition.
+ * is pressed. It changes to the selected image with a transition.
*
* @param[inout] button The Dali::Toolkit::PushButton in which this object is registered.
*/
*/
enum PaintState
{
- ReleasedState, ///< The push button is released.
- PressedState, ///< The push button is pressed.
- DimmedReleasedState, ///< The push button is dimmed and released.
- DimmedPressedState, ///< The push button is dimemd and pressed.
- ReleasedPressedTransition, ///< The push button is in transition from released to pressed.
- PressedReleasedTransition, ///< The push button is in transition from pressed to released.
- ReleasedDimmedTransition, ///< The push button is in transition from released to dimmed.
- DimmedReleasedTransition, ///< The push button is in transition from dimmed to released.
- PressedDimmedTransition, ///< The push button is in transition from pressed to dimmed.
- DimmedPressedTransition ///< The push button is in transition from dimmed to pressed.
+ ReleasedState, ///< The push button is released.
+ PressedState, ///< The push button is pressed.
+ DisabledReleasedState, ///< The push button is disabled and released.
+ DisabledPressedState, ///< The push button is Disabled and pressed.
+ ReleasedPressedTransition, ///< The push button is in transition from released to pressed.
+ PressedReleasedTransition, ///< The push button is in transition from pressed to released.
+ ReleasedDisabledTransition, ///< The push button is in transition from released to disabled.
+ DisabledReleasedTransition, ///< The push button is in transition from disabled to released.
+ PressedDisabledTransition, ///< The push button is in transition from pressed to disabled.
+ DisabledPressedTransition ///< The push button is in transition from disabled to pressed.
};
/**
private:
bool mAutoRepeating; ///< Stores the autorepeating property.
- bool mDimmed; ///< Stores the dimmed property.
+ bool mDisabled; ///< Stores the disabled property.
PaintState mPaintState; ///< The painter state.
Animation mFadeInAnimation; ///< Animation used in the state transitions.
namespace Toolkit
{
-const Property::Index PushButton::PROPERTY_AUTO_REPEATING = Internal::Button::BUTTON_PROPERTY_END_INDEX + 1;
-const Property::Index PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_END_INDEX + 2;
-const Property::Index PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_END_INDEX + 3;
-const Property::Index PushButton::PROPERTY_TOGGLABLE = Internal::Button::BUTTON_PROPERTY_END_INDEX + 4;
-const Property::Index PushButton::PROPERTY_TOGGLE = Internal::Button::BUTTON_PROPERTY_END_INDEX + 5;
-const Property::Index PushButton::PROPERTY_NORMAL_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_END_INDEX + 6;
-const Property::Index PushButton::PROPERTY_PRESSED_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_END_INDEX + 7;
-const Property::Index PushButton::PROPERTY_DIMMED_STATE_ACTOR = Internal::Button::BUTTON_PROPERTY_END_INDEX + 8;
-const Property::Index PushButton::PROPERTY_LABEL_ACTOR = Internal::Button::BUTTON_PROPERTY_END_INDEX + 9;
-
namespace Internal
{
TypeAction action1( typeRegistration, Toolkit::PushButton::ACTION_PUSH_BUTTON_CLICK, &PushButton::DoAction );
-PropertyRegistration property1( typeRegistration, "auto-repeating", Toolkit::PushButton::PROPERTY_AUTO_REPEATING, Property::BOOLEAN, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property2( typeRegistration, "initial-auto-repeating-delay", Toolkit::PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, Property::FLOAT, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property3( typeRegistration, "next-auto-repeating-delay", Toolkit::PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY, Property::FLOAT, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property4( typeRegistration, "togglable", Toolkit::PushButton::PROPERTY_TOGGLABLE, Property::BOOLEAN, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property5( typeRegistration, "toggle", Toolkit::PushButton::PROPERTY_TOGGLE, Property::BOOLEAN, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property6( typeRegistration, "normal-state-actor", Toolkit::PushButton::PROPERTY_NORMAL_STATE_ACTOR, Property::MAP, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property7( typeRegistration, "pressed-state-actor", Toolkit::PushButton::PROPERTY_PRESSED_STATE_ACTOR, Property::MAP, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property8( typeRegistration, "dimmed-state-actor", Toolkit::PushButton::PROPERTY_DIMMED_STATE_ACTOR, Property::MAP, &PushButton::SetProperty, &PushButton::GetProperty );
-PropertyRegistration property9( typeRegistration, "label-actor", Toolkit::PushButton::PROPERTY_LABEL_ACTOR, Property::MAP, &PushButton::SetProperty, &PushButton::GetProperty );
-
} // unnamed namespace
namespace
void PushButton::SetToggled( bool toggle )
{
- if( !mDimmed && mToggleButton && ( toggle != mToggled ) )
+ if( !mDisabled && mToggleButton && ( toggle != mToggled ) )
{
mToggled = toggle;
GetPushButtonPainter( mPainter )->Toggled( handle );
// Emit signal.
- mToggledSignal.Emit( handle, mToggled );
+ mStateChangedSignal.Emit( handle, mToggled );
}
}
return mBackgroundImage;
}
-void PushButton::SetPressedImage( Image image )
+void PushButton::SetSelectedImage( Image image )
{
- SetPressedImage( ImageActor::New( image ) );
+ SetSelectedImage( ImageActor::New( image ) );
}
-void PushButton::SetPressedImage( Actor image )
+void PushButton::SetSelectedImage( Actor image )
{
Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetPressedImage( handle, image );
+ GetPushButtonPainter( mPainter )->SetSelectedImage( handle, image );
}
-Actor& PushButton::GetPressedImage()
+Actor& PushButton::GetSelectedImage()
{
- return mPressedImage;
+ return mSelectedImage;
}
-Actor PushButton::GetPressedImage() const
+Actor PushButton::GetSelectedImage() const
{
- return mPressedImage;
+ return mSelectedImage;
}
-void PushButton::SetDimmedBackgroundImage( Image image )
+void PushButton::SetDisabledBackgroundImage( Image image )
{
- SetDimmedBackgroundImage( ImageActor::New( image ) );
+ SetDisabledBackgroundImage( ImageActor::New( image ) );
}
-void PushButton::SetDimmedBackgroundImage( Actor image )
+void PushButton::SetDisabledBackgroundImage( Actor image )
{
Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetDimmedBackgroundImage( handle, image );
+ GetPushButtonPainter( mPainter )->SetDisabledBackgroundImage( handle, image );
}
-Actor& PushButton::GetDimmedBackgroundImage()
+Actor& PushButton::GetDisabledBackgroundImage()
{
- return mDimmedBackgroundImage;
+ return mDisabledBackgroundImage;
}
-Actor PushButton::GetDimmedBackgroundImage() const
+Actor PushButton::GetDisabledBackgroundImage() const
{
- return mDimmedBackgroundImage;
+ return mDisabledBackgroundImage;
}
-void PushButton::SetDimmedImage( Image image )
+void PushButton::SetDisabledImage( Image image )
{
- SetDimmedImage( ImageActor::New( image ) );
+ SetDisabledImage( ImageActor::New( image ) );
}
-void PushButton::SetDimmedImage( Actor image )
+void PushButton::SetDisabledImage( Actor image )
{
Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetDimmedImage( handle, image );
+ GetPushButtonPainter( mPainter )->SetDisabledImage( handle, image );
}
-Actor& PushButton::GetDimmedImage()
+Actor& PushButton::GetDisabledImage()
{
- return mDimmedImage;
+ return mDisabledImage;
}
-Actor PushButton::GetDimmedImage() const
+Actor PushButton::GetDisabledImage() const
{
- return mDimmedImage;
+ return mDisabledImage;
}
-void PushButton::SetLabelText( const std::string& text )
+void PushButton::SetLabel( const std::string& label )
{
- Toolkit::TextView textView ( Toolkit::TextView::New( text ) );
+ Toolkit::TextView textView ( Toolkit::TextView::New( label ) );
textView.SetWidthExceedPolicy( Toolkit::TextView::ShrinkToFit ); // Make sure our text always fits inside the button
- SetLabelText( textView );
+ SetLabel( textView );
}
-void PushButton::SetLabelText( Actor text )
+void PushButton::SetLabel( Actor label )
{
Toolkit::PushButton handle( GetOwner() );
- GetPushButtonPainter( mPainter )->SetLabelText( handle, text );
+ GetPushButtonPainter( mPainter )->SetLabel( handle, label );
}
-Actor& PushButton::GetLabel()
+Actor PushButton::GetLabel() const
{
return mLabel;
}
-Actor PushButton::GetLabelText() const
+Actor& PushButton::GetLabel()
{
return mLabel;
}
bool connected( true );
Toolkit::PushButton button = Toolkit::PushButton::DownCast(handle);
- if( Toolkit::PushButton::SIGNAL_TOGGLED == signalName )
+ if( Toolkit::PushButton::SIGNAL_STATE_CHANGED == signalName )
{
- button.ToggledSignal().Connect( tracker, functor );
+ button.StateChangedSignal().Connect( tracker, functor );
}
else if( Toolkit::PushButton::SIGNAL_PRESSED == signalName )
{
{
PushButton& pushButtonImpl( GetImplementation( pushButton ) );
- switch ( propertyIndex )
+ if ( propertyIndex == Toolkit::Button::PROPERTY_AUTO_REPEATING )
{
- case Toolkit::PushButton::PROPERTY_AUTO_REPEATING:
- {
- pushButtonImpl.SetAutoRepeating( value.Get< bool >() );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
- {
- pushButtonImpl.SetInitialAutoRepeatingDelay( value.Get< float >() );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
- {
- pushButtonImpl.SetNextAutoRepeatingDelay( value.Get< float >() );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_TOGGLABLE:
- {
- pushButtonImpl.SetToggleButton( value.Get< bool >() );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_TOGGLE:
- {
- pushButtonImpl.SetToggled( value.Get< bool >() );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_NORMAL_STATE_ACTOR:
- {
- pushButtonImpl.SetButtonImage( Scripting::NewActor( value.Get< Property::Map >() ) );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_PRESSED_STATE_ACTOR:
- {
- pushButtonImpl.SetPressedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_DIMMED_STATE_ACTOR:
- {
- pushButtonImpl.SetDimmedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_LABEL_ACTOR:
- {
- pushButtonImpl.SetLabelText( Scripting::NewActor( value.Get< Property::Map >() ) );
- break;
- }
+ pushButtonImpl.SetAutoRepeating( value.Get< bool >() );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY )
+ {
+ pushButtonImpl.SetInitialAutoRepeatingDelay( value.Get< float >() );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY )
+ {
+ pushButtonImpl.SetNextAutoRepeatingDelay( value.Get< float >() );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_TOGGLABLE )
+ {
+ pushButtonImpl.SetToggleButton( value.Get< bool >() );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_TOGGLED )
+ {
+ pushButtonImpl.SetToggled( value.Get< bool >() );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR )
+ {
+ pushButtonImpl.SetButtonImage( Scripting::NewActor( value.Get< Property::Map >() ) );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR )
+ {
+ pushButtonImpl.SetSelectedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR )
+ {
+ pushButtonImpl.SetDisabledImage( Scripting::NewActor( value.Get< Property::Map >() ) );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_LABEL_ACTOR )
+ {
+ pushButtonImpl.SetLabel( Scripting::NewActor( value.Get< Property::Map >() ) );
}
}
}
{
PushButton& pushButtonImpl( GetImplementation( pushButton ) );
- switch ( propertyIndex )
+ if ( propertyIndex == Toolkit::Button::PROPERTY_AUTO_REPEATING )
{
- case Toolkit::PushButton::PROPERTY_AUTO_REPEATING:
- {
- value = pushButtonImpl.mAutoRepeating;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
- {
- value = pushButtonImpl.mInitialAutoRepeatingDelay;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
- {
- value = pushButtonImpl.mNextAutoRepeatingDelay;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_TOGGLABLE:
- {
- value = pushButtonImpl.mToggleButton;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_TOGGLE:
- {
- value = pushButtonImpl.mToggled;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_NORMAL_STATE_ACTOR:
- {
- Property::Map map;
- Scripting::CreatePropertyMap( pushButtonImpl.mButtonImage, map );
- value = map;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_PRESSED_STATE_ACTOR:
- {
- Property::Map map;
- Scripting::CreatePropertyMap( pushButtonImpl.mPressedImage, map );
- value = map;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_DIMMED_STATE_ACTOR:
- {
- Property::Map map;
- Scripting::CreatePropertyMap( pushButtonImpl.mDimmedImage, map );
- value = map;
- break;
- }
-
- case Toolkit::PushButton::PROPERTY_LABEL_ACTOR:
- {
- Property::Map map;
- Scripting::CreatePropertyMap( pushButtonImpl.mLabel, map );
- value = map;
- break;
- }
+ value = pushButtonImpl.mAutoRepeating;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY )
+ {
+ value = pushButtonImpl.mInitialAutoRepeatingDelay;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY )
+ {
+ value = pushButtonImpl.mNextAutoRepeatingDelay;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_TOGGLABLE )
+ {
+ value = pushButtonImpl.mToggleButton;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_TOGGLED )
+ {
+ value = pushButtonImpl.mToggled;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR )
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( pushButtonImpl.mButtonImage, map );
+ value = map;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR )
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( pushButtonImpl.mSelectedImage, map );
+ value = map;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR )
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( pushButtonImpl.mDisabledImage, map );
+ value = map;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_LABEL_ACTOR )
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( pushButtonImpl.mLabel, map );
+ value = map;
}
}
GetPushButtonPainter( mPainter )->Toggled( handle );
// Emit signal.
- mToggledSignal.Emit( handle, mToggled );
+ mStateChangedSignal.Emit( handle, mToggled );
}
else
{
bool PushButton::AutoRepeatingSlot()
{
bool consumed = false;
- if( !mDimmed )
+ if( !mDisabled )
{
// Restart the autorepeat timer.
SetUpTimer( mNextAutoRepeatingDelay );
Actor GetBackgroundImage() const;
/**
- * @copydoc Dali::Toolkit::PushButton::SetPressedImage( const Image image )
+ * @copydoc Dali::Toolkit::PushButton::SetSelectedImage( const Image image )
*/
- void SetPressedImage( Image image );
+ void SetSelectedImage( Image image );
/**
- * @copydoc Dali::Toolkit::PushButton::SetPressedImage( Actor image )
+ * @copydoc Dali::Toolkit::PushButton::SetSelectedImage( Actor image )
*/
- void SetPressedImage( Actor image );
+ void SetSelectedImage( Actor image );
/**
* Used by the painter only.
- * @return A reference to the pressed image.
+ * @return A reference to the selected image.
*/
- Actor& GetPressedImage();
+ Actor& GetSelectedImage();
/**
- * @copydoc Dali::Toolkit::PushButton::GetPressedImage()
+ * @copydoc Dali::Toolkit::PushButton::GetSelectedImage()
*/
- Actor GetPressedImage() const;
+ Actor GetSelectedImage() const;
/**
- * @copydoc Dali::Toolkit::PushButton::SetDimmedBackgroundImage( Image image )
+ * @copydoc Dali::Toolkit::PushButton::SetDisabledBackgroundImage( Image image )
*/
- void SetDimmedBackgroundImage( Image image );
+ void SetDisabledBackgroundImage( Image image );
/**
- * @copydoc Dali::Toolkit::PushButton::SetDimmedBackgroundImage( Actor image )
+ * @copydoc Dali::Toolkit::PushButton::SetDisabledBackgroundImage( Actor image )
*/
- void SetDimmedBackgroundImage( Actor image );
+ void SetDisabledBackgroundImage( Actor image );
/**
* Used by the painter only.
- * @return A reference to the dimmed background image.
+ * @return A reference to the disabled background image.
*/
- Actor& GetDimmedBackgroundImage();
+ Actor& GetDisabledBackgroundImage();
/**
- * @copydoc Dali::Toolkit::PushButton::GetDimmedBackgroundImage()
+ * @copydoc Dali::Toolkit::PushButton::GetDisabledBackgroundImage()
*/
- Actor GetDimmedBackgroundImage() const;
+ Actor GetDisabledBackgroundImage() const;
/**
- * @copydoc Dali::Toolkit::PushButton::SetDimmedImage( Image image )
+ * @copydoc Dali::Toolkit::PushButton::SetDisabledImage( Image image )
*/
- void SetDimmedImage( Image image );
+ void SetDisabledImage( Image image );
/**
- * @copydoc Dali::Toolkit::PushButton::SetDimmedImage( Actor image )
+ * @copydoc Dali::Toolkit::PushButton::SetDisabledImage( Actor image )
*/
- void SetDimmedImage( Actor image );
+ void SetDisabledImage( Actor image );
/**
* Used by the painter only.
- * @return A reference to the dimmed button image.
+ * @return A reference to the disabled button image.
*/
- Actor& GetDimmedImage();
+ Actor& GetDisabledImage();
/**
- * @copydoc Dali::Toolkit::PushButton::GetDimmedImage()
+ * @copydoc Dali::Toolkit::PushButton::GetDisabledImage()
*/
- Actor GetDimmedImage() const;
+ Actor GetDisabledImage() const;
/**
- * @copydoc Dali::Toolkit::PushButton::SetLabelText( const std::string& text )
+ * @copydoc Dali::Toolkit::PushButton::SetLabel( const std::string& label )
*/
- void SetLabelText( const std::string& text );
+ void SetLabel( const std::string& label );
/**
- * @copydoc Dali::Toolkit::PushButton::SetLabelText( Actor text )
+ * @copydoc Dali::Toolkit::PushButton::SetLabel( Actor label )
*/
- void SetLabelText( Actor text );
+ void SetLabel( Actor label );
/**
- * Used by the painter only.
- * @return A reference to the label actor.
+ * @copydoc Dali::Toolkit::PushButton::GetLabel()
*/
- Actor& GetLabel();
+ Actor GetLabel() const;
/**
- * @copydoc Dali::Toolkit::PushButton::GetLabelText()
+ * Used by the painter only.
+ * @return A reference to the label actor.
*/
- Actor GetLabelText() const;
+ Actor& GetLabel();
/**
* Used by the painter only.
Toolkit::PushButton::PressedSignalType mPressedSignal; ///< Signal emitted when the button is pressed.
Toolkit::PushButton::ReleasedSignalType mReleasedSignal; ///< Signal emitted when the button is released.
- Actor mButtonImage; ///< Stores the released image.
+ Actor mButtonImage; ///< Stores the unselected image.
Actor mBackgroundImage; ///< Stores the background image.
- Actor mPressedImage; ///< Stores the pressed image.
- Actor mDimmedImage; ///< Stores the dimmed image.
- Actor mDimmedBackgroundImage; ///< Stores the dimmed background image.
+ Actor mSelectedImage; ///< Stores the selected image.
+ Actor mDisabledImage; ///< Stores the disabled image.
+ Actor mDisabledBackgroundImage; ///< Stores the disabled background image.
Actor mLabel; ///< Stores the text label.
virtual void SetSize( Toolkit::Button& button, const Vector3& size ) = 0;
/**
- * @copydoc ButtonPainter::SetDimmed( Toolkit::Button& button, bool dimmed )
+ * @copydoc ButtonPainter::SetDisabled( Toolkit::Button& button, bool disabled )
*/
- virtual void SetDimmed( Toolkit::Button& button, bool dimmed ) = 0;
+ virtual void SetDisabled( Toolkit::Button& button, bool disabled ) = 0;
/**
* @copydoc ButtonPainter::SetAnimationTime()
using namespace Dali;
using namespace Dali::Toolkit::Internal;
-namespace Dali
-{
-namespace Toolkit
-{
-const Property::Index RadioButton::PROPERTY_ACTIVE = Internal::Button::BUTTON_PROPERTY_END_INDEX + 11;
-const Property::Index RadioButton::PROPERTY_LABEL_ACTOR = Internal::Button::BUTTON_PROPERTY_END_INDEX + 12;
-}
-}
-
namespace
{
TypeRegistration typeRegistration( typeid( Toolkit::RadioButton ), typeid( Toolkit::Button ), Create);
-PropertyRegistration property1(typeRegistration, "active", Toolkit::RadioButton::PROPERTY_ACTIVE, Property::BOOLEAN, &RadioButton::SetProperty, &RadioButton::GetProperty);
-PropertyRegistration property2(typeRegistration, "label-actor", Toolkit::RadioButton::PROPERTY_LABEL_ACTOR, Property::MAP, &RadioButton::SetProperty, &RadioButton::GetProperty);
-
-const char* const INACTIVE_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-inactive.png";
-const char* const ACTIVE_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-active.png";
+const char* const UNSELECTED_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-unselected.png";
+const char* const SELECTED_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-selected.png";
const Vector3 DISTANCE_BETWEEN_IMAGE_AND_LABEL(5.0f, 0.0f, 0.0f);
}
}
RadioButton::RadioButton()
- : mActive(false)
+ : mSelected(false)
{
- mInactiveImage = Dali::Image::New( INACTIVE_BUTTON_IMAGE_DIR );
- mActiveImage = Dali::Image::New( ACTIVE_BUTTON_IMAGE_DIR );
+ mUnselectedImage = Dali::Image::New( UNSELECTED_BUTTON_IMAGE_DIR );
+ mSelectedImage = Dali::Image::New( SELECTED_BUTTON_IMAGE_DIR );
- mRadioIcon = Dali::ImageActor::New( mInactiveImage );
+ mRadioIcon = Dali::ImageActor::New( mUnselectedImage );
}
RadioButton::~RadioButton()
return mLabel;
}
-void RadioButton::SetActive(bool active)
+void RadioButton::SetSelected(bool selected)
{
- if( mActive != active )
+ if( mSelected != selected )
{
- if( active )
+ if( selected )
{
Actor parent = Self().GetParent();
if( parent )
if( rbChild )
{
- rbChild.SetActive(false);
+ rbChild.SetSelected(false);
}
}
}
- mActive = true;
- mRadioIcon.SetImage(mActiveImage);
+ mSelected = true;
+ mRadioIcon.SetImage(mSelectedImage);
}
else
{
- mActive = false;
- mRadioIcon.SetImage(mInactiveImage);
+ mSelected = false;
+ mRadioIcon.SetImage(mUnselectedImage);
}
- // Raise toggled signal
+ // Raise state changed signal
Toolkit::RadioButton handle( GetOwner() );
- mToggledSignal.Emit( handle, mActive );
+ mStateChangedSignal.Emit( handle, mSelected );
RelayoutRequest();
}
}
-bool RadioButton::IsActive()const
+bool RadioButton::IsSelected()const
{
- return mActive;
+ return mSelected;
}
void RadioButton::ToggleState()
{
- SetActive(!mActive);
+ SetSelected(!mSelected);
}
void RadioButton::OnRelaidOut( Vector2 /*size*/, ActorSizeContainer& container )
void RadioButton::OnButtonUp()
{
- // Don't allow selection on an already active radio button
- if( !mActive )
+ // Don't allow selection on an already selected radio button
+ if( !mSelected )
{
ToggleState();
}
{
RadioButton& radioButtonImpl( GetImplementation( radioButton ) );
- switch ( propertyIndex )
+ if ( propertyIndex == Toolkit::Button::PROPERTY_TOGGLED )
{
- case Toolkit::RadioButton::PROPERTY_ACTIVE:
- {
- radioButtonImpl.SetActive( value.Get< bool >( ) );
- break;
- }
- case Toolkit::RadioButton::PROPERTY_LABEL_ACTOR:
- {
- radioButtonImpl.SetLabel( Scripting::NewActor( value.Get< Property::Map >( ) ) );
- break;
- }
+ radioButtonImpl.SetSelected( value.Get< bool >( ) );
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_LABEL_ACTOR )
+ {
+ radioButtonImpl.SetLabel( Scripting::NewActor( value.Get< Property::Map >( ) ) );
}
}
}
{
RadioButton& radioButtonImpl( GetImplementation( radioButton ) );
- switch ( propertyIndex )
+ if ( propertyIndex == Toolkit::Button::PROPERTY_TOGGLED )
{
- case Toolkit::RadioButton::PROPERTY_ACTIVE:
- {
- value = radioButtonImpl.mActive;
- break;
- }
- case Toolkit::RadioButton::PROPERTY_LABEL_ACTOR:
- {
- Property::Map map;
- Scripting::CreatePropertyMap( radioButtonImpl.mLabel, map );
- value = map;
- break;
- }
+ value = radioButtonImpl.mSelected;
+ }
+ else if ( propertyIndex == Toolkit::Button::PROPERTY_LABEL_ACTOR )
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap( radioButtonImpl.mLabel, map );
+ value = map;
}
}
Actor GetLabel() const;
/**
- * @copydoc Dali::Toolkit::RadioButton::SetActive(bool active)
+ * @copydoc Dali::Toolkit::RadioButton::SetSelected(bool selected)
*/
- void SetActive(bool active);
+ void SetSelected(bool selected);
/**
- * @copydoc Dali::Toolkit::RadioButton::IsActive()
+ * @copydoc Dali::Toolkit::RadioButton::IsSelected()
*/
- bool IsActive()const;
+ bool IsSelected()const;
/**
* @copydoc Dali::Toolkit::RadioButton::ToggleState()
// Undefined
RadioButton& operator=(const RadioButton& origin);
- Image mInactiveImage; ///< Stores the inactive image
- Image mActiveImage; ///< Stores the active image
+ Image mUnselectedImage; ///< Stores the unselected image
+ Image mSelectedImage; ///< Stores the selected image
ImageActor mRadioIcon; ///< Stores the current image
- Actor mLabel; ///< Stores the button label
- bool mActive; ///< Stores the active state
+ Actor mLabel; ///< Stores the button label
+ bool mSelected; ///< Stores the selected state
} ;
} // namespace Internal
optionPressedBackground.Add( pressedIcon );
// 12. Set the pressed option image
- option.SetPressedImage( optionPressedContainer );
+ option.SetSelectedImage( optionPressedContainer );
// 13. Add the divider
if ( !finalOption )
{
const char* const Button::SIGNAL_CLICKED = "clicked";
-const char* const Button::SIGNAL_TOGGLED = "toggled";
+const char* const Button::SIGNAL_STATE_CHANGED = "state-changed";
Button::Button()
{}
return Control::DownCast<Button, Internal::Button>(handle);
}
-void Button::SetDimmed( bool dimmed )
+void Button::SetDisabled( bool disabled )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmed( dimmed );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabled( disabled );
}
-bool Button::IsDimmed() const
+bool Button::IsDisabled() const
{
- return Dali::Toolkit::GetImplementation( *this ).IsDimmed();
+ return Dali::Toolkit::GetImplementation( *this ).IsDisabled();
}
void Button::SetAnimationTime( float animationTime )
return Dali::Toolkit::GetImplementation( *this ).ClickedSignal();
}
-Button::ToggledSignalType& Button::ToggledSignal()
+Button::StateChangedSignalType& Button::StateChangedSignal()
{
- return Dali::Toolkit::GetImplementation( *this ).ToggledSignal();
+ return Dali::Toolkit::GetImplementation( *this ).StateChangedSignal();
}
Button::Button( Internal::Button& implementation )
/**
* @brief Button is a base class for different kind of buttons.
*
- * This class provides the dimmed property and the clicked signal.
+ * This class provides the disabled property and the clicked signal.
*
* A ClickedSignal() is emitted when the button is touched and the touch
* point doesn't leave the boundary of the button.
*
- * When the \e dimmed property is set to \e true, no signal is emitted.
+ * When the \e disabled property is set to \e true, no signal is emitted.
*/
class DALI_IMPORT_API Button : public Control
{
public:
// Signal Names
- static const char* const SIGNAL_CLICKED; ///< name "clicked"
- static const char* const SIGNAL_TOGGLED; ///< name "toggled"
+ static const char* const SIGNAL_CLICKED; ///< name "clicked"
+ static const char* const SIGNAL_STATE_CHANGED; ///< name "state-changed"
// Properties
- static const Property::Index PROPERTY_DIMMED; ///< name "dimmed", @see SetDimmed(), type BOOLEAN
+ static const Property::Index PROPERTY_DISABLED; ///< name "disabled", @see SetDisabled(), type BOOLEAN
+ static const Property::Index PROPERTY_AUTO_REPEATING; ///< name "auto-repeating", @see SetAutoRepeating(), type BOOLEAN
+ static const Property::Index PROPERTY_INITIAL_AUTO_REPEATING_DELAY; ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type FLOAT
+ static const Property::Index PROPERTY_NEXT_AUTO_REPEATING_DELAY; ///< name "next-auto-repeating-delay", @see SetNextAutoRepeatingDelay(), type FLOAT
+ static const Property::Index PROPERTY_TOGGLABLE; ///< name "togglable", @see SetToggleButton(), type BOOLEAN
+ static const Property::Index PROPERTY_TOGGLED; ///< name "toggled", @see SetToggled(), type BOOLEAN
+ static const Property::Index PROPERTY_NORMAL_STATE_ACTOR; ///< name "button-state-actor", @see SetButtonImage(), type MAP
+ static const Property::Index PROPERTY_SELECTED_STATE_ACTOR; ///< name "selected-state-actor", @see SetSelectedImage(), type MAP
+ static const Property::Index PROPERTY_DISABLED_STATE_ACTOR; ///< name "disabled-state-actor", @see SetDisabledImage(), type MAP
+ static const Property::Index PROPERTY_LABEL_ACTOR; ///< name "label-actor", @see SetLabel(), type MAP
public:
~Button();
/**
- * @brief Sets the button as \e dimmed.
+ * @brief Sets the button as \e disabled.
*
- * No signals are emitted when the \e dimmed property is set.
+ * No signals are emitted when the \e disabled property is set.
*
- * @param[in] dimmed property.
+ * @param[in] disabled property.
*/
- void SetDimmed( bool dimmed );
+ void SetDisabled( bool disabled );
/**
- * @return \e true if the button is \e dimmed.
+ * @return \e true if the button is \e disabled.
*/
- bool IsDimmed() const;
+ bool IsDisabled() const;
/**
* @brief Sets the animation time.
typedef Signal< bool ( Button ) > ClickedSignalType;
/**
- * @brief Button toggled signal type
+ * @brief Button state changed signal type
*/
- typedef Signal< bool ( Button, bool ) > ToggledSignalType;
+ typedef Signal< bool ( Button, bool ) > StateChangedSignalType;
/**
* @brief Signal emitted when the button is touched and the touch point doesn't leave the boundary of the button.
ClickedSignalType& ClickedSignal();
/**
- * @brief Signal emitted when the button's state is toggled.
+ * @brief Signal emitted when the button's state is changed.
*/
- ToggledSignalType& ToggledSignal();
+ StateChangedSignalType& StateChangedSignal();
public: // Not intended for application developers
const char* const CheckBoxButton::ACTION_CHECK_BOX_BUTTON_CLICK = "check-box-button-click";
-const std::string CheckBoxButton::USE_FADE_ANIMATION_PROPERTY_NAME( "use-fade-animation" );
-const std::string CheckBoxButton::USE_CHECK_ANIMATION_PROPERTY_NAME( "use-check-animation" );
-
-
CheckBoxButton::CheckBoxButton()
: Button()
{
return Dali::Toolkit::GetImplementation( *this ).GetCheckedImage();
}
-void CheckBoxButton::SetDimmedBackgroundImage( Image image )
+void CheckBoxButton::SetDisabledBackgroundImage( Image image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
}
-void CheckBoxButton::SetDimmedBackgroundImage( Actor image )
+void CheckBoxButton::SetDisabledBackgroundImage( Actor image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
}
-Actor CheckBoxButton::GetDimmedBackgroundImage() const
+Actor CheckBoxButton::GetDisabledBackgroundImage() const
{
- return Dali::Toolkit::GetImplementation( *this ).GetDimmedBackgroundImage();
+ return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
}
-void CheckBoxButton::SetDimmedCheckedImage( Image image )
+void CheckBoxButton::SetDisabledCheckedImage( Image image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedCheckedImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledCheckedImage( image );
}
-void CheckBoxButton::SetDimmedCheckedImage( Actor image )
+void CheckBoxButton::SetDisabledCheckedImage( Actor image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedCheckedImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledCheckedImage( image );
}
-Actor CheckBoxButton::GetDimmedCheckedImage() const
+Actor CheckBoxButton::GetDisabledCheckedImage() const
{
- return Dali::Toolkit::GetImplementation( *this ).GetDimmedCheckedImage();
+ return Dali::Toolkit::GetImplementation( *this ).GetDisabledCheckedImage();
}
CheckBoxButton::CheckBoxButton( Internal::CheckBoxButton& implementation )
* By default a CheckBoxButton emits a Button::ClickedSignal() signal when the button changes its state to checked or unchecked.
*
* The button's appearance could be modified by setting images or actors with CheckBoxButton::SetBackgroundImage,
- * CheckBoxButton::SetCheckedImage, CheckBoxButton::SetDimmedBackgroundImage and CheckBoxButton::SetDimmedCheckedImage.
+ * CheckBoxButton::SetCheckedImage, CheckBoxButton::SetDisabledBackgroundImage and CheckBoxButton::SetDisabledCheckedImage.
*
- * When the button is not dimmed, if it's not checked it only shows the \e background image. The \e checked image is shown over the
+ * When the button is not disabled, if it's not checked it only shows the \e background image. The \e checked image is shown over the
* \e background image when the box is checked (\e background image is not replaced by \e checked image).
*
- * When the button is dimmed, \e background image and \e checked image are replaced by \e dimmed images.
+ * When the button is disabled, \e background image and \e checked image are replaced by \e disabled images.
*
* CheckBoxButton doesn't have a text. However, a Dali::Toolkit::TableView with a Dali::TextActor or a Dali::Toolkit::TextView
* and a CheckBoxButton could be used instead.
//Action Names
static const char* const ACTION_CHECK_BOX_BUTTON_CLICK;
- // Properties
- static const std::string USE_FADE_ANIMATION_PROPERTY_NAME;
- static const std::string USE_CHECK_ANIMATION_PROPERTY_NAME;
-
public:
/**
/**
* Sets the button as checked or unchecked.
*
- * Emits a Button::ClickedSignal() signal if the checkbox is not dimmed and the new state,
+ * Emits a Button::ClickedSignal() signal if the checkbox is not disabled and the new state,
* given in the \e checked param, is different than the previous one.
*
* @param[in] checked state.
Actor GetCheckedImage() const;
/**
- * Sets the dimmed background image.
+ * Sets the disabled background image.
*
- * @param[in] image The dimmed background image.
+ * @param[in] image The disabled background image.
*/
- void SetDimmedBackgroundImage( Image image );
+ void SetDisabledBackgroundImage( Image image );
/**
- * @copydoc SetDimmedBackgroundImage( Image image )
+ * @copydoc SetDisabledBackgroundImage( Image image )
*/
- void SetDimmedBackgroundImage( Actor image );
+ void SetDisabledBackgroundImage( Actor image );
/**
- * Gets the dimmed background image.
- * @return An actor with the dimmed background image.
+ * Gets the disabled background image.
+ * @return An actor with the disabled background image.
*/
- Actor GetDimmedBackgroundImage() const;
+ Actor GetDisabledBackgroundImage() const;
/**
- * Sets the dimmed checked image.
+ * Sets the disabled checked image.
*
- * @param[in] image The dimmed checked image.
+ * @param[in] image The disabled checked image.
*/
- void SetDimmedCheckedImage( Image image );
+ void SetDisabledCheckedImage( Image image );
/**
- * @copydoc SetDimmedCheckedImage( Image image )
+ * @copydoc SetDisabledCheckedImage( Image image )
*/
- void SetDimmedCheckedImage( Actor image );
+ void SetDisabledCheckedImage( Actor image );
/**
- * Gets the dimmed checked image.
- * @return An actor with the dimmed checked image.
+ * Gets the disabled checked image.
+ * @return An actor with the disabled checked image.
*/
- Actor GetDimmedCheckedImage() const;
+ Actor GetDisabledCheckedImage() const;
public: // Not intended for application developers
return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
}
-void PushButton::SetPressedImage( Image image )
+void PushButton::SetSelectedImage( Image image )
{
- Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
}
-void PushButton::SetPressedImage( Actor image )
+void PushButton::SetSelectedImage( Actor image )
{
- Dali::Toolkit::GetImplementation( *this ).SetPressedImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
}
-Actor PushButton::GetPressedImage() const
+Actor PushButton::GetSelectedImage() const
{
- return Dali::Toolkit::GetImplementation( *this ).GetPressedImage();
+ return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
}
-void PushButton::SetDimmedBackgroundImage( Image image )
+void PushButton::SetDisabledBackgroundImage( Image image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
}
-void PushButton::SetDimmedBackgroundImage( Actor image )
+void PushButton::SetDisabledBackgroundImage( Actor image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedBackgroundImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
}
-Actor PushButton::GetDimmedBackgroundImage() const
+Actor PushButton::GetDisabledBackgroundImage() const
{
- return Dali::Toolkit::GetImplementation( *this ).GetDimmedBackgroundImage();
+ return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
}
-void PushButton::SetDimmedImage( Image image )
+void PushButton::SetDisabledImage( Image image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
}
-void PushButton::SetDimmedImage( Actor image )
+void PushButton::SetDisabledImage( Actor image )
{
- Dali::Toolkit::GetImplementation( *this ).SetDimmedImage( image );
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
}
-Actor PushButton::GetDimmedImage() const
+Actor PushButton::GetDisabledImage() const
{
- return Dali::Toolkit::GetImplementation( *this ).GetDimmedImage();
+ return Dali::Toolkit::GetImplementation( *this ).GetDisabledImage();
}
-void PushButton::SetLabelText( const std::string& text )
+void PushButton::SetLabel( const std::string& label )
{
- Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
+ Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
}
-void PushButton::SetLabelText( Actor text )
+void PushButton::SetLabel( Actor label )
{
- Dali::Toolkit::GetImplementation( *this ).SetLabelText( text );
+ Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
}
-Actor PushButton::GetLabelText() const
+Actor PushButton::GetLabel() const
{
- return Dali::Toolkit::GetImplementation( *this ).GetLabelText();
+ return Dali::Toolkit::GetImplementation( *this ).GetLabel();
}
PushButton::PressedSignalType& PushButton::PressedSignal()
*
* The intervals could be modified with the PushButton::SetInitialAutoRepeatingDelay and PushButton::SetNextAutoRepeatingDelay methods.
*
- * A \e toggle button can't be \e autorepeating. If the \e autorepeating property is set to \e true, then the \e toggle property is set to
+ * A \e toggle button can't be \e autorepeating. If the \e autorepeating property is set to \e true, then the \e toggled property is set to
* false but no signal is emitted.
*
* <li>\e toggle
*
- * When \e toggle is set to \e true, a PushButton::ToggledSignal() signal is emitted, with the toggle state, every time the button is touched instead
+ * When \e toggle is set to \e true, a Button::StateChangedSignal() signal is emitted, with the toggle state, every time the button is touched instead
* of emit PushButton::PressedSignal(), Button::ClickedSignal() and PushButton::ReleasedSignal() signals.
*
- * An \e autorepeating button can't be \e toggle. If the \e toggle property is set to \e true, then the \e autorepeating property is set to false.
+ * An \e autorepeating button can't be \e toggle. If the \e toggled property is set to \e true, then the \e autorepeating property is set to false.
* </ul>
*
* The button's appearance could be modified by setting images or actors with PushButton::SetButtonImage, PushButton::SetBackgroundImage,
- * PushButton::SetPressedImage, PushButton::SetDimmedBackgroundImage and PushButton::SetDimmedImage or setting a text with
- * PushButton::SetLabelText.
+ * PushButton::SetSelectedImage, PushButton::SetDisabledBackgroundImage and PushButton::SetDisabledImage or setting a text with
+ * PushButton::SetLabel.
*
* The \e background is always shown and doesn't change if the button is pressed or released. The \e button image is shown over the \e background image when the
- * button is not pressed and is replaced by the \e pressed image when the button is pressed. The text label is placed always on the top of all images.
+ * button is not pressed and is replaced by the \e selected image when the button is pressed. The text label is placed always on the top of all images.
*
- * When the button is dimmed, \e background, \e button and \e pressed images are replaced by their \e dimmed images.
+ * When the button is disabled, \e background, \e button and \e selected images are replaced by their \e disabled images.
*
* The methods used to modify the button's appearance could receive Dali::Actor objects as a parameter, so more complex images could be defined.
*
- * Is not mandatory set all images. A button could be defined only by setting its \e background image or by setting its \e background and \e pressed images.
+ * Is not mandatory set all images. A button could be defined only by setting its \e background image or by setting its \e background and \e selected images.
*/
class DALI_IMPORT_API PushButton : public Button
{
//Action Names
static const char* const ACTION_PUSH_BUTTON_CLICK; ///< name "push-button-click"
- // Properties
- static const Property::Index PROPERTY_AUTO_REPEATING; ///< name "auto-repeating", @see SetAutoRepeating(), type BOOLEAN
- static const Property::Index PROPERTY_INITIAL_AUTO_REPEATING_DELAY; ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type FLOAT
- static const Property::Index PROPERTY_NEXT_AUTO_REPEATING_DELAY; ///< name "next-auto-repeating-delay", @see SetNextAutoRepeatingDelay(), type FLOAT
- static const Property::Index PROPERTY_TOGGLABLE; ///< name "togglable", @see SetToggleButton(), type BOOLEAN
- static const Property::Index PROPERTY_TOGGLE; ///< name "toggle", @see SetToggled(), type BOOLEAN
- static const Property::Index PROPERTY_NORMAL_STATE_ACTOR; ///< name "button-state-actor", @see SetButtonImage(), type MAP
- static const Property::Index PROPERTY_PRESSED_STATE_ACTOR; ///< name "pressed-state-actor", @see SetPressedImage(), type MAP
- static const Property::Index PROPERTY_DIMMED_STATE_ACTOR; ///< name "dimmed-state-actor", @see SetDimmedImage(), type MAP
- static const Property::Index PROPERTY_LABEL_ACTOR; ///< name "label-actor", @see SetLabelText(), type STRING
-
public:
/**
/**
* @brief Sets the \e autorepeating property.
*
- * If the \e autorepeating property is set to \e true, then the \e toggle property is set to false
+ * If the \e autorepeating property is set to \e true, then the \e toggled property is set to false
* but no signal is emitted.
*
* @param[in] autoRepeating \e autorepeating property.
float GetNextAutoRepeatingDelay() const;
/**
- * @brief Sets the \e toggle property.
+ * @brief Sets the \e toggled property.
*
- * If the \e toggle property is set to \e true, then the \e autorepeating property is set to false.
+ * If the \e toggled property is set to \e true, then the \e autorepeating property is set to false.
*
* @param[in] toggle property.
*/
void SetToggleButton( bool toggle );
/**
- * @return \e true if the \e toggle property is set.
+ * @return \e true if the \e toggled property is set.
*/
bool IsToggleButton() const;
/**
* @brief Sets the button as toggled or not toggled.
*
- * \e toggle property must be set to \e true.
+ * \e toggled property must be set to \e true.
*
- * Emits a PushButton::ToggledSignal() signal.
+ * Emits a Button::StateChangedSignal() signal.
*
* @param[in] toggle state.
*/
void SetToggled( bool toggle );
/**
- * @return \e true if the \e toggle property is set and the button is toggled.
+ * @return \e true if the \e toggled property is set and the button is toggled.
*/
bool IsToggled() const;
Actor GetBackgroundImage() const;
/**
- * @brief Sets the pressed image.
+ * @brief Sets the selected image.
*
- * @param[in] image The pressed image.
+ * @param[in] image The selected image.
*/
- void SetPressedImage( Image image );
+ void SetSelectedImage( Image image );
/**
- * @copydoc SetPressedImage( Image image )
+ * @copydoc SetSelectedImage( Image image )
*/
- void SetPressedImage( Actor image );
+ void SetSelectedImage( Actor image );
/**
- * @brief Gets the pressed image.
+ * @brief Gets the selected image.
*
- * @return An actor with the pressed image.
+ * @return An actor with the selected image.
*/
- Actor GetPressedImage() const;
+ Actor GetSelectedImage() const;
/**
- * @brief Sets the dimmed background image.
+ * @brief Sets the disabled background image.
*
- * @param[in] image The dimmed background image.
+ * @param[in] image The disabled background image.
*/
- void SetDimmedBackgroundImage( Image image );
+ void SetDisabledBackgroundImage( Image image );
/**
- * @copydoc SetDimmedBackgroundImage( Image image )
+ * @copydoc SetDisabledBackgroundImage( Image image )
*/
- void SetDimmedBackgroundImage( Actor image );
+ void SetDisabledBackgroundImage( Actor image );
/**
- * @brief Gets the dimmed background image.
+ * @brief Gets the disabled background image.
*
- * @return An actor with the dimmed background image.
+ * @return An actor with the disabled background image.
*/
- Actor GetDimmedBackgroundImage() const;
+ Actor GetDisabledBackgroundImage() const;
/**
- * @brief Sets the dimmed button image.
+ * @brief Sets the disabled button image.
*
- * @param[in] image The dimmed button image.
+ * @param[in] image The disabled button image.
*/
- void SetDimmedImage( Image image );
+ void SetDisabledImage( Image image );
/**
- * @copydoc SetDimmedImage( Image image )
+ * @copydoc SetDisabledImage( Image image )
*/
- void SetDimmedImage( Actor image );
+ void SetDisabledImage( Actor image );
/**
- * @brief Gets the dimmed image.
+ * @brief Gets the disabled image.
*
- * @return An actor with the dimmed image.
+ * @return An actor with the disabled image.
*/
- Actor GetDimmedImage() const;
+ Actor GetDisabledImage() const;
/**
- * @brief Sets the text label.
+ * @brief Sets the button label.
*
- * @param[in] text Label text.
+ * @param[in] label The button label.
*/
- void SetLabelText( const std::string& text );
+ void SetLabel( const std::string& label );
/**
- * @copydoc SetLabelText( const std::string& text )
+ * @copydoc SetLabel( const std::string& label )
*/
- void SetLabelText( Actor text );
+ void SetLabel( Actor label );
/**
- * @brief Gets the label text.
+ * @brief Gets the label.
*
- * @return An actor with the label text.
+ * @return An actor with the label.
*/
- Actor GetLabelText() const;
+ Actor GetLabel() const;
public: //Signals
return Dali::Toolkit::GetImplementation(*this).GetLabel();
}
-void RadioButton::SetActive(bool active)
+void RadioButton::SetSelected(bool selected)
{
- Dali::Toolkit::GetImplementation(*this).SetActive(active);
+ Dali::Toolkit::GetImplementation(*this).SetSelected(selected);
}
-bool RadioButton::IsActive()const
+bool RadioButton::IsSelected()const
{
- return Dali::Toolkit::GetImplementation(*this).IsActive();
+ return Dali::Toolkit::GetImplementation(*this).IsSelected();
}
void RadioButton::ToggleState()
}
/**
- * @brief A RadioButton provides a radio button which two states \e active or \e inactive.
+ * @brief A RadioButton provides a radio button which two states \e selected or \e unselected.
*
* Radio buttons are designed to select one of many option at the same time.
*
- * Every button have its own \e label and \e state, which can be modified by RadioButton::SetLabel and RadioButton::SetActive.
+ * Every button have its own \e label and \e state, which can be modified by RadioButton::SetLabel and RadioButton::SetSelected.
*
* RadioButton can change its current state using RadioButton::ToggleState.
*
* RadioButtons can be grouped.
* Two or more RadioButtons are in one group when they have this same parent.
- * In each groups only one RadioButton can be \e active at a given time.
- * So when RadioButton is set to \e active, other RadioButtons in its group are set to \e inactive.
- * When \e active RadioButton is set to \e inactive no other RadioButtons in his group is set to \e active.
+ * In each groups only one RadioButton can be \e selected at a given time.
+ * So when RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected.
+ * When \e selected RadioButton is set to \e unselected no other RadioButtons in his group is set to \e selected.
*
- * A Button::ClickedSignal() is emitted when the RadioButton change its state to \e active or \e inactive.
+ * A Button::ClickedSignal() is emitted when the RadioButton change its state to \e selected or \e unselected.
*/
class DALI_IMPORT_API RadioButton: public Button
{
public:
-
- // Properties
- static const Property::Index PROPERTY_ACTIVE; ///< name "active", @see SetActive(), type BOOLEAN
- static const Property::Index PROPERTY_LABEL_ACTOR; ///< name "label-actor", @see SetLabel(), type MAP
-
- public:
/**
* @brief Create an uninitialized RadioButton; this can be initialized with RadioButton::New().
*
Actor GetLabel() const;
/**
- * @brief Sets the button as active or inactive.
+ * @brief Sets the button as selected or unselected.
*
- * @param[in] active property
+ * @param[in] selected property
*/
- void SetActive(bool active);
+ void SetSelected(bool selected);
/**
- * @return true if button is active, false if button is inactive.
+ * @return true if button is selected, false if button is unselected.
*/
- bool IsActive()const;
+ bool IsSelected()const;
/**
* @brief Change button state.
*
- * If button is active deactivate it. If button is inactive activate it.
+ * If button is selected unselect it. If button is unselected select it.
*/
void ToggleState();
} // namespace
-CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& checkedImagePath, const std::string& dimmedBackgroundImagePath, const std::string& dimmedCheckedImagePath )
+CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& checkedImagePath, const std::string& disabledBackgroundImagePath, const std::string& disabledCheckedImagePath )
{
CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetCheckedImage( CreateAlignedImage( checkedImagePath ) );
}
- if( !dimmedBackgroundImagePath.empty() )
+ if( !disabledBackgroundImagePath.empty() )
{
- button.SetDimmedBackgroundImage( CreateAlignedImage( dimmedBackgroundImagePath ) );
+ button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImagePath ) );
}
- if( !dimmedCheckedImagePath.empty() )
+ if( !disabledCheckedImagePath.empty() )
{
- button.SetDimmedCheckedImage( CreateAlignedImage( dimmedCheckedImagePath ) );
+ button.SetDisabledCheckedImage( CreateAlignedImage( disabledCheckedImagePath ) );
}
return button;
}
-CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedImageActor, Actor dimmedBackgroundImageActor, Actor dimmedCheckedImagActor )
+CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedImageActor, Actor disabledBackgroundImageActor, Actor disabledCheckedImagActor )
{
CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetCheckedImage( CreateAlignedImage( checkedImageActor ) );
}
- if( dimmedBackgroundImageActor )
+ if( disabledBackgroundImageActor )
{
- button.SetDimmedBackgroundImage( CreateAlignedImage( dimmedBackgroundImageActor ) );
+ button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImageActor ) );
}
- if( dimmedCheckedImagActor )
+ if( disabledCheckedImagActor )
{
- button.SetDimmedCheckedImage( CreateAlignedImage( dimmedCheckedImagActor ) );
+ button.SetDisabledCheckedImage( CreateAlignedImage( disabledCheckedImagActor ) );
}
return button;
*
* @param[in] backgroundImagePath Image path to be shown as button background.
* @param[in] checkedImagePath Image path to be shown as checked button.
- * @param[in] dimmedBackgroundImagePath Image path to be shown as button dimmed background.
- * @param[in] dimmedCheckedImagePath Image path to be shown as dimmed checked button.
+ * @param[in] disabledBackgroundImagePath Image path to be shown as button isabled background.
+ * @param[in] disabledCheckedImagePath Image path to be shown as disabled checked button.
*/
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& checkedImagePath, const std::string& dimmedBackgroundImagePath, const std::string& dimmedCheckedImagePath );
+DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& checkedImagePath, const std::string& disabledBackgroundImagePath, const std::string& disabledCheckedImagePath );
/**
* Creates a check box button with the given images.
*
* @param[in] backgroundImageActor Image to be shown as button background.
* @param[in] checkedImageActor Image to be shown as checked button.
- * @param[in] dimmedBackgroundImageActor Image to be shown as button dimmed background.
- * @param[in] dimmedCheckedImagActor Image to be shown as dimmed checked button.
+ * @param[in] disabledBackgroundImageActor Image to be shown as button disabled background.
+ * @param[in] disabledCheckedImagActor Image to be shown as disabled checked button.
*/
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedImageActor, Actor dimmedBackgroundImageActor, Actor dimmedCheckedImagActor );
+DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedImageActor, Actor disabledBackgroundImageActor, Actor disabledCheckedImagActor );
/**
* Creates a check box button with the given background and checked images.
} // namespace
-PushButton CreatePushButton( const std::string& releasedImagePath, const std::string& pressedImagePath, const std::string& backgroundImagePath,
- const std::string& dimmedReleasedImagePath, const std::string& dimmedBackgroundImagePath )
+PushButton CreatePushButton( const std::string& unselectedImagePath, const std::string& selectedImagePath, const std::string& backgroundImagePath,
+ const std::string& disabledUnselectedImagePath, const std::string& disabledBackgroundImagePath )
{
PushButton button = Toolkit::PushButton::New();
- if( !releasedImagePath.empty() )
+ if( !unselectedImagePath.empty() )
{
- button.SetButtonImage( CreateAlignedImage( releasedImagePath ) );
+ button.SetButtonImage( CreateAlignedImage( unselectedImagePath ) );
}
- if( !pressedImagePath.empty() )
+ if( !selectedImagePath.empty() )
{
- button.SetPressedImage( CreateAlignedImage( pressedImagePath ) );
+ button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
}
if( !backgroundImagePath.empty() )
button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
}
- if( !dimmedReleasedImagePath.empty() )
+ if( !disabledUnselectedImagePath.empty() )
{
- button.SetDimmedImage( CreateAlignedImage( dimmedReleasedImagePath ) );
+ button.SetDisabledImage( CreateAlignedImage( disabledUnselectedImagePath ) );
}
- if( !dimmedBackgroundImagePath.empty() )
+ if( !disabledBackgroundImagePath.empty() )
{
- button.SetDimmedBackgroundImage( CreateAlignedImage( dimmedBackgroundImagePath ) );
+ button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImagePath ) );
}
return button;
}
-PushButton CreatePushButton( Actor releasedImageActor, Actor pressedImageActor, Actor backgroundImageActor,
- Actor dimmedReleasedImageActor, Actor dimmedBackgroundImageActor )
+PushButton CreatePushButton( Actor unselectedImageActor, Actor selectedImageActor, Actor backgroundImageActor,
+ Actor disabledUnselectedImageActor, Actor disabledBackgroundImageActor )
{
PushButton button = Toolkit::PushButton::New();
- if( releasedImageActor )
+ if( unselectedImageActor )
{
- button.SetButtonImage( CreateAlignedImage( releasedImageActor ) );
+ button.SetButtonImage( CreateAlignedImage( unselectedImageActor ) );
}
- if( pressedImageActor )
+ if( selectedImageActor )
{
- button.SetPressedImage( CreateAlignedImage( pressedImageActor ) );
+ button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
}
if( backgroundImageActor )
button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
}
- if( dimmedReleasedImageActor )
+ if( disabledUnselectedImageActor )
{
- button.SetDimmedImage( CreateAlignedImage( dimmedReleasedImageActor ) );
+ button.SetDisabledImage( CreateAlignedImage( disabledUnselectedImageActor ) );
}
- if( dimmedBackgroundImageActor )
+ if( disabledBackgroundImageActor )
{
- button.SetDimmedBackgroundImage( CreateAlignedImage( dimmedBackgroundImageActor ) );
+ button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImageActor ) );
}
return button;
* @note Images won't be scaled to fill the whole button size.
* @note If an image path is empty, this image is not set to the button.
*
- * @param[in] releasedImagePath Image path to be shown when the button is released.
- * @param[in] pressedImagePath Image path to be shown when the button is pressed.
- * @param[in] backgroundImagePath Image path to be shown as button background.
- * @param[in] dimmedReleasedImagePath Image path to be shown when the button is released and dimmed.
- * @param[in] dimmedBackgroundImagePath Image path to be shown as button background when the button is dimmed.
+ * @param[in] unselectedImagePath Image path to be shown when the button is unselected.
+ * @param[in] selectedImagePath Image path to be shown when the button is selected.
+ * @param[in] backgroundImagePath Image path to be shown as button background.
+ * @param[in] disabledUnselectedImagePath Image path to be shown when the button is unselected and disabled.
+ * @param[in] disabledBackgroundImagePath Image path to be shown as button background when the button is disabled.
* @return A handle to the new push button
*/
-DALI_IMPORT_API PushButton CreatePushButton( const std::string& releasedImagePath, const std::string& pressedImagePath, const std::string& backgroundImagePath,
- const std::string& dimmedReleasedImagePath, const std::string& dimmedBackgroundImagePath );
+DALI_IMPORT_API PushButton CreatePushButton( const std::string& unselectedImagePath, const std::string& selectedImagePath, const std::string& backgroundImagePath,
+ const std::string& disabledUnselectedImagePath, const std::string& disabledBackgroundImagePath );
/**
* @brief Creates a push button with the given images.
* @note Images won't be scaled to fill the whole button size.
* @note If an image is an empty handle, this image is not set to the button.
*
- * @param[in] releasedImageActor Image to be shown when the button is released.
- * @param[in] pressedImageActor Image to be shown when the button is pressed.
- * @param[in] backgroundImageActor Image to be shown as button background.
- * @param[in] dimmedReleasedImageActor Image to be shown when the button is released and dimmed.
- * @param[in] dimmedBackgroundImageActor Image to be shown as button background when the button is dimmed.
+ * @param[in] unselectedImageActor Image to be shown when the button is unselected.
+ * @param[in] selectedImageActor Image to be shown when the button is pressed.
+ * @param[in] backgroundImageActor Image to be shown as button background.
+ * @param[in] disabledUnselectedImageActor Image to be shown when the button is unselected and disabled.
+ * @param[in] disabledBackgroundImageActor Image to be shown as button background when the button is disabled.
* @return A handle to the new pushbutton
*/
-DALI_IMPORT_API PushButton CreatePushButton( Actor releasedImageActor, Actor pressedImageActor, Actor backgroundImageActor,
- Actor dimmedReleasedImageActor, Actor dimmedBackgroundImageActor );
+DALI_IMPORT_API PushButton CreatePushButton( Actor unselectedImageActor, Actor selectedImageActor, Actor backgroundImageActor,
+ Actor disabledUnselectedImageActor, Actor disabledBackgroundImageActor );
/**
* @brief Creates a push button with the given background image.