BCGSuite for MFC
CBCGPGraphicsManagerHelperabstract

Detailed Description

Produce the following steps to add Graphics Manager to your CWnd-derived class:

  1. Derive your class from CBCGPGraphicsManagerHelper (multiple inheritance).
  2. Override OnGraphicsManagerDraw() method and call required drawing methods such as pGM->FillRectangle, pGM->DrawText or pGM->DrawLine.
  3. Call DoGraphicsManagerDraw() from OnPaint or OnDraw methods.

The following code demonstrates how to use CBCGPGraphicsManagerHelper in CView-derived class:

Copy
class CMyView : public CView,
{
...
virtual void OnGraphicsManagerDraw(CBCGPGraphicsManager* pGM, const CBCGPRect& rect, BOOL bIsPrinting);
};
void CMyView::OnDraw(CDC* pDC)
{
}
void CMyView::OnGraphicsManagerDraw(CBCGPGraphicsManager* pGM, const CBCGPRect& rectClient, BOOL /*bIsPrinting*/)
{
CBCGPRect rect(50, 50, 300, 200);
// For better performance we recommend to make CBCGPBrush resources as class member variables
// and setup them in the constructor.
CBCGPBrush brFill(CBCGPColor::LightGreen, CBCGPColor::White, CBCGPBrush::BCGP_GRADIENT_RADIAL_TOP_LEFT);
CBCGPBrush brBorder(CBCGPColor::DarkGreen);
CBCGPBrush brText(CBCGPColor::Black);
pGM->FillRectangle(rect, brFill);
pGM->DrawRectangle(rect, brBorder);
CString strText = _T("Hello, Graphics Manager!");
pGM->DrawText(strText, rect, tf, brText);
}
+ Inheritance diagram for CBCGPGraphicsManagerHelper:

Public Member Functions

 SetGraphicsManagerTypeSpecifies a graphics manager type.
 

Protected Member Functions

 DoGraphicsManagerDrawCall this method to initiate a window content drawing using the graphics manager.
 
 DoGraphicsManagerDrawCall this method to initiate a window content drawing using the graphics manager.
 
 OnGraphicsManagerDrawThis method is called by the library to draw the window content.