Re: Inheritance and MFC
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 04 Jul 2007 03:52:36 -0400
I see no reason you can't separate it, as long as you understand the difference between
data and display of data.
joe
On Tue, 3 Jul 2007 22:41:53 -0700, "Nobody" <Nobody@xxxxxxxxx> wrote:
Hi Tom,Joseph M. Newcomer [MVP]
Actually, it is a different kind of Grid.
Not Grid Excel type, but Grid XY Coordinates type.
By the looks of things, I suppose I can't seperate the Grid from MFC.
Thanks anyways,
"Tom Serface" <tom.nospam@xxxxxxxxxxxxx> wrote in message news:3A03F7F9-769F-43EF-9261-E69359D10F67@xxxxxxxxxxxxxxxx
Hi Nobody,
To create a control, like a grid control, you'll likely want to start with
something similar that is already derived from a CWnd and has some of the
properties you want to use. Perhaps something like this:
http://www.codeproject.com/miscctrl/gridctrl.asp
Tom
"Nobody" <Nobody@xxxxxxxxx> wrote in message
news:eN%237eNdvHHA.4796@xxxxxxxxxxxxxxxxxxxxxxx
Hi Tom,
You didn't post any of the code from your grid object,I posted what was relevant.
if it is a control or displays anything I'll be it is already derived fromIt does not.
or contains a CWnd at some point.
Is this an object you created...Yes.
I guess that is what I am doing.
I am trying to create a control.
It is a control, but does not contain any controls.
I am trying to add controls to my control. i.e. Scrollbars
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
{
//Bunch of stuff
}
CGridSB: public CGrid, public CWnd
{
CScrollbar sb;
CreateScrollbars();
SetScreenRect(){ PositionScrollbars(); }
}
CView::OnDraw()
{
CGridSB sb;
sb.SetScreenRect(Rect);
sb.OnDraw(pDC);
}
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Inheritance and MFC
- From: Nobody
- Re: Inheritance and MFC
- From: Tom Serface
- Re: Inheritance and MFC
- From: Nobody
- Re: Inheritance and MFC
- From: Tom Serface
- Re: Inheritance and MFC
- From: Nobody
- Inheritance and MFC
- Prev by Date: Re: Inheritance and MFC
- Next by Date: Re: Text window not displaying inside loop
- Previous by thread: Re: Inheritance and MFC
- Next by thread: Re: Inheritance and MFC
- Index(es):
Relevant Pages
|