_SplitPanel::_SplitPanel()
: __pSplitPanelPresenter(null)
, __pTapGesture(null)
+ , __pFirstPaneParent(null)
+ , __pSecondPaneParent(null)
, __pFirstPane(null)
, __pSecondPane(null)
, __splitPanelDividerDirection(SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
_ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
pSplitPanel = new (std::nothrow) _SplitPanel;
- SysTryReturn(NID_UI_CTRL, pSplitPanel, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryReturn(NID_UI_CTRL, pSplitPanel, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pSplitPanel->Construct(splitPanelDividerStyle, splitPanelDividerDirection);
if (r != E_SUCCESS)
pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.height / 2.0f;
pSplitPanel->__pTapGesture = new (std::nothrow) _TouchTapGestureDetector;
- SysTryCatch(NID_UI_CTRL, pSplitPanel->__pTapGesture, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryCatch(NID_UI_CTRL, pSplitPanel->__pTapGesture, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pSplitPanel->AddGestureDetector(*(pSplitPanel->__pTapGesture));
r = pSplitPanel->__pTapGesture->AddGestureListener(*pSplitPanel);
result r = E_SUCCESS;
__pDividerVisualElement = new (std::nothrow) VisualElement();
- SysTryReturnResult(NID_UI_CTRL, __pDividerVisualElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryReturnResult(NID_UI_CTRL, __pDividerVisualElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = __pDividerVisualElement->Construct();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct divider visual element.", GetErrorMessage(r));
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach divider visual element.", GetErrorMessage(r));
__pSplitPanelPresenter = new (std::nothrow) _SplitPanelPresenter;
- SysTryCatch(NID_UI_CTRL, __pSplitPanelPresenter != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryCatch(NID_UI_CTRL, __pSplitPanelPresenter != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = __pSplitPanelPresenter->Construct(*this, splitPanelDividerStyle, splitPanelDividerDirection);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct presenter.", GetErrorMessage(r));
+ __pFirstPaneParent = _Control::CreateControlN();
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, __pFirstPaneParent != null, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pSecondPaneParent = _Control::CreateControlN();
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, __pSecondPaneParent != null, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pFirstPaneParent->SetBackgroundColor(Color(0,0,0,0));
+ __pSecondPaneParent->SetBackgroundColor(Color(0,0,0,0));
+
+ r = AttachChild(*__pFirstPaneParent);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = AttachChild(*__pSecondPaneParent);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
return r;
CATCH:
__pDividerVisualElement = null;
}
- delete __pSplitPanelPresenter;
- __pSplitPanelPresenter = null;
+ if (__pSplitPanelPresenter)
+ {
+ delete __pSplitPanelPresenter;
+ __pSplitPanelPresenter = null;
+ }
+
+ if (__pFirstPaneParent)
+ {
+ if (__pFirstPane)
+ {
+ __pFirstPaneParent->DetachChild(*__pFirstPane);
+ }
+
+ DetachChild(*__pFirstPaneParent);
+
+ delete __pFirstPaneParent;
+ __pFirstPaneParent = null;
+ }
+
+ if (__pSecondPaneParent)
+ {
+ if (__pSecondPane)
+ {
+ __pSecondPaneParent->DetachChild(*__pSecondPane);
+ }
+
+ DetachChild(*__pSecondPaneParent);
+
+ delete __pSecondPaneParent;
+ __pSecondPaneParent = null;
+ }
return r;
}
if (__pDividerVisualElement)
{
+ GetVisualElement()->DetachChild(*__pDividerVisualElement);
+
__pDividerVisualElement->Destroy();
__pDividerVisualElement = null;
}
+ if (__pFirstPaneParent)
+ {
+ DetachChild(*__pFirstPaneParent);
+
+ delete __pFirstPaneParent;
+ __pFirstPaneParent = null;
+ }
+
+ if (__pSecondPaneParent)
+ {
+ DetachChild(*__pSecondPaneParent);
+
+ delete __pSecondPaneParent;
+ __pSecondPaneParent = null;
+ }
+
ClearLastResult();
}
{
__pSplitPanelEvent = _SplitPanelEvent::CreateInstanceN(*this);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, r, r, "[%s] Propagating.", GetErrorMessage(r))
+ SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pSplitPanelEvent->AddListener(listener);
}
_SplitPanel::RemoveSplitPanelEventListener(const _ISplitPanelEventListener& listener)
{
SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.")
+ "[E_SYSTEM] System error occurred.");
__pSplitPanelEvent->RemoveListener(listener);
if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- r = AttachChild(*pControl);
+ r = __pFirstPaneParent->AttachChild(*pControl);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pFirstPane = pControl;
}
else
{
- r = AttachChild(*pControl);
+ r = __pSecondPaneParent->AttachChild(*pControl);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pSecondPane = pControl;
_Control*
_SplitPanel::GetPane(SplitPanelPaneOrder paneOrder) const
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, null, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
{
return const_cast <_Control*>(__pFirstPane);
}
- else
+
+ return const_cast <_Control*>(__pSecondPane);
+}
+
+_Control*
+_SplitPanel::GetPaneParent(SplitPanelPaneOrder paneOrder) const
+{
+ if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- return const_cast <_Control*>(__pSecondPane);
+ return const_cast <_Control*>(__pFirstPaneParent);
}
+
+ return const_cast <_Control*>(__pSecondPaneParent);
}
result
_SplitPanel::SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle)
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
__pSplitPanelPresenter->SetDividerStyle(splitPanelDividerStyle);
return E_SUCCESS;
_SplitPanel::SetDividerPosition(float position)
{
const float width = GetBoundsF().width;
+ const float height = GetBoundsF().height;
+ int configValue = 0;
+ float margin = 0.0f;
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
+ }
- if ((0.0f > position) || (width < position))
+ margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
+
+ if ((0.0f > position) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)))
{
return E_OUT_OF_RANGE;
}
}
}
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
-
if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
{
if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
{
if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
{
- SysLog(NID_UI_CTRL, "[E_SYSTEM] System error occurred. This functionality is not supported for divider style fixed");
+ SysLog(NID_UI_CTRL, "[E_SYSTEM] System error occurred. This functionality is not supported for divider style fixed.");
return E_SUCCESS;
}
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
-
const float width = GetBoundsF().width;
+ const float height = GetBoundsF().height;
+ int configValue = 0;
float margin = 0.0f;
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+
if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
{
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, margin);
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
}
else
{
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, margin);
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
}
- if ((0.0f > position) || ((width - margin) < position) || (position < GetMinimumDividerPosition()))
+ margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
+
+ if ((0.0f > position) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)) ||
+ (position < GetMinimumDividerPosition()))
{
return E_OUT_OF_RANGE;
}
}
const float width = GetBoundsF().width;
+ const float height = GetBoundsF().height;
+ int configValue = 0;
+ float margin = 0.0f;
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
- if ((0.0f > position) || (width < position) || (position > GetMaximumDividerPosition()))
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
{
- return E_OUT_OF_RANGE;
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
}
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+ margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
+
+ if ((0.0f > position) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)) ||
+ (position > GetMaximumDividerPosition()))
+ {
+ return E_OUT_OF_RANGE;
+ }
if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
{
result
_SplitPanel::MaximizePane(SplitPanelPaneOrder paneOrder)
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
- __pSplitPanelPresenter->MaximizePane(paneOrder);
-
- return E_SUCCESS;
+ return __pSplitPanelPresenter->MaximizePane(paneOrder);
}
bool
_SplitPanel::IsPaneMaximized(SplitPanelPaneOrder paneOrder) const
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, false, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
return __pSplitPanelPresenter->IsPaneMaximized(paneOrder);
}
result
_SplitPanel::RestorePane(void)
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
- __pSplitPanelPresenter->RestorePane();
-
- return E_SUCCESS;
+ return __pSplitPanelPresenter->RestorePane();
}
result
_SplitPanel::SendSplitPanelEvent(_SplitPanelEventStatus status)
{
result r = E_SUCCESS;
+ IEventArg* pEventArg = null;
if (__pSplitPanelEvent)
{
- IEventArg* pEventArg = _SplitPanelEvent::CreateSplitPanelEventArgN(status);
+ pEventArg = _SplitPanelEvent::CreateSplitPanelEventArgN(status);
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, pEventArg, r, r, "[%s] Propagating.", GetErrorMessage(r));
result
_SplitPanel::OnAttachedToMainTree(void)
{
+ String hintText = L"";
+ FloatRectangle dividerRect(0.0f, 0.0f, 0.0f, 0.0f);
+ _AccessibilityContainer* pContainer = null;
+
if (likely(!(_AccessibilityManager::IsActivated())))
{
return E_SUCCESS;
}
- _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+ pContainer = GetAccessibilityContainer();
if (pContainer)
{
if (__pDividerVisualElement)
{
- FloatRectangle dividerRect = __pSplitPanelPresenter->GetDividerRectangle();
- String hintText = L"";
+ dividerRect = __pSplitPanelPresenter->GetDividerRectangle();
if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
{
hintText = String(L"Drag scroll, double tap and move to adjust split area");
}
- __pAccessibilityElement = new _AccessibilityElement(true);
+ __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
__pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(dividerRect));
bool
_SplitPanel::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- SetDividerPosition(GetDividerPosition() + 5);
+ SetDividerPosition(GetDividerPosition() + ACCESSIBILITY_DIVIDER_POSITION_OFFSET);
Invalidate();
return true;
_SplitPanel::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- SetDividerPosition(GetDividerPosition() - 5);
+ SetDividerPosition(GetDividerPosition() - ACCESSIBILITY_DIVIDER_POSITION_OFFSET);
Invalidate();
return true;
using namespace Tizen::Ui;
using namespace Tizen::Graphics;
using namespace Tizen::Ui::Animations;
+using namespace Tizen::Base;
namespace Tizen { namespace Ui { namespace Controls
{
, __pDividerThumbBitmap(null)
, __transactionIdMaximize(0)
, __transactionIdRestore(0)
- , __controlAnimatorAnimationInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
- , __visualElementAnimationInterpolator(L"Linear")
+ , __controlAnimatorInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
+ , __visualElementInterpolator(L"Linear")
{
GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_NORMAL, __dividerBackgroundColor);
GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_PRESSED, __dividerPressedBackgroundColor);
AdjustDividerRectangle();
- __controlAnimatorAnimationInterpolator = ANIMATION_INTERPOLATOR_EASE_IN;
- __visualElementAnimationInterpolator = L"EaseIn";
+ __controlAnimatorInterpolator = ANIMATION_INTERPOLATOR_EASE_IN;
+ __visualElementInterpolator = L"EaseIn";
return E_SUCCESS;
Bitmap* pThumbBitmap = null;
dividerPosition = __pSplitPanel->GetDividerPosition();
+ pThumbBitmap = __pDividerThumbBitmap;
if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
{
- pThumbBitmap = __pDividerThumbBitmap;
if ((positionX >= dividerPosition)
&& (positionX <= dividerPosition + pThumbBitmap->GetWidthF()))
{
}
else
{
- pThumbBitmap = __pDividerThumbBitmap;
if ((positionY >= dividerPosition)
&& (positionY <= dividerPosition + pThumbBitmap->GetHeightF()))
{
}
point = touchinfo.GetCurrentPosition();
+ pThumbBitmap = __pDividerThumbBitmap;
if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
{
return false;
}
- pThumbBitmap = __pDividerThumbBitmap;
-
if (point.x <= __pSplitPanel->GetBoundsF().width - pThumbBitmap->GetWidthF())
{
__pSplitPanel->SetDividerPosition(point.x);
return false;
}
- pThumbBitmap = __pDividerThumbBitmap;
-
if (point.y <= __pSplitPanel->GetBoundsF().height - pThumbBitmap->GetHeightF())
{
__pSplitPanel->SetDividerPosition(point.y);
if (__splitPanelDividerPressed == true)
{
__splitPanelDividerPressed = false;
+
Draw();
}
{
return E_SUCCESS;
}
- else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
+ else if (GetTransactionStatus() == ANIMATION_TRANSACTION_STATUS_PLAYING)
{
AnimationTransaction::Stop(__transactionIdMaximize);
AnimationTransaction::Stop(__transactionIdRestore);
RecalcSplitPanel();
- ChangePaneOrder(paneOrder);
-
AnimationTransaction::Begin(__transactionIdMaximize);
if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RIGHT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_RIGHT);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_RIGHT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_LEFT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_LEFT);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_LEFT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_BOTTOM);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_BOTTOM);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_BOTTOM);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_TOP);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_TOP);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_TOP);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
{
return E_SUCCESS;
}
- else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
+ else if (GetTransactionStatus() == ANIMATION_TRANSACTION_STATUS_PLAYING)
{
AnimationTransaction::Stop(__transactionIdMaximize);
AnimationTransaction::Stop(__transactionIdRestore);
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
result
_SplitPanelPresenter::Draw(void)
{
- if (__pSplitPanelModel->GetPaneMaximumState() == false && GetAnimationStatus() == ANIMATOR_STATUS_STOPPED)
+ if (__pSplitPanelModel->GetPaneMaximumState() == false && GetTransactionStatus() == ANIMATION_TRANSACTION_STATUS_STOPPED)
{
FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle dividerThumbBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ Canvas* pCanvas = null;
//adjust divider rectangle
AdjustDividerRectangle();
- Canvas* pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
+ pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
SysTryReturnResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "Propagating.");
- pCanvas->Clear();
-
- //resize pane
- SetPaneBounds();
-
- dividerBounds = __dividerRectangle;
- dividerBounds.x = 0.0f;
- dividerBounds.y = 0.0f;
-
- if (__splitPanelDividerPressed == true)
+ if (pCanvas)
{
- pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
- }
- else
- {
- pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundBitmap);
- }
+ pCanvas->Clear();
- //draw divider
- pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundEffectBitmap);
+ //resize pane
+ SetPaneBounds();
- //draw divider thumb
- if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- dividerThumbBounds = __dividerThumbRectangle;
- if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ dividerBounds = __dividerRectangle;
+ dividerBounds.x = 0.0f;
+ dividerBounds.y = 0.0f;
+
+ if (__splitPanelDividerPressed == true)
{
- dividerThumbBounds.x = 0.0f;
+ pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
}
else
{
- dividerThumbBounds.y = 0.0f;
+ pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundBitmap);
}
- pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap);
- }
+ //draw divider
+ pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundEffectBitmap);
+
+ //draw divider thumb
+ if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
+ {
+ dividerThumbBounds = __dividerThumbRectangle;
+ if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ {
+ dividerThumbBounds.x = 0.0f;
+ }
+ else
+ {
+ dividerThumbBounds.y = 0.0f;
+ }
+
+ pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap);
+ }
- delete pCanvas;
+ delete pCanvas;
+ }
}
return E_SUCCESS;
{
r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
+
r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
}
{
r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
+
r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
}
__pDividerPressedBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerPressedBackgroundColor);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, (__pDividerPressedBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, (__pDividerPressedBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(GetLastResult()));
__pDividerBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerBackgroundColor);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(GetLastResult()));
delete pDividerBackgroundBitmap;
_SplitPanelPresenter::OnBoundsChanged(void)
{
RecalcSplitPanel();
+
return;
}
FloatPoint panePostion(0.0f, 0.0f);
_Control* pFirstPane = null;
_Control* pSecondPane = null;
+ _Control* pFirstPaneParent = null;
+ _Control* pSecondPaneParent = null;
clientBounds = __pSplitPanel->GetBoundsF();
pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
-
pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
+ pFirstPaneParent = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_FIRST);
+ pSecondPaneParent = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_SECOND);
+
clientBounds.x = clientBounds.y = 0.0f;
if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST))
}
}
+ if (pFirstPaneParent != null)
+ {
+ r = pFirstPaneParent->SetBounds(firstPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ }
+
+ if (pSecondPaneParent != null)
+ {
+ r = pSecondPaneParent->SetBounds(secondPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ }
+
//set Pane bounds
if (pFirstPane != null)
{
- r = pFirstPane->SetBounds(firstPaneBounds);
-
- if (r != E_SUCCESS)
+ if (pFirstPane->IsResizable())
{
- panePostion.x = firstPaneBounds.x;
- panePostion.y = firstPaneBounds.y;
-
- r = pFirstPane->SetPosition(panePostion);
+ r = pFirstPane->SetBounds(firstPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
-
+
+ r = pFirstPane->SetPosition(Point(0.0f, 0.0f));
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
if (pSecondPane != null)
{
- r = pSecondPane->SetBounds(secondPaneBounds);
-
- if (r != E_SUCCESS)
+ if (pSecondPane->IsResizable())
{
- panePostion.x = secondPaneBounds.x;
- panePostion.y = secondPaneBounds.y;
-
- r = pSecondPane->SetPosition(panePostion);
+ r = pSecondPane->SetBounds(secondPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
-
+
+ r = pSecondPane->SetPosition(Point(0.0f, 0.0f));
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
__setFirstDividerPositionChangeEvent = false;
__pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
}
+
+ pFirstPane->Invalidate(true);
+ pSecondPane->Invalidate(true);
}
return r;
dividerPosition = __pSplitPanel->GetDividerPosition();
clientBounds = __pSplitPanel->GetBoundsF();
- if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
- {
- pThumbBitmap = __pDividerThumbBitmap;
+ pThumbBitmap = __pDividerThumbBitmap;
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
- }
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
+ }
+ if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ {
height = clientBounds.height;
- if (height > 0)
+ if (height > 0.0f)
{
__dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height);
__dividerThumbRectangle = FloatRectangle(dividerPosition, ((height - pThumbBitmap->GetHeightF()) / 2.0f), pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
}
else
{
- pThumbBitmap = __pDividerThumbBitmap;
-
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
- }
-
width = clientBounds.width;
if (width > 0.0f)
__pSplitPanel->SetDividerVisualElementBounds(__dividerRectangle);
}
-void
-_SplitPanelPresenter::ChangePaneOrder(SplitPanelPaneOrder paneOrder)
-{
- result r = E_SUCCESS;
- _Control* pFirstPane = null;
- _Control* pSecondPane = null;
-
- if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
- {
- pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
- SysTryReturnVoidResult(NID_UI_CTRL, pFirstPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->DetachChild(*pFirstPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->AttachChild(*pFirstPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
- else
- {
- pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
- SysTryReturnVoidResult(NID_UI_CTRL, pSecondPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->DetachChild(*pSecondPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->AttachChild(*pSecondPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
-
- return;
-}
-
result
_SplitPanelPresenter::AnimateDivider(int destination)
{
result r = E_SUCCESS;
FloatRectangle dividerBoundsStart(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle dividerBoundsEnd(0.0f, 0.0f, 0.0f, 0.0f);
- FloatRectangle dividerBounds(0, 0, 0, 0);
- FloatRectangle clientBounds(0, 0, 0, 0);
- FloatRectangle firstPaneBounds(0, 0, 0, 0);
- Control* pFirstPanelControl = null;
+ FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ _Control* pFirstPaneParent = null;
VisualElement* pVisualElementDivider = null;
VisualElementPropertyAnimation* pAnimationDivider = null;
- const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementAnimationInterpolator);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pTimingFunction != null, r, "Propagating.");
-
- pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
+ pFirstPaneParent = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_FIRST);
+ SysTryReturnResult(NID_UI_CTRL, pFirstPaneParent != null, GetLastResult(), "Propagating.");
pVisualElementDivider = __pSplitPanel->GetDividerVisualElement();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, r, "Propagating.");
+ SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, GetLastResult(), "Propagating.");
pVisualElementDivider->RemoveAllAnimations();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- pAnimationDivider = new (std::nothrow) VisualElementPropertyAnimation();
- SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, E_OUT_OF_MEMORY, " Memory allocation failed.")
-
- r = pAnimationDivider->SetPropertyName(L"bounds");
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
-
- r = pAnimationDivider->SetDuration(ANIMATION_DURATION);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "Propagating.");
- pAnimationDivider->SetTimingFunction(pTimingFunction);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+ pAnimationDivider = GetVisualElementAnimation(L"bounds");
+ SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, GetLastResult(), "Propagating.");
dividerBounds = pVisualElementDivider->GetBounds();
clientBounds = __pSplitPanel->GetBoundsF();
- firstPaneBounds = pFirstPanelControl->GetBoundsF();
+ firstPaneBounds = pFirstPaneParent->GetBoundsF();
dividerBoundsStart = dividerBounds;
clientBounds.x = clientBounds.y = 0.0f;
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
pVisualElementDivider->AddAnimation(L"Bounds", *pAnimationDivider);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
CATCH:
delete pAnimationDivider;
- return r;
+ return r;
}
result
_SplitPanelPresenter::AnimatePane(int destination)
{
- result r = E_SUCCESS;
Rectangle clientBounds(0, 0, 0, 0);
Rectangle firstPaneBounds(0, 0, 0, 0);
Rectangle secondPaneBounds(0, 0, 0, 0);
Rectangle dividerRectangle(0, 0, 0, 0);
- Control* pFirstPanelControl = null;
- Control* pSecondPanelControl = null;
+ Control* pFirstPaneControl = null;
+ Control* pSecondPaneControl = null;
ControlAnimator* pControlAnimatorFirstPane = null;
ControlAnimator* pControlAnimatorSecondPane = null;
- FloatAnimation animationHidePane = FloatAnimation(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- FloatAnimation animationShowPane = FloatAnimation(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ FloatAnimation hidePane(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorInterpolator);
+ FloatAnimation showPane(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorInterpolator);
- pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
+ pFirstPaneControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
+ pSecondPaneControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
- pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pSecondPanelControl != null, r, "Propagating.");
-
- pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pControlAnimatorFirstPane != null, r, "Propagating.");
-
- pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pControlAnimatorSecondPane != null, r, "Propagating.");
+ pControlAnimatorFirstPane = pFirstPaneControl->GetControlAnimator();
+ pControlAnimatorSecondPane = pSecondPaneControl->GetControlAnimator();
clientBounds = __pSplitPanel->GetBounds();
- firstPaneBounds = pFirstPanelControl->GetBounds();
- secondPaneBounds = pSecondPanelControl->GetBounds();
+ firstPaneBounds = pFirstPaneControl->GetBounds();
+ secondPaneBounds = pSecondPaneControl->GetBounds();
clientBounds.x = clientBounds.y = 0;
case _SPLIT_PANEL_ANIMATION_RIGHT:
{
Rectangle secondPaneEndBounds = secondPaneBounds;
- secondPaneEndBounds.x = clientBounds.x + clientBounds.width + dividerRectangle.width;
+ secondPaneEndBounds.x = clientBounds.width + dividerRectangle.width;
- RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation maximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, maximizeFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pFirstPanelControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == true)
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
case _SPLIT_PANEL_ANIMATION_LEFT:
{
Rectangle firstPaneEndBounds = firstPaneBounds;
- firstPaneEndBounds.x = clientBounds.x - firstPaneBounds.width - dividerRectangle.width;
-
- RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ firstPaneEndBounds.x = -(firstPaneBounds.width + dividerRectangle.width);
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
+ }
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pSecondPanelControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == true)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
case _SPLIT_PANEL_ANIMATION_TOP:
{
Rectangle firstPaneEndBounds = firstPaneBounds;
- firstPaneEndBounds.y = clientBounds.y - firstPaneBounds.height - dividerRectangle.height;
+ firstPaneEndBounds.y = -(firstPaneBounds.height + dividerRectangle.height);
- RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
+ }
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pSecondPanelControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == true)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
case _SPLIT_PANEL_ANIMATION_BOTTOM:
{
Rectangle secondPaneEndBounds = secondPaneBounds;
- secondPaneEndBounds.y = clientBounds.y + clientBounds.height + dividerRectangle.height;
-
- RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ secondPaneEndBounds.y = clientBounds.height + dividerRectangle.height;
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation maximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, maximizeFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pFirstPanelControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == true)
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
- RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ secondPaneEndBounds.x = secondPaneEndBounds.y = 0;
- // Restore Pane 1
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
+ RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- // Restore Pane 2
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
+ }
if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
else
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
}
break;
Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
- RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ secondPaneEndBounds.x = secondPaneEndBounds.y = 0;
- // Restore Pane 1
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
+ RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- // Restore Pane 2
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
+ }
if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
else
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
}
break;
return E_SUCCESS;
}
+result
+_SplitPanelPresenter::AnimatePaneParent(int destination)
+{
+ result r = E_SUCCESS;
+ _Control* pFirstPane = null;
+ _Control* pSecondPane = null;
+ VisualElement* pVEFirstPane = null;
+ VisualElement* pVESecondPane = null;
+ VisualElementPropertyAnimation* pAnimationFirstPane = null;
+ VisualElementPropertyAnimation* pAnimationSecondPane = null;
+
+ FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle dividerRectangle(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneStartBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneEndBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle secondPaneStartBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle secondPaneEndBounds(0.0f, 0.0f, 0.0f, 0.0f);
+
+ pFirstPane = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_FIRST);
+ pSecondPane = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_SECOND);
+
+ if (pFirstPane)
+ {
+ pVEFirstPane = pFirstPane->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pVEFirstPane != null, GetLastResult(), "Propagating.");
+
+ pVEFirstPane->RemoveAllAnimations();
+ }
+
+ if (pSecondPane)
+ {
+ pVESecondPane = pSecondPane->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pVESecondPane != null, GetLastResult(), "Propagating.");
+
+ pVESecondPane->RemoveAllAnimations();
+ }
+
+ pAnimationFirstPane = GetVisualElementAnimation(L"bounds");
+ SysTryReturnResult(NID_UI_CTRL, pAnimationFirstPane != null, GetLastResult(), "Propagating.");
+
+ pAnimationSecondPane = GetVisualElementAnimation(L"bounds");
+ SysTryReturnResult(NID_UI_CTRL, pAnimationSecondPane != null, GetLastResult(), "Propagating.");
+
+ clientBounds = __pSplitPanel->GetBoundsF();
+ firstPaneBounds = pFirstPane->GetBoundsF();
+ secondPaneBounds = pSecondPane->GetBoundsF();
+
+ clientBounds.x = clientBounds.y = 0.0f;
+
+ dividerRectangle = __dividerRectangle;
+
+ switch (destination)
+ {
+ case _SPLIT_PANEL_ANIMATION_RIGHT:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = clientBounds;
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = secondPaneBounds;
+ secondPaneEndBounds.x = clientBounds.width + dividerRectangle.width;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_LEFT:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = firstPaneBounds;
+ firstPaneEndBounds.x = -(firstPaneBounds.width + dividerRectangle.width);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = clientBounds;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_TOP:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = firstPaneBounds;
+ firstPaneEndBounds.y = -(firstPaneBounds.height + dividerRectangle.height);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = clientBounds;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_BOTTOM:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = clientBounds;
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = secondPaneBounds;
+ secondPaneEndBounds.y = clientBounds.height + dividerRectangle.height;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
+ }
+ break;
+ }
+
+ if (pFirstPane)
+ {
+ r = pAnimationFirstPane->SetStartValue(firstPaneStartBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ r = pAnimationFirstPane->SetEndValue(firstPaneEndBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ pFirstPane->SetBounds(firstPaneEndBounds);
+
+ if (pVEFirstPane)
+ {
+ pVEFirstPane->AddAnimation(L"Bounds", *pAnimationFirstPane);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
+ }
+ }
+
+ if (pSecondPane)
+ {
+ r = pAnimationSecondPane->SetStartValue(secondPaneStartBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ r = pAnimationSecondPane->SetEndValue(secondPaneEndBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ pSecondPane->SetBounds(secondPaneEndBounds);
+
+ if (pVESecondPane)
+ {
+ pVESecondPane->AddAnimation(L"Bounds", *pAnimationSecondPane);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
+ }
+ }
+
+CATCH:
+
+ delete pAnimationFirstPane;
+ delete pAnimationSecondPane;
+
+ return r;
+}
+
Control*
_SplitPanelPresenter::GetPaneControl(SplitPanelPaneOrder paneOrder)
{
SplitPanel& splitPanelPublic = pSplitPanelImpl->GetPublic();
pControl = splitPanelPublic.GetPane(paneOrder);
- SysTryReturn(NID_UI_CTRL, pControl != null, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturn(NID_UI_CTRL, pControl != null, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
return pControl;
}
-AnimatorStatus
-_SplitPanelPresenter::GetAnimationStatus(void)
+AnimationTransactionStatus
+_SplitPanelPresenter::GetTransactionStatus(void)
{
- result r = E_SUCCESS;
-
- Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pFirstPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- Control* pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pSecondPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- ControlAnimator* pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- ControlAnimator* pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- if (pControlAnimatorFirstPane->GetStatus() == ANIMATOR_STATUS_STOPPED && pControlAnimatorSecondPane->GetStatus() == ANIMATOR_STATUS_STOPPED)
+ if (AnimationTransaction::GetStatus(__transactionIdMaximize) == ANIMATION_TRANSACTION_STATUS_STOPPED &&
+ AnimationTransaction::GetStatus(__transactionIdRestore) == ANIMATION_TRANSACTION_STATUS_STOPPED)
{
- return ANIMATOR_STATUS_STOPPED;
+ return ANIMATION_TRANSACTION_STATUS_STOPPED;
}
- return ANIMATOR_STATUS_PLAYING;
+ return ANIMATION_TRANSACTION_STATUS_PLAYING;
}
FloatRectangle
{
float width = 0.0f;
float height = 0.0f;
+ float dividerPosition = 0.0f;
+ FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
- float dividerPosition = __pSplitPanel->GetDividerPosition();
+ dividerPosition = __pSplitPanel->GetDividerPosition();
- FloatRectangle clientBounds = __pSplitPanel->GetBoundsF();
+ clientBounds = __pSplitPanel->GetBoundsF();
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+ orientation = _ControlManager::GetInstance()->GetOrientation();
- if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
{
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
- }
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
+ }
+ if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ {
height = clientBounds.height;
if (height > 0.0f)
}
else
{
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
- }
-
width = clientBounds.width;
if (width > 0.0f)
return secondPaneBounds;
}
+VisualElementPropertyAnimation*
+_SplitPanelPresenter::GetVisualElementAnimation(Tizen::Base::String propertyName)
+{
+ result r = E_SUCCESS;
+ VisualElementPropertyAnimation* pAnimation = null;
+
+ const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementInterpolator);
+ SysTryReturn(NID_UI_CTRL, pTimingFunction != null, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ pAnimation = new (std::nothrow) VisualElementPropertyAnimation();
+ SysTryReturn(NID_UI_CTRL, pAnimation != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ r = pAnimation->SetPropertyName(propertyName);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ r = pAnimation->SetDuration(ANIMATION_DURATION);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ pAnimation->SetTimingFunction(pTimingFunction);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
+
+ return pAnimation;
+
+CATCH:
+ delete pAnimation;
+
+ return null;
+}
+
}}} // Tizen::Ui::Controls