SRGraphLegend Class

class SRGraphLegend: public SRGraphTitle

Handles painting of the legend panel and inherits font management from the SRGraphTitle class

Defined in: SRGraphLegend.h

Class Members

Protected data members

int  m_nKeyHeight

Stores the height of the key items between passes.

SRGDisplayBase *  m_pDisplay

Pointer to the SRGDisplayBase to which this legend has locked itself (do not alter)

CRect  m_LegendRect

Basic rectangle of the legend panel

BOOL  m_bKeepTop

Semaphore to prevent moving the horizontal origin of the rectangle during auto resizing

BOOL  m_bKeepLeft

Semaphore to prevent moving the vertical origin of the rectangle during auto resizing

BOOL  m_bAutoSizeX

Semaphore to prevent changing the height of the rectangle during auto resizing

BOOL  m_bAutoSizeY

TRUE if the legend is to automatically extend its bottom boundary to contain the list

BOOL  m_bResize

Semaphore to resize the component rectangle to fit the legend data

SRGraphRect  m_FinalRect

The final, resized component rectangle in device independent coordinates

BOOL  m_bSizeForeground

Semaphore signifying a demand to recalculate the component size -- see  DrawForeground

double  m_dKeySize

Width of key data

int  m_nKeyCount

Count of the number of keys currently in this legend.

int  m_nMaxChar

Count of max number of character that will display in the annotation text

int  m_nMaxLine

Count of the maximum number of lines the legend will display

Protected member functions

virtual void  DrawForeground()

Draws text or recalculates the size of the component

virtual void  DrawKey(CPoint topleft,CPoint bottomright, int index, int group, int CurrentKey)

Draws legend keys onto the component

virtual int  CalcKeySize()

Calculates size of graphic keys

virtual void  DrawCustomKey(CPoint topleft,CPoint bottomright,int group,int index,SRGraphStyle *ptrStyle)

Customization system for legend keys

virtual void  SetCustomLegendSteps()

Sets the group and index stepping interval for legends

DWORD  GetLegendStyle()

Retrieves the legend style replacing CX_LEGEND_AUTOMATIC with an appropriate style

virtual CSize  CalcCharSize(CFont* pFont)

Return the size of a typical character in font pFont

public member functions

inline void  SetKeyAnnotationCharCount(int nChar)

Sets the number of char that will displayed in the key annotation

inline int  GetKeyAnnotationCharCount()

Get the number of char that will displayed in the key annotation

inline void  SetKeyAnnotationLineCount(int nLineCount)

Sets the maximum number of lines in the legend keys.

inline int  GetKeyAnnotationLineCount()

Returns the maximum number of lines in the legend keys.

virtual void  SetSizeDefaults()

Sets default key size according to measurement mode

virtual int  CalcFontAutoSize()

Calculates font size for the legend class

virtual CScale  SetComponentFileVersion()

NEW 6.01 SP1 The legend has a new file setting.

virtual void  WriteSpecificParameters(CStdioFile *f)

Writes special legend parameters to a template file

virtual int  ReadTemplateLine(LPCTSTR line)

Reads a legend line from a template file

virtual void  WriteName(CStdioFile *file)

Writes the object's name to a template file

virtual  ~SRGraphLegend()

Destructor

void  SetKeySize(double keysize)

Initializes the size of graphic keys

inline double  GetKeySize()

Retrieves the size of the graphic keys

enum  AutoSize_Flags

Bit flags used by SetAutoSize()

virtual void  SetAutoSize(int sizebits)

Initializes the auto-sizing flags

inline virtual void  SetResize(BOOL b=TRUE)

Set TRUE if the legend component rectangle is to be resized to fit the legend data

inline virtual BOOL  GetResize()

Returns TRUE if the legend component rectangle is resizable

virtual SRGraphRect  CalcFinalRect(CDC *pDC,CWnd *pCWnd)

Returns actual, resized component rectangle -- can be called outside of draw cycle

inline SRGraphRect  GetFinalRect()

Returns actual, resized component rectangle determined by previous call to Draw() or CalcFinalRect()

virtual void  Draw(CDC *pDC,CWnd *pCWnd)

Overrides  SRGraphComponent::Draw to enable automatic resizing

virtual void  GetParentContent()

Retrieves pertinent data from the parent  SRGraph

 SRGraphLegend()

Constructor

virtual void  Serialize(CArchive& ar)

To store or retrieve information via a CArchive