ReactOS  0.4.15-dev-2714-g4864c87
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 162 of file rosui.h.

Member Enumeration Documentation

◆ MeasureType

Enumerator
Type_FitContent 
Type_Fixed 
Type_Percent 
Type_FitParent 

Definition at line 165 of file rosui.h.

Constructor & Destructor Documentation

◆ CUiMeasure() [1/2]

CUiMeasure::CUiMeasure ( )
inline

Definition at line 178 of file rosui.h.

179  {
181  m_Value = 0;
182  }
INT m_Value
Definition: rosui.h:175
MeasureType m_Type
Definition: rosui.h:174

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

◆ CUiMeasure() [2/2]

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

Definition at line 184 of file rosui.h.

185  {
186  m_Type = type;
187  m_Value = value;
188  }
INT m_Value
Definition: rosui.h:175
MeasureType m_Type
Definition: rosui.h:174
GLsizei const GLfloat * value
Definition: glext.h:6069
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Member Function Documentation

◆ ComputeMeasure()

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

Definition at line 190 of file rosui.h.

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

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

◆ FitContent()

static CUiMeasure CUiMeasure::FitContent ( )
inlinestatic

Definition at line 208 of file rosui.h.

209  {
210  return CUiMeasure(Type_FitContent, 0);
211  }
CUiMeasure()
Definition: rosui.h:178

◆ FitParent()

static CUiMeasure CUiMeasure::FitParent ( )
inlinestatic

Definition at line 213 of file rosui.h.

214  {
215  return CUiMeasure(Type_FitParent, 0);
216  }
CUiMeasure()
Definition: rosui.h:178

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

◆ Fixed()

static CUiMeasure CUiMeasure::Fixed ( INT  pixels)
inlinestatic

Definition at line 218 of file rosui.h.

219  {
220  return CUiMeasure(Type_Fixed, pixels);
221  }
CUiMeasure()
Definition: rosui.h:178
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 223 of file rosui.h.

224  {
225  return CUiMeasure(Type_Percent, percent);
226  }
CUiMeasure()
Definition: rosui.h:178

Member Data Documentation

◆ m_Type

MeasureType CUiMeasure::m_Type
private

Definition at line 174 of file rosui.h.

Referenced by ComputeMeasure(), and CUiMeasure().

◆ m_Value

INT CUiMeasure::m_Value
private

Definition at line 175 of file rosui.h.

Referenced by ComputeMeasure(), and CUiMeasure().


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