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
virtual void DrawTitleText(const CString& str, const CRect& rc, BOOL bWrapText)
Draws multi-line clipped text for the title portion of the text panel.
virtual void DrawText(const CString& str, const CRect& rc)
Traws multi-line clipped text for the body text portion of the text panel
virtual CScale SetComponentFileVersion()
NEW 6.01 The text panel has a new file setting.
virtual void WriteFontParameters(CStdioFile *file)
Exports font parameters to the template file
virtual void WriteName(CStdioFile *file)
Writes the "textpanel" command name to the template file
Default constructor
virtual ~SRGTextPanel()
Destructor
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
virtual void Draw(CDC *pDC,CWnd *pCWnd)
Draws this object
virtual void UpdateTitleFont()
Refreshes the title font
virtual CRect CalcTitleRect()
Calculates the rectangle required to display the title
virtual void SetBodyText(CString s,int code=1)
Sets the text displayed in the body panel
virtual CString GetBodyText(int code = 1)
Returns the text displayed in the body panel
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
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
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 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
Justification of body text
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
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
virtual void DrawFill()
Draws the fill of the title rectangle
virtual void DrawForeground()
Draws the text panel foreground