{
_KeyCode keyCode = keyInfo.GetKeyCode();
- if (keyCode == _KEY_RIGHT)
+ if (!__pEdit->IsSearchFieldFocused())
{
- if (GetMode() == SEARCH_BAR_MODE_NORMAL)
- {
- __pEdit->SetFocused();
- return true;
- }
+ return false;
+ }
- if (!__isButtonEnabled || __pCancelButton->IsFocused() || !__isUsableCancelButton)
- {
- return true;
- }
+ switch (keyCode)
+ {
+ case _KEY_RIGHT:
+ SetFocusCallbackParameter(false);
+ if (&source == __pEdit)
+ {
+ if ((!__isButtonEnabled || !__isUsableCancelButton) && __pContentControl && __pContentControl->GetEnableState())
+ {
+ __pContentControl->SetFocused();
+ __pContentControl->OnDrawFocus();
- SetFocusCallBackParameter(false);
- __pCancelButton->SetFocused();
- __pCancelButton->Invalidate(true);
+ return true;
+ }
- return true;
- }
+ __pCancelButton->SetFocused();
- if (keyCode == _KEY_LEFT)
- {
- if (__pCancelButton->GetButtonStatus() == _BUTTON_STATUS_HIGHLIGHTED)
- {
- __pCancelButton->Invalidate();
- __pEdit->SetFocused();
- }
+ return true;
+ }
- if (__pCancelButton->GetButtonStatus() == _BUTTON_STATUS_DISABLED) //Searchbar Button is disabled, left arrow key is pressed
- {
- __pEdit->SetFocused();
- }
+ if (&source == __pCancelButton && __pContentControl && __pContentControl->GetVisibleState() && __pContentControl->GetEnableState())
+ {
+ __pContentControl->SetFocused();
+ __pContentControl->OnDrawFocus();
- return true;
- }
+ return true;
+ }
- if (keyCode == _KEY_ENTER || keyCode == _KEY_TAB)
- {
- if (GetMode() == SEARCH_BAR_MODE_NORMAL)
- {
- return false;
- }
+ break;
- SetMode(SEARCH_BAR_MODE_NORMAL);
- __isKeyPressed = true;
- SetFocused();
+ case _KEY_LEFT:
+ if (&source == __pCancelButton)
+ {
+ __pEdit->SetFocused();
+ return true;
+ }
+
+ if (&source == __pContentControl)
+ {
+ if ((__isButtonEnabled && __isUsableCancelButton))
+ {
+ __pCancelButton->SetFocused();
+ }
+ else
+ {
+ __pEdit->SetFocused();
+ }
+ return true;
+ }
- return true;
+ break;
+
+ case _KEY_ENTER:
+ if (&source == __pCancelButton)
+ {
+ SetMode(SEARCH_BAR_MODE_NORMAL);
+ __isKeyPressed = true;
+ SetFocused();
+ _Control::OnDrawFocus();
+
+ return true;
+ }
+
+ break;
+
+ default:
+ return false;
}
return false;
}
void
-_SearchBar::SetFocusCallBackParameter(bool state)
+_SearchBar::SetFocusCallbackParameter(bool state)
{
__isFocusCallbackToBeFired = state;
return;
}
bool
-_SearchBar::IsFocusCallBackToBeFired(void) const
+_SearchBar::IsFocusCallbackToBeFired(void) const
{
return __isFocusCallbackToBeFired;
}
ClearLastResult();
result r = __pSearchBar->RemoveTextBlock();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error has occured. Unable to remove the text block.")
+ "[E_SYSTEM] A system error has occured. Unable to remove the text block.");
return r;
}
{
SetMode(SEARCH_BAR_MODE_INPUT);
- if (!__pSearchBar->IsFocusCallBackToBeFired())
+ if (!__pSearchBar->IsFocusCallbackToBeFired())
{
return;
}
void
_SearchBarImpl::OnFocusLost(const Tizen::Ui::Control& source)
{
- if (!__pSearchBar->IsFocusCallBackToBeFired())
+ if (!__pSearchBar->IsFocusCallbackToBeFired())
{
return;
}
SearchFieldStatus GetCurrentStatus(void);
void SetEditTextFilter(IEditTextFilter* pFilter);
void SendOpaqueCommand (const Tizen::Base::String& command);
- void SetFocusCallBackParameter(bool state);
- bool IsFocusCallBackToBeFired(void) const;
+ void SetFocusCallbackParameter(bool state);
+ bool IsFocusCallbackToBeFired(void) const;
virtual _UiTouchEventDelivery OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo);