, __pPressedItemBackgroundEffectBitmap(null)
, __pSelectedItemBackgroundBitmap(null)
, __pHighlightedItemBackgroundBitmap(null)
+ , __isInFocusMode(false)
{
ClearLastResult();
result r = E_SUCCESS;
{
__pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
}
- if(GetItemCount() > 0)
+ if (GetItemCount() > 0)
{
__currentHighlightedItemIndex = 0;
}
return __pTabPresenter->IsEditModeEnabled();
}
+bool
+_Tab::IsInFocusMode(void) const
+{
+ return __isInFocusMode;
+}
+
result
_Tab::SetBackgroundBitmap(const Bitmap& bitmap)
{
{
return true;
}
-
- if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
- {
- __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
- }
- __currentHighlightedItemIndex = -1;
-
return __pTabPresenter->OnTouchPressed(source, touchinfo);
}
}
_KeyCode keyCode = keyInfo.GetKeyCode();
int itemCount = __pTabPresenter->GetItemCount();
- if(itemCount == 0)
+ if (itemCount == 0 || __isInFocusMode == false)
{
return false;
}
return false;
}
-bool
-_Tab::OnFocusGained(const _Control & source)
+void
+_Tab::OnDrawFocus(void)
{
- if (this != &source)
- {
- return false;
- }
-
- if(__pTabPresenter->GetItemCount() > 0)
+ if (__pTabPresenter->GetItemCount() > 0)
{
__currentHighlightedItemIndex = 0;
}
{
__currentHighlightedItemIndex = -1;
}
- return true;
-}
-
-bool
-_Tab::OnFocusLost(const _Control & source)
-{
- if (this != &source)
+ if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
{
- return false;
+ __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_HIGHLIGHTED);
}
+ __pTabPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
+ __isInFocusMode = true;
+ return;
+}
+void
+_Tab::OnFocusModeStateChanged(void)
+{
if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) == _TABITEM_STATUS_HIGHLIGHTED)
{
__pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_NORMAL);
}
__currentHighlightedItemIndex = -1;
+ __isInFocusMode = false;
Invalidate();
- return true;
-}
-
-void
-_Tab::OnDrawFocus()
-{
- if (__pTabPresenter->GetItemStatus(__currentHighlightedItemIndex) != _TABITEM_STATUS_SELECTED)
- {
- __pTabPresenter->SetItemStatus(__currentHighlightedItemIndex, _TABITEM_STATUS_HIGHLIGHTED);
- }
- __pTabPresenter->ShiftToFocusedItem(__currentHighlightedItemIndex, _FOCUS_DIRECTION_MOVE_LEFT);
- return;
}
void
void SetEditModeEnabled(bool isEnabled);
bool IsEditModeEnabled(void) const;
+ bool IsInFocusMode(void) const;
+
result SetBackgroundBitmap(const Tizen::Graphics::Bitmap& bitmap);
Tizen::Graphics::Bitmap* GetBackgroundBitmap(void) const;
Tizen::Graphics::Bitmap* GetDisabledBackgroundBitmap(void) const;
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
- bool OnFocusGained(const _Control& source);
- bool OnFocusLost(const _Control& source);
virtual void OnDrawFocus(void);
+ virtual void OnFocusModeStateChanged(void);
private:
int GetItemIndex(int actionId);
private:
_TabPresenter* __pTabPresenter;
+ bool __isInFocusMode;
int __style;
int __currentHighlightedItemIndex;
_TabStatus __tabStatus;