SRGTextPanel Class

class SRGTextPanel: public SRGraphTitle

This class provides a simple multi-line text panel with independently styled title and body fonts.

Defined in: SRGTextPanel.h

Class Members

CHART_API virtual void DrawTitleText(const CString& str, const CRect& rc, BOOL bWrapText)

Draws multi-line clipped text for the title portion of the text panel.

CHART_API virtual void DrawText(const CString& str, const CRect& rc)

Traws multi-line clipped text for the body text portion of the text panel

CHART_API virtual CScale SetComponentFileVersion()

NEW 6.01 The text panel has a new file setting.

CHART_API virtual void WriteFontParameters(CStdioFile *file)

Exports font parameters to the template file

CHART_API virtual void WriteName(CStdioFile *file)

Writes the "textpanel" command name to the template file

CHART_API SRGTextPanel()

Default constructor

CHART_API virtual ~SRGTextPanel()

Destructor

CHART_API virtual void Serialize(CArchive &ar)

Serializes this object

enum _TitleOrientation

Specifies the location of text within the panel

inline virtual CString GetTitleText(int code = 1)

Returns the title text

inline virtual void SetTitleOrientation(_TitleOrientation n)

Sets the orientation of the title -- top, left, bottom or right

inline virtual _TitleOrientation GetTitleOrientation()

Returns the current title orientation

inline virtual void SetTitleTextColor(COLORREF c)

Sets the color of the title text

inline virtual void SetBodyTextColor(COLORREF c)

Sets the color of the body text

inline virtual COLORREF GetTitleTextColor()

Returns the color of the title text

inline virtual COLORREF GetBodyTextColor()

Returns the color of the body text

inline virtual SRGraphStyle * GetTitleStyle()

Returns a pointer to the style object associated with the title bar

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

Draws this object

CHART_API virtual void UpdateTitleFont()

Refreshes the title font

CHART_API virtual CRect CalcTitleRect()

Calculates the rectangle required to display the title

CHART_API virtual void SetBodyText(CString s,int code=1)

Sets the text displayed in the body panel

CHART_API virtual CString GetBodyText(int code = 1)

Returns the text displayed in the body panel

CHART_API virtual void SetTitleText(CString s,int code=1)

Sets the text displayed in the title panel

inline virtual void SetBodyFontSize(int n)

Sets the size of the font used to display the body text

inline virtual int GetBodyFontSize()

Returns the size of the font used to display the body text

inline virtual void SetTitleFontSize(int n)

Sets the size of the font used to display the title text

inline virtual int GetTitleFontSize()

Returns the size of the font used to display the title text

inline virtual void SetBodyFontStyle(int n)

Sets the style of the font used to display the body text

inline virtual int GetBodyFontStyle()

Returns the style of the font used to display the body text

inline virtual void SetTitleFontStyle(int n)

Sets the style of the font used to display the title text

inline virtual int GetTitleFontStyle()

Returns the style of the font used to display the title text

CHART_API virtual int CalcFontAutoSize()

Calculates font size for the text panel body if the text style includes CX_FONT_AUTOSIZE

inline virtual void SetBodyFontFaceName(CString strFaceName)

Sets the typeface name for the body text

inline virtual CString GetBodyFontFaceName()

Returns the typeface name of the body text

inline virtual void SetTitleFontFaceName(CString strFaceName)

Sets the typeface name for the title text

inline virtual CString GetTitleFontFaceName()

Returns the typeface name of the title text

inline virtual BOOL GetUseTitle()

Returns TRUE if the title is to be used

inline virtual void SetUseTitle(BOOL b)

Set TRUE if the title is to be used

inline virtual void SetResize(BOOL b=TRUE)

Set TRUE if the body text panel is to be resizable

inline virtual BOOL GetResize()

Returns TRUE if the body text panel is resizable

CHART_API 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()

CHART_API virtual void GetParentContent()

Overidden to do nothing

inline virtual void SetTitleFontJustification(int v)

initializes font justification for the title panel

inline virtual int GetTitleFontJustification()

returns font justification for the title panel

inline virtual void SetBodyFontJustification(int v)

initializes font justification for the body panel

inline virtual int GetBodyFontJustification()

returns font justification for the body panel

int m_nBodyFontJustification

Justification of body text

int m_nTitleFontJustification

Justification of title text

CRect m_BGRect

Background rectangle

CRect m_RefRect

Rectangle used as a comparison reference

SRGraphStyle m_TitleStyle

Style parameters for the title panel

CRect m_TitleRect

Rectangle used to draw the title

BOOL m_bSizeForeground

Set to TRUE when the foreground is being sized

COLORREF m_BodyTextColor

RGB color of body text

COLORREF m_TitleTextColor

RGB color of title text

int m_nEscapement

Escapement angle for text

CFont m_TitleFont

Font for title text

SRGraphAnnotationList m_TitleText

Annotation list for title text

SRGraphAnnotationList m_BodyText

Annotation list for body text

CRect m_TextRect

Text area rectangle

BOOL m_bUseTitle

Flag to use title

BOOL m_bResize

Automatic resizing flag

SRGraphRect m_FinalRect

The final, resized component rectangle in device independent coordinates

int m_nTitleFontSize

Size of font for title text

int m_nBodyFontSize

Size of font for body text

int m_nTitleFontStyle

Font style for title text

int m_nBodyFontStyle

Fong style for body text

CString m_strTitleFontFaceName

Font facename for title text

CString m_strBodyFontFaceName

Font facename for body text

CHART_API virtual void DrawFill()

Draws the fill of the title rectangle

CHART_API virtual void DrawForeground()

Draws the text panel foreground