#include <FBaseString.h>
#include <FBaseSysLog.h>
#include <FGrp_BitmapImpl.h>
+#include <FGrp_CoordinateSystemUtils.h>
#include "FUi_ResourceManager.h"
#include "FUi_UiTouchEvent.h"
#include "FUi_TouchTapGestureDetector.h"
#include "FUi_AccessibilityElement.h"
#include "FUiCtrl_SplitPanel.h"
#include "FUiCtrl_SplitPanelPresenter.h"
-#include "FGrp_CoordinateSystemUtils.h"
using namespace Tizen::Ui;
using namespace Tizen::Graphics;
, __splitPanelDividerDirection(SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
, __pSplitPanelEvent(null)
, __dividerTapCount(0)
+ , __isFocusModeEnabled(false)
, __pAccessibilityElement(null)
, __pDividerVisualElement(null)
{
bool
_SplitPanel::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
{
+ if (__isFocusModeEnabled == false)
+ {
+ return false;
+ }
+
return __pSplitPanelPresenter->OnKeyPressed(source, keyInfo);
}
bool
_SplitPanel::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
{
+ if (__isFocusModeEnabled == false)
+ {
+ return false;
+ }
+
return __pSplitPanelPresenter->OnKeyReleased(source, keyInfo);
}
void
_SplitPanel::OnDrawFocus(void)
{
+ __isFocusModeEnabled = true;
__pSplitPanelPresenter->DrawFocus();
return;
}
_SplitPanel::OnFocusLost(const _Control& source)
{
result r = __pSplitPanelPresenter->ReleaseFocus();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
_Control::OnFocusLost(source);
return true;
}
+void
+_SplitPanel::OnFocusModeStateChanged(void)
+{
+ __isFocusModeEnabled = false;
+ __pSplitPanelPresenter->ReleaseFocus();
+
+ return;
+}
+
result
_SplitPanel::SetPane(_Control* pControl, SplitPanelPaneOrder paneOrder)
{
#include <FUiCtrlSplitPanelTypes.h>
#include <FBaseSysLog.h>
#include <FGrp_BitmapImpl.h>
+#include <FGrp_CoordinateSystemUtils.h>
#include "FUi_ResourceManager.h"
#include "FUi_UiTouchEvent.h"
#include "FUiCtrl_SplitPanelPresenter.h"
#include "FUiCtrl_SplitPanel.h"
#include "FUiCtrl_SplitPanelImpl.h"
-#include "FGrp_CoordinateSystemUtils.h"
using namespace Tizen::Ui;
using namespace Tizen::Graphics;
{
FloatPoint point(0.0f, 0.0f);
- ReleaseFocus();
-
point = touchinfo.GetCurrentPosition();
if (CheckDividerTouchRegion(point.x, point.y) == true)
bool
_SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
{
- ReleaseFocus();
-
if (__splitPanelDividerPressed == true)
{
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
FloatPoint point(0.0f, 0.0f);
Bitmap* pThumbBitmap = null;
- ReleaseFocus();
-
if (__pSplitPanel != &source || __splitPanelDividerPressed == false )
{
return false;
DrawFocus(__currentFocusedPane);
}
}
+ else if (keyCode == _KEY_TAB && !__pSplitPanel->IsFocused())
+ {
+ __pSplitPanel->SetFocused(true);
+ }
else
{
return false;
_SplitPanelPresenter::DrawFocus(SplitPanelPaneOrder focusedPane)
{
result r = E_SUCCESS;
- Canvas* pSplitPanelCanvas = null;
+ Canvas* pCanvas = null;
FloatRectangle currentFocusBounds(0.0f, 0.0f, 0.0f, 0.0f);
_Control* pControl = null;
if (pControl != null)
{
- pControl->SetFocused();
- pControl->DrawFocus();
- }
- else
- {
- pSplitPanelCanvas = __pSplitPanel->GetCanvasN();
- SysTryReturnResult(NID_UI_CTRL, (pSplitPanelCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
-
- //give focus
- if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pFocusBitmap))
+ if (pControl->IsFocusable())
{
- r = pSplitPanelCanvas->DrawNinePatchedBitmap(currentFocusBounds, *__pFocusBitmap);
- SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ pControl->SetFocused(true);
+ pControl->DrawFocus();
+
+ return r;
}
else
{
- r = pSplitPanelCanvas->DrawBitmap(currentFocusBounds, *__pFocusBitmap);
- SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ __pSplitPanel->SetFocused(true);
+ currentFocusBounds = pControl->GetBoundsF();
+
+ pCanvas = pControl->GetCanvasN();
+ SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of Control.");
}
+ }
+ else
+ {
+ __pSplitPanel->SetFocused(true);
+
+ pCanvas = __pSplitPanel->GetCanvasN();
+ SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
+ }
- delete pSplitPanelCanvas;
+ //give focus
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pFocusBitmap))
+ {
+ r = pCanvas->DrawNinePatchedBitmap(currentFocusBounds, *__pFocusBitmap);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ else
+ {
+ r = pCanvas->DrawBitmap(currentFocusBounds, *__pFocusBitmap);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
+ delete pCanvas;
+
return r;
CATCH:
- delete pSplitPanelCanvas;
+ delete pCanvas;
return r;
}
}
else
{
- return r;
+ _Control* pFocusedControl = __pSplitPanel->GetPane(__currentFocusedPane);
+ if (pFocusedControl != null)
+ {
+ if (!pFocusedControl->IsFocusable())
+ {
+ Canvas* pPaneCanvas = pFocusedControl->GetCanvasN();
+ SysTryReturnResult(NID_UI_CTRL, (pPaneCanvas != null), E_SYSTEM, "A system error has occurred. Failed to get the canvas of SplitPanel.");
+
+ panebounds = pFocusedControl->GetBoundsF();
+
+ pPaneCanvas->SetBackgroundColor(pFocusedControl->GetBackgroundColor());
+ pPaneCanvas->Clear(panebounds);
+
+ delete pPaneCanvas;
+ }
+
+ if(!__pSplitPanel->IsFocused())
+ {
+ pFocusedControl->SetFocused(false);
+ __pSplitPanel->SetFocused(true);
+ }
+
+ return r;
+ }
}
pSplitPanelCanvas = __pSplitPanel->GetCanvasN();