BCGSuite for MFC
CBCGPChartLegendCtrl

Detailed Description

The CBCGPChartLegendCtrl implements the functionality of a visual control (CBCGPVisualCtrl) that hosts a CBCGPChartLegendVisualObject.

You can use this control to place an advanced legend on a dialog or embed it into a dockable pane.

The following code illustrates how to embed a legend into dockable pane:

Copy
class CMyDockingPane : public CBCGPDockingControlBar
{
public:
CMyDockingPane();
// Attributes
public:
// other code.....
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
AFX_MSG DECLARE_MESSAGE_MAP()
};
int CMyDockingPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CBCGPDockingControlBar::OnCreate(lpCreateStruct) == -1)
return -1;
// note that rectangle must not be empty
m_legend.Create(CRect(0, 0, 1, 1), this, 0);
return 0;
}
void CMyDockingPane::OnSize(UINT nType, int cx, int cy)
{
CBCGPDockingControlBar::OnSize(nType, cx, cy);
// Legend control should cover a whole client area:
m_legend.SetWindowPos (NULL, -1, -1, cx, cy, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
}
+ Inheritance diagram for CBCGPChartLegendCtrl:

Public Member Functions

 CreateCustomLegendCreates a custom legend
 
 GetLegendReturns a pointer to encapsulated legend visual object
 
- Public Member Functions inherited from CBCGPBaseVisualCtrl
 CreateCreates a Windows control.
 
 CreatePopupCreates a popup window
 
 DoPrintImplements printing support for encapsulated visual object.
 
 EnableInfoTipEnables the information tip associated with this control.
 
 EnableTooltipEnables tooltips
 
 GetGraphicsManagerGets graphics manager associated with control.
 
 GetPrintOptionsGets control printing options.
 
 IsInfoTipEnabledTells whether the information tip is enabled.
 
 IsTooltipEnabledTells whether the visual control tooltip support is enabled.
 
 SetPrintOptionsSets control printing options.
 

Additional Inherited Members

- Static Public Member Functions inherited from CBCGPBaseVisualCtrl
 CloseActivePopupCloses active popup (created by CBCGPBaseVisualCtrl::CreatePopup) visual control.
 
 HasActivePopupTells whether a popup (created by CBCGPBaseVisualCtrl::CreatePopup) visual control is active.
 
- Protected Member Functions inherited from CBCGPGestureBase
 OnGestureEventBeginCalled by the framework to handle BCGP_GID_BEGIN notification.
 
 OnGestureEventEndCalled by the framework to handle BCGP_GID_END notification.
 
 ProcessGestureEventThis method should be called from WM_GESTURE message handler.