Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Classes not to subclass
Message
De
27/05/2003 01:08:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
26/05/2003 12:06:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00792211
Message ID:
00792949
Vues:
34
Good Morning Marcia,
>Hi Agnes.
>
>PMFJI, does this ADD OBJECT (not the member*) thing work with versions prior VFP 8.0?
>
>Sure. ADD OBJECT is a clause of DEFINE CLASS.
I was not exact with my question. ::)
Does it replace the standard textbox or add it a new Object? This is because the column creates the textbox (and the header) if I do not add any ADD OBJECT.
Would it be possible to add a standard header the same way?

>Can I add moe then one object?
>
>As long as the container is appropriate for whatever you are trying to add to it. Of course, trying to use your own custom columns with custom headers and text boxes in your grid class is a real PITA prior to version 8. You need code similar to this in the grid class's Init() to use your custom member classes:
>
>
>LOCAL lnColumnCount, loColumn, lcName, lnCol
>SET PROCEDURE TO GridMembers.prg ADDITIVE
>lnColumnCount = This.ColumnCount
>IF lnColumnCount > 0
>  *** dimension the arrays properly
>  DIMENSION This.aControlSources[ lnColumnCount ]
>  DIMENSION This.aCaptions[ lnColumnCount ]
>  *** Remove all the base class columns
>  FOR lnCol = 1 TO lnColumnCount
>    *** Save the colntrolSource and the Caption
>    This.aControlsources[ lnCol ] = EVALUATE( 'This.Column' + TRANSFORM( lnCol ) + '.ControlSource' )
>    This.aCaptions[ lnCol ] = EVALUATE( 'This.Column' + TRANSFORM( lnCol ) + '.Header1.Caption' )
>    This.RemoveObject( 'Column' + TRANSFORM( lnCol ) )
>  ENDFOR
>  *** Now add the custom columns
>  FOR lnCol = 1 TO lnColumnCount
>    lcName =  'Column' + TRANSFORM( lnCol )
>    This.AddObject( lcName, 'colCustom' )
>    loColumn = EVALUATE( 'This.' + lcName )
>    loColumn.ControlSource = This.aControlsources[ lnCol ]
>    loColumn.Header1.Caption = This.aCaptions[ lnCol ]
>    loColumn.Visible = .T.
>  ENDFOR
>ENDIF
>
Yes that must be done if a grid was visual created.

BTW Is there a reason that you EVALUATE the columns and not use THIS.COLUMNS(lnCol).***?

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform