Re: custom columns/headers

Tech-Archive recommends: Speed Up your PC by fixing your registry



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@xxxxxxxxxxxxx> wrote in message
news:uKwbTXVNFHA.3796@xxxxxxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxx> wrote in message
> > news:uN6b2ZLNFHA.3788@xxxxxxxxxxxxxxxxxxxxxxx
> >> 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@xxxxxxxxxxxxx> wrote in message
> >>> news:%23anQnnKNFHA.1948@xxxxxxxxxxxxxxxxxxxxxxx
> >>>> 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@xxxxxxxxxxx> wrote in message
> >>>>> news:O3qK4TPMFHA.1396@xxxxxxxxxxxxxxxxxxxxxxx
> >>>>>> 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
>
>


.



Relevant Pages

  • Re: custom columns/headers
    ... > if you just drop a standard grid on a form ... > shows the data in the active cursor with the field names as the captions. ... > if you do the same thing with a grid that has custom column, header ... >>> Gerry ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Grid Column Header
    ... So now I must now create a PRG file just to ... the grid on the fly, or to predefine your grid class using code in the ... You can change the header class used in the Init of the grid. ... ENDFUNC ...
    (microsoft.public.fox.vfp.forms)
  • Re: Grid Column Header
    ... grid on the fly, or to predefine your grid class using code in the headers. ... You can change the header class used in the Init of the grid. ... INSERT INTO somedata VALUES ... ENDFUNC ...
    (microsoft.public.fox.vfp.forms)
  • Re: Grid Column Header
    ... have a custom grid class with that header code in it. ... ENDFUNC ...
    (microsoft.public.fox.vfp.forms)
  • Re: custom columns/headers
    ... >> if you do the same thing with a grid that has custom column, header ... >> captions. ...
    (microsoft.public.fox.programmer.exchange)