X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-input%2Ftext-input-popup-impl.cpp;h=e92e4d02fa44d6bad77fe6aca0cb4adbc194048e;hp=3ad818fd7c8756ec2a1832bc984e7f165652af12;hb=22e89375677d1fe737d5472e21ab681f2f3e4ca7;hpb=9f8c97ef6070093c3529a9d4368e18307eebf007 diff --git a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp index 3ad818f..e92e4d0 100644 --- a/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp @@ -18,8 +18,8 @@ // EXTERNAL INCLUDES #include #include -#include #include +#include // INTERNAL INCLUDES #include @@ -40,23 +40,23 @@ const Vector2 DEFAULT_POPUP_INDICATOR_OFFSET(0.0f, 60.0f); /** * Image resource paths */ -const std::string POPUP_BACKGROUND( DALI_IMAGE_DIR "popup_bubble_bg.#.png" ); -const std::string POPUP_BACKGROUND_EFFECT( DALI_IMAGE_DIR "popup_bubble_bg_ef.#.png" ); -const std::string POPUP_BACKGROUND_LINE( DALI_IMAGE_DIR "popup_bubble_bg_line.#.png" ); - -const std::string POPUP_TAIL_BOTTOM( DALI_IMAGE_DIR "popup_bubble_tail_bottom.png" ); -const std::string POPUP_TAIL_BOTTOM_EFFECT( DALI_IMAGE_DIR "popup_bubble_tail_bottom_ef.png" ); -const std::string POPUP_TAIL_BOTTOM_LINE( DALI_IMAGE_DIR "popup_bubble_tail_bottom_line.png" ); -const std::string POPUP_TAIL_TOP( DALI_IMAGE_DIR "popup_bubble_tail_top.png" ); -const std::string POPUP_TAIL_TOP_EFFECT( DALI_IMAGE_DIR "popup_bubble_tail_top_ef.png" ); -const std::string POPUP_TAIL_TOP_LINE( DALI_IMAGE_DIR "popup_bubble_tail_top_line.png" ); - -const std::string OPTION_ICON_CLIPBOARD( DALI_IMAGE_DIR "copy_paste_icon_clipboard.png" ); -const std::string OPTION_ICON_COPY( DALI_IMAGE_DIR "copy_paste_icon_copy.png" ); -const std::string OPTION_ICON_CUT( DALI_IMAGE_DIR "copy_paste_icon_cut.png" ); -const std::string OPTION_ICON_PASTE( DALI_IMAGE_DIR "copy_paste_icon_paste.png" ); -const std::string OPTION_ICON_SELECT( DALI_IMAGE_DIR "copy_paste_icon_select.png" ); -const std::string OPTION_ICON_SELECT_ALL( DALI_IMAGE_DIR "copy_paste_icon_select_all.png" ); +const char* const POPUP_BACKGROUND = DALI_IMAGE_DIR "popup_bubble_bg.#.png"; +const char* const POPUP_BACKGROUND_EFFECT = DALI_IMAGE_DIR "popup_bubble_bg_ef.#.png"; +const char* const POPUP_BACKGROUND_LINE = DALI_IMAGE_DIR "popup_bubble_bg_line.#.png"; + +const char* const POPUP_TAIL_BOTTOM = DALI_IMAGE_DIR "popup_bubble_tail_bottom.png"; +const char* const POPUP_TAIL_BOTTOM_EFFECT = DALI_IMAGE_DIR "popup_bubble_tail_bottom_ef.png"; +const char* const POPUP_TAIL_BOTTOM_LINE = DALI_IMAGE_DIR "popup_bubble_tail_bottom_line.png"; +const char* const POPUP_TAIL_TOP = DALI_IMAGE_DIR "popup_bubble_tail_top.png"; +const char* const POPUP_TAIL_TOP_EFFECT = DALI_IMAGE_DIR "popup_bubble_tail_top_ef.png"; +const char* const POPUP_TAIL_TOP_LINE = DALI_IMAGE_DIR "popup_bubble_tail_top_line.png"; + +const char* const OPTION_ICON_CLIPBOARD = DALI_IMAGE_DIR "copy_paste_icon_clipboard.png"; +const char* const OPTION_ICON_COPY = DALI_IMAGE_DIR "copy_paste_icon_copy.png"; +const char* const OPTION_ICON_CUT = DALI_IMAGE_DIR "copy_paste_icon_cut.png"; +const char* const OPTION_ICON_PASTE = DALI_IMAGE_DIR "copy_paste_icon_paste.png"; +const char* const OPTION_ICON_SELECT = DALI_IMAGE_DIR "copy_paste_icon_select.png"; +const char* const OPTION_ICON_SELECT_ALL = DALI_IMAGE_DIR "copy_paste_icon_select_all.png"; /** * Constant values for building the GUI @@ -101,9 +101,16 @@ namespace Toolkit namespace Internal { -const char* const TextInputPopup::SIGNAL_PRESSED = "pressed"; -const char* const TextInputPopup::SIGNAL_HIDE_FINISHED = "hide-finished"; -const char* const TextInputPopup::SIGNAL_SHOW_FINISHED = "show-finished"; +namespace +{ + +// Signals + +const char* const SIGNAL_PRESSED = "pressed"; +const char* const SIGNAL_HIDE_FINISHED = "hide-finished"; +const char* const SIGNAL_SHOW_FINISHED = "show-finished"; + +} const char* const TextInputPopup::OPTION_SELECT_WORD = "option-select_word"; // "Select Word" popup option. const char* const TextInputPopup::OPTION_SELECT_ALL("option-select_all"); // "Select All" popup option. @@ -253,7 +260,6 @@ Toolkit::TextView TextInputPopup::CreateOptionCaption( const std::string& captio styledCaption.push_back( MarkupProcessor::StyledText( Text( caption ), style ) ); Toolkit::TextView textView = Toolkit::TextView::New( styledCaption ); - textView.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed ); textView.SetWidthExceedPolicy( Toolkit::TextView::EllipsizeEnd ); textView.SetHeightExceedPolicy( Toolkit::TextView::EllipsizeEnd ); textView.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); @@ -287,7 +293,7 @@ void TextInputPopup::CreateBackground() mBackgroundEffect.SetAnchorPoint( AnchorPoint::CENTER ); mBackgroundEffect.SetParentOrigin( ParentOrigin::CENTER ); mBackgroundEffect.SetName( "text-input-popup-background-effect" ); - mBackgroundEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT ); + mBackgroundEffect.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mBackgroundEffect.SetZ( 1.0f ); mBackground.Add( mBackgroundEffect ); @@ -296,7 +302,7 @@ void TextInputPopup::CreateBackground() mBackgroundLine.SetAnchorPoint( AnchorPoint::CENTER); mBackgroundLine.SetParentOrigin( ParentOrigin::CENTER ); mBackgroundLine.SetName( "text-input-popup-background-effect" ); - mBackgroundLine.SetSizeMode( SIZE_EQUAL_TO_PARENT ); + mBackgroundLine.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mBackgroundLine.SetColor( mLineColor ); mBackgroundLine.SetZ( 0.1f ); mBackgroundEffect.Add( mBackgroundLine ); @@ -322,7 +328,7 @@ void TextInputPopup::CreateTail() mTailEffect.SetParentOrigin( ParentOrigin::CENTER ); mTailEffect.SetAnchorPoint( AnchorPoint::CENTER ); mTailEffect.SetName( "text-input-popup-tail-effect" ); - mTailEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT ); + mTailEffect.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mTailEffect.SetZ( 0.1f ); mTail.Add( mTailEffect ); @@ -330,7 +336,7 @@ void TextInputPopup::CreateTail() mTailLine = ImageActor::New( tailLine ); mTailLine.SetParentOrigin( ParentOrigin::CENTER ); mTailLine.SetAnchorPoint( AnchorPoint::CENTER ); - mTailLine.SetSizeMode( SIZE_EQUAL_TO_PARENT ); + mTailLine.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mTailLine.SetName( "text-input-popup-tail-line" ); mTailLine.SetColor( mLineColor ); mTailLine.SetZ( 0.1f ); @@ -484,7 +490,6 @@ void TextInputPopup::AddOption(const std::string& name, const std::string& capti // 5. Create a option. Toolkit::PushButton option = Toolkit::PushButton::New(); - option.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed ); option.SetParentOrigin( ParentOrigin::TOP_LEFT ); option.SetAnchorPoint( AnchorPoint::TOP_LEFT ); option.SetSize( constrainedOptionSize ); @@ -542,8 +547,8 @@ void TextInputPopup::Hide(bool animate) if(animate) { mAnimation = Animation::New( HIDE_POPUP_ANIMATION_DURATION ); - mAnimation.AnimateTo( Property(mRoot, Actor::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut ); - mAnimation.AnimateTo( Property(mRoot, Actor::COLOR_ALPHA), 0.0f, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::COLOR_ALPHA), 0.0f, AlphaFunctions::EaseOut ); mAnimation.Play(); mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnHideFinished ); @@ -551,8 +556,8 @@ void TextInputPopup::Hide(bool animate) } else { - mRoot.SetProperty(Actor::SCALE, Vector3::ZERO); - mRoot.SetProperty(Actor::COLOR_ALPHA, 0.0f); + mRoot.SetProperty(Actor::Property::SCALE, Vector3::ZERO); + mRoot.SetProperty(Actor::Property::COLOR_ALPHA, 0.0f); mState = StateHidden; } } @@ -578,8 +583,8 @@ void TextInputPopup::Show( Actor target, bool animate ) if(animate) { mAnimation = Animation::New( SHOW_POPUP_ANIMATION_DURATION ); - mAnimation.AnimateTo( Property(mRoot, Actor::SCALE), Vector3::ONE, AlphaFunctions::EaseOut ); - mAnimation.AnimateTo( Property(mRoot, Actor::COLOR_ALPHA), 1.0f, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::SCALE), Vector3::ONE, AlphaFunctions::EaseOut ); + mAnimation.AnimateTo( Property(mRoot, Actor::Property::COLOR_ALPHA), 1.0f, AlphaFunctions::EaseOut ); mAnimation.Play(); mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnShowFinished ); @@ -587,8 +592,8 @@ void TextInputPopup::Show( Actor target, bool animate ) } else { - mRoot.SetProperty(Actor::SCALE, Vector3::ONE); - mRoot.SetProperty(Actor::COLOR_ALPHA, 1.0f); + mRoot.SetProperty(Actor::Property::SCALE, Vector3::ONE); + mRoot.SetProperty(Actor::Property::COLOR_ALPHA, 1.0f); mState = StateShown; } } @@ -895,12 +900,12 @@ TextInputPopup::PressedSignalType& TextInputPopup::PressedSignal() return mPressedSignal; } -TextInputPopup::HideFinishedSignalType& TextInputPopup::HideFinishedSignal() +TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::HideFinishedSignal() { return mHideFinishedSignal; } -TextInputPopup::ShowFinishedSignalType& TextInputPopup::ShowFinishedSignal() +TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::ShowFinishedSignal() { return mShowFinishedSignal; } @@ -910,4 +915,3 @@ TextInputPopup::ShowFinishedSignalType& TextInputPopup::ShowFinishedSignal() } // namespace Toolkit } // namespace Dali -