Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 6.0 SaveAsClass - Header, Column,Page
Message
De
05/10/1998 16:49:21
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
03/10/1998 10:49:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00143459
Message ID:
00144019
Vues:
35
>>Now the hard part, getting the grid to use this header class. In the grid's Init;
>>
>>
>>SET PROCEDURE TO <ThePrgThatHasTheDefineClassInIt> ADDITIVE
>>WITH THIS
>>   FOR Col IN .Columns
>>      .RemoveObject("Header1")
>>      .AddObject("Header1","MyHeader")
>>   ENDFOR
>>ENDWITH
>>
>
>Jim- I have toyed around with this kind of thing before, but never really gone too far with it, because I can't get properties copied from the form designer header to the 'myheader' automatically. Have you ever seen a way devised to 'loop' through an object properties, for the purpose of mimicking them in another object?

I've done it for the OptionGroup - here's the code:

with this
.visible=.t.
local i, maxwidth, _cap, _top, _width, oldname, newname
maxwidth=0
if .buttoncount=0
.buttoncount=1
endif
for i=1 to .buttoncount
oldname="option"+allt(str(i))
with eval("."+oldname)
_cap=.caption
_top=.top
_width=.width
endwith
.removeobject(oldname)
newname="rdugme"+allt(str(i))
.addobject(newname, "gradio_b")
with eval("."+newname)
.visible=.t.
.caption=_cap
.top=_top
.width=_width
endwith
maxwidth=max(maxwidth, _width)
endfor
.height=.buttons(.buttoncount).top+.buttons(.buttoncount).height
.width=maxwidth
endwith

It's in the group's Init. Analogous code can be used for any other container objects of the kind (commandbutton groups, pageframes, grids).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform