SRGraphLabelBlock Class
class SRGraphLabelBlock: public SRGraphLabel
Manages blocks of SRGraphLabel objectsDefined in: SRGraphLabelBlock.h
Remarks
Label blocks may perform anti-collision calculations on labels which they control. If this facility is enabled, then any label found to be overlapping another may optionally be removed or moved in a specific direction.Label blocks are also capable of maintaining a list of points, effectively the points at which each label was displayed, for the positioning of tick marks or grid lines.
Class Members
protected data members
BOOL m_bUseMyOwnTickList
When reset - label placement and sizing takes place but no text is output,
BOOL m_bUseMyOwnTickList
Set by the label block when a tick logging request is made but no tick list is provided
BOOL m_bCheckOverlaps
When TRUE, the label block checks all labels for overlaps and performs anti-collision vectoring
CRect m_BlockRect
Rectangle of the screen covered by the label block -- determined during pass 0 or pass 1 processing
CSize m_TotalBlockSize
Accumulated unrotated size of the label block
CObList m_LabelList
List of SRGraphLabel objects that this block holds
BOOL m_bLogTickPositions
Enables the logging of label locations in a tick list
public member functions
CRgn* m_pNoDrawRgn
Pointer to a region that will be reserved for other use
int CalcFontAutoSize()
Calculate the font size
void SetFontStyle(int nFontStyle)
Sets the font style and reset the autofontsize flag
virtual void UpdateTickList()
Updates the tick list without an offset
virtual void CreateLabels()
Creates the labels
virtual int GetLabelCount()
Returns the number of labels in this block
virtual void RemoveLastLabel()
Removes and deletes the "tail" label from the label list
virtual void KillLabels()
Removes and deletes all labels in the list
virtual void SetPass(BOOL b)
Initializes the pass semaphore to allow pre-draw sizing of the labels or actual drawing
virtual BOOL GetPass()
Interrogates the m_bPass member
virtual void AddLabelIndex(LPCTSTR LabelText,int nIndex,int nCode=1)
Adds a label or updates a label in an indexed position
virtual void UpdateTickList(int nOffsetX,int nOffsetY)
Transfers all label locations to a list for use when drawing grid lines and tick marks
virtual SRGraphLabel * GetLabelIndex(int nIndex)
Retrieves a label from the list referenced by index
virtual void AddLabel(SRGraphLabel *label,BOOL bUseLocalFont=FALSE)
Adds a label to the tail of the label list
virtual void SetBlockLocationPoints(int nLocationPoint)
Globally sets the location points for all labels in the block
virtual void SetBlockOrientations(double dAngle)
Globally sets the orientation angles for all labels in the block
virtual void SetBlockPositions(CPoint StartPoint, CPoint EndPoint)
"Pegs" all labels in a block along a line between the two points supplied
virtual void SetBlockVectors(double dVectorX,double dVectorY)
Globally sets the anti-collision vectors for all labels in the block
virtual void AddLabel(LPCTSTR strLabelText)
Adds a label to the list (overload)
virtual CRect GetBlockRect()
Returns a rectangle (in device dependent coordinates) calculated to fully cover the drawn block
virtual CRect GetLogRect()
Same as GetBlockRect() -- for compatiblity with other components
virtual void SetptrTickPositionList(CPtrList *ptr)
Initializes the pointer to the block's tick list
virtual void SetLogTickPositions(BOOL b)
Enables or disables the tick position logging feature
virtual CPtrList* GetptrTickPositionList()
Retrieves the pointer to the tick position list associated with this label block
virtual void SetCheckOverlaps(BOOL b)
Enables or disables the block's anti-collision feature
virtual BOOL GetCheckOverlaps()
Returns the anti-collision test semaphore
Constructor
virtual ~SRGraphLabelBlock()
Destructor
virtual void Serialize(CArchive &ar)
Allows storage or retrieval via the archive
enum BlockTitle
Block title positions
enum LabelPositions
May be used instead of a positive integer index to return the first or last label on the list
protected member functions
inline void DrawBorder()
Overridden to prevent the drawing of a component panel
inline void DrawFill()
Overridden to prevent the drawing of a component panel
inline void DrawShadow()
Overridden to prevent the drawing of a component panel
void DrawForeground()
Sizes or draws the text with anti-collision if enabled
Protected data members
CPtrList m_LabelRects
Windows CE only. This maintains a list of CRects for anti collision detection without regions.
POSITION m_LastPos
List class position storage for speed-up code
int m_nLastIndex
List class index number for speed-up code
int m_nBlockTitle
Reserved