Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

mcStyleArray Class Reference

#include <Styles.h>

Inheritance diagram for mcStyleArray:

Inheritance graph
[legend]
Collaboration diagram for mcStyleArray:

Collaboration graph
[legend]
List of all members.

Detailed Description

Container of n mcStyle classes, where n = MATHCORE_MAX_EXPDEPTH.

This class can be used to store a set of styles

Definition at line 280 of file Styles.h.

GET functions.

The mcStyleArray setters.

int gui_GetStyleIndexFor (const mcElement &p) const
 Returns the style for the given element.
const mcStyleGet (int n) const
 Returns the mcStyle associated to the n-th exponent depth.
const mcStylegui_GetStyleFor (const mcElement &p) const
 Returns the style for given element.
static int GetCount ()
 Returns the number of mcStyles stored in this class.

Public Member Functions

 mcStyleArray ()
 Default constructor.
 mcStyleArray (const mcStyle *arr)
 Constructs the array of styles, copying the given styles.
 mcStyleArray (const mcStyleArray *arr)
 Copy constructor.
virtual ~mcStyleArray ()
 Destroys the contained styles.
void DeepCopy (const mcStyleArray *)
 Deep copies the given array into this one.
SET functions.
The mcStyleArray setters.

void Set (const mcStyle *arr)
 (Re)sets all the contents of this class.
void Set (const mcStyle *style, int n)
 (Re)sets the n-th style of this class.
void ScaleSize (float f=1.0)
 Scales the size of all the text settings contained inside all the styles contained in this object, See mcTextSettings::ScaleSize() for more info.

Protected Member Functions

void CreateArray ()
 Creates the array of styles if it's not already a valid pointer.

Protected Attributes

mcStylem_pStyles
 The array of styles for all the exponent depths of mcElementGUI.


Constructor & Destructor Documentation

mcStyleArray::mcStyleArray  )  [inline]
 

Default constructor.

Definition at line 306 of file Styles.h.

References CreateArray(), and m_pStyles.

mcStyleArray::mcStyleArray const mcStyle arr  )  [inline]
 

Constructs the array of styles, copying the given styles.

Definition at line 309 of file Styles.h.

References CreateArray(), m_pStyles, and Set().

mcStyleArray::mcStyleArray const mcStyleArray arr  )  [inline]
 

Copy constructor.

Definition at line 315 of file Styles.h.

References CreateArray(), DeepCopy(), and m_pStyles.

mcStyleArray::~mcStyleArray  )  [virtual]
 

Destroys the contained styles.

Definition at line 276 of file MathHelpers.cpp.

References m_pStyles.


Member Function Documentation

void mcStyleArray::CreateArray  )  [protected]
 

Creates the array of styles if it's not already a valid pointer.

This function is required because this class always need to work on a valid array but it cannot just define the m_pStyles array as follows:

In fact, the mcELEMENTMATH_MAX_EXPDEPTH value is defined in Element.h, where also mcElementGUI (which requires this class) is defined. This implies that we cannot use that #define here because we cannot include in this file "Element.h".

Definition at line 283 of file MathHelpers.cpp.

References m_pStyles, and mcELEMENTMATH_MAX_EXPDEPTH.

Referenced by mcStyleArray().

void mcStyleArray::DeepCopy const mcStyleArray  ) 
 

Deep copies the given array into this one.

Definition at line 289 of file MathHelpers.cpp.

References mcStyle::DeepCopy(), m_pStyles, and mcELEMENTMATH_MAX_EXPDEPTH.

Referenced by mcStyleArray().

const mcStyle* mcStyleArray::Get int  n  )  const [inline]
 

Returns the mcStyle associated to the n-th exponent depth.

Definition at line 364 of file Styles.h.

References m_pStyles.

Referenced by mcOperatorHelpers::gui_DoRecalcSize(), mcElementHelpers::gui_GetStyle(), and gui_GetStyleFor().

int mcStyleArray::GetCount  )  [static]
 

Returns the number of mcStyles stored in this class.

The returned number is always the same because the maximum exponent depth of the expressions the user inputs is a #define which, obviously, cannot change at run-time.

Definition at line 303 of file MathHelpers.cpp.

References mcELEMENTMATH_MAX_EXPDEPTH.

const mcStyle* mcStyleArray::gui_GetStyleFor const mcElement p  )  const [inline]
 

Returns the style for given element.

Definition at line 369 of file Styles.h.

References Get(), and gui_GetStyleIndexFor().

Referenced by mcElementHelpers::gui_GetStyleForThis().

int mcStyleArray::gui_GetStyleIndexFor const mcElement p  )  const
 

Returns the style for the given element.

Returns:
The index (in the style array) of the style for the current element

Definition at line 311 of file MathHelpers.cpp.

Referenced by gui_GetStyleFor().

void mcStyleArray::ScaleSize float  f = 1.0  ) 
 

Scales the size of all the text settings contained inside all the styles contained in this object, See mcTextSettings::ScaleSize() for more info.

Definition at line 321 of file MathHelpers.cpp.

References m_pStyles, mcELEMENTMATH_MAX_EXPDEPTH, and mcStyle::ScaleSize().

Referenced by mcMathMngHelpers::gui_InitStyles().

void mcStyleArray::Set const mcStyle style,
int  n
[inline]
 

(Re)sets the n-th style of this class.

Definition at line 336 of file Styles.h.

References mcStyle::DeepCopy(), and m_pStyles.

void mcStyleArray::Set const mcStyle arr  ) 
 

(Re)sets all the contents of this class.

Definition at line 296 of file MathHelpers.cpp.

References mcStyle::DeepCopy(), m_pStyles, and mcELEMENTMATH_MAX_EXPDEPTH.

Referenced by mcElementHelpers::gui_Init(), mcElementHelpers::gui_InitDefaultStyles(), and mcStyleArray().


Member Data Documentation

mcStyle* mcStyleArray::m_pStyles [protected]
 

The array of styles for all the exponent depths of mcElementGUI.

This array has mcELEMENTMATH_MAX_EXPDEPTH entries.

Definition at line 286 of file Styles.h.

Referenced by CreateArray(), DeepCopy(), Get(), mcStyleArray(), ScaleSize(), Set(), and ~mcStyleArray().


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

Documentation generated with Doxygen on Sun Feb 6 17:13:12 2005
Visit MathStudio home page for more info

[ Top ]