ReactOS  0.4.15-dev-1184-g23e04ae
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 233 of file rosui.h.

Constructor & Destructor Documentation

◆ CUiBox()

CUiBox::CUiBox ( )
inlineprotected

Definition at line 242 of file rosui.h.

243  {
246  }
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239

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 248 of file rosui.h.

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