concept of including it in an MFC class seems more than a little strange.
In fact, the "using ... a few other MFC functions" means you are already
committed to MFC.
Hi Joe,
Why is a grid object not derived from CWnd in the first place?
I wanted to make the grid object independent of MFC.
The only reason I am using CObject is for Serialization.
I am using the registry and a few other MFC functions, OnDraw(),
OnMouseMove(), etc.
I should actually make several layers, but it is what it is for now.
I noticed that the more I use the grid object, the more I have to keep
adding scroll bars for pan, zoom, etc.
So, my idea was to make a CWnd GridSB Class that implements Scrollbars.
That class inherits from the Grid CObject class.
Then, I can leave the scroll bars inside of the CGrid Object, instead of
Creating scroll bars each time.
This is basically what I have.
CGrid : public CObject
CGridSB: public CGrid, public CWnd
{
CScrollbar sb;
CreateScrollbars();
SetScreenRect(){ Position Scrollbars(); }
}
CView::OnDraw()
{
CGridSB sb;
sb.SetScreenRect(Rect);
sb.OnDraw(pDC);
}