ReactOS  0.4.15-dev-1177-g6cb3b62
CUiMeasure Class Reference

#include <rosui.h>

Public Types

enum  MeasureType { Type_FitContent = 0, Type_Fixed = 1, Type_Percent = 2, Type_FitParent = 3 }
 

Public Member Functions

 CUiMeasure ()
 
 CUiMeasure (MeasureType type, INT value)
 
INT ComputeMeasure (INT parent, INT content)
 

Static Public Member Functions

static CUiMeasure FitContent ()
 
static CUiMeasure FitParent ()
 
static CUiMeasure Fixed (INT pixels)
 
static CUiMeasure Percent (INT percent)
 

Private Attributes

MeasureType m_Type
 
INT m_Value
 

Detailed Description

Definition at line 158 of file rosui.h.

Member Enumeration Documentation

◆ MeasureType

Enumerator
Type_FitContent 
Type_Fixed 
Type_Percent 
Type_FitParent 

Definition at line 161 of file rosui.h.

Constructor & Destructor Documentation

◆ CUiMeasure() [1/2]

CUiMeasure::CUiMeasure ( )
inline

Definition at line 174 of file rosui.h.

175  {
177  m_Value = 0;
178  }
INT m_Value
Definition: rosui.h:171
MeasureType m_Type
Definition: rosui.h:170

Referenced by FitContent(), FitParent(), Fixed(), and Percent().

◆ CUiMeasure() [2/2]

CUiMeasure::CUiMeasure ( MeasureType  type,
INT  value 
)
inline

Definition at line 180 of file rosui.h.

181  {
182  m_Type = type;
183  m_Value = value;
184  }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
INT m_Value
Definition: rosui.h:171
MeasureType m_Type
Definition: rosui.h:170
GLsizei const GLfloat * value
Definition: glext.h:6069

Member Function Documentation

◆ ComputeMeasure()

INT CUiMeasure::ComputeMeasure ( INT  parent,
INT  content 
)
inline

Definition at line 186 of file rosui.h.

187  {
188  switch (m_Type)
189  {
190  case Type_FitContent:
191  return content;
192  case Type_Fixed:
193  return m_Value;
194  case Type_Percent:
195  return max(content, parent * m_Value / 100);
196  case Type_FitParent:
197  return parent;
198  }
199 
200  return 0;
201  }
#define max(a, b)
Definition: svc.c:63
content
Definition: atl_ax.c:993
INT m_Value
Definition: rosui.h:171
r parent
Definition: btrfs.c:2944
MeasureType m_Type
Definition: rosui.h:170

Referenced by CUiPanel::OnParentSize(), and CUiSplitPanel::OnParentSize().

◆ FitContent()

static CUiMeasure CUiMeasure::FitContent ( )
inlinestatic

Definition at line 204 of file rosui.h.

205  {
206  return CUiMeasure(Type_FitContent, 0);
207  }
CUiMeasure()
Definition: rosui.h:174

◆ FitParent()

static CUiMeasure CUiMeasure::FitParent ( )
inlinestatic

Definition at line 209 of file rosui.h.

210  {
211  return CUiMeasure(Type_FitParent, 0);
212  }
CUiMeasure()
Definition: rosui.h:174

Referenced by CUiPanel::CUiPanel(), and CUiSplitPanel::CUiSplitPanel().

◆ Fixed()

static CUiMeasure CUiMeasure::Fixed ( INT  pixels)
inlinestatic

Definition at line 214 of file rosui.h.

215  {
216  return CUiMeasure(Type_Fixed, pixels);
217  }
CUiMeasure()
Definition: rosui.h:174
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546

◆ Percent()

static CUiMeasure CUiMeasure::Percent ( INT  percent)
inlinestatic

Definition at line 219 of file rosui.h.

220  {
221  return CUiMeasure(Type_Percent, percent);
222  }
CUiMeasure()
Definition: rosui.h:174

Member Data Documentation

◆ m_Type

MeasureType CUiMeasure::m_Type
private

Definition at line 170 of file rosui.h.

Referenced by ComputeMeasure(), and CUiMeasure().

◆ m_Value

INT CUiMeasure::m_Value
private

Definition at line 171 of file rosui.h.

Referenced by ComputeMeasure(), and CUiMeasure().


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