Re: Inheritance and MFC



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,

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 from
or contains a CWnd at some point.
It does not.

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);
}


Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: Inheritance and MFC
    ... If you are creating a control, ... I noticed that the more I use the grid object, the more I have to keep adding scroll bars for pan, zoom, etc. ... my idea was to make a CWnd GridSB Class that implements Scrollbars. ...
    (microsoft.public.vc.mfc)
  • Re: Inheritance and MFC
    ... Not Grid Excel type, ... To create a control, like a grid control, you'll likely want to start with ... or contains a CWnd at some point. ... adding scroll bars for pan, zoom, etc. ...
    (microsoft.public.vc.mfc)
  • Re: Inheritance and MFC
    ... 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. ... I noticed that the more I use the grid object, the more I have to keep adding scroll bars for pan, zoom, etc. ...
    (microsoft.public.vc.mfc)
  • Re: GridCtrl vertical scrollbar problem
    ... It sounds like the control is not paying ... attention to the fact that the scroll bars got turned on. ... I got a wierd problem with GridCtrl scrollbar, I am using a grid ctrl ...
    (microsoft.public.vc.mfc)
  • Re: How to fire an event
    ... I have an Infragistic datagrid control, ... The button click event is being raised upon a post-back to the server. ... manipulating the grid in script would cause a server event to be raised. ... The problem here is that I have no idea whether the grid will raise the ...
    (microsoft.public.dotnet.languages.csharp)