MFC Grid manual

CHighlightSettings Class Reference

Highlighting related information. More...

#include <Dapfor/GUI/HighlightSettings.h>

List of all members.


Public Types

enum  Mode {
  InverseColor, ForeColor, BackColor, ForeBackColor,
  AlphaBlendForeColor, AlphaBlendBackColor, AlphaBlendForeBackColor, FadingForeColor,
  FadingBackColor, FadingForeBackColor
}

Public Member Functions

 CHighlightSettings ()
 Default constructor.
 CHighlightSettings (const CHighlightSettings &settings)
 Copy constructor.
 CHighlightSettings (int highlightPeriod, COLORREF foreColor, COLORREF backColor, BYTE foreAlpha, BYTE backAlpha, int fadingSpan, Mode mode)
 Constructor.
int GetHighlightPeriod () const
 Time interval in milliseconds during which a cell is highlighted.
COLORREF GetForeColor () const
 Gets the foreground color.
COLORREF GetBackColor () const
 Gets the background color.
BYTE GetForeAlpha () const
 Alpha-blend coefficient for the foreground color.
BYTE GetBackAlpha () const
 Alpha-blend coefficient for the background color.
int GetFadingSpan () const
 Time interval between two color modifications to implement a fading effect. Has sense only for Fading mode.
Mode GetMode () const
 Gets a highlight mode.
void SetHighlightPeriod (int period)
 Sets a new highlight period.
void SetForeColor (COLORREF color)
 Sets a new foreground color.
void SetBackColor (COLORREF color)
 Sets a new background color.
void SetForeAlpha (BYTE alpha)
 Sets a new foreground alpha coefficient.
void SetBackAlpha (BYTE alpha)
 Sets a new background alpha coefficient.
void SetFadingSpan (int span)
 Sets a new time interval between two color modifications. Makes sense only for Fading mode.
void SetMode (Mode mode)
 Sets a new highlight mode.
void Serialize (CArchive &ar)
 Serializes/deserializes this object to/from the archive.

Static Public Member Functions

static int GetSerializeVertion ()
 Gets serialization version.

Detailed Description

Highlighting related information.

Version:
1.0.0.0 Initial version
:
//Turn on cell highlighting
m_Grid.AllowHighlight(true);

//Select highlighting with fading effect
m_Grid.GetHighlightSettings().SetMode(Dapfor::GUI::FadingBackColor);
m_Grid.GetHighlightSettings().SetBackColor(RGB(230, 10, 14));

Member Enumeration Documentation

enum Mode

Highlight modes

Enumerator:
InverseColor  Inverses background and foreground colors during a highlight period.
ForeColor  Replaces text color in a cell with the specified foreground color during highlight period.
BackColor  Replaces cell background with the specified background color during highlight period.
ForeBackColor  Replaces text and background in a cell together with foreground and background colors during highlight period.
AlphaBlendForeColor  Performs alpha blending of text in a cell with a specified foreground color during highlight period.
AlphaBlendBackColor  Performs alpha blending of cell background with the specified background color during highlight period.
AlphaBlendForeBackColor  Performs alpha blending of text and background in a cell together with specified foreground and background colors during highlight period.
FadingForeColor  Highlights text in a cell during highlight period with a fading effect.
FadingBackColor  Highlights cell background during highlight period with a fading effect.
FadingForeBackColor  Highlights text and background in a cell together during highlight period with a fading effect.


Constructor & Destructor Documentation

CHighlightSettings ( const CHighlightSettings settings  ) 

Copy constructor.

Parameters:
[in] settings to be copied

CHighlightSettings ( int  highlightPeriod,
COLORREF  foreColor,
COLORREF  backColor,
BYTE  foreAlpha,
BYTE  backAlpha,
int  fadingSpan,
Mode  mode 
)

Constructor.

Parameters:
[in] highlightPeriod Time interval in milliseconds during which a cell is highlighted.
[in] foreColor Foreground color
[in] backColor Background color
[in] foreAlpha Foreground alpha coefficient
[in] backAlpha Background alpha coefficient
[in] fadingSpan Time interval between two color modifications. Makes sense only for Fading mode.
[in] mode Highlight mode


Member Function Documentation

int GetHighlightPeriod (  )  const [inline]

Time interval in milliseconds during which a cell is highlighted.

Returns:
Time period in milliseconds

COLORREF GetForeColor (  )  const [inline]

Gets the foreground color.

Returns:
Foreground color

COLORREF GetBackColor (  )  const [inline]

Gets the background color.

Returns:
Background color

BYTE GetForeAlpha (  )  const [inline]

Alpha-blend coefficient for the foreground color.

Returns:
Foreground alpha coefficient

BYTE GetBackAlpha (  )  const [inline]

Alpha-blend coefficient for the background color.

Returns:
Backgrond alpha coefficient

int GetFadingSpan (  )  const [inline]

Time interval between two color modifications to implement a fading effect. Has sense only for Fading mode.

Returns:
Time interval in milliseconds between two color modifications.

CHighlightSettings::Mode GetMode (  )  const [inline]

Gets a highlight mode.

Returns:
Current Highlight mode

void SetHighlightPeriod ( int  period  )  [inline]

Sets a new highlight period.

Parameters:
[in] period Time period in milliseconds.

void SetForeColor ( COLORREF  color  )  [inline]

Sets a new foreground color.

Parameters:
[in] color A new foreground color

void SetBackColor ( COLORREF  color  )  [inline]

Sets a new background color.

Parameters:
[in] color A new background color

void SetForeAlpha ( BYTE  alpha  )  [inline]

Sets a new foreground alpha coefficient.

Parameters:
[in] alpha A new foreground alpha coefficient

void SetBackAlpha ( BYTE  alpha  )  [inline]

Sets a new background alpha coefficient.

Parameters:
[in] alpha A new background alpha coefficient

void SetFadingSpan ( int  span  )  [inline]

Sets a new time interval between two color modifications. Makes sense only for Fading mode.

Parameters:
[in] span A new time interval in milliseconds between two color modifications.

void SetMode ( Mode  mode  )  [inline]

Sets a new highlight mode.

Parameters:
[in] mode A new highlight mode

int GetSerializeVertion (  )  [static]

Gets serialization version.

Returns:
Current serialization version

void Serialize ( CArchive &  ar  ) 

Serializes/deserializes this object to/from the archive.

Parameters:
[in] ar Acrhive to serialize or deserialize the object