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"
36 using namespace Tizen::Ui;
37 using namespace Tizen::Graphics;
38 using namespace Tizen::Ui::Animations;
40 namespace Tizen { namespace Ui { namespace Controls
43 _SplitPanelPresenter::_SplitPanelPresenter(void)
45 , __pSplitPanelModel(null)
46 , __dividerMaximumPosition(0)
47 , __dividerMinimumPosition(0)
48 , __splitPanelDividerPressed(false)
49 , __setFirstDividerPositionChangeEvent(true)
50 , __dividerRectangle(0,0,0,0)
51 , __dividerThumbRectangle(0,0,0,0)
52 , __pDividerPressedBackgroundBitmap(null)
53 , __pDividerBackgroundBitmap(null)
54 , __pDividerBackgroundEffectBitmap(null)
55 , __pDividerThumbBitmap(null)
56 , __transactionIdMaximize(0)
57 , __transactionIdRestore(0)
58 , __controlAnimatorAnimationInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
59 , __visualElementAnimationInterpolator(L"Linear")
61 GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_NORMAL, __dividerBackgroundColor);
62 GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_PRESSED, __dividerPressedBackgroundColor);
65 _SplitPanelPresenter::~_SplitPanelPresenter(void)
67 delete __pSplitPanelModel;
68 __pSplitPanelModel = null;
70 delete __pDividerPressedBackgroundBitmap;
71 __pDividerPressedBackgroundBitmap = null;
73 delete __pDividerBackgroundBitmap;
74 __pDividerBackgroundBitmap = null;
76 delete __pDividerThumbBitmap;
77 __pDividerThumbBitmap = null;
79 delete __pDividerBackgroundEffectBitmap;
80 __pDividerBackgroundEffectBitmap = null;
84 _SplitPanelPresenter::Construct(const _SplitPanel& splitPanel, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection)
88 _SplitPanelModel* pModel = new (std::nothrow) _SplitPanelModel;
89 SysTryReturnResult(NID_UI_CTRL, pModel, E_OUT_OF_MEMORY, "Memory allocation failed.");
91 r = SetModel(*pModel);
92 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to set the model.");
94 r = pModel->Construct();
95 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to construct _SplitPanelModel instance.");
97 __pSplitPanel = const_cast <_SplitPanel*>(&splitPanel);
98 SysTryCatch(NID_UI_CTRL, __pSplitPanel != null, , E_SYSTEM, "[E_SYSTEM] A system error has occurred. _SplitPanel instance is null.");
100 __pSplitPanelModel->SetDividerStyle(splitPanelDividerStyle);
102 r = LoadBitmap(splitPanelDividerDirection);
103 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
105 AdjustDividerRectangle();
107 __controlAnimatorAnimationInterpolator = ANIMATION_INTERPOLATOR_EASE_IN;
108 __visualElementAnimationInterpolator = L"EaseIn";
120 _SplitPanelPresenter::CheckDividerTouchRegion(int positionX, int positionY)
122 int dividerPosition = __pSplitPanel->GetDividerPosition();
124 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
126 Bitmap* pThumbBitmap = __pDividerThumbBitmap;
127 if ((positionX >= dividerPosition)
128 && (positionX <= dividerPosition + pThumbBitmap->GetWidth()))
135 Bitmap* pThumbBitmap = __pDividerThumbBitmap;
136 if ((positionY >= dividerPosition)
137 && (positionY <= dividerPosition + pThumbBitmap->GetHeight()))
147 _SplitPanelPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
149 Point point = touchinfo.GetCurrentPosition();
151 if (CheckDividerTouchRegion(point.x, point.y) == true)
153 __splitPanelDividerPressed = true;
162 _SplitPanelPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
164 if (__splitPanelDividerPressed == true)
166 __splitPanelDividerPressed = false;
174 _SplitPanelPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
176 if (__pSplitPanel != &source || __splitPanelDividerPressed == false )
181 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
186 Point point = touchinfo.GetCurrentPosition();
188 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
190 // Min, Max Position Check.
191 if ((__pSplitPanel->GetMinimumDividerPosition() > point.x)
192 || (__pSplitPanel->GetMaximumDividerPosition() < point.x))
197 Bitmap* pThumbBitmap = __pDividerThumbBitmap;
199 if (point.x <= __pSplitPanel->GetBounds().width - pThumbBitmap->GetWidth())
201 __pSplitPanel->SetDividerPosition(point.x);
206 // Min, Max Position Check.
207 if ((__pSplitPanel->GetMinimumDividerPosition() > point.y)
208 || (__pSplitPanel->GetMaximumDividerPosition() < point.y))
213 Bitmap* pThumbBitmap = __pDividerThumbBitmap;
215 if (point.y <= __pSplitPanel->GetBounds().height - pThumbBitmap->GetHeight())
217 __pSplitPanel->SetDividerPosition(point.y);
221 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
229 _SplitPanelPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
231 if (__splitPanelDividerPressed == true)
233 __splitPanelDividerPressed = false;
241 _SplitPanelPresenter::OnTapGestureDetected(_TouchTapGestureDetector& gesture)
243 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
248 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_DOUBLE_PRESSED);
254 _SplitPanelPresenter::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
260 _SplitPanelPresenter::SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle)
262 __pSplitPanelModel->SetDividerStyle(splitPanelDividerStyle);
267 SplitPanelDividerStyle
268 _SplitPanelPresenter::GetDividerStyle(void) const
270 return __pSplitPanelModel->GetDividerStyle();
274 _SplitPanelPresenter::GetDividerRectangle(void) const
276 return __dividerRectangle;
280 _SplitPanelPresenter::MaximizePane(SplitPanelPaneOrder paneOrder)
282 result r = E_SUCCESS;
284 if (IsPaneMaximized(paneOrder))
288 else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
290 AnimationTransaction::Stop(__transactionIdMaximize);
291 AnimationTransaction::Stop(__transactionIdRestore);
296 ChangePaneOrder(paneOrder);
298 AnimationTransaction::Begin(__transactionIdMaximize);
300 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
302 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
304 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RIGHT);
305 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
307 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RIGHT);
308 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
312 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_LEFT);
313 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
315 r = AnimatePane(_SPLIT_PANEL_ANIMATION_LEFT);
316 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
321 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
323 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_BOTTOM);
324 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
326 r = AnimatePane(_SPLIT_PANEL_ANIMATION_BOTTOM);
327 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
331 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_TOP);
332 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
334 r = AnimatePane(_SPLIT_PANEL_ANIMATION_TOP);
335 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
339 AnimationTransaction::Commit();
341 __pSplitPanelModel->SetPaneMaximumState(true);
342 __pSplitPanelModel->SetMaximizedPaneOrder(paneOrder);
347 AnimationTransaction::Discard();
353 _SplitPanelPresenter::IsPaneMaximized(SplitPanelPaneOrder paneOrder) const
355 if ((__pSplitPanelModel->GetPaneMaximumState() == true)
356 && (__pSplitPanelModel->GetMaximizedPaneOrder() == paneOrder))
365 _SplitPanelPresenter::RestorePane(void)
367 result r = E_SUCCESS;
369 if (__pSplitPanelModel->GetPaneMaximumState() == false)
373 else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
375 AnimationTransaction::Stop(__transactionIdMaximize);
376 AnimationTransaction::Stop(__transactionIdRestore);
381 AnimationTransaction::Begin(__transactionIdRestore);
383 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
385 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
386 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
388 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
389 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
393 r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
394 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
396 r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
397 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
400 AnimationTransaction::Commit();
402 __pSplitPanelModel->SetPaneMaximumState(false);
407 AnimationTransaction::Discard();
413 _SplitPanelPresenter::Draw(void)
415 if (__pSplitPanelModel->GetPaneMaximumState() == false && GetAnimationStatus() == ANIMATOR_STATUS_STOPPED)
417 //adjust divider rectangle
418 AdjustDividerRectangle();
420 Canvas* pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
421 SysTryReturnResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "Propagating.");
428 Rectangle dividerBounds = __dividerRectangle;
432 if (__splitPanelDividerPressed == true)
434 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
438 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundBitmap);
442 pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundEffectBitmap);
445 if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
447 Rectangle dividerThumbBounds = __dividerThumbRectangle;
448 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
450 dividerThumbBounds.x = 0;
454 dividerThumbBounds.y = 0;
457 pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap);
467 _SplitPanelPresenter::LoadBitmap(SplitPanelDividerDirection splitPanelDividerDirection)
469 result r = E_SUCCESS;
470 Bitmap *pDividerBackgroundBitmap = null;
472 // Modified - Changeable Color / Resource ( Fixed Style )
473 r = GET_BITMAP_CONFIG_N(SPLITPANEL::DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pDividerBackgroundBitmap);
474 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Failed to load bitmap.");
476 if (splitPanelDividerDirection == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
478 r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
479 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
480 r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
481 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
485 r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
486 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
487 r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
488 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
491 __pDividerPressedBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerPressedBackgroundColor);
493 SysTryCatch(NID_UI_CTRL, (__pDividerPressedBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
495 __pDividerBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerBackgroundColor);
497 SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
499 delete pDividerBackgroundBitmap;
504 delete pDividerBackgroundBitmap;
505 delete __pDividerBackgroundEffectBitmap;
506 delete __pDividerPressedBackgroundBitmap;
507 delete __pDividerThumbBitmap;
513 _SplitPanelPresenter::RecalcSplitPanel(void)
515 //adjust divider rectangle
516 AdjustDividerRectangle();
525 _SplitPanelPresenter::OnChangeLayout(_ControlOrientation orientation)
527 AnimationTransaction::Stop(__transactionIdMaximize);
528 AnimationTransaction::Stop(__transactionIdRestore);
534 _SplitPanelPresenter::OnBoundsChanged(void)
541 _SplitPanelPresenter::SetModel(const _SplitPanelModel& splitPanelModel)
543 __pSplitPanelModel = const_cast<_SplitPanelModel*>(&splitPanelModel);
549 _SplitPanelPresenter::SetPaneBounds(void)
551 result r = E_SUCCESS;
552 Rectangle firstPaneBounds(0, 0, 0, 0);
553 Rectangle secondPaneBounds(0, 0, 0, 0);
555 Rectangle clientBounds = __pSplitPanel->GetBounds();
557 _Control* pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
559 _Control* pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
561 clientBounds.x = clientBounds.y = 0;
563 if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST))
565 firstPaneBounds = clientBounds;
567 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
569 secondPaneBounds = Rectangle(clientBounds.width + __dividerRectangle.width, 0, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height);
573 secondPaneBounds = Rectangle(0, clientBounds.height + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
576 else if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_SECOND))
578 secondPaneBounds = clientBounds;
580 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
582 firstPaneBounds = Rectangle(clientBounds.x -__dividerRectangle.x - __dividerRectangle.width, 0, __dividerRectangle.x, clientBounds.height);
586 firstPaneBounds = Rectangle(0, clientBounds.y -__dividerRectangle.y - __dividerRectangle.height, clientBounds.width, __dividerRectangle.y);
591 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
593 firstPaneBounds = Rectangle(0, 0, __dividerRectangle.x, clientBounds.height);
594 secondPaneBounds = Rectangle(__dividerRectangle.x + __dividerRectangle.width, 0, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height);
598 firstPaneBounds = Rectangle(0, 0, clientBounds.width, __dividerRectangle.y);
599 secondPaneBounds = Rectangle(0, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
604 bool resizable = true;
607 if (pFirstPane != null)
609 movable = pFirstPane->IsMovable();
610 resizable = pFirstPane->IsResizable();
612 pFirstPane->SetMovable(true);
613 pFirstPane->SetResizable(true);
615 r = pFirstPane->SetBounds(firstPaneBounds);
616 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
618 pFirstPane->SetMovable(movable);
619 pFirstPane->SetResizable(resizable);
622 if (pSecondPane != null)
624 movable = pSecondPane->IsMovable();
625 resizable = pSecondPane->IsResizable();
627 pSecondPane->SetMovable(true);
628 pSecondPane->SetResizable(true);
630 r = pSecondPane->SetBounds(secondPaneBounds);
631 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
633 pSecondPane->SetMovable(movable);
634 pSecondPane->SetResizable(resizable);
637 if ((pFirstPane != null) && (pSecondPane != null))
639 if (__setFirstDividerPositionChangeEvent == true)
641 __setFirstDividerPositionChangeEvent = false;
642 __pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
650 _SplitPanelPresenter::AdjustDividerRectangle(void)
652 int dividerPosition = __pSplitPanel->GetDividerPosition();
653 // Check - Divider Postion. ( Screen Size Over / Maximum Divider Position )
655 Rectangle clientBounds = __pSplitPanel->GetBounds();
659 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
661 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
663 Bitmap* pThumbBitmap = __pDividerThumbBitmap;
665 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
667 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
671 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
674 height = clientBounds.height;
678 __dividerRectangle = Rectangle(dividerPosition, 0, width, height);
679 __dividerThumbRectangle = Rectangle(dividerPosition, ((height - pThumbBitmap->GetHeight()) / 2), pThumbBitmap->GetWidth(), pThumbBitmap->GetHeight());
684 Bitmap* pThumbBitmap = __pDividerThumbBitmap;
686 width = clientBounds.width;
688 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
690 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
694 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
699 __dividerRectangle = Rectangle(0, dividerPosition, width, height);
700 __dividerThumbRectangle = Rectangle(((width - pThumbBitmap->GetWidth()) / 2), dividerPosition, pThumbBitmap->GetWidth(), pThumbBitmap->GetHeight());
704 __pSplitPanel->SetDividerVisualElementBounds(__dividerRectangle);
708 _SplitPanelPresenter::ChangePaneOrder(SplitPanelPaneOrder paneOrder)
710 result r = E_SUCCESS;
712 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
714 _Control* pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
715 SysTryReturnVoidResult(NID_UI_CTRL, pFirstPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
717 r = __pSplitPanel->DetachChild(*pFirstPane);
718 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
720 r = __pSplitPanel->AttachChild(*pFirstPane);
721 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
725 _Control* pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
726 SysTryReturnVoidResult(NID_UI_CTRL, pSecondPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
728 r = __pSplitPanel->DetachChild(*pSecondPane);
729 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
731 r = __pSplitPanel->AttachChild(*pSecondPane);
732 SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
739 _SplitPanelPresenter::AnimateDivider(int destination)
741 result r = E_SUCCESS;
743 FloatRectangle dividerBoundsStartF(0.0f, 0.0f, 0.0f, 0.0f);
744 FloatRectangle dividerBoundsEndF(0.0f, 0.0f, 0.0f, 0.0f);
746 Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
748 SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
750 VisualElement* pVisualElementDivider = __pSplitPanel->GetDividerVisualElement();
752 SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, r, "Propagating.");
754 pVisualElementDivider->RemoveAllAnimations();
756 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
758 FloatRectangle dividerBoundsF = pVisualElementDivider->GetBounds();
759 Rectangle clientBounds = __pSplitPanel->GetBounds();
760 Rectangle firstPaneBounds = pFirstPanelControl->GetBounds();
762 const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementAnimationInterpolator);
764 SysTryReturnResult(NID_UI_CTRL, pTimingFunction != null, r, "Propagating.");
766 VisualElementPropertyAnimation* pAnimationDivider = new (std::nothrow) VisualElementPropertyAnimation();
767 SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, E_OUT_OF_MEMORY, " Memory allocation failed.")
769 r = pAnimationDivider->SetPropertyName(L"bounds");
770 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
772 r = pAnimationDivider->SetDuration(ANIMATION_DURATION);
773 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
775 pAnimationDivider->SetTimingFunction(pTimingFunction);
777 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
779 dividerBoundsF = pVisualElementDivider->GetBounds();
780 dividerBoundsStartF = dividerBoundsF;
782 clientBounds.x = clientBounds.y = 0;
786 case _SPLIT_PANEL_ANIMATION_RIGHT:
788 dividerBoundsStartF.x = firstPaneBounds.x + firstPaneBounds.width;
790 dividerBoundsEndF = dividerBoundsF;
791 dividerBoundsEndF.x = (float)clientBounds.width;
794 case _SPLIT_PANEL_ANIMATION_LEFT:
796 dividerBoundsStartF.x = firstPaneBounds.x + firstPaneBounds.width;
798 dividerBoundsEndF = dividerBoundsF;
799 dividerBoundsEndF.x = (float)clientBounds.x - dividerBoundsF.width;
802 case _SPLIT_PANEL_ANIMATION_TOP:
804 dividerBoundsStartF.y = firstPaneBounds.y + firstPaneBounds.height;
806 dividerBoundsEndF = dividerBoundsF;
807 dividerBoundsEndF.y = (float)clientBounds.y - dividerBoundsF.height;
810 case _SPLIT_PANEL_ANIMATION_BOTTOM:
812 dividerBoundsStartF.y = firstPaneBounds.y + firstPaneBounds.height;
814 dividerBoundsEndF = dividerBoundsF;
815 dividerBoundsEndF.y = (float)clientBounds.height;
818 case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
820 dividerBoundsF = FloatRectangle((float)__dividerRectangle.x, (float)__dividerRectangle.y,
821 (float)__dividerRectangle.width, (float)__dividerRectangle.height);
823 dividerBoundsStartF = dividerBoundsF;
824 dividerBoundsEndF = dividerBoundsF;
826 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
828 dividerBoundsStartF.y = (float)clientBounds.height;
832 dividerBoundsStartF.y = (float)clientBounds.y - dividerBoundsF.height;
836 case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
838 dividerBoundsF = FloatRectangle((float)__dividerRectangle.x, (float)__dividerRectangle.y,
839 (float)__dividerRectangle.width, (float)__dividerRectangle.height);
841 dividerBoundsStartF = dividerBoundsF;
842 dividerBoundsEndF = dividerBoundsF;
844 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
846 dividerBoundsStartF.x = (float)clientBounds.width;
850 dividerBoundsStartF.x = (float)clientBounds.x - dividerBoundsF.width;
856 r = pAnimationDivider->SetStartValue(dividerBoundsStartF);
857 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
859 r = pAnimationDivider->SetEndValue(dividerBoundsEndF);
860 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
862 pVisualElementDivider->AddAnimation(L"Bounds", *pAnimationDivider);
864 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
868 delete pAnimationDivider;
874 _SplitPanelPresenter::AnimatePane(int destination)
876 result r = E_SUCCESS;
878 Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
880 SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
882 Control* pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
884 SysTryReturnResult(NID_UI_CTRL, pSecondPanelControl != null, r, "Propagating.");
886 ControlAnimator* pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
888 SysTryReturnResult(NID_UI_CTRL, pControlAnimatorFirstPane != null, r, "Propagating.");
890 ControlAnimator* pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
892 SysTryReturnResult(NID_UI_CTRL, pControlAnimatorSecondPane != null, r, "Propagating.");
894 Rectangle clientBounds = __pSplitPanel->GetBounds();
895 Rectangle firstPaneBounds = pFirstPanelControl->GetBounds();
896 Rectangle secondPaneBounds = pSecondPanelControl->GetBounds();
898 FloatAnimation animationHidePane(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
899 FloatAnimation animationShowPane(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
901 clientBounds.x = clientBounds.y = 0;
905 case _SPLIT_PANEL_ANIMATION_RIGHT:
907 Rectangle secondPaneEndBounds = secondPaneBounds;
908 secondPaneEndBounds.x = clientBounds.x + clientBounds.width + __dividerRectangle.width;
910 RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
911 RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
913 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
914 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
916 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
917 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
919 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
920 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
922 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
923 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
925 if (pFirstPanelControl->GetShowState() == false)
927 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
928 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
932 case _SPLIT_PANEL_ANIMATION_LEFT:
934 Rectangle firstPaneEndBounds = firstPaneBounds;
935 firstPaneEndBounds.x = clientBounds.x - firstPaneBounds.width - __dividerRectangle.width;
937 RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
938 RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
940 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
941 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
943 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
944 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
946 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
947 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
949 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
950 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
952 if (pSecondPanelControl->GetShowState() == false)
954 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
955 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
959 case _SPLIT_PANEL_ANIMATION_TOP:
961 Rectangle firstPaneEndBounds = firstPaneBounds;
962 firstPaneEndBounds.y = clientBounds.y - firstPaneBounds.height - __dividerRectangle.height;
964 RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
965 RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
967 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
968 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
970 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
971 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
973 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
974 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
976 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
977 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
979 if (pSecondPanelControl->GetShowState() == false)
981 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
982 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
986 case _SPLIT_PANEL_ANIMATION_BOTTOM:
988 Rectangle secondPaneEndBounds = secondPaneBounds;
989 secondPaneEndBounds.y = clientBounds.y + clientBounds.height + __dividerRectangle.height;
991 RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
992 RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
994 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
995 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
997 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
998 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1000 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
1001 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1003 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
1004 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1006 if (pFirstPanelControl->GetShowState() == false)
1008 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1009 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1013 case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
1015 Rectangle firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
1016 Rectangle secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
1018 RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1019 RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1022 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
1023 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1025 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
1026 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1029 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
1030 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1032 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
1033 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1035 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
1037 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1038 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1042 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1043 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1047 case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
1049 Rectangle firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
1050 Rectangle secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
1052 RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1053 RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
1056 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
1057 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1059 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
1060 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1063 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
1064 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1066 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
1067 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1069 if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
1071 r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1072 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1076 r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
1077 SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
1087 _SplitPanelPresenter::GetPaneControl(SplitPanelPaneOrder paneOrder)
1089 _ControlImpl* pControlImpl = static_cast<_ControlImpl*>(__pSplitPanel->GetUserData());
1090 SysTryReturn(NID_UI_CTRL, pControlImpl != null, null, E_SYSTEM, "[E_SYSTEM] A system error has occurred. _ControlImpl is null.");
1092 _SplitPanelImpl* pSplitPanelImpl = dynamic_cast<_SplitPanelImpl*>(pControlImpl);
1093 SysTryReturn(NID_UI_CTRL, pSplitPanelImpl != null, null, E_SYSTEM, "[E_SYSTEM]A system error has occurred. _SplitPanelImpl is null.");
1095 SplitPanel& splitPanelPublic = pSplitPanelImpl->GetPublic();
1097 Control* pControl = splitPanelPublic.GetPane(paneOrder);
1098 SysTryReturn(NID_UI_CTRL, pControl != null, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
1104 _SplitPanelPresenter::GetAnimationStatus(void)
1106 result r = E_SUCCESS;
1108 Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
1109 r = GetLastResult();
1110 SysTryReturn(NID_UI_CTRL, pFirstPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1112 Control* pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
1113 r = GetLastResult();
1114 SysTryReturn(NID_UI_CTRL, pSecondPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1116 ControlAnimator* pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
1117 r = GetLastResult();
1118 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1120 ControlAnimator* pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
1121 r = GetLastResult();
1122 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
1124 if (pControlAnimatorFirstPane->GetStatus() == ANIMATOR_STATUS_STOPPED && pControlAnimatorSecondPane->GetStatus() == ANIMATOR_STATUS_STOPPED)
1126 return ANIMATOR_STATUS_STOPPED;
1129 return ANIMATOR_STATUS_PLAYING;
1133 _SplitPanelPresenter::GetRestorePaneBounds(SplitPanelPaneOrder paneOrder)
1138 Rectangle firstPaneBounds(0, 0, 0, 0);
1139 Rectangle secondPaneBounds(0, 0, 0, 0);
1141 int dividerPosition = __pSplitPanel->GetDividerPosition();
1143 Rectangle clientBounds = __pSplitPanel->GetBounds();
1145 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1147 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
1149 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
1151 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
1155 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
1158 height = clientBounds.height;
1162 __dividerRectangle = Rectangle(dividerPosition, 0, width, height);
1167 width = clientBounds.width;
1169 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
1171 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
1175 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
1180 __dividerRectangle = Rectangle(0, dividerPosition, width, height);
1184 if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
1186 firstPaneBounds = Rectangle(0, 0, __dividerRectangle.x, clientBounds.height);
1187 secondPaneBounds = Rectangle(__dividerRectangle.x + __dividerRectangle.width, 0, clientBounds.width - __dividerRectangle.x - __dividerRectangle.width,clientBounds.height);
1191 firstPaneBounds = Rectangle(0, 0, clientBounds.width, __dividerRectangle.y);
1192 secondPaneBounds = Rectangle(0, __dividerRectangle.y + __dividerRectangle.height, clientBounds.width, clientBounds.height - __dividerRectangle.y - __dividerRectangle.height);
1195 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
1197 return firstPaneBounds;
1200 return secondPaneBounds;
1203 }}} // Tizen::Ui::Controls