Re: using member classes in VFP 8 for grid columns & headers by Paul
Paul
Wed Aug 11 04:29:37 CDT 2004
I have attached herewith a zip with the form & class file (program).
Please check it out.
Run the form & check the alignment of the header caption.
Next, modify the MyHeader.prg & change the alignment & the compile it & run
the form again.
Try this out at least 2 times.
You Should face a problem.
Regards,
Paul
"Sietse Wijnker" <sietse.wijnker@ATsw-software.nl> wrote in message
news:%23Y2OfH4fEHA.3428@TK2MSFTNGP11.phx.gbl...
> Hi Paul,
> Are you sure you're pointing to the correct class-file?
> I see you'resetting the HeaderClassLibrary property to 'F:\MyHeader.FXP'.
Is
> the header class in that location?
>
> I've tried what you said without any problems:
>
> Simple form with grdTest grid (Visually designed):
> DEFINE CLASS grdtest AS grid
> MemberClassLibrary = "member.prg"
> MemberClass = "mycol"
> Height = 200
> Width = 320
> Name = "grdtest"
> Themes=.F.
> ENDDEFINE
>
> Member.prg:
> *- Memberclasses
> DEFINE CLASS mycol AS Column
> HeaderClassLibrary = 'headercls.prg'
> HeaderClass = 'myHdr'
> ENDDEFINE
>
> Headercls.prg:
> *- Memberclasses
> DEFINE CLASS myHdr AS Header
> Alignment = 2
> ForeColor=RGB(0,255,0)
> BackColor=RGB(255,255,255)
> FontSize=20
> PROCEDURE Click()
> MESSAGEBOX(PROGRAM())
> ENDPROC
> ENDDEFINE
>
>
> "Paul Wilson" <paul@thisisadummyemailaddress.com> wrote in message
> news:OQPS$33fEHA.2352@TK2MSFTNGP09.phx.gbl...
> > Hi Sietse,
> >
> > Thanx for checking it out,
> > Well, i've tried it with the PRG (didn't work), but check this out
now...
> >
> > include a messagebox to be displayed in the Click event of the header.
> >
> > Now run the form (don't change anything in the form), compile the
> > MyHeader.prg file.
> > You shouldn't see it.
> >
> > If u still do see a messagebox, then try to change some other stuff in
the
> > header - esp alignment, font size...
> >
> > It won't work.
> >
> > Regards,
> > Paul
> >
> > "Sietse Wijnker" <sietse.wijnker@ATsw-software.nl> wrote in message
> > news:uEzmnu3fEHA.3016@tk2msftngp13.phx.gbl...
> > > Repost of my message in the grids-group (now with proper formatting
> ;-)):
> > > Hi Paul,
> > >
> > > From the VFP Help on the HeaderClass property:
> > > Column.HeaderClass [ = cClassName ]
> > >
> > > cClassName
> > > Specifies the name of a member class in a program (.prg) file.
> > >
> > > In your code you're referring to an fxp.
> > > I've tried your example without any trouble, but i used the prg-file
to
> > > refer to in the Memberclass property of the column. When I changed it
to
> > > point to the fxp, it indeed showed the same symptoms you're referring
> to.
> > >
> > > HTH,
> > > Sietse Wijnker
> > >
> > > "Devapriya De Silva" <ddesilva@qa-software.com> wrote in message
> > > news:%23cSrES1fEHA.636@TK2MSFTNGP12.phx.gbl...
> > > > Hi Paul,
> > > >
> > > > You are not doing anything wrong I guess.
> > > > This is the default behavior of it.
> > > > i.e.
> > > > Changing MemberClass and MemberClassLibrary affects only newly
created
> > > > member objects, not existing member objects in the container.
> > > >
> > > > This is documented under the memberclass property help found in the
> > visual
> > > > foxpro language reference.
> > > >
> > > > The other option is for you to build the grid dynamically in your
> visual
> > > > class.
> > > > Kind Regards,
> > > > Devapriya De Silva
> > > >
> > > > "Paul Wilson" <paul@thisisadummyemailaddress.com> wrote in message
> > > > news:uqNTuw0fEHA.720@TK2MSFTNGP11.phx.gbl...
> > > > > I'm trying to use the Member class feature of VFP 8 to create
> classes
> > > for
> > > > > 1). Grid class (which uses the Member class feature for mapping
> > Columns)
> > > > > 2). Column class in a PRG (which uses the HeaderClass for mapping
> > Header
> > > > > class)
> > > > > 3). Header class in a PRG (for the Column Class).
> > > > >
> > > > > I've created a Visual class for the Grid, & have set the Member
> Class
> > &
> > > > > Class Library properties of the grid
> > > > > for the Column class (in the PRG).
> > > > > The contents of the PRG (for the Column & Header classes is as
> > follows)
> > > > >
> > > > > DEFINE CLASS uColumn AS Column
> > > > > HeaderClassLibrary = 'F:\MyHeader.FXP'
> > > > > HeaderClass = 'oHeader'
> > > > > ENDDEFINE
> > > > >
> > > > > && Below is the code from MyHeader.PRG
> > > > >
> > > > > DEFINE CLASS oHeader AS Header
> > > > > Alignment = 2
> > > > > FontSize = 8
> > > > > Caption = "Header"
> > > > > Name = "Header"
> > > > > ENDDEFINE
> > > > >
> > > > > When i drop the Grid class on a form & use it, its all fine,
> > > > > The caption of the Header is Center Aligned.
> > > > > But, if i go & change this Alignment of the Header caption to Left
> (0)
> > > in
> > > > > the MyHeader.PRG & compile it,
> > > > > then the changes are NOT reflected in the GRID (form).
> > > > >
> > > > > The changes APPEAR ONLY IF, i change the column count in the Grid
> (on
> > > the
> > > > > form) to a greater value, & run the form again.
> > > > > Ie, I HAVE TO REFRESH the GRID to retrive the Column class from
the
> > PRG
> > > > once
> > > > > again, which in turn refreshes its setting
> > > > > for the HEADER CLASS from the HeaderClass & HeaderClassLibrary.
> > > > >
> > > > > Am i doing something wrong here.
> > > > > Cuz, if this is how it works, then I'll have to modify ALL my
forms,
> > > when
> > > > > ever i make a change to the Header Class in the PRG.
> > > > >
> > > > > Best Regards,
> > > > >
> > > > > Paul
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
begin 666 Grid Problems.zip
M4$L#!!0````(`&)["S$IWE4?RP```#H!```:````1W)I9"!0<F]B;&5M<R]M
M>4AE861E<BY"04M5CK$*PC 0AN<4^@Y'E^KBX*;@4)-4A=J*07!PB1HDF":2
MMH,^O=?&H4*&R\=_]W^,Y[N2`RTR(:"CSG2UA4Q F.*(;)6\*T^-;)I"7[WT
M;R K("E=7C9>W^'@W=6HNKGLWR$Z>_E'&D<`XU7 [[#F`L0`+QD;RN,HCMA8
MXY?I-<*$&IG1#ULKV^(5(',DN;.MT!\UZ"P04/EJM;,P@"1L)LA+6:M?_8CB
M.QPKRMGIB+U&WYY(R)X+D6WXNCI/,&N,2Z:(4;7/PI_T%U!+`P04````" !O
M>PLQI'1:3VD!```S`@``&@```$=R:60@4')O8FQE;7,O;7E(96%D97(N1EA0
M;5(]3\)0%#VO?(E((LAD8B0F#AHU03>B0RT(3: 0BH.FBT)%8FM)E03BSW!R
ME,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\\Q
M7Z)N4 __8S8X9X,_KDGGC,ZK[DX7ZT]02P,$"@``````=GL+,0``````````
M``````X```!'<FED(%!R;V)L96US+U!+`0(4`!0````(`&)["S$IWE4?RP``
M`#H!```:``````````$`( ````````!'<FED(%!R;V)L96US+VUY2&5A9&5R
M+D)!2U!+`0(4`!0````(`&]["S&D=%I/:0$``#,"```:````````````( ``
M``,!``!'<FED(%!R;V)L96US+VUY2&5A9&5R+D984%!+`0(4`!0````(`&U[
M"S$94/J8RP```#H!```:``````````$`( ```*0"``!'<FED(%!R;V)L96US
M+VUY2&5A9&5R+E!21U!+`0(4`!0````(`'9["S%0/'/[BP$``&H&```:````
M``````$`( ```*<#``!'<FED(%!R;V)L96US+W1E<W1G<FED+E-#5%!+`0(4
M`!0````(`'9["S&%!X-DUP$``-X'```:``````````$`( ```&H%``!'<FED
M(%!R;V)L96US+W1E<W1G<FED+G-C>%!+`0(4``H``````'9["S$`````````
M```````.````````````$ ```'D'``!'<FED(%!R;V)L96US+U!+!08`````
.!@`&`*0!``"E!P``````
`
end