ReactOS 0.4.15-dev-7931-gfd331f1
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 252 of file rosui.h.

Constructor & Destructor Documentation

◆ CUiBox()

CUiBox::CUiBox ( )
inlineprotected

Definition at line 261 of file rosui.h.

262 {
265 }
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:257
CUiAlignment m_VerticalAlignment
Definition: rosui.h:258
@ UiAlign_LeftTop
Definition: rosui.h:246

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

269 {
270 parentRect.left += m_Margin.left;
271 parentRect.right -= m_Margin.right;
272 parentRect.top += m_Margin.top;
273 parentRect.bottom -= m_Margin.bottom;
274
275 if (parentRect.right < parentRect.left)
276 parentRect.right = parentRect.left;
277
278 if (parentRect.bottom < parentRect.top)
279 parentRect.bottom = parentRect.top;
280
281 SIZE szParent = {parentRect.right - parentRect.left, parentRect.bottom - parentRect.top};
282 SIZE szCurrent = {currentRect.right - currentRect.left, currentRect.bottom - currentRect.top};
283
284 currentRect = parentRect;
285
286 switch (m_HorizontalAlignment)
287 {
288 case UiAlign_LeftTop:
289 currentRect.right = currentRect.left + szCurrent.cx;
290 break;
291 case UiAlign_Middle:
292 currentRect.left = parentRect.left + (szParent.cx - szCurrent.cx) / 2;
293 currentRect.right = currentRect.left + szCurrent.cx;
294 break;
295 case UiAlign_RightBtm:
296 currentRect.left = currentRect.right - szCurrent.cx;
297 break;
298 default:
299 break;
300 }
301
302 switch (m_VerticalAlignment)
303 {
304 case UiAlign_LeftTop:
305 currentRect.bottom = currentRect.top + szCurrent.cy;
306 break;
307 case UiAlign_Middle:
308 currentRect.top = parentRect.top + (szParent.cy - szCurrent.cy) / 2;
309 currentRect.bottom = currentRect.top + szCurrent.cy;
310 break;
311 case UiAlign_RightBtm:
312 currentRect.top = currentRect.bottom - szCurrent.cy;
313 break;
314 default:
315 break;
316 }
317
318 *newRect = currentRect;
319 }
CUiMargin m_Margin
Definition: rosui.h:255
@ UiAlign_Middle
Definition: rosui.h:247
@ UiAlign_RightBtm
Definition: rosui.h:248
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306

Referenced by CUiPanel::OnParentSize(), CUiWindow< T >::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: