return markupString;
}
+void TextInput::ShowPlaceholderText( const MarkupProcessor::StyledTextArray& stylePlaceHolderText )
+{
+ mDisplayedTextView.SetText( stylePlaceHolderText );
+ mPlaceHolderSet = true;
+ mDisplayedTextView.SetScrollPosition( Vector2( 0.0f,0.0f ) );
+}
+
void TextInput::SetPlaceholderText( const std::string& placeHolderText )
{
// Get the placeholder styled text array from the markup string.
MarkupProcessor::GetStyledTextArray( placeHolderText, mStyledPlaceHolderText, IsMarkupProcessingEnabled() );
-
if( mStyledText.empty() )
{
- // Set the placeholder text only if the styled text is empty.
- mDisplayedTextView.SetText( mStyledPlaceHolderText );
- mPlaceHolderSet = true;
+ ShowPlaceholderText( mStyledPlaceHolderText );
}
}
if( mStyledText.empty() )
{
- // If the initial text is empty, set the placeholder text.
- mDisplayedTextView.SetText( mStyledPlaceHolderText );
- mPlaceHolderSet = true;
+ ShowPlaceholderText( mStyledPlaceHolderText );
}
else
{
if( mStyledText.empty() )
{
- // Styled text is empty, so set the placeholder text.
- mDisplayedTextView.SetText( mStyledPlaceHolderText );
- mPlaceHolderSet = true;
+ ShowPlaceholderText( mStyledPlaceHolderText );
}
}
break;
if( mStyledText.empty() )
{
- // Styled text is empty, so set the placeholder text.
- mDisplayedTextView.SetText( mStyledPlaceHolderText );
- mPlaceHolderSet = true;
+ ShowPlaceholderText( mStyledPlaceHolderText );
}
else
{
mDisplayedTextView.RemoveTextFrom( mPreEditStartPosition, numberOfCharactersToReplace );
}
+
GetTextLayoutInfo();
EmitTextModified();
}
mStyledText.erase( start, end ); // erase range of characters
- // Remove text from TextView.
+ // Remove text from TextView and update place holder text if required
+ // Set the placeholder text only if the styled text is empty.
if( mStyledText.empty() )
{
- // Styled text is empty, so set the placeholder text.
- mDisplayedTextView.SetText( mStyledPlaceHolderText );
- mPlaceHolderSet = true;
+ ShowPlaceholderText( mStyledPlaceHolderText );
}
else
{
if( mStyledText.empty() )
{
- // Styled text is empty, so set the placeholder text.
- mDisplayedTextView.SetText( mStyledPlaceHolderText );
- mPlaceHolderSet = true;
+ ShowPlaceholderText( mStyledPlaceHolderText );
}
else
{
if( textToInsert.empty() && emptyTextView )
{
// No character has been added and the text-view was empty.
- // Set the placeholder text.
- mDisplayedTextView.SetText( mStyledPlaceHolderText );
- mPlaceHolderSet = true;
+ // Show the placeholder text.
+ ShowPlaceholderText( mStyledPlaceHolderText );
}
else
{
Toolkit::Control::SizePolicy mWidthPolicy :3; ///< Stores the width policy. 3 bits covers 8 values
Toolkit::Control::SizePolicy mHeightPolicy :3; ///< Stores the height policy. 3 bits covers 8 values
- ControlBehaviour mFlags :4; ///< Flags passed in from constructor. Need to increase this size when new enums are added
+ ControlBehaviour mFlags :6; ///< Flags passed in from constructor. Need to increase this size when new enums are added
bool mInsideRelayout:1; ///< Detect when were in Relayout
bool mIsKeyboardNavigationSupported:1; ///< Stores whether keyboard navigation is supported by the control.
bool mIsKeyboardFocusGroup:1; ///< Stores whether the control is a focus group.
GetImpl( styleManager ).ApplyThemeStyle( GetOwner() );
}
+ SetRequiresHoverEvents(mImpl->mFlags & REQUIRES_HOVER_EVENTS);
+ SetRequiresMouseWheelEvents(mImpl->mFlags & REQUIRES_MOUSE_WHEEL_EVENTS);
+
mImpl->mInitialized = true;
}
return false; // Do not consume
}
+bool Control::OnHoverEvent(const HoverEvent& event)
+{
+ return false; // Do not consume
+}
+
bool Control::OnKeyEvent(const KeyEvent& event)
{
return false; // Do not consume
virtual bool OnTouchEvent(const TouchEvent& event);
/**
+ * @copydoc Dali::CustomActorImpl::OnHoverEvent(const HoverEvent&)
+ */
+ virtual bool OnHoverEvent(const HoverEvent& event);
+
+ /**
* @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
*/
virtual bool OnKeyEvent(const KeyEvent& event);
CONTROL_BEHAVIOUR_NONE = 0,
REQUIRES_TOUCH_EVENTS = 1<<1, ///< True if the OnTouchEvent() callback is required.
REQUIRES_STYLE_CHANGE_SIGNALS = 1<<2, ///< True if needs to monitor style change signals such as theme/font change
- NO_SIZE_NEGOTIATION = 1<<3 ///< True if control does not need size negotiation, i.e. it can be skipped in the algorithm
+ NO_SIZE_NEGOTIATION = 1<<3, ///< True if control does not need size negotiation, i.e. it can be skipped in the algorithm
+ REQUIRES_HOVER_EVENTS = 1<<4, ///< True if the OnHoverEvent() callback is required.
+ REQUIRES_MOUSE_WHEEL_EVENTS = 1<<5 ///< True if the OnMouseWheelEvent() callback is required.
};
/**