I want to print information around the grid (e.g. text above, below and to the left/right). Is it possible to specify where on the printed page Objective Grid will print?
Sure, just override these two virtual functions->
void CGXGridCore::OnAdjustPrintRectangle(CDC* /*pDC*/, CPrintInfo* pInfo)
{
CGXGridParam* pParam = GetParam();
CGXProperties* pProp = pParam->GetProperties();
// subtract left, right, bottom and top Frame
int nTop, nLeft, nBottom, nRight;
pProp->GetMargins(nTop, nLeft, nBottom, nRight);
pInfo->m_rectDraw.top += nTop;
pInfo->m_rectDraw.left += nLeft;
pInfo->m_rectDraw.bottom -= nBottom;
pInfo->m_rectDraw.right -= nRight;
}
Or simply set the margins by calling
GetProperties()->SetMargins(nTop, nLeft, nBottom, nRight);
The next member function is responsible for drawing the outside area:
void CGXGridCore::OnPrintHeaderAndFooter(CDC* pDC, CPrintInfo* pInfo)
{
CGXGridParam* pParam = GetParam();
CGXProperties* pProp = pParam->GetProperties();
CDocument* pDoc = NULL;
if (m_pGridWnd->IsKindOf(RUNTIME_CLASS(CView)))
pDoc = ((CView*) m_pGridWnd)->GetDocument();
pProp->OnPrintHeaderAndFooter(pDC, pInfo, pDoc, pParam);
}
So you could override this and add your own code instead of: calling
pProp->OnPrintHeaderAndFooter();