Re: custom columns/headers by gerry
gerry
Wed Mar 30 23:46:04 CST 2005
sorry but i don't see your point , if i drop label on a form or a derived
label on a form , the behaviour of the 2 is 100% identical unless I have
modified the derived class to change its behaviour.
I am specifying that a grid should use my column class which should use my
header class.
this grid is then dropped on a form - I haven't modified any properties or
overridden any methods - there is no behaviour to have changed.
taking your tack - how do dynamic header captions ever get assigned using
custom header classes ? I have no way to know what the caption should be or
when it should be updated.
Gerry
"Dan Freeman" <spam@microsoft.com> wrote in message
news:uKwbTXVNFHA.3796@TK2MSFTNGP10.phx.gbl...
> You're observing the difference between what VFP chooses to do when you
drop
> a control on a form, and when you drop one of your own. There are MANY
> different behaviors.
>
> If you drop a label on a form, VFP sets .Visible=.t. and adds a default
> caption. But if you AddObject(), it doesn't. You have to set all those
other
> attributes yourself.
>
> Dan
>
> gerry wrote:
> > but it shouldn't - default header behaviour is to reset the captions
> > when a new record source is assigned to the grid.
> > how do you ever know when to set it and what to set it to ?
> > I'm not implementing any code or modifying any property values in my
> > derived classes - so the behaviour should still be 100% the same as
> > the default.
> >
> > it is starting to look an awful lot like either the grid , column or
> > header classes that we can derive from are not the same as the
> > default grid , column and header classes used by the default vfp grid
> > else derived classes would behave 100% exactly the same as the
> > default objects.
> >
> > Gerry
> >
> >
> >
> > "Dan Freeman" <spam@microsoft.com> wrote in message
> > news:uN6b2ZLNFHA.3788@tk2msftngp13.phx.gbl...
> >> As I said, it starts empty and stays empty until you set it.
> >>
> >> Dan
> >>
> >> gerry wrote:
> >>> Hi Dan ,
> >>>
> >>> that's correct, in this case I'm not setting the caption expecting
> >>> that it will be set when the grid's RecordSource is assigned as per
> >>> default header behaviour - but it isn't.
> >>>
> >>> Gerry
> >>>
> >>>
> >>>
> >>> "Dan Freeman" <spam@microsoft.com> wrote in message
> >>> news:%23anQnnKNFHA.1948@TK2MSFTNGP14.phx.gbl...
> >>>> Sure. I've been using custom headers since VFP3.
> >>>>
> >>>> I don't see any header.caption being set in the code you posted.
> >>>> IIRC, they default to empty.
> >>>>
> >>>> Dan
> >>>>
> >>>> gerry wrote:
> >>>>> So do I assume then that no one ever uses custom header classes ?
> >>>>>
> >>>>>
> >>>>> "gerry" <germ@hotmail.com> wrote in message
> >>>>> news:O3qK4TPMFHA.1396@TK2MSFTNGP10.phx.gbl...
> >>>>>> I have subclassed grid , column & header classes as :
> >>>>>>
> >>>>>> >> my.vcx
> >>>>>> define class mygrid as grid
> >>>>>> memberclass="mycolumn"
> >>>>>> memberclasslibrary="this.prg"
> >>>>>> procedure init
> >>>>>> set step on && just to be sure we are getting
> >>>>>> here endproc
> >>>>>> procedure error(x,y,z)
> >>>>>> set step on && just to be sure we aren't
> >>>>>> getting here endproc
> >>>>>> enddefine
> >>>>>>
> >>>>>> >> my.prg
> >>>>>> define class mycolumn as column
> >>>>>> headerclass="myheader"
> >>>>>> headerclasslibrary="this.prg"
> >>>>>> procedure init
> >>>>>> set step on && just to be sure we are getting
> >>>>>> here endproc
> >>>>>> procedure error(x,y,z)
> >>>>>> set step on && just to be sure we aren't
> >>>>>> getting here endproc
> >>>>>> enddefine
> >>>>>>
> >>>>>> define class myheader as header
> >>>>>> procedure init
> >>>>>> set step on && just to be sure we are getting
> >>>>>> here endproc
> >>>>>> procedure error(x,y,z)
> >>>>>> set step on && just to be sure we aren't
> >>>>>> getting here endproc
> >>>>>> enddefine
> >>>>>>
> >>>>>> when i use mygrid everything seems to be ok
> >>>>>> - all of the init()s get hit
> >>>>>> - none of the error()s get hit
> >>>>>> but - the column header captions are always blank.
> >>>>>>
> >>>>>> if i change the mycolumn class to use the standard header , the
> >>>>>> captions re-appear.
> >>>>>>
> >>>>>> I assume that I am missing some small detail here but I don't see
> >>>>>> what it is.
> >>>>>> Any suggestions ?
> >>>>>>
> >>>>>> Gerry
>
>