, __isUserGuideTextColor(false)
, __isKeypadOpening(false)
, __isupdateContentBounds(false)
- , __isKeyPressed(false)
, __isFocusCallbackToBeFired(true)
, __isButtonTextChangedByApp(false)
+ , __contentVisibilitySetByApp(true)
, __keypadAction(CORE_KEYPAD_ACTION_SEARCH)
, __pBackgroundBitmap(null)
, __backgroundColor(Color())
}
result
-_SearchBar::SetContentAreaVisible(bool visible)
+_SearchBar::SetContentAreaVisible(bool visible, bool isCalledByApp)
{
SysTryReturn(NID_UI_CTRL, __pContainer, E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] A system error has occurred. The instance of parent to content is null.");
__pContainer->SetVisibleState(visible);
}
+ if (isCalledByApp)
+ {
+ __contentVisibilitySetByApp = visible;
+ }
+
return __pSearchBarPresenter->SetContentAreaVisible(visible);
}
return _UI_TOUCH_EVENT_DELIVERY_YES;
}
- if (GetMode() == SEARCH_BAR_MODE_INPUT)
- {
- return _UI_TOUCH_EVENT_DELIVERY_YES;
- }
+ __pEdit->SetSearchFieldFocus(false);
+ SetContentAreaVisible(__contentVisibilitySetByApp); //When a touch happens on SearchField
+ SetFocusCallbackParameter(true);
+ SetMode(SEARCH_BAR_MODE_INPUT);
return _UI_TOUCH_EVENT_DELIVERY_YES;
}
if (__actionId == actionId)
{
__isCancelActionInProgress = true;
+ SetFocusCallbackParameter(true);
SetMode(SEARCH_BAR_MODE_NORMAL);
+ SetFocused();
+
if (__pActionEvent)
{
IEventArg* pEventArg = _ActionEvent::CreateActionEventArgN(__actionId);
void
_SearchBar::OnTextValueChanged(const _Control& source)
{
+ if (GetTextLength())
+ {
+ SetContentAreaVisible(__contentVisibilitySetByApp);
+ }
+
if (!__isCancelActionInProgress)
{
SetContentDimming();
bool
_SearchBar::OnFocusGained(const _Control& source)
{
- if (__isKeyPressed)
- {
- __isKeyPressed = false;
- _Control::OnDrawFocus();
+ return _Control::OnFocusGained(source);
+}
- return true;
- }
+bool
+_SearchBar::OnFocusLost(const _Control &source)
+{
+ return _Control::OnFocusLost(source);
+}
- if (GetVisibleState() == true)
- {
- __pEdit->SetFocused();
- }
+void
+_SearchBar::OnDrawFocus(void)
+{
+ __pEdit->SetSearchFieldFocus(true);
+ _Control::OnDrawFocus();
+
+ return;
+}
- return true;
+void
+_SearchBar::OnFocusModeStateChanged(void)
+{
+ return;
}
bool
-_SearchBar::OnFocusLost(const _Control &source)
+_SearchBar::OnPreviewKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
{
- __pEdit->SetSearchFieldFocus(false);
- _Control::OnFocusLost(source);
- return true;
+ if (!__pEdit->IsUsbKeyboardConnected())
+ {
+ return false;
+ }
+
+ if (!__pEdit->IsSearchFieldFocused())
+ {
+ return false;
+ }
+
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
+ switch (keyCode)
+ {
+ case _KEY_TAB:
+ SetFocusCallbackParameter(true);
+ if ((__pContentControl && __pContentControl->IsVisible() == false) || !__pContentControl)
+ {
+ SetContentAreaVisible(false);
+ }
+
+ break;
+ default:
+ break;
+ }
+ return false;
}
bool
switch (keyCode)
{
case _KEY_RIGHT:
+ if (&source == this)
+ {
+ SetFocusCallbackParameter(true);
+ SetMode(SEARCH_BAR_MODE_INPUT);
+ __pEdit->SetFocused();
+ }
+
SetFocusCallbackParameter(false);
+
if (&source == __pEdit)
{
- if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->GetVisibleState() && __pContentControl->GetEnableState())
+ if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
{
__pContentControl->SetFocused();
__pContentControl->OnDrawFocus();
return true;
}
- if (&source == __pCancelButton && __pContentControl && __pContentControl->GetVisibleState() && __pContentControl->GetEnableState())
+ if (&source == __pCancelButton && __pContentControl && __pContentControl->IsVisible() && __pContentControl->GetEnableState())
{
__pContentControl->SetFocused();
__pContentControl->OnDrawFocus();
case _KEY_ENTER:
if (&source == __pCancelButton)
{
+ SetFocusCallbackParameter(true);
SetMode(SEARCH_BAR_MODE_NORMAL);
- __isKeyPressed = true;
SetFocused();
_Control::OnDrawFocus();
return;
}
-void
-_SearchBar::OnDrawFocus(void)
-{
- __pEdit->SetSearchFieldFocus(true);
- return;
-}
-
bool
_SearchBar::IsContentAttachable(const _Control* pContent)
{
Tizen::Ui::_Control* GetContent(void) const;
result SetContent(const Tizen::Ui::_Control* pContent);
result UpdateContentArea(bool invalidate = true);
- result SetContentAreaVisible(bool visible);
+ result SetContentAreaVisible(bool visible, bool isCalledByApp = false);
bool IsContentAreaVisible(void) const;
result SetContentAreaSize(const Tizen::Graphics::Dimension& size);
Tizen::Graphics::Dimension GetContentAreaSize(void) const;
virtual void OnFontInfoRequested(unsigned long& style, int& size);
virtual bool OnFocusGained(const _Control& source);
virtual bool OnFocusLost(const _Control& source);
+ virtual void OnDrawFocus(void);
+ virtual void OnFocusModeStateChanged(void);
+ virtual bool OnPreviewKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
virtual void OnSettingChanged(Tizen::Base::String& key);
result CreateContentsArea(void);
result CreateClippedGroupControl(void);
void CreateAccessibilityElement(void);
- virtual void OnDrawFocus(void);
Tizen::Ui::_Control* GetParentForm(void) const;
bool __isUserGuideTextColor;
bool __isKeypadOpening;
bool __isupdateContentBounds;
- bool __isKeyPressed;
bool __isFocusCallbackToBeFired;
bool __isButtonTextChangedByApp;
+ bool __contentVisibilitySetByApp;
CoreKeypadAction __keypadAction;