X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fbutton-impl.cpp;h=90a741abb3b4cb47d1ea19cb968adde9e4774b59;hp=f3efbc366c1426c75ae3f3c3a6baeab78678508a;hb=1123d866f9342b8950fe63715f6eaa1be9a2c18f;hpb=f4d5b3ffc194fc1b1c14f4a79e3efa435a31bc32 diff --git a/base/dali-toolkit/internal/controls/buttons/button-impl.cpp b/base/dali-toolkit/internal/controls/buttons/button-impl.cpp index f3efbc3..90a741a 100644 --- a/base/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/base/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -1,18 +1,19 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // CLASS HEADER @@ -46,6 +47,7 @@ BaseHandle Create() 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 ); @@ -105,6 +107,11 @@ Toolkit::Button::ClickedSignalV2& Button::ClickedSignal() return mClickedSignalV2; } +Toolkit::Button::ToggledSignalV2& Button::ToggledSignal() +{ + return mToggledSignalV2; +} + bool Button::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor ) { Dali::BaseHandle handle( object ); @@ -116,6 +123,10 @@ bool Button::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tr { button.ClickedSignal().Connect( tracker, functor ); } + else if( Dali::Toolkit::Button::SIGNAL_TOGGLED == signalName ) + { + button.ToggledSignal().Connect( tracker, functor ); + } else { // signalName does not match any signal @@ -223,13 +234,10 @@ void Button::OnTap(Actor actor, TapGesture tap) // Do nothing. } -void Button::OnStageDisconnection() +void Button::OnControlStageDisconnection() { - if( ButtonUp != mState ) - { - OnTouchPointLeave(); // Notification for derived classes. - mState = ButtonUp; - } + OnButtonStageDisconnection(); // Notification for derived classes. + mState = ButtonUp; } void Button::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )