ReactOS  0.4.14-dev-317-g96040ec
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()

virtual VOID CUiBox::ComputeContentBounds ( RECT rect)
inlinevirtual

◆ ComputeMinimalSize()

virtual VOID CUiBox::ComputeMinimalSize ( SIZE size)
inlinevirtual

Reimplemented in CUiSplitPanel, CUiWindow< T >, CUiWindow< CTreeView >, CUiWindow< CListView >, CUiWindow< CToolbar<> >, CUiWindow< CRichEdit >, CUiWindow< CSearchBar >, CUiWindow< CStatusBar >, and CUiPanel.

Definition at line 303 of file rosui.h.

304  {
305  // Override in subclass
306  size->cx = max(size->cx, 0);
307  size->cy = min(size->cy, 0);
308  };
#define max(a, b)
Definition: svc.c:63
GLsizeiptr size
Definition: glext.h:5919
#define min(a, b)
Definition: monoChain.cc:55

Referenced by CUiWindow< CStatusBar >::ComputeMinimalSize().

◆ 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:292
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
LONG cx
Definition: windef.h:319
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
LONG bottom
Definition: windef.h:294
CUiMargin m_Margin
Definition: rosui.h:236
LONG cy
Definition: windef.h:320

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

◆ CountSizableChildren()

virtual DWORD_PTR CUiBox::CountSizableChildren ( )
inlinevirtual

Reimplemented in CUiSplitPanel, CUiWindow< T >, CUiWindow< CTreeView >, CUiWindow< CListView >, CUiWindow< CToolbar<> >, CUiWindow< CRichEdit >, CUiWindow< CSearchBar >, CUiWindow< CStatusBar >, and CUiPanel.

Definition at line 315 of file rosui.h.

316  {
317  // Override in subclass
318  return 0;
319  };

◆ OnParentSize()

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

Reimplemented in CUiSplitPanel, CUiWindow< T >, CUiWindow< CTreeView >, CUiWindow< CListView >, CUiWindow< CToolbar<> >, CUiWindow< CRichEdit >, CUiWindow< CSearchBar >, CUiWindow< CStatusBar >, and CUiPanel.

Definition at line 321 of file rosui.h.

322  {
323  // Override in subclass
324  return NULL;
325  };
smooth NULL
Definition: ftsmooth.c:416

Member Data Documentation

◆ m_HorizontalAlignment

◆ m_Margin

CUiMargin CUiBox::m_Margin

Definition at line 236 of file rosui.h.

Referenced by ComputeRect(), CMainWindow::CreateLayout(), and CMainWindow::CreateSearchBar().

◆ m_VerticalAlignment


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