Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Current scctext text generator replacement
Message
De
27/10/2014 03:39:03
 
 
À
26/10/2014 23:49:04
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Source Safe Control
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01599986
Message ID:
01609957
Vues:
59
>O.k. That seems to fit to that what I know. (I manipulate VCX's for years). So this is just a double check. :)
>One need all fields of all records which belongs to the class, except objcode. Objcode will be generated by COMPILE CLASSLIB and then it's available in the designers.

Exactly, and this info es what you found as metadata-comments on generated tx2 files, encapsulated by class and object (look under DEFINE CLASS, ADD OBJECT, etc)


>The first record in the vcx is meta about the vcx. We don't need to discuss how a class is stored.
>You will somehow wrap all the fields other then method in your prg. so you can read them again.
>
>That's it, basically?

Yes, that's it. This is a small example ot that:
DEFINE CLASS cnt_controles AS container 
   *< CLASSDATA: Baseclass="container" Timestamp="" Scale="Pixels" Uniqueid="" />

   *-- OBJECTDATA items order determines ZOrder / El orden de los items OBJECTDATA determina el ZOrder 
   *< OBJECTDATA: ObjPath="Textbox_h" UniqueID="" Timestamp="" />

   *< DefinedPropArrayMethod>
      *m: unmetodo_normal
      *m: unmetodo_oculto
      *m: unmetodo_protegido
      *p: unaprop_oculta		&& Una prop.oculta
      *p: unaprop_protegida		&& Una prop.protegida
   *< /DefinedPropArrayMethod>

   HIDDEN unaprop_oculta
   PROTECTED unaprop_protegida
   Height = 159
   Name = "cnt_controles"
   unaprop_comun = this is a text value in VFP storing format!
   unaprop_oculta = 1000		&& Una prop.oculta
   unaprop_protegida = .NULL.		&& Una prop.protegida
   Width = 284

   ADD OBJECT 'Textbox_h' AS textbox WITH ;
      BackColor = 255,0,0, ;
      Height = 23, ;
      Left = 76, ;
      Name = "Textbox_h", ;
      Top = 12, ;
      Width = 196
      *< END OBJECT: BaseClass="textbox" />

   PROCEDURE Textbox_h.Click
      *-- cnt_controles.Textbox_h.Click()

   ENDPROC

ENDDEFINE
As you see, I'm using special tokens for classes, objects, methods, properties, arrays and more, so I can later read this metadata again, and ti is encoded in a way that a developer sees it as not disturbing comments to not break the normal reading of the program, and being encapsulated in this way you can cut and paste, anytime you respect the structure of this metadata.

The "rare" assignments as
BackColor = 255,0,0
corresponds to VFP internal storing for some values, that ar differently saved when you change the value that when it is a default value. This special assignments, between other things, causes that you can't compile as PRG, but at the same time you can use almost any VFP tool that works with PRG code.


>
>I allways thought vcx / sxc ... as a good example of bad table design ....

Yep. It's a pitty that VFP team didn't enhance the file format to not be binary.
Another pity is that some of the code in methods field is not valid VFP code, and it's only encoded for storing it. If you export a form with inherited controls, you can find ADD OBJECTs that references various controls, which is invalid because VFP syntax does not allow that.


Regards.-
Fernando D. Bozzo
Madrid / Spain
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform