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%2Fpush-button-impl.cpp;h=34245c2c47c9c4a9af5730be80a7bab0c71a5446;hp=4f87d38a58562e9ab0fb47311e999fba012bc268;hb=1123d866f9342b8950fe63715f6eaa1be9a2c18f;hpb=00ef589046a32c53d20de1c61af7cc69524e51dc diff --git a/base/dali-toolkit/internal/controls/buttons/push-button-impl.cpp b/base/dali-toolkit/internal/controls/buttons/push-button-impl.cpp index 4f87d38..34245c2 100644 --- a/base/dali-toolkit/internal/controls/buttons/push-button-impl.cpp +++ b/base/dali-toolkit/internal/controls/buttons/push-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 @@ -58,9 +59,8 @@ BaseHandle Create() TypeRegistration typeRegistration( typeid(Toolkit::PushButton), typeid(Toolkit::Button), Create ); -SignalConnectorType signalConnector1( typeRegistration, Toolkit::PushButton::SIGNAL_TOGGLED , &PushButton::DoConnectSignal ); -SignalConnectorType signalConnector2( typeRegistration, Toolkit::PushButton::SIGNAL_PRESSED , &PushButton::DoConnectSignal ); -SignalConnectorType signalConnector3( typeRegistration, Toolkit::PushButton::SIGNAL_RELEASED, &PushButton::DoConnectSignal ); +SignalConnectorType signalConnector1( typeRegistration, Toolkit::PushButton::SIGNAL_PRESSED , &PushButton::DoConnectSignal ); +SignalConnectorType signalConnector2( typeRegistration, Toolkit::PushButton::SIGNAL_RELEASED, &PushButton::DoConnectSignal ); TypeAction action1( typeRegistration, Toolkit::PushButton::ACTION_PUSH_BUTTON_CLICK, &PushButton::DoAction ); @@ -355,11 +355,6 @@ Actor& PushButton::GetFadeOutButtonImage() return mFadeOutButtonImage; } -Toolkit::PushButton::ToggledSignalV2& PushButton::ToggledSignal() -{ - return mToggledSignalV2; -} - Toolkit::PushButton::PressedSignalV2& PushButton::PressedSignal() { return mPressedSignalV2; @@ -583,7 +578,7 @@ void PushButton::OnButtonUp() // Notifies the painter the button has been toggled. GetPushButtonPainter( mPainter )->Toggled( handle ); - //Emit signal. + // Emit signal. mToggledSignalV2.Emit( handle, mToggled ); } else @@ -643,6 +638,25 @@ float PushButton::OnAnimationTimeRequested() const return GetPushButtonPainter( mPainter )->GetAnimationTime(); } +void PushButton::OnButtonStageDisconnection() +{ + if( ButtonDown == mState ) + { + if( !mToggleButton ) + { + Toolkit::PushButton handle( GetOwner() ); + + // Notifies the painter the button has been released. + GetPushButtonPainter( mPainter )->Released( handle ); + + if( mAutoRepeating ) + { + mAutoRepeatingTimer.Reset(); + } + } + } +} + PushButton::PushButton() : Button(), mAutoRepeating( false ),