ReactOS 0.4.15-dev-7712-gbbbcd8e
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 172 of file rosui.h.

Member Enumeration Documentation

◆ MeasureType

Enumerator
Type_FitContent 
Type_Fixed 
Type_Percent 
Type_FitParent 

Definition at line 175 of file rosui.h.

176 {
177 Type_FitContent = 0,
178 Type_Fixed = 1,
179 Type_Percent = 2,
181 };
@ Type_FitParent
Definition: rosui.h:180
@ Type_Fixed
Definition: rosui.h:178
@ Type_FitContent
Definition: rosui.h:177
@ Type_Percent
Definition: rosui.h:179

Constructor & Destructor Documentation

◆ CUiMeasure() [1/2]

CUiMeasure::CUiMeasure ( )
inline

Definition at line 188 of file rosui.h.

189 {
191 m_Value = 0;
192 }
MeasureType m_Type
Definition: rosui.h:184
INT m_Value
Definition: rosui.h:185

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

◆ CUiMeasure() [2/2]

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

Definition at line 194 of file rosui.h.

195 {
196 m_Type = type;
197 m_Value = value;
198 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: pdh_main.c:94

Member Function Documentation

◆ ComputeMeasure()

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

Definition at line 201 of file rosui.h.

202 {
203 switch (m_Type)
204 {
205 case Type_FitContent:
206 return content;
207 case Type_Fixed:
208 return m_Value;
209 case Type_Percent:
210 return max(content, parent * m_Value / 100);
211 case Type_FitParent:
212 return parent;
213 }
214
215 return 0;
216 }
content
Definition: atl_ax.c:994
r parent
Definition: btrfs.c:3010
#define max(a, b)
Definition: svc.c:63

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

◆ FitContent()

static CUiMeasure CUiMeasure::FitContent ( )
inlinestatic

Definition at line 220 of file rosui.h.

221 {
222 return CUiMeasure(Type_FitContent, 0);
223 }
CUiMeasure()
Definition: rosui.h:188

◆ FitParent()

static CUiMeasure CUiMeasure::FitParent ( )
inlinestatic

Definition at line 226 of file rosui.h.

227 {
228 return CUiMeasure(Type_FitParent, 0);
229 }

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

◆ Fixed()

static CUiMeasure CUiMeasure::Fixed ( INT  pixels)
inlinestatic

Definition at line 232 of file rosui.h.

233 {
235 }
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 238 of file rosui.h.

239 {
240 return CUiMeasure(Type_Percent, percent);
241 }

Member Data Documentation

◆ m_Type

MeasureType CUiMeasure::m_Type
private

Definition at line 184 of file rosui.h.

Referenced by ComputeMeasure(), and CUiMeasure().

◆ m_Value

INT CUiMeasure::m_Value
private

Definition at line 185 of file rosui.h.

Referenced by ComputeMeasure(), and CUiMeasure().


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