SRGraph::DrawingUsing

voidSRGraph::DrawingUsing(CDC *pDC, CWnd *pCWnd)

Prepares the SRGraph object so that component drawing and sizing functions can be utilized outside the normal drawing process -- DrawComponentList(). Sets the m_pDC, m_pCWnd, and m_DisplayRect members.

Defined in: SRGraph.cpp

Parameters

pDC

Pointer to a valid CDC for the drawing processes

pCWnd

Pointer to a CWnd object in which drawing will take place

Example

The following code segment shows how to draw a wiget in response to a mouse click, for example

SRGraphDisplay *pD = (SRGraphDisplay *)GetGraph()-&gtGetComponent(0,IDS_SRG_DISPLAYTYPE);
if(pD!=NULL)
{
               CDC *pDC=GetDC();
               GetGraph()-&gtDrawingUsing(pDC, this);
               pD-&gtDrawingUsing(pDC, this);
               CPoint datapoint= [ omitted ]
               SRGraphStyle * pStyle = GetGraph()-&gtGetDefaultDataStyle();
               pD-&gtDrawWiget(datapoint,pStyle);
               pD-&gtNotDrawing();
               GetGraph()-&gtNotDrawing();
               ReleaseDC(pDC);
}

Developer Notes

Use this function before accessing any component drawing or sizing functions outside the normal drawing process -- DrawComponentList(). Components frequently access the chart's m_DisplayRect member and GetDisplaySize() function so that they can position themselves -- especially when using the CX_PERCENT measurement mode.

See also...

 DrawComponentList  SRGraphComponent::DrawingUsing  NotDrawing