Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Store column settings in a grid
Message
De
10/05/1999 16:47:38
 
 
À
10/05/1999 16:45:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00216330
Message ID:
00216907
Vues:
31
John ---

I was being dense (lol).....of course you could seek the current user and object and then SCAN .. ENDSCAN to set all properties. Sorry to confuse you.!



>In the case where you have a grid that you want to reset the values of properties do you step through each object with a loop to restore all property settings in the init? In your example you have hard coded the object name as "Form1.Grid1.Column1"+"ColumnWidth". Do you do a seek for each property that you wish to resore? My thoughts at the moment suggest that it might be more portable to select all the object names that match the container (grid in this case) somehow then step through and set all the properties???
>
>Maybe a SELECT all Objname that contains Form1.Grid1??
>
>Thanks
>>Hiya John
>>
>>Essentially, David and I are preaching the same resolution. The structure of a table to store properties, for me, would be:
>>
>>User C(10),Objname C(100),Prop C(100),PropSet C(100)
>>
>>Main index would be on PADR(user,10)+PADR(objname,100)+PADR(prop,100)
>>
>>So, to restore Form1.Grid1.Column1's ColumnWidth to settings for the current user:
>>
>>*** Assumption is oApp.CurrentUser = Username
>>USE usersets ORDER main IN 0
>>SELECT usersets
>>SEEK PADR(oApp.CurrentUser,10)+PADR("Form1.Grid1.Column1",100)+PADR("C
>>IF FOUND()
>>   THISFORM.Grid1.Column1.ColumnWidth=VAL(usersets.propset)
>>ENDIF
>>
>>
>>This table structure works for all objects as you are not hard-wiring fieldnames for the Grid object only, see?
>>
>>>
>>>Thanks for the reply. I don't understand what you mean by "Divorce the user from the OOP".
>>>
>>>I am restoring the settings in the init of the grid with the following code as suggested by David Frankembach. My object is to present the grid back as the user left it or restore it to the original settings if they select that. I don't see why I can't use SEEK now that the rest is working ok.
>>>
>>>
>>>SELECT User
>>>LOCATE FOR User.FormName = ThisForm.Name
>>>DO WHILE FOUND()
>>>   loColumn = EVALUATE("This." + ALLTRIM(User.Name))
>>>   WITH loColumn
>>>      .ColumnOrder = User.ColumnOrder
>>>      .Width = User.Width
>>>   ENDWITH
>>>   CONTINUE
>>>ENDDO
>>>SELECT CustView
>>>
>>>
>>>
>>>Thanks
>>>
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform