ReactOS  0.4.15-dev-1619-g69dffed
CUiBox Class Reference

#include <rosui.h>

Inheritance diagram for CUiBox:
Collaboration diagram for CUiBox:

Public Member Functions

virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 

Public Attributes

CUiMargin m_Margin
 
CUiAlignment m_HorizontalAlignment
 
CUiAlignment m_VerticalAlignment
 

Protected Member Functions

 CUiBox ()
 
virtual VOID ComputeRect (RECT parentRect, RECT currentRect, RECT *newRect)
 

Detailed Description

Definition at line 237 of file rosui.h.

Constructor & Destructor Documentation

◆ CUiBox()

CUiBox::CUiBox ( )
inlineprotected

Definition at line 246 of file rosui.h.

247  {
250  }
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243

Member Function Documentation

◆ ComputeContentBounds()

◆ ComputeMinimalSize()

virtual VOID CUiBox::ComputeMinimalSize ( SIZE size)
inlinevirtual

◆ ComputeRect()

virtual VOID CUiBox::ComputeRect ( RECT  parentRect,
RECT  currentRect,
RECT newRect 
)
inlineprotectedvirtual

Definition at line 252 of file rosui.h.

253  {
254  parentRect.left += m_Margin.left;
255  parentRect.right -= m_Margin.right;
256  parentRect.top += m_Margin.top;
257  parentRect.bottom -= m_Margin.bottom;
258 
259  if (parentRect.right < parentRect.left)
260  parentRect.right = parentRect.left;
261 
262  if (parentRect.bottom < parentRect.top)
263  parentRect.bottom = parentRect.top;
264 
265  SIZE szParent = {parentRect.right - parentRect.left, parentRect.bottom - parentRect.top};
266  SIZE szCurrent = {currentRect.right - currentRect.left, currentRect.bottom - currentRect.top};
267 
268  currentRect = parentRect;
269 
270  switch (m_HorizontalAlignment)
271  {
272  case UiAlign_LeftTop:
273  currentRect.right = currentRect.left + szCurrent.cx;
274  break;
275  case UiAlign_Middle:
276  currentRect.left = parentRect.left + (szParent.cx - szCurrent.cx) / 2;
277  currentRect.right = currentRect.left + szCurrent.cx;
278  break;
279  case UiAlign_RightBtm:
280  currentRect.left = currentRect.right - szCurrent.cx;
281  break;
282  default:
283  break;
284  }
285 
286  switch (m_VerticalAlignment)
287  {
288  case UiAlign_LeftTop:
289  currentRect.bottom = currentRect.top + szCurrent.cy;
290  break;
291  case UiAlign_Middle:
292  currentRect.top = parentRect.top + (szParent.cy - szCurrent.cy) / 2;
293  currentRect.bottom = currentRect.top + szCurrent.cy;
294  break;
295  case UiAlign_RightBtm:
296  currentRect.top = currentRect.bottom - szCurrent.cy;
297  break;
298  default:
299  break;
300  }
301 
302  *newRect = currentRect;
303  }
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
LONG cx
Definition: windef.h:334
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
LONG bottom
Definition: windef.h:309
CUiMargin m_Margin
Definition: rosui.h:240
LONG cy
Definition: windef.h:335

Referenced by CUiPanel::OnParentSize(), CUiWindow< CWindowImpl< CAppInfoDisplay > >::OnParentSize(), and CUiSplitPanel::OnParentSize().

◆ CountSizableChildren()

◆ OnParentSize()

virtual HDWP CUiBox::OnParentSize ( RECT  parentRect,
HDWP  hDwp 
)
inlinevirtual

Member Data Documentation

◆ m_HorizontalAlignment

◆ m_Margin

◆ m_VerticalAlignment


The documentation for this class was generated from the following file: