2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_SplitPanelPresenter.cpp
20 * @brief This is the header file for the _SplitPanelPresenter class.
22 * This header file contains the declarations of the %_SplitPanelPresenter class.
25 #include <FBaseErrorDefine.h>
26 #include <FGrpCanvas.h>
27 #include <FUiCtrlSplitPanelTypes.h>
28 #include <FBaseSysLog.h>
29 #include <FGrp_BitmapImpl.h>
30 #include "FUi_ResourceManager.h"
31 #include "FUi_UiTouchEvent.h"
32 #include "FUiCtrl_SplitPanelPresenter.h"
33 #include "FUiCtrl_SplitPanel.h"
34 #include "FUiCtrl_SplitPanelImpl.h"
35 #include "FGrp_CoordinateSystemUtils.h"
37 using namespace Tizen::Ui;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Ui::Animations;
41 namespace Tizen { namespace Ui { namespace Controls
44 _SplitPanelPresenter::_SplitPanelPresenter(void)
46 , __pSplitPanelModel(null)
47 , __dividerMaximumPosition(0.0f)
48 , __dividerMinimumPosition(0.0f)
49 , __splitPanelDividerPressed(false)
50 , __setFirstDividerPositionChangeEvent(true)
51 , __dividerRectangle(0.0f, 0.0f ,0.0f, 0.0f)
52 , __dividerThumbRectangle(0.0f, 0.0f, 0.0f, 0.0f)
53 , __pDividerPressedBackgroundBitmap(null)
54 , __pDividerBackgroundBitmap(null)
55 , __pDividerBackgroundEffectBitmap(null)
56 , __pDividerThumbBitmap(null)
57 , __transactionIdMaximize(0)
58 , __transactionIdRestore(0)
59 , __controlAnimatorAnimationInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
60 , __visualElementAnimationInterpolator(L"Linear")
62 GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_NORMAL, __dividerBackgroundColor);
63 GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_PRESSED, __dividerPressedBackgroundColor);
66 _SplitPanelPresenter::~_SplitPanelPresenter(void)
68 delete __pSplitPanelModel;
69 __pSplitPanelModel = null;
71 delete __pDividerPressedBackgroundBitmap;
72 __pDividerPressedBackgroundBitmap = null;
74 delete __pDividerBackgroundBitmap;
75 __pDividerBackgroundBitmap = null;
77 delete __pDividerThumbBitmap;
78 __pDividerThumbBitmap = null;
80 delete __pDividerBackgroundEffectBitmap;
81 __pDividerBackgroundEffectBitmap = null;
85 _SplitPanelPresenter::Construct(const _SplitPanel& splitPanel, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection)
88 _SplitPanelModel* pModel = null;
90 pModel = new (std::nothrow) _SplitPanelModel;
91 SysTryReturnResult(NID_UI_CTRL, pModel, E_OUT_OF_MEMORY, "Memory allocation failed.");
93 r = SetModel(*pModel);
94 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to set the model.");
96 r = pModel->Construct();
97 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to construct _SplitPanelModel instance.");
99 __pSplitPanel = const_cast <_SplitPanel*>(&splitPanel);
100 SysTryCatch(NID_UI_CTRL, __pSplitPanel != null, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. _SplitPanel instance is null.");
102 __pSplitPanelModel->SetDividerStyle(splitPanelDividerStyle);
104 r = LoadBitmap(splitPanelDividerDirection);
105 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
107 AdjustDividerRectangle();
109 __controlAnimatorAnimationInterpolator = ANIMATION_INTERPOLATOR_EASE_IN;
110 __visualElementAnimationInterpolator = L"EaseIn";
122 _SplitPanelPresenter::CheckDividerTouchRegion(float positionX, float positionY)
124 float dividerPosition = 0.0f;
125 Bitmap* pThumbBitmap = null;
127 dividerPosition = __pSplitPanel->GetDividerPosition();
129 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
131 pThumbBitmap = __pDividerThumbBitmap;
132 if ((positionX >= dividerPosition)
133 && (positionX <= dividerPosition + pThumbBitmap->GetWidthF()))
140 pThumbBitmap = __pDividerThumbBitmap;
141 if ((positionY >= dividerPosition)
142 && (positionY <= dividerPosition + pThumbBitmap->GetHeightF()))
152 _SplitPanelPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
154 FloatPoint point(0.0f, 0.0f);
156 point = touchinfo.GetCurrentPosition();
158 if (CheckDividerTouchRegion(point.x, point.y) == true)
160 __splitPanelDividerPressed = true;
169 _SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
171 if (__splitPanelDividerPressed == true)
173 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
174 __splitPanelDividerPressed = false;
182 _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
184 FloatPoint point(0.0f, 0.0f);
185 Bitmap* pThumbBitmap = null;
187 if (__pSplitPanel != &source || __splitPanelDividerPressed == false )
192 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
197 point = touchinfo.GetCurrentPosition();
199 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
201 // Min, Max Position Check.
202 if ((__pSplitPanel->GetMinimumDividerPosition() > point.x)
203 || (__pSplitPanel->GetMaximumDividerPosition() < point.x))
208 pThumbBitmap = __pDividerThumbBitmap;
210 if (point.x <= __pSplitPanel->GetBoundsF().width - pThumbBitmap->GetWidthF())
212 __pSplitPanel->SetDividerPosition(point.x);
217 // Min, Max Position Check.
218 if ((__pSplitPanel->GetMinimumDividerPosition() > point.y)
219 || (__pSplitPanel->GetMaximumDividerPosition() < point.y))
224 pThumbBitmap = __pDividerThumbBitmap;
226 if (point.y <= __pSplitPanel->GetBoundsF().height - pThumbBitmap->GetHeightF())
228 __pSplitPanel->SetDividerPosition(point.y);
232 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
240 _SplitPanelPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
242 if (__splitPanelDividerPressed == true)
244 __splitPanelDividerPressed = false;
252 _SplitPanelPresenter::OnTapGestureDetected(_TouchTapGestureDetector& gesture)
254 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
259 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_DOUBLE_PRESSED);
265 _SplitPanelPresenter::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
271 _SplitPanelPresenter::SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle)
273 __pSplitPanelModel->SetDividerStyle(splitPanelDividerStyle);
278 SplitPanelDividerStyle
279 _SplitPanelPresenter::GetDividerStyle(void) const
281 return __pSplitPanelModel->GetDividerStyle();
285 _SplitPanelPresenter::GetDividerRectangle(void) const
287 return __dividerRectangle;
291 _SplitPanelPresenter::MaximizePane(SplitPanelPaneOrder paneOrder)
293 result r = E_SUCCESS;
295 if (IsPaneMaximized(paneOrder))
299 else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
301 AnimationTransaction::Stop(__transactionIdMaximize);
302 AnimationTransaction::Stop(__transactionIdRestore);
307 ChangePaneOrder(paneOrder);
309 AnimationTransaction::Begin(__transactionIdMaximize);
311 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
313 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
315 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RIGHT);
316 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
318 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RIGHT);
319 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
323 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_LEFT);
324 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
326 r = AnimatePane(_SPLIT_PANEL_ANIMATION_LEFT);
327 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
332 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
334 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_BOTTOM);
335 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
337 r = AnimatePane(_SPLIT_PANEL_ANIMATION_BOTTOM);
338 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
342 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_TOP);
343 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
345 r = AnimatePane(_SPLIT_PANEL_ANIMATION_TOP);
346 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
350 AnimationTransaction::Commit();
352 __pSplitPanelModel->SetPaneMaximumState(true);
353 __pSplitPanelModel->SetMaximizedPaneOrder(paneOrder);
358 AnimationTransaction::Discard();
364 _SplitPanelPresenter::IsPaneMaximized(SplitPanelPaneOrder paneOrder) const
366 if ((__pSplitPanelModel->GetPaneMaximumState() == true)
367 && (__pSplitPanelModel->GetMaximizedPaneOrder() == paneOrder))
376 _SplitPanelPresenter::RestorePane(void)
378 result r = E_SUCCESS;
380 if (__pSplitPanelModel->GetPaneMaximumState() == false)
384 else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
386 AnimationTransaction::Stop(__transactionIdMaximize);
387 AnimationTransaction::Stop(__transactionIdRestore);
392 AnimationTransaction::Begin(__transactionIdRestore);
394 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
396 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
397 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
399 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
400 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
404 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
405 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
407 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
408 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
411 AnimationTransaction::Commit();
413 __pSplitPanelModel->SetPaneMaximumState(false);
418 AnimationTransaction::Discard();
424 _SplitPanelPresenter::Draw(void)
426 if (__pSplitPanelModel->GetPaneMaximumState() == false && GetAnimationStatus() == ANIMATOR_STATUS_STOPPED)
428 FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
429 FloatRectangle dividerThumbBounds(0.0f, 0.0f, 0.0f, 0.0f);
431 //adjust divider rectangle
432 AdjustDividerRectangle();
434 Canvas* pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
435 SysTryReturnResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "Propagating.");
442 dividerBounds = __dividerRectangle;
443 dividerBounds.x = 0.0f;
444 dividerBounds.y = 0.0f;
446 if (__splitPanelDividerPressed == true)
448 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
452 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundBitmap);
456 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundEffectBitmap);
459 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
461 dividerThumbBounds = __dividerThumbRectangle;
462 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
464 dividerThumbBounds.x = 0.0f;
468 dividerThumbBounds.y = 0.0f;
471 pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap);
481 _SplitPanelPresenter::LoadBitmap(SplitPanelDividerDirection splitPanelDividerDirection)
483 result r = E_SUCCESS;
484 Bitmap *pDividerBackgroundBitmap = null;
486 // Modified - Changeable Color / Resource ( Fixed Style )
487 r = GET_BITMAP_CONFIG_N(SPLITPANEL::DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDividerBackgroundBitmap);
488 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to load bitmap.");
490 if (splitPanelDividerDirection == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
492 r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
493 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
494 r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
495 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
499 r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
500 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
501 r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
502 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
505 __pDividerPressedBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerPressedBackgroundColor);
507 SysTryCatch(NID_UI_CTRL, (__pDividerPressedBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
509 __pDividerBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerBackgroundColor);
511 SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
513 delete pDividerBackgroundBitmap;
518 delete pDividerBackgroundBitmap;
519 delete __pDividerBackgroundEffectBitmap;
520 delete __pDividerPressedBackgroundBitmap;
521 delete __pDividerThumbBitmap;
527 _SplitPanelPresenter::RecalcSplitPanel(void)
529 //adjust divider rectangle
530 AdjustDividerRectangle();
539 _SplitPanelPresenter::OnChangeLayout(_ControlOrientation orientation)
541 AnimationTransaction::Stop(__transactionIdMaximize);
542 AnimationTransaction::Stop(__transactionIdRestore);
548 _SplitPanelPresenter::OnBoundsChanged(void)
555 _SplitPanelPresenter::SetModel(const _SplitPanelModel& splitPanelModel)
557 __pSplitPanelModel = const_cast<_SplitPanelModel*>(&splitPanelModel);
563 _SplitPanelPresenter::SetPaneBounds(void)
565 result r = E_SUCCESS;
566 FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
567 FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
568 FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
569 FloatPoint panePostion(0.0f, 0.0f);
570 _Control* pFirstPane = null;
571 _Control* pSecondPane = null;
573 clientBounds = __pSplitPanel->GetBoundsF();
575 pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
577 pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
579 clientBounds.x = clientBounds.y = 0.0f;
581 if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST))
583 firstPaneBounds = clientBounds;
585 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
587 secondPaneBounds = FloatRectangle(clientBounds.width + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width, clientBounds.height);
591 secondPaneBounds = FloatRectangle(0.0f, clientBounds.height + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
594 else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND))
596 secondPaneBounds = clientBounds;
598 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
600 firstPaneBounds = FloatRectangle(clientBounds.x -__dividerRectangle.x - __dividerRectangle.width, 0.0f, __dividerRectangle.x, clientBounds.height);
604 firstPaneBounds = FloatRectangle(0.0f, clientBounds.y -__dividerRectangle.y - __dividerRectangle.height, clientBounds.width, __dividerRectangle.y);
609 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
611 firstPaneBounds = FloatRectangle(0.0f, 0.0f, __dividerRectangle.x, clientBounds.height);
612 secondPaneBounds = FloatRectangle(__dividerRectangle.x + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height);
616 firstPaneBounds = FloatRectangle(0.0f, 0.0f, clientBounds.width, __dividerRectangle.y);
617 secondPaneBounds = FloatRectangle(0.0f, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
622 if (pFirstPane != null)
624 r = pFirstPane->SetBounds(firstPaneBounds);
628 panePostion.x = firstPaneBounds.x;
629 panePostion.y = firstPaneBounds.y;
631 r = pFirstPane->SetPosition(panePostion);
634 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
637 if (pSecondPane != null)
639 r = pSecondPane->SetBounds(secondPaneBounds);
643 panePostion.x = secondPaneBounds.x;
644 panePostion.y = secondPaneBounds.y;
646 r = pSecondPane->SetPosition(panePostion);
649 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
652 if ((pFirstPane != null) && (pSecondPane != null))
654 if (__setFirstDividerPositionChangeEvent == true)
656 __setFirstDividerPositionChangeEvent = false;
657 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
665 _SplitPanelPresenter::AdjustDividerRectangle(void)
667 float dividerPosition = 0.0f;
670 FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
671 _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
672 Bitmap* pThumbBitmap = null;
674 orientation = _ControlManager::GetInstance()->GetOrientation();
676 dividerPosition = __pSplitPanel->GetDividerPosition();
677 clientBounds = __pSplitPanel->GetBoundsF();
679 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
681 pThumbBitmap = __pDividerThumbBitmap;
683 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
685 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
689 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
692 height = clientBounds.height;
696 __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height);
697 __dividerThumbRectangle = FloatRectangle(dividerPosition, ((height - pThumbBitmap->GetHeightF()) / 2.0f), pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
702 pThumbBitmap = __pDividerThumbBitmap;
704 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
706 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
710 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
713 width = clientBounds.width;
717 __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height);
718 __dividerThumbRectangle = FloatRectangle(((width - pThumbBitmap->GetWidth()) / 2.0f), dividerPosition, pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
722 __pSplitPanel->SetDividerVisualElementBounds(__dividerRectangle);
726 _SplitPanelPresenter::ChangePaneOrder(SplitPanelPaneOrder paneOrder)
728 result r = E_SUCCESS;
729 _Control* pFirstPane = null;
730 _Control* pSecondPane = null;
732 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
734 pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
735 SysTryReturnVoidResult(NID_UI_CTRL, pFirstPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
737 r = __pSplitPanel->DetachChild(*pFirstPane);
738 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
740 r = __pSplitPanel->AttachChild(*pFirstPane);
741 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
745 pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
746 SysTryReturnVoidResult(NID_UI_CTRL, pSecondPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
748 r = __pSplitPanel->DetachChild(*pSecondPane);
749 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
751 r = __pSplitPanel->AttachChild(*pSecondPane);
752 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
759 _SplitPanelPresenter::AnimateDivider(int destination)
761 result r = E_SUCCESS;
762 FloatRectangle dividerBoundsStart(0.0f, 0.0f, 0.0f, 0.0f);
763 FloatRectangle dividerBoundsEnd(0.0f, 0.0f, 0.0f, 0.0f);
764 FloatRectangle dividerBounds(0, 0, 0, 0);
765 FloatRectangle clientBounds(0, 0, 0, 0);
766 FloatRectangle firstPaneBounds(0, 0, 0, 0);
767 Control* pFirstPanelControl = null;
768 VisualElement* pVisualElementDivider = null;
769 VisualElementPropertyAnimation* pAnimationDivider = null;
771 const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementAnimationInterpolator);
773 SysTryReturnResult(NID_UI_CTRL, pTimingFunction != null, r, "Propagating.");
775 pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
777 SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
779 pVisualElementDivider = __pSplitPanel->GetDividerVisualElement();
781 SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, r, "Propagating.");
783 pVisualElementDivider->RemoveAllAnimations();
785 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
787 pAnimationDivider = new (std::nothrow) VisualElementPropertyAnimation();
788 SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, E_OUT_OF_MEMORY, " Memory allocation failed.")
790 r = pAnimationDivider->SetPropertyName(L"bounds");
791 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
793 r = pAnimationDivider->SetDuration(ANIMATION_DURATION);
794 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
796 pAnimationDivider->SetTimingFunction(pTimingFunction);
798 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
800 dividerBounds = pVisualElementDivider->GetBounds();
801 clientBounds = __pSplitPanel->GetBoundsF();
802 firstPaneBounds = pFirstPanelControl->GetBoundsF();
803 dividerBoundsStart = dividerBounds;
805 clientBounds.x = clientBounds.y = 0.0f;
809 case _SPLIT_PANEL_ANIMATION_RIGHT:
811 dividerBoundsStart.x = firstPaneBounds.x + firstPaneBounds.width;
813 dividerBoundsEnd = dividerBounds;
814 dividerBoundsEnd.x = clientBounds.width;
817 case _SPLIT_PANEL_ANIMATION_LEFT:
819 dividerBoundsStart.x = firstPaneBounds.x + firstPaneBounds.width;
821 dividerBoundsEnd = dividerBounds;
822 dividerBoundsEnd.x = clientBounds.x - dividerBounds.width;
825 case _SPLIT_PANEL_ANIMATION_TOP:
827 dividerBoundsStart.y = firstPaneBounds.y + firstPaneBounds.height;
829 dividerBoundsEnd = dividerBounds;
830 dividerBoundsEnd.y = clientBounds.y - dividerBounds.height;
833 case _SPLIT_PANEL_ANIMATION_BOTTOM:
835 dividerBoundsStart.y = firstPaneBounds.y + firstPaneBounds.height;
837 dividerBoundsEnd = dividerBounds;
838 dividerBoundsEnd.y = clientBounds.height;
841 case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
843 dividerBounds = __dividerRectangle;
845 dividerBoundsStart = dividerBounds;
846 dividerBoundsEnd = dividerBounds;
848 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
850 dividerBoundsStart.y = clientBounds.height;
854 dividerBoundsStart.y = clientBounds.y - dividerBounds.height;
858 case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
860 dividerBounds = __dividerRectangle;
862 dividerBoundsStart = dividerBoundsEnd = dividerBounds;
864 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
866 dividerBoundsStart.x = clientBounds.width;
870 dividerBoundsStart.x = clientBounds.x - dividerBounds.width;
876 r = pAnimationDivider->SetStartValue(dividerBoundsStart);
877 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
879 r = pAnimationDivider->SetEndValue(dividerBoundsEnd);
880 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
882 pVisualElementDivider->AddAnimation(L"Bounds", *pAnimationDivider);
884 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
888 delete pAnimationDivider;
894 _SplitPanelPresenter::AnimatePane(int destination)
896 result r = E_SUCCESS;
897 Rectangle clientBounds(0, 0, 0, 0);
898 Rectangle firstPaneBounds(0, 0, 0, 0);
899 Rectangle secondPaneBounds(0, 0, 0, 0);
900 Rectangle dividerRectangle(0, 0, 0, 0);
901 Control* pFirstPanelControl = null;
902 Control* pSecondPanelControl = null;
903 ControlAnimator* pControlAnimatorFirstPane = null;
904 ControlAnimator* pControlAnimatorSecondPane = null;
906 FloatAnimation animationHidePane = FloatAnimation(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
907 FloatAnimation animationShowPane = FloatAnimation(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
909 pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
911 SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
913 pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
915 SysTryReturnResult(NID_UI_CTRL, pSecondPanelControl != null, r, "Propagating.");
917 pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
919 SysTryReturnResult(NID_UI_CTRL, pControlAnimatorFirstPane != null, r, "Propagating.");
921 pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
923 SysTryReturnResult(NID_UI_CTRL, pControlAnimatorSecondPane != null, r, "Propagating.");
925 clientBounds = __pSplitPanel->GetBounds();
926 firstPaneBounds = pFirstPanelControl->GetBounds();
927 secondPaneBounds = pSecondPanelControl->GetBounds();
929 clientBounds.x = clientBounds.y = 0;
931 dividerRectangle = _CoordinateSystemUtils::ConvertToInteger(__dividerRectangle);
935 case _SPLIT_PANEL_ANIMATION_RIGHT:
937 Rectangle secondPaneEndBounds = secondPaneBounds;
938 secondPaneEndBounds.x = clientBounds.x + clientBounds.width + dividerRectangle.width;
940 RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
941 RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
943 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
944 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
946 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
947 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
949 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
950 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
952 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
953 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
955 if (pFirstPanelControl->GetShowState() == false)
957 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
958 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
962 case _SPLIT_PANEL_ANIMATION_LEFT:
964 Rectangle firstPaneEndBounds = firstPaneBounds;
965 firstPaneEndBounds.x = clientBounds.x - firstPaneBounds.width - dividerRectangle.width;
967 RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
968 RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
970 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
971 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
973 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
974 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
976 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
977 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
979 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
980 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
982 if (pSecondPanelControl->GetShowState() == false)
984 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
985 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
989 case _SPLIT_PANEL_ANIMATION_TOP:
991 Rectangle firstPaneEndBounds = firstPaneBounds;
992 firstPaneEndBounds.y = clientBounds.y - firstPaneBounds.height - dividerRectangle.height;
994 RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
995 RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
997 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
998 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1000 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
1001 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1003 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
1004 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1006 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
1007 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1009 if (pSecondPanelControl->GetShowState() == false)
1011 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1012 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1016 case _SPLIT_PANEL_ANIMATION_BOTTOM:
1018 Rectangle secondPaneEndBounds = secondPaneBounds;
1019 secondPaneEndBounds.y = clientBounds.y + clientBounds.height + dividerRectangle.height;
1021 RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1022 RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1024 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
1025 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1027 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
1028 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1030 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
1031 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1033 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
1034 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1036 if (pFirstPanelControl->GetShowState() == false)
1038 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1039 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1043 case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
1045 Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
1046 Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
1048 RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1049 RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1052 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
1053 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1055 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
1056 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1059 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
1060 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1062 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
1063 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1065 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
1067 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1068 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1072 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1073 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1077 case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
1079 Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
1080 Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
1082 RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1083 RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1086 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
1087 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1089 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
1090 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1093 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
1094 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1096 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
1097 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1099 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
1101 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1102 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1106 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1107 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1117 _SplitPanelPresenter::GetPaneControl(SplitPanelPaneOrder paneOrder)
1119 _ControlImpl* pControlImpl = null;
1120 _SplitPanelImpl* pSplitPanelImpl = null;
1121 Control* pControl = null;
1123 pControlImpl = static_cast<_ControlImpl*>(__pSplitPanel->GetUserData());
1124 SysTryReturn(NID_UI_CTRL, pControlImpl != null, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. _ControlImpl is null.");
1126 pSplitPanelImpl = dynamic_cast<_SplitPanelImpl*>(pControlImpl);
1127 SysTryReturn(NID_UI_CTRL, pSplitPanelImpl != null, null, E_SYSTEM, "[E_SYSTEM]A system error has occurred. _SplitPanelImpl is null.");
1129 SplitPanel& splitPanelPublic = pSplitPanelImpl->GetPublic();
1131 pControl = splitPanelPublic.GetPane(paneOrder);
1132 SysTryReturn(NID_UI_CTRL, pControl != null, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1138 _SplitPanelPresenter::GetAnimationStatus(void)
1140 result r = E_SUCCESS;
1142 Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
1143 r = GetLastResult();
1144 SysTryReturn(NID_UI_CTRL, pFirstPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1146 Control* pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
1147 r = GetLastResult();
1148 SysTryReturn(NID_UI_CTRL, pSecondPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1150 ControlAnimator* pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
1151 r = GetLastResult();
1152 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1154 ControlAnimator* pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
1155 r = GetLastResult();
1156 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1158 if (pControlAnimatorFirstPane->GetStatus() == ANIMATOR_STATUS_STOPPED && pControlAnimatorSecondPane->GetStatus() == ANIMATOR_STATUS_STOPPED)
1160 return ANIMATOR_STATUS_STOPPED;
1163 return ANIMATOR_STATUS_PLAYING;
1167 _SplitPanelPresenter::GetRestorePaneBounds(SplitPanelPaneOrder paneOrder)
1170 float height = 0.0f;
1172 FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
1173 FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
1175 float dividerPosition = __pSplitPanel->GetDividerPosition();
1177 FloatRectangle clientBounds = __pSplitPanel->GetBoundsF();
1179 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1181 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
1183 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
1185 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
1189 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
1192 height = clientBounds.height;
1196 __dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height);
1201 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
1203 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
1207 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
1210 width = clientBounds.width;
1214 __dividerRectangle = FloatRectangle(0.0f, dividerPosition, width, height);
1218 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
1220 firstPaneBounds = FloatRectangle(0.0f, 0.0f, __dividerRectangle.x, clientBounds.height);
1221 secondPaneBounds = FloatRectangle(__dividerRectangle.x + __dividerRectangle.width, 0.0f, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width, clientBounds.height);
1225 firstPaneBounds = FloatRectangle(0.0f, 0.0f, clientBounds.width, __dividerRectangle.y);
1226 secondPaneBounds = FloatRectangle(0.0f, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
1229 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
1231 return firstPaneBounds;
1234 return secondPaneBounds;
1237 }}} // Tizen::Ui::Controls