SRGraphComponent Class Overview

This is the basic class which manages the display of backgrounds, displays, legends, titles and other items.

The basic SRGraphComponent has the ability to fill its own background, Draw a border around itself and to draw a shadow which reduces the brilliance of items below and to the right of it. Background filling may be a solid, single color. A wash or vignette of color's or an image taken from the application resources. Borders drawn on the object may be thick or thin (3 pixels or 6 pixels), have the appearance of being raised or lowered or be bevelled in a manner similar to the style used for buttons in Windows. Shadows may be thin, medium or thick. They use a checkerboard image to allow only 50 percent of the underlying color to show through. SRGraphComponent plays the biggest role in the definition of appearance in Objective Chart. As a basis for your own graph style it can be used to draw bars, lines, 3D bars wigets and polygons all in a style consistent with the original implementations. All components have a basic set of variables which allow interaction with and data gathering from the graph which owns the component and also allows certain information to be gleaned about the type of display surface which is being used to draw the component.

The primary channel for graph information is via the m_pParentGraph pointer which must be set to point to the SRGraph object upon whose component list this object is stored. Normally the initialisation of the m_pParentGraph pointer is done when the item is added using the SRGraph::AddComponent function. However some component items may build and use temporary components during their draw cycles. For example an SRGraphDisplay may possibly make a temporary SRGraphLabelBlock in which to store annotations while display is taking place In this case the component which is built on the stack must be informed of the parent graph by using the SetParent member function. Care must be taken to do this at an early stage in the use of the component because the component may fail through lack of important, globally available data held in the parent graph. (i.e. the country code for annotations) Furthermore certain calculations made by the component depend upon knowledge of the CDC and CWnd which is being used to display