serge_girard wrote:Vagelis,
I succesfully added BackColor as possible item to change on the fly. It works fine !!
Serge
That is great Serge!I think it can be a really strong tool for our daily development work.
I was thinking of a way to have the control properties displayed dynamically, without the need of changing the code everytime we need to add a property or a new control.Here is my idea so far and i would love your input and your critic on it :
We make two dbf files(or anything else to be honest, SQL tables, ini files etc...)
First file we call it ControlsMaster.dbf and it has the following structure:
1st Field : CtrlID - Numeric - Size 3 - It contains the ID of a specific property of a specific control
2nd Field: CtrlName - Character - Size 30 - The name of the control
3rd Field: Property - Character - Size 30 - The name of the property
4th Field: Visual - Character - Size 30 - The name of the control that will visually be displayed on the rtfm form.
5th Field: Prop1 - Character - Size 30 - The 1st value that the property can get
6th Field: Prop1 - Character - Size 30 - The 2nd value that the property can get
7th Field: Prop1 - Character - Size 30 - The 3rd value that the property can get
8th Field: Prop1 - Character - Size 30 - The 4th value that the property can get
9th Field: Prop1 - Character - Size 30 - The 5th value that the property can get
![Master.jpg](./download/file.php?id=7109&sid=6c0a88b656a571dcd08ef9d9752f9da9)
- Master.jpg (152.36 KiB) Viewed 4758 times
Second file we call it ControlsDetails.dbf and it has the following structure:
1st Field :CtrlId - Numeric - Size 2 - It contains the ID of a specific property of a specific control
2nd Field: Property - Numeric - Size 3 - The number of the property
3rd Field: String - Character - Size 50 - The string that will be inserted in the form.
![Details.jpg](./download/file.php?id=7110&sid=6c0a88b656a571dcd08ef9d9752f9da9)
- Details.jpg (97.42 KiB) Viewed 4758 times
So let me give you an example of a user who wants to change the alignemnt property of a label :
The program will show a combobox with the following values: Left-Right-Center.
Lets say that the user chooses the Right alignment. On the 1st table we find the all the controls with the name LABEl at first. Then we search for the ALIGNMENT property and we get two numbers. The CtrlID which is 1 in our case and the property that was changed which is 2 in our case(RIGHT).
Now we go to the 2nd table and search for CtrlID==1.AND. Property==2. That returns the string "RIGHTALIGN := .T." which we can now use to change the property and/or put it in the fmg file.
I hope i explained it quite ok.This way we can add controls or properties at any time with no need of messing with the code.
I would love to hear your ideas and opinions on that.
Thanks
Vagelis
@Pablo
Do you think it will be better to make another thread for this project?the real time form manager? And keep this one for your idea for the prg - > fmg?
I just dont want to hijack your thread. Anyway i wish to contribute in everyway i can in both of them.
Google Translate
Estaba pensando en una manera de tener las propiedades de control aparece de forma dinámica, sin la necesidad de cambiar el código cada vez que tenemos que añadir una propiedad o un nuevo control.Here es mi idea hasta ahora y me encantaría que su entrada y su crítico en él :
Hacemos dos archivos de DBF (o cualquier otra cosa para ser honesto, tablas SQL, archivos ini etc ...)
En primer archivo que llamarlo ControlsMaster.dbf y tiene la siguiente estructura:
1er Campo: CtrlID - Numérico - Tamaño 3 - Contiene el identificador de una propiedad específica de un control específico
2º Campo: CtrlName - Carácter - Tamaño 30 - El nombre del control
3ª Campo: Propiedad - Carácter - Tamaño 30 - El nombre de la propiedad
4º Campo: Visual - Carácter - Tamaño 30 - El nombre del control que visualmente se muestra en el formulario rtfm.
5º Campo: Prop1 - Carácter - Tamaño 30 - El 1er valor que la propiedad puede conseguir
6 de Campo: Prop1 - Carácter - Tamaño 30 - El segundo valor que la propiedad se puede conseguir
7 de Campo: Prop1 - Carácter - Tamaño 30 - La tercera valor que la propiedad se puede conseguir
8 de Campo: Prop1 - Carácter - Tamaño 30 - El cuarto valor que la propiedad se puede conseguir
9 de Campo: Prop1 - Carácter - Tamaño 30 - El quinto valor que la propiedad se puede conseguir
![Master.jpg](./download/file.php?id=7109&sid=6c0a88b656a571dcd08ef9d9752f9da9)
- Master.jpg (152.36 KiB) Viewed 4758 times
Segundo archivo que llamarlo ControlsDetails.dbf y tiene la siguiente estructura:
1er Campo: CtrlId - Numérico - Tamaño 2 - Contiene el identificador de una propiedad específica de un control específico
2º Campo: Propiedad - Numérico - Tamaño 3 - El número de la propiedad
3ª Campo: String - Carácter - Tamaño 50 - La cadena que se inserta en el formulario.
![Details.jpg](./download/file.php?id=7110&sid=6c0a88b656a571dcd08ef9d9752f9da9)
- Details.jpg (97.42 KiB) Viewed 4758 times
Así que te voy a dar un ejemplo de un usuario que quiere cambiar la propiedad alignemnt de una etiqueta:
El programa mostrará un cuadro combinado con los siguientes valores: izquierda-derecha-centro.
Digamos que el usuario elige la alineación derecha. En la 1ª tabla nos encontramos con los todos los controles de la etiqueta del nombre al principio. Luego buscamos la propiedad Alignment y obtenemos dos números. El CtrlID que es en nuestro caso 1 y la propiedad que se ha cambiado, que es en nuestro caso 2 (derecha).
Ahora vamos a la segunda mesa y la búsqueda de CtrlID == 1.AND. == 2 Propiedad. Que devuelve la cadena "RIGHTALIGN: = .T." que ahora podemos utilizar para cambiar la propiedad y / o ponerlo en el archivo fmg.
Espero que se lo expliqué de manera bastante ok.This podemos añadir controles o propiedades en cualquier momento sin necesidad de jugar con el código.
Me encantaría escuchar sus ideas y opiniones sobre eso.
Gracias
vagelis
@Pablo
¿Cree que será mejor hacer otro hilo para este proyecto? El gestor de formularios en tiempo real? Y mantener esta uno para su idea para el PRG -> fmg?
Sólo que no quieren secuestrar su hilo. De todos modos me gustaría contribuir en todos los sentidos puedo en ambos.