X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fradio-button-impl.cpp;h=5389a22ab7915229a752965e1b91a30cbb02b806;hp=9dd7570b500e0cdfd07e72132fa392dacfffdb41;hb=6261b85db16d8e9f842c9dc152046747eec67eaa;hpb=d748f6c99a59e045b8a8d267012372f996cbc3fd diff --git a/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp b/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp index 9dd7570..5389a22 100644 --- a/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp @@ -22,7 +22,6 @@ // EXTERNAL INCLUDES #include #include -#include #if defined(DEBUG_ENABLED) extern Debug::Filter* gLogButtonFilter; @@ -81,13 +80,7 @@ void RadioButton::OnInitialize() bool RadioButton::OnToggleReleased() { // Radio button overrides toggle release (button up) as doesn't allow un-selection to be performed on it directly. - bool stateChanged = false; - if( !IsSelected() ) - { - Button::SetSelected( true ); // Set button to selected as previously unselected - stateChanged = true; - } - return stateChanged; + return false; } void RadioButton::OnStateChange( State newState ) @@ -95,29 +88,21 @@ void RadioButton::OnStateChange( State newState ) // Radio button can be part of a group, if a button in the group is selected then all others should be unselected DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "RadioButton::OnStateChange state(%d)\n", newState ); - switch( newState ) - { - case SELECTED_STATE: - { - Actor parent = Self().GetParent(); - if( parent ) - { - for( unsigned int i = 0; i < parent.GetChildCount(); ++i ) - { - Dali::Toolkit::RadioButton radioButtonChild = Dali::Toolkit::RadioButton::DownCast( parent.GetChildAt( i ) ); - if( radioButtonChild && radioButtonChild != Self() ) - { - radioButtonChild.SetSelected( false ); - } - } - } - } - - default: - { - break; - } - } + if ( SELECTED_STATE == newState ) + { + Actor parent = Self().GetParent(); + if( parent ) + { + for( unsigned int i = 0; i < parent.GetChildCount(); ++i ) + { + Dali::Toolkit::RadioButton radioButtonChild = Dali::Toolkit::RadioButton::DownCast( parent.GetChildAt( i ) ); + if( radioButtonChild && radioButtonChild != Self() ) + { + radioButtonChild.SetProperty( Toolkit::Button::Property::SELECTED, false ); + } + } + } + } } } // namespace Internal