/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
void TextField::OnTap(const TapGesture& gesture)
{
DALI_LOG_INFO(gTextFieldLogFilter, Debug::Verbose, "TextField::OnTap %p\n", mController.Get());
- if(mInputMethodContext && IsEditable())
- {
- mInputMethodContext.Activate();
- }
+
// Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
Extents padding;
padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
void TextField::TextInserted(unsigned int position, unsigned int length, const std::string& content)
{
- GetAccessibleObject()->EmitTextInserted(position, length, content);
+ auto accessible = GetAccessibleObject();
+ if(DALI_LIKELY(accessible))
+ {
+ accessible->EmitTextInserted(position, length, content);
+ }
}
void TextField::TextDeleted(unsigned int position, unsigned int length, const std::string& content)
{
- GetAccessibleObject()->EmitTextDeleted(position, length, content);
+ auto accessible = GetAccessibleObject();
+ if(DALI_LIKELY(accessible))
+ {
+ accessible->EmitTextDeleted(position, length, content);
+ }
}
void TextField::CursorPositionChanged(unsigned int oldPosition, unsigned int newPosition)
{
- GetAccessibleObject()->EmitTextCursorMoved(newPosition);
+ auto accessible = GetAccessibleObject();
+ if(DALI_LIKELY(accessible))
+ {
+ accessible->EmitTextCursorMoved(newPosition);
+ }
if((oldPosition != newPosition) && !mCursorPositionChanged)
{