mTouchStartTime( 0 ),
mTextLayoutInfo(),
mCurrentCopySelecton(),
- mPopUpPanel(),
+ mPopupPanel(),
mScrollTimer(),
mScrollDisplacement(),
mCurrentHandlePosition(),
mBoundingRectangleWorldCoordinates = boundary;
// Set Boundary for Popup so it keeps the Pop-up within the area also.
- mPopUpPanel.SetPopupBoundary( boundingRectangle );
+ mPopupPanel.SetPopupBoundary( boundingRectangle );
}
const Rect<float> TextInput::GetBoundingRectangle() const
{
mActualGrabHandlePosition = MoveGrabHandle( gesture.displacement );
SetCursorVisibility( true );
- SetUpPopUpSelection();
+ SetUpPopupSelection();
ShowPopup();
}
if (actor == mHandleOneGrabArea)
if( mGrabArea == actor )
{
- if( mPopUpPanel.GetState() == TextInputPopup::StateHidden || mPopUpPanel.GetState() == TextInputPopup::StateHiding )
+ if( mPopupPanel.GetState() == TextInputPopup::StateHidden || mPopupPanel.GetState() == TextInputPopup::StateHiding )
{
- SetUpPopUpSelection();
+ SetUpPopupSelection();
ShowPopup();
}
bool TextInput::OnPopupButtonPressed( Toolkit::Button button )
{
- mPopUpPanel.PressedSignal().Disconnect( this, &TextInput::OnPopupButtonPressed );
+ mPopupPanel.PressedSignal().Disconnect( this, &TextInput::OnPopupButtonPressed );
const std::string& name = button.GetName();
void TextInput::ClearPopup()
{
- mPopUpPanel.Clear();
+ mPopupPanel.Clear();
}
void TextInput::AddPopupOptions()
{
- mPopUpPanel.AddPopupOptions();
+ mPopupPanel.AddPopupOptions();
}
void TextInput::SetPopupPosition( const Vector3& position )
{
- mPopUpPanel.SetTailPosition( position );
- mPopUpPanel.Self().SetPosition( position );
+ mPopupPanel.SetTailPosition( position );
+ mPopupPanel.GetRootActor().SetPosition( position );
}
void TextInput::HidePopup(bool animate, bool signalFinished )
{
- if ( ( mPopUpPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopUpPanel.GetState() == TextInputPopup::StateShown ) )
+ if ( ( mPopupPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopupPanel.GetState() == TextInputPopup::StateShown ) )
{
- mPopUpPanel.Hide( animate );
+ mPopupPanel.Hide( animate );
if( animate && signalFinished )
{
- mPopUpPanel.HideFinishedSignal().Connect( this, &TextInput::OnPopupHideFinished );
+ mPopupPanel.HideFinishedSignal().Connect( this, &TextInput::OnPopupHideFinished );
}
}
}
position = Vector3(topHandle.x, topHandle.y, 0.0f);
bottomHandle.y += GetSelectionHandleSize().y + mPopupOffsetFromText.w;
- mPopUpPanel.SetAlternativeOffset(Vector2( mBoundingRectangleWorldCoordinates.x, bottomHandle.y - topHandle.y));
+ mPopupPanel.SetAlternativeOffset(Vector2( mBoundingRectangleWorldCoordinates.x, bottomHandle.y - topHandle.y));
float xPosition = ( fabsf( topHandle.x - bottomHandle.x ) )*0.5f + std::min( topHandle.x , bottomHandle.x );
const Size rowSize = GetRowRectFromCharacterPosition( mCursorPosition );
position.y -= ( mPopupOffsetFromText.y + rowSize.height );
// if can't be positioned above, then position below row.
- Vector2 alternativePopUpPosition( mBoundingRectangleWorldCoordinates.x, position.y ); // default if no grab handle
+ Vector2 alternativePopupPosition( mBoundingRectangleWorldCoordinates.x, position.y ); // default if no grab handle
if ( mGrabHandle )
{
// If grab handle enabled then position pop-up below the grab handle.
- alternativePopUpPosition.y = rowSize.height + mGrabHandle.GetCurrentSize().height + mPopupOffsetFromText.w +50.0f;
+ alternativePopupPosition.y = rowSize.height + mGrabHandle.GetCurrentSize().height + mPopupOffsetFromText.w +50.0f;
}
- mPopUpPanel.SetAlternativeOffset( alternativePopUpPosition );
+ mPopupPanel.SetAlternativeOffset( alternativePopupPosition );
}
// reposition popup above the desired cursor posiiton.
SetPopupPosition( worldPosition );
// Show popup
- mPopUpPanel.Show(animate);
+ mPopupPanel.Show(animate);
StartMonitoringStageForTouch();
- mPopUpPanel.PressedSignal().Connect( this, &TextInput::OnPopupButtonPressed );
+ mPopupPanel.PressedSignal().Connect( this, &TextInput::OnPopupButtonPressed );
}
void TextInput::ShowPopupCutCopyPaste()
{
ClearPopup();
- mPopUpPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed
+ mPopupPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed
// Check the selected text is whole text or not.
if( IsTextSelected() && ( mStyledText.size() != GetSelectedText().size() ) )
{
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsSelectAll, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelectAll, true );
}
if ( !mStyledText.empty() )
{
-
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsCopy, true );
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsCut, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCopy, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCut, true );
}
if( mClipboard && mClipboard.NumberOfItems() )
{
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsPaste, true );
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsClipboard, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsPaste, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsClipboard, true );
}
AddPopupOptions();
- mPopUpPanel.Hide(false);
+ mPopupPanel.Hide(false);
ShowPopup();
}
-void TextInput::SetUpPopUpSelection()
+void TextInput::SetUpPopupSelection()
{
ClearPopup();
- mPopUpPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed
+ mPopupPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed
// If no text exists then don't offer to select
if ( !mStyledText.empty() )
{
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsSelectAll, true );
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsSelect, true );
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsCut, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelectAll, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelect, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCut, true );
}
// if clipboard has valid contents then offer paste option
if( mClipboard && mClipboard.NumberOfItems() )
{
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsPaste, true );
- mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsClipboard, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsPaste, true );
+ mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsClipboard, true );
}
AddPopupOptions();
- mPopUpPanel.Hide(false);
+ mPopupPanel.Hide(false);
}
bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIndex )
bool TextInput::WasTouchedCheck( const Actor& touchedActor ) const
{
- Actor popUpPanel = mPopUpPanel.GetRootActor();
+ Actor popUpPanel = mPopupPanel.GetRootActor();
if ( ( touchedActor == Self() ) || ( touchedActor == popUpPanel ) )
{
bool popUpShown( false );
- if ( ( mPopUpPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopUpPanel.GetState() == TextInputPopup::StateShown ) )
+ if ( ( mPopupPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopupPanel.GetState() == TextInputPopup::StateShown ) )
{
popUpShown = true;
}
ShowGrabHandleAndSetVisibility( false );
// If the keyboard is not now being shown, then hide the popup panel
- mPopUpPanel.Hide( true );
+ mPopupPanel.Hide( true );
}
}
}
case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetCutPastePopUpColor( value.Get< Vector4 >() );
+ textInputImpl.mPopupPanel.SetCutPastePopupColor( value.Get< Vector4 >() );
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetCutPastePopUpPressedColor( value.Get< Vector4 >() );
+ textInputImpl.mPopupPanel.SetCutPastePopupPressedColor( value.Get< Vector4 >() );
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetCutPastePopUpBorderColor( value.Get< Vector4 >() );
+ textInputImpl.mPopupPanel.SetCutPastePopupBorderColor( value.Get< Vector4 >() );
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetCutPastePopUpIconColor( value.Get< Vector4 >() );
+ textInputImpl.mPopupPanel.SetCutPastePopupIconColor( value.Get< Vector4 >() );
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetCutPastePopUpIconPressedColor( value.Get< Vector4 >() );
+ textInputImpl.mPopupPanel.SetCutPastePopupIconPressedColor( value.Get< Vector4 >() );
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetCutPastePopUpTextColor( value.Get< Vector4 >() );
+ textInputImpl.mPopupPanel.SetCutPastePopupTextColor( value.Get< Vector4 >() );
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetCutPastePopUpTextPressedColor( value.Get< Vector4 >() );
+ textInputImpl.mPopupPanel.SetCutPastePopupTextPressedColor( value.Get< Vector4 >() );
break;
}
case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCut, value.Get<unsigned int>() );
+ textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCut, value.Get<unsigned int>() );
break;
}
case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCopy, value.Get<unsigned int>() );
+ textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCopy, value.Get<unsigned int>() );
break;
}
case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsPaste, value.Get<unsigned int>() );
+ textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsPaste, value.Get<unsigned int>() );
break;
}
case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelect, value.Get<unsigned int>() );
+ textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelect, value.Get<unsigned int>() );
break;
}
case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll, value.Get<unsigned int>() );
+ textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll, value.Get<unsigned int>() );
break;
}
case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsClipboard, value.Get<unsigned int>() );
+ textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsClipboard, value.Get<unsigned int>() );
break;
}
case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY:
}
case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetCutPastePopUpColor();
+ value = textInputImpl.mPopupPanel.GetCutPastePopupColor();
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetCutPastePopUpPressedColor();
+ value = textInputImpl.mPopupPanel.GetCutPastePopupPressedColor();
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY :
{
- value = textInputImpl.mPopUpPanel.GetCutPastePopUpBorderColor();
+ value = textInputImpl.mPopupPanel.GetCutPastePopupBorderColor();
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetCutPastePopUpIconColor();
+ value = textInputImpl.mPopupPanel.GetCutPastePopupIconColor();
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetCutPastePopUpIconPressedColor();
+ value = textInputImpl.mPopupPanel.GetCutPastePopupIconPressedColor();
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetCutPastePopUpTextColor();
+ value = textInputImpl.mPopupPanel.GetCutPastePopupTextColor();
break;
}
case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetCutPastePopUpTextPressedColor();
+ value = textInputImpl.mPopupPanel.GetCutPastePopupTextPressedColor();
break;
}
case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCut );
+ value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCut );
break;
}
case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCopy );
+ value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCopy );
break;
}
case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsPaste );
+ value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsPaste );
break;
}
case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelect );
+ value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelect );
break;
}
case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll );
+ value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll );
break;
}
case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY:
{
- value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsClipboard );
+ value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsClipboard );
break;
}
case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY:
*
*/
-#include <dali-toolkit/internal/controls/text-input/text-input-popup-impl.h>
+#include <dali/integration-api/debug.h>
+#include <dali-toolkit/internal/controls/text-input/text-input-popup-impl.h>
#include <dali-toolkit/public-api/controls/buttons/push-button.h>
#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
#define GET_LOCALE_TEXT(string) dgettext("sys_string", string)
-namespace {
-
-// Default Colors
-
-const Vector4 DEFAULT_POPUP_BACKGROUND( Vector4( .20f, 0.29f, 0.44f, 1.0f ) );
-const Vector4 DEFAULT_POPUP_BUTTON_PRESSED( Vector4( 0.07f, 0.10f, 0.17f, 1.0f ) );
-const Vector4 DEFAULT_BORDER_COLOR( Vector4( 0.36f, 0.45f, 0.59f, 1.0f ) );
-const Vector4 DEFAULT_POPUP_ICON( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
-const Vector4 DEFAULT_POPUP_ICON_PRESSED( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
-const Vector4 DEFAULT_POPUP_TEXT( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
-const Vector4 DEFAULT_POPUP_TEXT_PRESSED( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
-const Vector3 POPUP_BORDER( Vector3( 1.0f, 1.0f, 0.0f ) );
-
-/* Functionality in place to have the end buttons using different images to inner button.
- * Supply a centre image and then a left and right image, the centre image can have straight ends while
- * the left image can be rounded on the left and straight on the right, the right image can be straight on the left and rounded on the right.
- */
-
-// Popup: Tails
-const char* DEFAULT_POPUP_TAIL_BOTTOM( DALI_IMAGE_DIR "popup_bubble_tail_bottom.png" );
-const char* DEFAULT_POPUP_TAIL_BOTTOM_OUTLINE( DALI_IMAGE_DIR "popup_bubble_tail_bottom_line.png" );
-const float TAIL_Y_POSITION( -1.5f );
-
-// Popup: Vertical Constraint
-// TODO: Remove - this should come from application - it is not possible to get the
-// height of the indicator actor from Dali-Toolkit.
-
-const float POP_UP_SCREEN_EDGE_MARGIN( 4.0f );
-const Vector2 DEFAULT_POPUP_INDICATOR_OFFSET(POP_UP_SCREEN_EDGE_MARGIN, 60.0f);
-
-const Vector3 POPUP_TEXT_OFFSET( 0.0f, 0.0f, 0.0f );
-const Vector3 POPUP_TEXT_ENLARGE( 12.0f, 28.0f, 0.0f );
-const Vector3 POPUP_MINIMUM_SIZE( 128.0f, 124.0f, 0.0f );
-
-const Vector3 BUTTON_TEXT_ENLARGE( 32.0f, 0.0f, 0.0f );
-const Vector3 BUTTON_TEXT_MINIMUM_SIZE( 128.0f, 126.0f, 0.0f );
-const Vector3 BUTTON_TEXT_MAXIMUM_SIZE( 190.0f, 126.0f, 0.0f );
-const Vector3 TEXT_LABEL_MAX_SIZE( 160.0f, 30.0f, 0.0f );
-
-const float DIVIDER_WIDTH(2.0f); ///< Width of each button divider
-const float DIVIDER_MARGIN(0.0f); ///< Top/Bottom Margin between divider and edge of popup.
-
-const float DEFAULT_UI_FONT_SIZE(7.0f); ///< Standard font size for Text-Input's UI
-
-const float HIDE_POPUP_ANIMATION_DURATION(0.2f); ///< Duration of popup hide animation in seconds.
-const float SHOW_POPUP_ANIMATION_DURATION(0.2f); ///< Duration of popup show animation in seconds.
-
-const Vector2 DEFAULT_ICON_SIZE( 45.0f, 45.0f ); ///< Default icon size for image in options
-const float TEXT_POSITION_OFFSET( -19.0f ); ///< Default offset for text label
-const float ICON_POSITION_OFFSET( 19.0f ); ///< Default offset for icon
+namespace
+{
+const Vector2 DEFAULT_POPUP_INDICATOR_OFFSET(0.0f, 60.0f);
-const char* DEFAULT_ICON_CLIPBOARD( DALI_IMAGE_DIR "copy_paste_icon_clipboard.png" );
-const char* DEFAULT_ICON_COPY( DALI_IMAGE_DIR "copy_paste_icon_copy.png" );
-const char* DEFAULT_ICON_CUT( DALI_IMAGE_DIR "copy_paste_icon_cut.png" );
-const char* DEFAULT_ICON_PASTE( DALI_IMAGE_DIR "copy_paste_icon_paste.png" );
-const char* DEFAULT_ICON_SELECT( DALI_IMAGE_DIR "copy_paste_icon_select.png" );
-const char* DEFAULT_ICON_SELECT_ALL( DALI_IMAGE_DIR "copy_paste_icon_select_all.png" );
// TODO: This should be based on the content for example:
// 1. For selection: should be above top of highlighted selection, or below bottom of highlighted selection + end handle.
// 2. For cursor: should be above top of cursor, or below bottom of cursor + grab handle.
const std::string POPUP_ALTERNATIVE_OFFSET("popup-alternative-offset"); ///< Alternative offset property for confinenment constraint.
-
const std::string POPUP_REQUESTED_POSITION("popup-requested-position"); ///< Position the Popup was requested to be, for confinenment constraint.
/**
+ * 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 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" );
+
+/**
+ * Constant values for building the GUI
+ */
+const Vector4 POPUP_BORDER( 14.0f, 14.0f, 14.0f, 14.0f ); ///< The margin of the popup.
+const Vector2 POPUP_MIN_SIZE( 0.0f, 126.0f ); ///< The minimum size of the popup.
+const Vector2 POPUP_MAX_SIZE( 720.0f, 126.0f ); ///< The maximum size of the popup.
+const float POPUP_TAIL_Y_OFFSET( -2.25f ); ///< The y offset of the tail.
+const Vector2 POPUP_TAIL_SIZE( 36.0f, 36.0f ); ///< The size of the tail.
+const Vector2 POPUP_DIVIDER_SIZE( 1.0f, 126.0f ); ///< The size of the divider.
+
+const Vector4 OPTION_MARGIN( 0.0f, 0.0f, 24.0f, 19.0f ); ///< The margin of the icon. the order is left, right, top and bottom
+const Vector2 OPTION_MAX_SIZE( 360.0f, 126.0f ); ///< The maximum size of the option.
+const Vector2 OPTION_MIN_SIZE( 128.0f, 126.0f ); ///< The minimum size of the option.
+const Vector2 OPTION_ICON_SIZE( 45.0f, 45.0f ); ///< The size of the icon.
+const Vector2 OPTION_TEXT_MIN_SIZE( 128.0f, 30.0f ); ///< The minimum size of the text.
+const float OPTION_GAP_ICON_TEXT( 8.0f ); ///< The gap between the icon and the text
+
+const float HIDE_POPUP_ANIMATION_DURATION( 0.2f ); ///< Duration of popup hide animation in seconds.
+const float SHOW_POPUP_ANIMATION_DURATION( 0.2f ); ///< Duration of popup show animation in seconds.
+
+/**
+ * Default Colors
+ */
+const Vector4 DEFAULT_POPUP_BACKGROUND( Vector4( .20f, 0.29f, 0.44f, 1.0f ) );
+const Vector4 DEFAULT_POPUP_BACKGROUND_PRESSED( Vector4( 0.07f, 0.10f, 0.17f, 1.0f ) );
+const Vector4 DEFAULT_POPUP_LINE_COLOR( Vector4( 0.36f, 0.45f, 0.59f, 1.0f ) );
+const Vector4 DEFAULT_OPTION_ICON( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
+const Vector4 DEFAULT_OPTION_ICON_PRESSED( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
+const Vector4 DEFAULT_OPTION_TEXT( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
+const Vector4 DEFAULT_OPTION_TEXT_PRESSED( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
+
+
+/**
* Confine Actor to boundaries of reference actor (e.g. Parent)
* Actor bounds (top-left position + size) are confined to reference Actor's
* bounds.
if ( mFlipHorizontal )
{
- if( corner.x < mBoundingRect.x + POP_UP_SCREEN_EDGE_MARGIN )
+ if( corner.x < mBoundingRect.x )
{
- // Snap PopUp to left hand boundary so stays visible
- corner.x = mBoundingRect.x + POP_UP_SCREEN_EDGE_MARGIN - ( origin.x * referenceSize.x ) + ( size.x * anchor.x );
+ // Snap Popup to left hand boundary so stays visible
+ corner.x = mBoundingRect.x - ( origin.x * referenceSize.x ) + ( size.x * anchor.x );
newPosition.x = corner.x;
}
- else if ( ( corner.x + size.x ) > ( ( mBoundingRect.x + mBoundingRect.width ) - POP_UP_SCREEN_EDGE_MARGIN ))
+ else if ( ( corner.x + size.x ) > ( mBoundingRect.x + mBoundingRect.width ))
{
- // Calculate offset from left boundary PopUp must be placed at so it does not exceed right side boundary.
- float requiredOffSetFromLeftBoundaryToFit = mBoundingRect.width - POP_UP_SCREEN_EDGE_MARGIN - size.x;
+ // Calculate offset from left boundary Popup must be placed at so it does not exceed right side boundary.
+ float requiredOffSetFromLeftBoundaryToFit = mBoundingRect.width - size.x;
corner.x = mBoundingRect.x + requiredOffSetFromLeftBoundaryToFit - ( origin.x * referenceSize.x ) + ( size.x * anchor.x );
newPosition.x = corner.x;
}
TextInputPopup::TextInputPopup()
: mState(StateHidden),
- mRootActor(Layer::New()),
+ mRoot(Layer::New()),
mPopupTailXPosition( 0.0f ),
- mContentSize( Vector3::ZERO ),
- mCutPasteButtonsColor( DEFAULT_POPUP_BACKGROUND ),
- mCutPasteButtonsPressedColor( DEFAULT_POPUP_BUTTON_PRESSED ),
- mBorderColor( DEFAULT_BORDER_COLOR ),
- mCutPasteIconsColor( DEFAULT_POPUP_ICON ),
- mCutPasteIconsPressedColor( DEFAULT_POPUP_ICON_PRESSED ),
- mCutPasteTextsColor( DEFAULT_POPUP_TEXT ),
- mCutPasteTextsPressedColor( DEFAULT_POPUP_TEXT_PRESSED ),
+ mContentSize( POPUP_MIN_SIZE ),
+ mBackgroundColor( DEFAULT_POPUP_BACKGROUND ),
+ mBackgroundPressedColor( DEFAULT_POPUP_BACKGROUND_PRESSED ),
+ mLineColor( DEFAULT_POPUP_LINE_COLOR ),
+ mIconColor( DEFAULT_OPTION_ICON ),
+ mIconPressedColor( DEFAULT_OPTION_ICON_PRESSED ),
+ mTextColor( DEFAULT_OPTION_TEXT ),
+ mTextPressedColor( DEFAULT_OPTION_TEXT_PRESSED ),
mSelectOptionPriority(1),
mSelectAllOptionPriority(2),
mCutOptionPriority(3),
mHideFinishedSignal(),
mShowFinishedSignal()
{
- mAlternativeOffsetProperty = mRootActor.RegisterProperty( POPUP_ALTERNATIVE_OFFSET, Vector2::ZERO );
- mRequestionPositionProperty = mRootActor.RegisterProperty( POPUP_REQUESTED_POSITION, Vector3::ZERO );
- mRootActor.SetParentOrigin( ParentOrigin::CENTER );
- mRootActor.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ mAlternativeOffsetProperty = mRoot.RegisterProperty( POPUP_ALTERNATIVE_OFFSET, Vector2::ZERO );
+ mRequestionPositionProperty = mRoot.RegisterProperty( POPUP_REQUESTED_POSITION, Vector3::ZERO );
+ mRoot.SetParentOrigin( ParentOrigin::CENTER );
+ mRoot.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
// constrain popup to size of parent.
}
-Actor TextInputPopup::Self()
-{
- return mRootActor;
-}
-
void TextInputPopup::AddToStage()
{
// TODO: Confinement constraint borders should be defined by the application.
// It should also not use the stage directly, instead it should add to parent container.
- Stage::GetCurrent().Add(mRootActor);
+ Stage::GetCurrent().Add(mRoot);
ApplyConfinementConstraint();
}
void TextInputPopup::ApplyConfinementConstraint()
{
- mRootActor.RemoveConstraints();
+ mRoot.RemoveConstraints();
Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
LocalSource( Actor::SIZE ),
LocalSource( Actor::PARENT_ORIGIN ),
Vector2::ZERO,
true,
true, mBoundingRect ) );
- mRootActor.ApplyConstraint(constraint);
+ mRoot.ApplyConstraint(constraint);
}
void TextInputPopup::ApplyTailConstraint()
mTail.ApplyConstraint( constraint );
}
-void TextInputPopup::CreateLayer( const Vector2& size )
-{
- mLayer = Layer::New();
- mLayer.SetParentOrigin(ParentOrigin::CENTER);
- mLayer.SetAnchorPoint(AnchorPoint::CENTER);
- mLayer.SetSize( size ); // matches stencil size
- mLayer.SetName("popup-mLayer");
-}
-
-void TextInputPopup::CreateStencil( const Vector2& size )
+void TextInputPopup::CreateStencil( const Vector2& size)
{
mStencil = CreateSolidColorActor( Color::BLUE );
- mStencil.SetParentOrigin( Vector3( ParentOrigin::CENTER ) );
+ mStencil.SetParentOrigin( ParentOrigin::CENTER );
mStencil.SetAnchorPoint( AnchorPoint::CENTER );
mStencil.SetDrawMode( DrawMode::STENCIL );
- mStencil.SetSize( size ); // slightly smaller than layer and stencil so over shoot always inside.
mStencil.SetVisible( true );
- mStencil.SetName("popup-stencil");
+ mStencil.SetName( "popup-stencil" );
+ mStencil.SetSize( size );
}
void TextInputPopup::OnScrollStarted( const Vector3& position )
mBackground.SetSensitive( true );
}
-void TextInputPopup::CreateScrollView( const Vector2& domainSize, const Vector2& visibleSize )
+void TextInputPopup::CreateScrollView()
{
mScrollView = Toolkit::ScrollView::New();
mScrollView.SetName("popup-scroll-view");
mScrollView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
mScrollView.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mScrollView.SetSize( visibleSize.x, visibleSize.y );
+ mScrollView.SetPosition( POPUP_BORDER.x, POPUP_BORDER.y );
mScrollView.SetScrollingDirection( PanGestureDetector::DIRECTION_HORIZONTAL, Degree( 40.0f ) );
mScrollView.SetAxisAutoLock( true );
mScrollView.ScrollStartedSignal().Connect( this, &TextInputPopup::OnScrollStarted );
mScrollView.ScrollCompletedSignal().Connect( this, &TextInputPopup::OnScrollCompleted );
+}
+
+void TextInputPopup::UpdateScrollViewProperty( const Vector2& visibleSize )
+{
+ mScrollView.SetSize( visibleSize.x, visibleSize.y );
RulerPtr rulerX = new DefaultRuler(); // IntrusivePtr which is unreferenced when ScrollView is destroyed.
RulerPtr rulerY = new DefaultRuler(); // IntrusivePtr which is unreferenced when ScrollView is destroyed.
rulerY->Disable();
- rulerX->SetDomain( RulerDomain( 0, domainSize.width, true ) );
+ rulerX->SetDomain( RulerDomain( 0, mContentSize.width, true ) );
mScrollView.SetRulerX(rulerX);
mScrollView.SetRulerY(rulerY);
}
void TextInputPopup::RemoveFromStage()
{
- Actor rootActor = Self();
- Stage::GetCurrent().Remove( rootActor );
+ Stage::GetCurrent().Remove( mRoot );
}
void TextInputPopup::Clear()
UnparentAndReset( mStencil );
UnparentAndReset( mBackground );
UnparentAndReset( mScrollView );
- UnparentAndReset( mLayer );
mButtonContainer.clear();
mDividerContainer.clear();
RemoveFromStage();
- mRootActor.RemoveConstraints();
+ mRoot.RemoveConstraints();
mState = StateHidden;
}
}
-Toolkit::TextView TextInputPopup::CreateOptionText( const MarkupProcessor::StyledTextArray& styledCaption )
-{
- Toolkit::TextView label = Toolkit::TextView::New( styledCaption );
- label.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed );
- label.SetWidthExceedPolicy( Toolkit::TextView::Fade );
- label.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- label.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
- label.SetPosition( 0.0f, TEXT_POSITION_OFFSET );
-
- return label;
-}
-
ImageActor TextInputPopup::CreateOptionIcon( Image iconImage, const Vector4& color )
{
ImageActor icon = ImageActor::New( iconImage );
-
- icon.SetSize( DEFAULT_ICON_SIZE );
+ icon.SetSize( OPTION_ICON_SIZE );
icon.SetParentOrigin( ParentOrigin::TOP_CENTER );
icon.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- icon.SetPosition( 0.0f, ICON_POSITION_OFFSET );
icon.SetColor( color );
-
+ icon.SetY( OPTION_MARGIN.z );
return icon;
}
-void TextInputPopup::CreatePopUpBackground()
+Toolkit::TextView TextInputPopup::CreateOptionCaption( const std::string& caption, const Vector4& color )
+{
+ TextStyle style;
+ style.SetTextColor( color );
+
+ PointSize pointSize( Font::PixelsToPoints( OPTION_TEXT_MIN_SIZE.y ) );
+ style.SetFontPointSize( pointSize );
+
+ MarkupProcessor::StyledTextArray styledCaption;
+ 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::ShrinkToFit );
+ textView.SetHeightExceedPolicy( Toolkit::TextView::ShrinkToFit );
+ textView.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ textView.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+ textView.SetY( -OPTION_MARGIN.w );
+
+ const float textWidth = textView.GetWidthForHeight( OPTION_TEXT_MIN_SIZE.y );
+ textView.SetSize( textWidth, OPTION_TEXT_MIN_SIZE.y );
+
+ return textView;
+}
+
+void TextInputPopup::CreateBackground()
{
// Create background-panel if not already created (required if we have at least one option)
if ( !mBackground )
{
- mBackground = Toolkit::CreateSolidColorActor( GetCutPastePopUpColor(), true, mBorderColor );
- mBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mBackground.SetName("pop-up-background");
- mContentSize = POPUP_TEXT_OFFSET;
+ Image bgImg = Image::New( POPUP_BACKGROUND );
+ mBackground = ImageActor::New( bgImg );
+ mBackground.SetAnchorPoint( AnchorPoint::CENTER );
+ mBackground.SetParentOrigin( ParentOrigin::CENTER );
+ mBackground.SetName( "text-input-popup-background" );
+ mBackground.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mBackground.SetColor( mBackgroundColor );
+
+ Image bgEffectImg = Image::New( POPUP_BACKGROUND_EFFECT );
+ mBackgroundEffect = ImageActor::New( bgEffectImg );
+ mBackgroundEffect.SetAnchorPoint( AnchorPoint::CENTER );
+ mBackgroundEffect.SetParentOrigin( ParentOrigin::CENTER );
+ mBackgroundEffect.SetName( "text-input-popup-background-effect" );
+ mBackgroundEffect.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mBackgroundEffect.SetZ( 1.0f );
+ mBackground.Add( mBackgroundEffect );
+
+ Image bgLine = Image::New( POPUP_BACKGROUND_LINE );
+ mBackgroundLine = ImageActor::New( bgLine );
+ mBackgroundLine.SetAnchorPoint( AnchorPoint::CENTER);
+ mBackgroundLine.SetParentOrigin( ParentOrigin::CENTER );
+ mBackgroundLine.SetName( "text-input-popup-background-effect" );
+ mBackgroundLine.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mBackgroundLine.SetColor( mLineColor );
+ mBackgroundLine.SetZ( 0.1f );
+ mBackgroundEffect.Add( mBackgroundLine );
+
Hide(false);
AddToStage();
+ }
+}
- // Add Tail too.
- Image tailImage = Image::New( DEFAULT_POPUP_TAIL_BOTTOM );
- Image tailImageOutline = Image::New( DEFAULT_POPUP_TAIL_BOTTOM_OUTLINE );
-
- mTailOutline = ImageActor::New ( tailImageOutline );
- mTailOutline.SetParentOrigin( ParentOrigin::CENTER );
- mTailOutline.SetAnchorPoint( AnchorPoint::CENTER );
- mTailOutline.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
-
- mTail = ImageActor::New( tailImage );
+void TextInputPopup::CreateTail()
+{
+ if ( !mTail )
+ {
+ Image tail = Image::New( POPUP_TAIL_BOTTOM );
+ mTail = ImageActor::New( tail );
mTail.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
mTail.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mTail.SetPosition( 0.0f, TAIL_Y_POSITION );
- // TODO: Make tail visible, and positioned in relation to original intended position of popup (i.e. before constrained effects)
- mTail.SetVisible(true);
- mTail.SetColor( mCutPasteButtonsColor );
- mTailOutline.SetColor( mBorderColor );
- mTail.Add( mTailOutline);
+ mTail.SetName( "text-input-popup-tail" );
+ mTail.SetPosition( 0.0f, POPUP_TAIL_Y_OFFSET - POPUP_BORDER.w, 1.2f );
+ mTail.SetColor( mBackgroundColor );
+
+ Image tailEffect = Image::New( POPUP_TAIL_BOTTOM_EFFECT );
+ mTailEffect = ImageActor::New( tailEffect );
+ mTailEffect.SetParentOrigin( ParentOrigin::CENTER );
+ mTailEffect.SetAnchorPoint( AnchorPoint::CENTER );
+ mTailEffect.SetName( "text-input-popup-tail-effect" );
+ mTailEffect.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mTailEffect.SetZ( 0.1f );
+ mTail.Add( mTailEffect );
+
+ Image tailLine = Image::New( POPUP_TAIL_BOTTOM_LINE );
+ mTailLine = ImageActor::New( tailLine );
+ mTailLine.SetParentOrigin( ParentOrigin::CENTER );
+ mTailLine.SetAnchorPoint( AnchorPoint::CENTER );
+ mTailLine.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
+ mTailLine.SetName( "text-input-popup-tail-line" );
+ mTailLine.SetColor( mLineColor );
+ mTailLine.SetZ( 0.1f );
+ mTailEffect.Add( mTailLine );
}
}
-void TextInputPopup::CreateDivider()
+ImageActor TextInputPopup::CreateDivider()
{
- if(mButtonContainer.size() > 0)
- {
- ImageActor divider = Toolkit::CreateSolidColorActor( mBorderColor );
+ ImageActor divider = Toolkit::CreateSolidColorActor( mLineColor );
divider.SetParentOrigin( ParentOrigin::TOP_LEFT );
divider.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- divider.SetPosition( Vector3( mContentSize.width, POPUP_TEXT_OFFSET.y, 0.0f ) );
- divider.SetColor( mBorderColor );
+ divider.SetSize( POPUP_DIVIDER_SIZE );
+ divider.SetPosition( mContentSize.width - POPUP_DIVIDER_SIZE.width, 0.0f );
+
// Keep track of all the dividers. As their height's need to be updated to the max. of all
// buttons currently added.
- mDividerContainer.push_back(divider);
- mBackground.Add( divider );
- mContentSize.width += DIVIDER_WIDTH;
- }
+ mDividerContainer.push_back( divider );
+
+ return divider;
}
-ImageActor TextInputPopup::CreatePressedBackground( const Vector3 requiredSize )
+ImageActor TextInputPopup::CreatePressedBackground( const Vector2& requiredSize )
{
- std::string pressedImageFilename;
- Vector4 pressedImageBorder;
- Vector2 pressedImageSize;
-
- ImageActor pressedButtonBg = Toolkit::CreateSolidColorActor( GetCutPastePopUpPressedColor() );
-
- pressedButtonBg.SetSize ( requiredSize );
- pressedButtonBg.SetParentOrigin( ParentOrigin::CENTER );
- pressedButtonBg.SetAnchorPoint( AnchorPoint::CENTER );
-
- return pressedButtonBg;
+ ImageActor pressedBg = Toolkit::CreateSolidColorActor( mBackgroundPressedColor );
+ pressedBg.SetDrawMode( DrawMode::OVERLAY );
+ pressedBg.SetParentOrigin( ParentOrigin::CENTER );
+ pressedBg.SetAnchorPoint( AnchorPoint::CENTER );
+ pressedBg.SetSize( requiredSize );
+ return pressedBg;
}
TextInputPopup::ButtonRequirement TextInputPopup::CreateRequiredButton( TextInputPopup::Buttons buttonId, std::size_t orderOfPriority,
const std::string& name, const std::string& caption, Image iconImage, bool enabled )
{
TextInputPopup::ButtonRequirement currentButton;
-
currentButton.buttonId = buttonId;
currentButton.orderOfPriority = orderOfPriority;
currentButton.name = name;
{
case ButtonsCut:
{
- Image cutIcon = Image::New( DEFAULT_ICON_CUT );
+ Image cutIcon = Image::New( OPTION_ICON_CUT );
currentButton = CreateRequiredButton( ButtonsCut, mCutOptionPriority, OPTION_CUT, GET_LOCALE_TEXT("IDS_COM_BODY_CUT"), cutIcon, false );
break;
}
case ButtonsCopy:
{
- Image copyIcon = Image::New( DEFAULT_ICON_COPY );
+ Image copyIcon = Image::New( OPTION_ICON_COPY );
currentButton = CreateRequiredButton( ButtonsCopy, mCopyOptionPriority, OPTION_COPY, GET_LOCALE_TEXT("IDS_COM_BODY_COPY"), copyIcon, false );
break;
}
case ButtonsPaste:
{
- Image pasteIcon = Image::New( DEFAULT_ICON_PASTE );
+ Image pasteIcon = Image::New( OPTION_ICON_PASTE );
currentButton = CreateRequiredButton( ButtonsPaste, mPasteOptionPriority, OPTION_PASTE, GET_LOCALE_TEXT("IDS_COM_BODY_PASTE"), pasteIcon, false );
break;
}
case ButtonsSelect:
{
- Image selectIcon = Image::New( DEFAULT_ICON_SELECT );
+ Image selectIcon = Image::New( OPTION_ICON_SELECT );
currentButton = CreateRequiredButton( ButtonsSelect, mSelectOptionPriority, OPTION_SELECT_WORD, GET_LOCALE_TEXT("IDS_COM_SK_SELECT"), selectIcon, false );
break;
}
case ButtonsSelectAll:
{
- Image selectAllIcon = Image::New( DEFAULT_ICON_SELECT_ALL );
+ Image selectAllIcon = Image::New( OPTION_ICON_SELECT_ALL );
currentButton = CreateRequiredButton( ButtonsSelectAll, mSelectAllOptionPriority, OPTION_SELECT_ALL, GET_LOCALE_TEXT("IDS_COM_BODY_SELECT_ALL"), selectAllIcon, false );
break;
}
case ButtonsClipboard:
{
- Image clipboardIcon = Image::New( DEFAULT_ICON_CLIPBOARD );
+ Image clipboardIcon = Image::New( OPTION_ICON_CLIPBOARD );
currentButton = CreateRequiredButton( ButtonsClipboard, mClipboardOptionPriority, OPTION_CLIPBOARD, GET_LOCALE_TEXT("IDS_COM_BODY_CLIPBOARD"), clipboardIcon, false );
break;
}
}
}
-void TextInputPopup::AddOption(const std::string& name, const std::string& caption, const Image iconImage, bool finalOption)
+void TextInputPopup::AddOption(const std::string& name, const std::string& caption, const Image iconImage, bool finalOption)
{
- CreatePopUpBackground();
-
- CreateDivider();
+ // 1. Create container for text and icon when not pressed.
+ Actor optionContainer = Actor::New();
+ optionContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ optionContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- // Create a Button with Text, Icon and highlight when pressed
+ // 2. Add text.
+ Toolkit::TextView captionTextView = CreateOptionCaption( caption, mTextColor );
+ optionContainer.Add( captionTextView );
- Toolkit::PushButton button = Toolkit::PushButton::New();
- button.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed );
- button.SetName( name );
+ // 3. Add icon.
+ ImageActor icon = CreateOptionIcon( iconImage, mIconColor );
+ optionContainer.Add( icon );
- // Create container for text and icon when not pressed
- Actor iconTextContainer = Actor::New();
- iconTextContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
- iconTextContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ // 4. Calculate the size of option.
+ const Vector2 textSize = Vector2( captionTextView.GetNaturalSize() );
+ const Vector2 optionSize( std::max( textSize.x, OPTION_ICON_SIZE.x ),
+ OPTION_MARGIN.z + OPTION_ICON_SIZE.y + OPTION_GAP_ICON_TEXT + textSize.y + OPTION_MARGIN.w );
+ const Vector2 constrainedOptionSize = Min( Max( optionSize, OPTION_MIN_SIZE ), OPTION_MAX_SIZE );
- // 1. Add text.
- TextStyle style;
- style.SetFontPointSize( PointSize( DEFAULT_UI_FONT_SIZE ) );
- style.SetTextColor( mCutPasteTextsColor );
- MarkupProcessor::StyledTextArray styledCaption;
- styledCaption.push_back( MarkupProcessor::StyledText( Text( caption ), style ) );
- Toolkit::TextView label = CreateOptionText( styledCaption );
- label.SetName( name );
+ // 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 );
+ option.SetX( mContentSize.x );
+ option.SetName( name );
+ option.ClickedSignal().Connect( this, &TextInputPopup::OnButtonPressed );
+ mScrollView.Add( option );
- iconTextContainer.Add( label );
+ // 6. Set the normal option image.
+ option.SetButtonImage( optionContainer );
- // Get natural size of text and then constrain it to bounds.
- const Vector3 textSize = label.GetNaturalSize();
- const Vector3 constrainedTextSize = Min( textSize, TEXT_LABEL_MAX_SIZE );
- Vector3 buttonSize( Max(constrainedTextSize + BUTTON_TEXT_ENLARGE, BUTTON_TEXT_MINIMUM_SIZE) );
- buttonSize = ( Min(buttonSize, BUTTON_TEXT_MAXIMUM_SIZE) );
- label.SetSize( Min( buttonSize, constrainedTextSize ) );
+ // 7. Update the content size.
+ mContentSize.x += constrainedOptionSize.x;
- button.SetParentOrigin( ParentOrigin::TOP_LEFT );
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- button.SetSize( buttonSize );
- button.SetPosition( Vector3( mContentSize.width, POPUP_BORDER.y, 0.0f ) );
+ // 8. Create the pressed container.
+ Actor optionPressedContainer = Actor::New();
- // 2. Add icon
- ImageActor icon = CreateOptionIcon( iconImage, mCutPasteIconsColor );
+ // 9. Add option pressed background.
+ Vector2 optionPressedBackgroundSize( constrainedOptionSize.x - 1.0f, constrainedOptionSize.y - 2.0f );
+ ImageActor optionPressedBackground = CreatePressedBackground( optionPressedBackgroundSize );
+ optionPressedContainer.Add( optionPressedBackground );
- iconTextContainer.Add( icon );
+ // 10. Add pressed text
+ Toolkit::TextView pressedCaptionTextView = CreateOptionCaption( caption, mTextPressedColor );
+ optionPressedBackground.Add( pressedCaptionTextView );
- // 3. Add highlight - Pressed state in Pushbutton needs a new image which means creating the text and icon again but including a highlight this time.
- ImageActor pressedImageBg = CreatePressedBackground( buttonSize );
+ // 11. Add pressed icon
+ ImageActor pressedIcon = CreateOptionIcon( iconImage, mIconPressedColor );
+ optionPressedBackground.Add( pressedIcon );
- Actor iconPressedTextContainer = Actor::New();
- iconPressedTextContainer.SetDrawMode( DrawMode::OVERLAY );
+ // 12. Set the pressed option image
+ option.SetPressedImage( optionPressedContainer );
- style.SetTextColor( mCutPasteTextsPressedColor );
- styledCaption.clear();
- styledCaption.push_back( MarkupProcessor::StyledText( Text( caption ), style ) );
- Toolkit::TextView pressedLabel = CreateOptionText( styledCaption );
- pressedLabel.SetSize( Min( buttonSize, TEXT_LABEL_MAX_SIZE ) );
- ImageActor pressedIcon = CreateOptionIcon( iconImage, mCutPasteIconsPressedColor );
-
- iconPressedTextContainer.Add( pressedImageBg );
- iconPressedTextContainer.Add( pressedLabel );
- iconPressedTextContainer.Add( pressedIcon );
-
- // Set Pressed button Image
- iconPressedTextContainer.SetSize( buttonSize );
- button.SetPressedImage( iconPressedTextContainer );
-
- // Set Normal button Image
- iconTextContainer.SetSize( buttonSize );
- button.SetButtonImage( iconTextContainer );
- mBackground.Add( button );
-
- // Update content size (represents size of all content i.e. from top-left of first button, to bottom-right of last button)
- mContentSize.width += buttonSize.width;
- mContentSize.height = std::max(mContentSize.height + ( POPUP_BORDER.y ), buttonSize.height);
- mButtonContainer.push_back(button);
-
- // resize all dividers based on the height content (i.e. max of all button heights)
- const float dividerHeight = mContentSize.height - DIVIDER_MARGIN;
- for(ActorIter i = mDividerContainer.begin(); i != mDividerContainer.end(); ++i)
+ // 13. Add the divider
+ if ( !finalOption )
{
- i->SetSize( DIVIDER_WIDTH, dividerHeight );
+ ImageActor divider = CreateDivider();
+ mScrollView.Add( divider );
}
- button.ClickedSignal().Connect( this, &TextInputPopup::OnButtonPressed );
}
void TextInputPopup::Hide(bool animate)
{
- if( mRootActor )
+ if( mRoot )
{
if(mAnimation)
{
if(animate)
{
mAnimation = Animation::New( HIDE_POPUP_ANIMATION_DURATION );
- mAnimation.AnimateTo( Property(mRootActor, Actor::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut );
- mAnimation.AnimateTo( Property(mRootActor, Actor::COLOR_ALPHA), 0.0f, AlphaFunctions::EaseOut );
+ mAnimation.AnimateTo( Property(mRoot, Actor::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut );
+ mAnimation.AnimateTo( Property(mRoot, Actor::COLOR_ALPHA), 0.0f, AlphaFunctions::EaseOut );
mAnimation.Play();
mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnHideFinished );
}
else
{
- mRootActor.SetProperty(Actor::SCALE, Vector3::ZERO);
- mRootActor.SetProperty(Actor::COLOR_ALPHA, 0.0f);
+ mRoot.SetProperty(Actor::SCALE, Vector3::ZERO);
+ mRoot.SetProperty(Actor::COLOR_ALPHA, 0.0f);
mState = StateHidden;
}
}
void TextInputPopup::Show(bool animate)
{
- if( mRootActor )
+ if( mRoot )
{
- mRootActor.SetSensitive( true );
+ mRoot.SetSensitive( true );
if(mAnimation)
{
if(animate)
{
mAnimation = Animation::New( SHOW_POPUP_ANIMATION_DURATION );
- mAnimation.AnimateTo( Property(mRootActor, Actor::SCALE), Vector3::ONE, AlphaFunctions::EaseOut );
- mAnimation.AnimateTo( Property(mRootActor, Actor::COLOR_ALPHA), 1.0f, AlphaFunctions::EaseOut );
+ mAnimation.AnimateTo( Property(mRoot, Actor::SCALE), Vector3::ONE, AlphaFunctions::EaseOut );
+ mAnimation.AnimateTo( Property(mRoot, Actor::COLOR_ALPHA), 1.0f, AlphaFunctions::EaseOut );
mAnimation.Play();
mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnShowFinished );
}
else
{
- mRootActor.SetProperty(Actor::SCALE, Vector3::ONE);
- mRootActor.SetProperty(Actor::COLOR_ALPHA, 1.0f);
+ mRoot.SetProperty(Actor::SCALE, Vector3::ONE);
+ mRoot.SetProperty(Actor::COLOR_ALPHA, 1.0f);
mState = StateShown;
}
}
void TextInputPopup::SetAlternativeOffset(Vector2 offset)
{
- mRootActor.SetProperty( mAlternativeOffsetProperty, offset );
+ mRoot.SetProperty( mAlternativeOffsetProperty, offset );
ApplyConfinementConstraint();
}
Actor TextInputPopup::GetRootActor() const
{
- return mRootActor;
+ return mRoot;
}
// Styling
-void TextInputPopup::SetCutPastePopUpColor( const Vector4& color )
+void TextInputPopup::SetCutPastePopupColor( const Vector4& color )
{
- mCutPasteButtonsColor = color;
+ mBackgroundColor = color;
}
-const Vector4& TextInputPopup::GetCutPastePopUpColor() const
+const Vector4& TextInputPopup::GetCutPastePopupColor() const
{
- return mCutPasteButtonsColor;
+ return mBackgroundColor;
}
-void TextInputPopup::SetCutPastePopUpPressedColor( const Vector4& color )
+void TextInputPopup::SetCutPastePopupPressedColor( const Vector4& color )
{
- mCutPasteButtonsPressedColor = color;
+ mBackgroundPressedColor = color;
}
-const Vector4& TextInputPopup::GetCutPastePopUpPressedColor() const
+const Vector4& TextInputPopup::GetCutPastePopupPressedColor() const
{
- return mCutPasteButtonsPressedColor;
+ return mBackgroundPressedColor;
}
-void TextInputPopup::SetCutPastePopUpBorderColor( const Vector4& color )
+void TextInputPopup::SetCutPastePopupBorderColor( const Vector4& color )
{
- mBorderColor = color;
+ mLineColor = color;
}
-const Vector4& TextInputPopup::GetCutPastePopUpBorderColor() const
+const Vector4& TextInputPopup::GetCutPastePopupBorderColor() const
{
- return mBorderColor;
+ return mLineColor;
}
-void TextInputPopup::SetCutPastePopUpIconColor( const Vector4& color )
+void TextInputPopup::SetCutPastePopupIconColor( const Vector4& color )
{
- mCutPasteIconsColor = color;
+ mIconColor = color;
}
-const Vector4& TextInputPopup::GetCutPastePopUpIconColor() const
+const Vector4& TextInputPopup::GetCutPastePopupIconColor() const
{
- return mCutPasteIconsColor;
+ return mIconColor;
}
-void TextInputPopup::SetCutPastePopUpIconPressedColor( const Vector4& color )
+void TextInputPopup::SetCutPastePopupIconPressedColor( const Vector4& color )
{
- mCutPasteIconsPressedColor = color;
+ mIconPressedColor = color;
}
-const Vector4& TextInputPopup::GetCutPastePopUpIconPressedColor()
+const Vector4& TextInputPopup::GetCutPastePopupIconPressedColor()
{
- return mCutPasteIconsPressedColor;
+ return mIconPressedColor;
}
-void TextInputPopup::SetCutPastePopUpTextColor( const Vector4& color )
+void TextInputPopup::SetCutPastePopupTextColor( const Vector4& color )
{
- mCutPasteTextsColor = color;
+ mTextColor = color;
}
-const Vector4& TextInputPopup::GetCutPastePopUpTextColor()
+const Vector4& TextInputPopup::GetCutPastePopupTextColor()
{
- return mCutPasteTextsColor;
+ return mTextColor;
}
-void TextInputPopup::SetCutPastePopUpTextPressedColor( const Vector4& color )
+void TextInputPopup::SetCutPastePopupTextPressedColor( const Vector4& color )
{
- mCutPasteTextsPressedColor = color;
+ mTextPressedColor = color;
}
-const Vector4& TextInputPopup::GetCutPastePopUpTextPressedColor()
+const Vector4& TextInputPopup::GetCutPastePopupTextPressedColor()
{
- return mCutPasteTextsPressedColor;
+ return mTextPressedColor;
}
-void TextInputPopup::TogglePopUpButtonOnOff( TextInputPopup::Buttons requiredButton, bool enable )
+void TextInputPopup::TogglePopupButtonOnOff( TextInputPopup::Buttons requiredButton, bool enable )
{
bool match ( false );
for( std::vector<ButtonRequirement>::iterator it = mOrderListOfButtons.begin(), endIt = mOrderListOfButtons.end(); ( it != endIt && !match ); ++it )
void TextInputPopup::AddPopupOptions()
{
+ mContentSize = POPUP_MIN_SIZE;
+
+ // 1. Create the background.
+ CreateBackground();
+ mRoot.Add(mBackground);
+
+ // 2. Create the tail.
+ CreateTail();
+ mBackground.Add( mTail );
+
+ // 3. Create the scroll view.
+ CreateScrollView();
+ mBackground.Add( mScrollView );
+
+ // 4. Create the options and add into the scroll view.
for( std::vector<ButtonRequirement>::const_iterator it = mOrderListOfButtons.begin(), endIt = mOrderListOfButtons.end(); ( it != endIt ); ++it )
{
const ButtonRequirement& button( *it );
- if ( button.enabled )
+ if ( button.enabled )
{
- AddOption( button.name, button.caption, button.iconImage, false );
+ AddOption( button.name, button.caption, button.iconImage, it != ( endIt - 1 ) ? false : true );
}
}
- float visiblePopUpWidth = std::min( mContentSize.width - POP_UP_SCREEN_EDGE_MARGIN*2 , mBoundingRect.width - POP_UP_SCREEN_EDGE_MARGIN *2);
- float visbilePopUpHeight = std::max( mContentSize.height, POPUP_MINIMUM_SIZE.height );
- Vector2 visiblePopUpSize = Vector2( visiblePopUpWidth, visbilePopUpHeight );
-
- visiblePopUpWidth = std::max( visiblePopUpWidth, POPUP_MINIMUM_SIZE.width );
-
- mBackground.SetSize( mContentSize.width, mContentSize.height );
- mRootActor.SetSize( visiblePopUpWidth, visbilePopUpHeight ); // Make Root Actor reflect the size of its content
+ // 5. Calcurate a lot of size to make the layout.
+ const Vector2 visibleContentSize = Vector2( std::min( mContentSize.x, POPUP_MAX_SIZE.x - POPUP_BORDER.x - POPUP_BORDER.y ), mContentSize.y );
+ const Vector2 popupSize = Vector2( POPUP_BORDER.x + visibleContentSize.x + POPUP_BORDER.y,
+ POPUP_BORDER.z + visibleContentSize.y + POPUP_BORDER.w );
- CreateLayer( visiblePopUpSize );
- CreateStencil( visiblePopUpSize );
- CreateScrollView( Vector2( mContentSize.width, mContentSize.height ), visiblePopUpSize );
+ // 6. Set the scroll view ruller.
+ UpdateScrollViewProperty( visibleContentSize );
- mLayer.Add( mStencil );
- mLayer.Add( mScrollView );
- mScrollView.Add( mBackground );
- mRootActor.Add( mTail );
+ // 8. Create stencil
+ const Vector2 stencilSize = Vector2( popupSize.x, popupSize.y + POPUP_TAIL_SIZE.x + POPUP_TAIL_Y_OFFSET );
+ CreateStencil( stencilSize );
+ mRoot.Add( mStencil );
- Self().Add(mLayer);
+ // 7. Set the root size.
+ mRoot.SetSize( popupSize ); // Make Root Actor reflect the size of its content
- mLayer.Lower();
}
void TextInputPopup::SetPopupBoundary( const Rect<float>& boundingRectangle )
void TextInputPopup::SetTailPosition( const Vector3& position )
{
- mRootActor.SetProperty( mRequestionPositionProperty, position );
+ mRoot.SetProperty( mRequestionPositionProperty, position );
mPopupTailXPosition = position.x;
ApplyConfinementConstraint();
ApplyTailConstraint();
TextInputPopup();
/**
- * @return The root actor of for this popup is returned.
- */
- Actor Self();
-
- /**
* Clears popup options (popup no longer exists)
*/
void Clear();
/**
* Create the label
+ * @return the newly created Image actor to be used as the icon
+ */
+ ImageActor CreateOptionIcon( Image iconImage, const Vector4& color );
+
+ /**
+ * Create the caption
* @param[in] styledCaption The text to be displayed
* @return the newly created label
*/
- Toolkit::TextView CreateOptionText( const MarkupProcessor::StyledTextArray& styledCaption );
+ Toolkit::TextView CreateOptionCaption( const std::string& caption, const Vector4& color );
/**
- * Create the label
- * @param[in] iconImage the image to be used
- * @return the newly created Image actor to be used as the icon
+ * Creates and sets up the background
*/
- ImageActor CreateOptionIcon( Image iconImage, const Vector4& color );
+ void CreateBackground();
/**
- * Creates and sets up the popup background
+ * Create and set up the tail
*/
- void CreatePopUpBackground();
+ void CreateTail();
/**
* Create divider if multiple options
+ * @return Return a divider image actor
*/
- void CreateDivider();
+ ImageActor CreateDivider();
/**
- * Create a background to be used when button pressed
+ * Create a background to be used when option pressed
* @param[in] requiredSize size Image actor should be
* @return Returns an Image Actor to be used a pressed background
*/
- ImageActor CreatePressedBackground( const Vector3 requiredSize );
+ ImageActor CreatePressedBackground( const Vector2& requiredSize );
/**
* Creates a ordered vector of button options
* Set the Cut and Paste buttons color when in normal state
* @param[in] color color to use
*/
- void SetCutPastePopUpColor( const Vector4& color );
+ void SetCutPastePopupColor( const Vector4& color );
/**
- * Get the set color of the Copy and Paste PopUp buttons
+ * Get the set color of the Copy and Paste Popup buttons
* @return color
*/
- const Vector4& GetCutPastePopUpColor() const;
+ const Vector4& GetCutPastePopupColor() const;
/**
* Set the Cut and Paste button color when pressed.
* @param[in] color color to use
*/
- void SetCutPastePopUpPressedColor( const Vector4& color );
+ void SetCutPastePopupPressedColor( const Vector4& color );
/**
* Get the Cut and Paste pressed button color.
* @return color
*/
- const Vector4& GetCutPastePopUpPressedColor() const;
+ const Vector4& GetCutPastePopupPressedColor() const;
/**
* Set the border color of the popup
* @param[in] color required color
*/
- void SetCutPastePopUpBorderColor( const Vector4& color );
+ void SetCutPastePopupBorderColor( const Vector4& color );
/**
* Get the border color
* @return Vector4 the color of the border
*/
- const Vector4& GetCutPastePopUpBorderColor() const;
+ const Vector4& GetCutPastePopupBorderColor() const;
/**
* Toggle if a popup button should be enabled (shown) or not
* @param[in] requiredButton Button Id to enable or disable
* @param[in] enable toggle to enable (true) or disable (false)
*/
- void TogglePopUpButtonOnOff( TextInputPopup::Buttons requiredButton, bool enable );
+ void TogglePopupButtonOnOff( TextInputPopup::Buttons requiredButton, bool enable );
/**
* Set the Button Priority Position
* Set the icon color of the popup
* @param[in] color required color
*/
- void SetCutPastePopUpIconColor( const Vector4& color );
+ void SetCutPastePopupIconColor( const Vector4& color );
/**
* Get the popup icon color
* @return Vector4 the color of the popup icon
*/
- const Vector4& GetCutPastePopUpIconColor() const;
+ const Vector4& GetCutPastePopupIconColor() const;
/**
* Set the pressed icon color of the popup
* @param[in] color required color
*/
- void SetCutPastePopUpIconPressedColor( const Vector4& color );
+ void SetCutPastePopupIconPressedColor( const Vector4& color );
/**
* Get the popup pressed icon color
* @return Vector4 the color of the popup pressed icon
*/
- const Vector4& GetCutPastePopUpIconPressedColor();
+ const Vector4& GetCutPastePopupIconPressedColor();
/**
* Set the text color of the popup
* @param[in] color required color
*/
- void SetCutPastePopUpTextColor( const Vector4& color );
+ void SetCutPastePopupTextColor( const Vector4& color );
/**
* Get the popup text color
* @return Vector4 the color of the popup text
*/
- const Vector4& GetCutPastePopUpTextColor();
+ const Vector4& GetCutPastePopupTextColor();
/**
* Set the pressed text color of the popup
* @param[in] color required color
*/
- void SetCutPastePopUpTextPressedColor( const Vector4& color );
+ void SetCutPastePopupTextPressedColor( const Vector4& color );
/**
* Get the popup pressed text color
* @return Vector4 the color of the popup pressed text
*/
- const Vector4& GetCutPastePopUpTextPressedColor();
+ const Vector4& GetCutPastePopupTextPressedColor();
/**
* Get the Button Priority Position
void AddPopupOptions();
/**
- * Set Boundary that PopUp should stay within
+ * Set Boundary that Popup should stay within
* @param[in] boundingRectangle coordinates of bounding box from Top Left
*/
void SetPopupBoundary( const Rect<float>& boundingRectangle );
/**
- * Sets the positon of the PopUp tail relative to TextInput
+ * Sets the positon of the Popup tail relative to TextInput
* @param position Position to set
*/
void SetTailPosition( const Vector3& position );
void ApplyTailConstraint();
/**
- * Create a layer to hold the stencil
- * @param[in] size Size to of layer
- */
- void CreateLayer( const Vector2& size );
-
- /**
* Create a stencil to clip the scroll view content
- * @param[in] size Size to of stencil
+ * @param[in] size of the stencil.
*/
void CreateStencil( const Vector2& size );
/**
* Create a scroll view to hold the popup buttons and allow scrolling if too many buttons to fit within the visible boundary
- * @param[in] scrollViewSize size of content of the scroll view which can exceed its visible size
+ */
+ void CreateScrollView();
+
+ /**
+ * Set the scroll view size and ruler.
* @param[in] visibleSize size of the visible scroll view
*/
- void CreateScrollView( const Vector2& scrollViewSize, const Vector2& visibleSize );
+ void UpdateScrollViewProperty( const Vector2& visibleSize );
/**
* Removes Popup from the stage.
private:
State mState; ///< Popup State.
- Actor mRootActor; ///< The actor which all popup content is added to (i.e. panel and buttons)
+ Layer mRoot; ///< The actor which all popup content is added to (i.e. panel and buttons)
Property::Index mAlternativeOffsetProperty; ///< Property [Vector3] how much to offset the popup if it goes out of the screen
Property::Index mRequestionPositionProperty; ///< Prperty [Vector3] Requested position to place popup
ImageActor mBackground; ///< The background popup panel
+ ImageActor mBackgroundEffect; ///< The background effect
+ ImageActor mBackgroundLine; ///< The background line
ImageActor mTail; ///< The tail for the popup
- ImageActor mTailOutline; ///< The border/outline around the tail
+ ImageActor mTailEffect; ///< the tail effect
+ ImageActor mTailLine; ///< The border/outline around the tail
- float mPopupTailXPosition; ///< X position of PopUp tail.
+ float mPopupTailXPosition; ///< X position of Popup tail.
- Vector3 mContentSize; ///< Size of Content (i.e. Buttons)
+ Vector2 mContentSize; ///< Size of Content (i.e. Buttons)
ActorContainer mButtonContainer; ///< List of buttons added to popup.
ActorContainer mDividerContainer; ///< List of dividers added to popup.
Animation mAnimation; ///< Popup Hide/Show animation.
Actor mStencil; ///< Stencil to clip scrollview
Toolkit::ScrollView mScrollView; ///< Scrollview to house the popup
- Layer mLayer; ///< Layer to house the scroll view and stencil
std::vector<ButtonRequirement> mOrderListOfButtons; // List of buttons in the order to be displayed and a flag to indicate if needed.
- Vector4 mCutPasteButtonsColor; // Color of the cut and paste popup.
- Vector4 mCutPasteButtonsPressedColor; // Color of the cut and paste buttons when pressed.
- Vector4 mBorderColor; // Color of the border around the Cut and Paste Popup.
- Vector4 mCutPasteIconsColor; // Color of the popup icon.
- Vector4 mCutPasteIconsPressedColor; // Color of the popup icon when pressed.
- Vector4 mCutPasteTextsColor; // Color of the popup text.
- Vector4 mCutPasteTextsPressedColor; // Color of the popup text when pressed.
+ Vector4 mBackgroundColor; // Color of the background of the text input popup
+ Vector4 mBackgroundPressedColor; // Color of the option background.
+ Vector4 mLineColor; // Color of the line around the text input popup
+ Vector4 mIconColor; // Color of the popup icon.
+ Vector4 mIconPressedColor; // Color of the popup icon when pressed.
+ Vector4 mTextColor; // Color of the popup text.
+ Vector4 mTextPressedColor; // Color of the popup text when pressed.
Rect<float> mBoundingRect; // Boundary that Popup must stay within.