32 enableAnimate = FALSE;
38 pChild->SetVisible(FALSE, FALSE);
55 m_animator.SetOwnerSizeRange(rcLayout.Size(), szPage);
73 pChild->SetVisible(TRUE, FALSE);
89 if (iPage < 0 || iPage >= (
int)
m_childs.GetCount())
107 pFrom->Move(CRect(rc.TopLeft(), szPage));
113 pTo->Move(CRect(rc.TopLeft(), szPage));
120 for (UINT i = 0; i <
m_childs.GetCount(); i++)
123 CRect rcPage(rc.TopLeft(), szPage);
140 __baseCls::OnDestroy();
146 __baseCls::OnContainerChanged(pOldContainer, pNewContainer);
151 __baseCls::OnSize(nType, size);
160 pFrom->SetVisible(FALSE, TRUE);
185 pPage->GetDesiredSize(&szRet, nParentWid, nParentHei);
193 BOOL getSize = FALSE;
200 if (ret.cx < szChild.cx)
202 if (ret.cy < szChild.cy)
222 BOOL bRet = __baseCls::CreateChildren(xmlNode);
263 for (
int i = 0; i < nChilds; i++)
286 if (iChild < 0 || iChild > (
int)
m_childs.GetCount())
289 return (IWindow *)
this;
295 IWindow *pChild =
GetPage(iChild);
298 SStackPage *pPage = sobj_cast<SStackPage>(pChild);
307 IWindow *pChild =
GetPage(iChild);
310 SStackPage *pPage = sobj_cast<SStackPage>(pChild);
321 CSize szPage = rc.Size();
326 if (pLayoutParam->IsWrapContent(Any))
328 int nParentWid = -1, nParentHei = -1;
329 if (!pLayoutParam->IsWrapContent(Horz))
330 nParentWid = rc.Width();
331 if (!pLayoutParam->IsWrapContent(Vert))
332 nParentHei = rc.Height();
333 pPage->GetDesiredSize(&szPage, nParentWid, nParentHei);
345 m_pOwner->GetChildrenLayoutRect(&rc);
350 m_pTo->SetVisible(TRUE, FALSE);
358 m_pTo->SetAlpha(255);
368 __baseCls::start(pTimerlineMgr);
386 BYTE a = m_evalAlphaFrom.evaluate(fraction);
395 RECT rc1 = m_evalRcFrom.evaluate(fraction);
416 m_pOwner->GetChildrenLayoutRect(&rc);
420 m_evalAlphaFrom.setRange(255, 0);
431 rc2.top = rc2.bottom;
432 m_evalRcFrom.setRange(rc, rc2);
434 rc3.bottom = rc3.top;
441 rc2.bottom = rc2.top;
442 m_evalRcFrom.setRange(rc, rc2);
444 rc3.top = rc3.bottom;
454 rc2.left = rc2.right;
455 m_evalRcFrom.setRange(rc, rc2);
457 rc3.right = rc3.left;
464 rc2.right = rc2.left;
465 m_evalRcFrom.setRange(rc, rc2);
467 rc3.left = rc3.right;
479 rc2.OffsetRect(0, rc.Height());
480 m_evalRcFrom.setRange(rc, rc2);
482 rc3.OffsetRect(0, -rc.Height());
488 rc2.OffsetRect(0, -rc.Height());
489 m_evalRcFrom.setRange(rc, rc2);
491 rc3.OffsetRect(0, rc.Height());
500 rc2.OffsetRect(rc.Width(), 0);
501 m_evalRcFrom.setRange(rc, rc2);
503 rc3.OffsetRect(-rc.Width(), 0);
509 rc2.OffsetRect(-rc.Width(), 0);
510 m_evalRcFrom.setRange(rc, rc2);
512 rc3.OffsetRect(rc.Width(), 0);
Definition of the SStackView and related classes.
A page within a stack view.
BOOL IsVertAnimate() const
Checks if vertical animation is enabled.
StackViewAniStyle GetAnimateStyle() const
Gets the animation style.
BOOL IsVertChildAnimate(int iChild) const
Checks if vertical animation is enabled for a child.
SIZE MeasureChildren(int nParentWid, int nParentHei) override
Measures the size of child windows.
IWindow * GetIChild(int iChild) SCONST OVERRIDE
Gets a child window by index.
void OnSize(UINT nType, CSize size)
Handles the size change of the window.
void OnDestroy()
Handles the destruction of the window.
SViewSwitchAnimator m_animator
IWindow * GetSelPage() SCONST OVERRIDE
Gets the selected page.
void BuildChildsArray(BOOL updateSel)
Builds the array of child windows.
BOOL SelectPage(int iView, BOOL enableAnimate=TRUE) OVERRIDE
Selects a page.
StackViewAniStyle GetChildAnimateStyle(int iChild) const
Gets the animation style of a child.
~SStackView(void)
Destructor for SStackView.
StackViewAniStyle m_aniStyle
BOOL CreateChildren(SXmlNode xmlNode) override
Creates child windows from an XML node.
SArray< SWindow * > m_childs
void OnContainerChanged(ISwndContainer *pOldContainer, ISwndContainer *pNewContainer) override
Handles the change of the container.
void OnAfterRemoveChild(SWindow *pChild) override
Handles the removal of a child window.
void SetAniStyle(StackViewAniStyle aniStyle) OVERRIDE
Sets the animation style.
void OnAfterInsertChild(SWindow *pChild) override
Handles the insertion of a child window.
SStackView(void)
Constructor for SStackView.
CSize GetChildSize(IWindow *pPage) const
Gets the size of a child window.
IWindow * GetPage(int iPage) SCONST OVERRIDE
Gets a page by index.
void onAnimationEnd(IValueAnimator *pAnimator) OVERRIDE
Handles the end of an animation.
void SetAniDir(BOOL bVert) OVERRIDE
Sets the animation direction.
void UpdateChildrenPosition() OVERRIDE
Updates the positions of child windows.
BOOL isStarted() SCONST OVERRIDE
Checks if the animation has been started.
float getAnimatedFraction() SCONST OVERRIDE
Returns the current animation fraction.
void end() OVERRIDE
Ends the animation.
void initEvaluator()
Initializes the evaluators.
void onEvaluateValue(float fraction) OVERRIDE
Evaluates the value at a given fraction.
StackViewAniStyle m_aniStyle
void start(ITimelineHandlersMgr *pTimerlineMgr) OVERRIDE
Starts the animation.
TypeEvaluator< SIZE > m_evalOwnerSize
void SetOwnerSizeRange(SIZE szFrom, SIZE szTo)
Sets the owner size range.
TypeEvaluator< RECT > m_evalRcTo
SAutoRefPtr< IWindow > m_pFrom
void OnOwnerResize()
Handles owner resize.
SAutoRefPtr< IWindow > m_pTo
SIZE GetOwnerSize() const
Gets the owner size.
TypeEvaluator< BYTE > m_evalAlphaTo
void GetDesiredSize(SIZE *psz, int nParentWid, int nParentHei) OVERRIDE
Retrieves the desired size of the window.
void SetVisible(BOOL bVisible, BOOL bUpdate=FALSE) OVERRIDE
Sets the visibility of the window.
UINT GetChildrenCount() SCONST OVERRIDE
Retrieves the number of child windows.
BOOL IsVisible(BOOL bCheckParent=FALSE) SCONST OVERRIDE
Checks if the window is visible.
ISwndContainer * GetContainer() OVERRIDE
Retrieves the container associated with this window.
void GetChildrenLayoutRect(RECT *prc) SCONST OVERRIDE
Retrieves the layout rectangle of the children.
ILayoutParam * GetLayoutParam() SCONST OVERRIDE
Retrieves the layout parameter object associated with the window.
SWindow * GetWindow(int uCode) const
Retrieves a window based on a given code.
void Invalidate() OVERRIDE
Invalidates the entire window.
Class representing an XML node.
SOUI Window Container Interface.