Real Time Form Manager

Utilities like DBU, Make, IDE written in HMG/ used to create HMG based applications

Moderator: Rathinagiri

User avatar
vagblad
Posts: 160
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece

Real Time Form Manager

Post by vagblad »

Hello Pablo, some months ago Nikos and I started working on an editor for our forms which was running at the same time the program was. We wanted to reposition controls, change colors etc on the fly while the program was running so we could see the result on our screen before we re-compiled the program. We wanted to share that editor at some point because at the moment it has many flaws, but because we had lots of work and little free time we postponed the development again and again.

Now seeing your wonderful idea, you woke me up again :) I am going to share the code here, but please be patient with us because its just a small prototype at the moment. We use the HMG_SYSDATA to get our controls,forms,etc....
I have a great list of improvements already but i i think if we could combine that with your idea we can make an excellent tool for all of us. I am willing to help in anyway possible on my free time.

We called the project Real Time Form Manager or RTFM.
To make it work you need to add the Rtfm.prg and the Rtfm.fmg files in your project and recompile. Also copy the Rtfm.ini in your project's folder, and inside your main prg before the activate main you have to call the Rtfm_Init() function.
Thats it. Pretty simple.It has some glitches with a timer that is running but i havent worked on it for some time now.

P.S.: Personally and i think Nikos also, i am very happy to see you back and active. You were always contributing to move the HMG forward and helping lots of people in here.

Google translate
Hola Pablo, hace unos meses Nikos y empecé a trabajar en un editor para nuestros formularios que se estaba ejecutando en el mismo momento en que el programa era. Queríamos cambiar la posición de los controles, cambiar los colores, etc sobre la marcha mientras el programa se ejecuta, así que pudimos ver el resultado en nuestra pantalla antes de que vuelvan a compilar el programa. Queríamos compartir ese editor en algún momento, porque en el momento en que tiene muchos defectos, pero porque teníamos mucho trabajo y poco tiempo libre que pospuso el desarrollo y otra vez.

Ahora ver a su idea maravillosa, que me despertó de nuevo :) Voy a compartir el código aquí, pero por favor sean pacientes con nosotros porque es sólo un pequeño prototipo en el momento. Usamos el HMG_SYSDATA para conseguir nuestros controles, formularios, etc ....
Tengo una gran lista de mejoras ya, pero yo creo que si pudiéramos combinar eso con su idea de que podemos hacer una excelente herramienta para todos nosotros. Estoy dispuesto a ayudar de cualquier manera posible en mi tiempo libre.

Llamamos al proyecto en tiempo real Forma Manager o RTFM.
Para que funcione es necesario agregar los archivos de la Rtfm.fmg Rtfm.prg y en su proyecto y recompilar. También copiar el Rtfm.ini en la carpeta de su proyecto, y dentro de su prg principal antes de que el principal activa usted tiene que llamar a la función Rtfm_Init ().
Eso es. Bastante simple.It tiene algunos problemas con un temporizador que se está ejecutando, pero que no he trabajado en él durante algún tiempo.

P.S .: En lo personal y creo que Nikos también, estoy muy feliz de verte de nuevo y activo. Siempre estaban contribuyendo a mover la HMG adelante y ayudar a mucha gente aquí.

Update: Uploaded the correct files
Attachments
TestRtfm.zip
(1.54 MiB) Downloaded 338 times
Last edited by vagblad on Wed Oct 12, 2016 1:51 pm, edited 4 times in total.
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Prg2Fmg Project

Post by serge_girard »

Hello Vagelis.

I tried your to include RTFM and finally I succeed but now immediatly receive runtime errors at:
PROCEDURE Rtfm_ScanControls(cForm) : Error BASE/1132 Bound error: array access
Debuffing tought me:
len(_HMG_SYSDATA [135]) 0
len(_HMG_SYSDATA [136]) 11
len(_HMG_SYSDATA [138]) 0

Now i can't remember where to find what is (_HMG_SYSDATA [138] ...

Serge
There's nothing you can do that can't be done...
User avatar
vagblad
Posts: 160
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece

Re: Prg2Fmg Project

Post by vagblad »

serge_girard wrote:Hello Vagelis.

I tried your to include RTFM and finally I succeed but now immediatly receive runtime errors at:
PROCEDURE Rtfm_ScanControls(cForm) : Error BASE/1132 Bound error: array access
Debuffing tought me:
len(_HMG_SYSDATA [135]) 0
len(_HMG_SYSDATA [136]) 11
len(_HMG_SYSDATA [138]) 0

Now i can't remember where to find what is (_HMG_SYSDATA [138] ...

Serge
Serge i am terribly sorry, you are right. It's because i mainly use Grigory's MiniGui and the structure of the _HMG_SYSDATA is different.
I will correct the mistakes and reupload the files.
Sorry for my mistake.
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Prg2Fmg Project

Post by serge_girard »

No problem , I allready noticed the difference !

S
There's nothing you can do that can't be done...
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Prg2Fmg Project

Post by serge_girard »

Vagelis,

Please translate also some Greec labels..

Thx,

Serge
There's nothing you can do that can't be done...
User avatar
vagblad
Posts: 160
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece

Re: Prg2Fmg Project

Post by vagblad »

I've uploaded the correct files. Again sorry for the inconvenience. You can just test it right away. It's nothing spectacular, just a textbox and a label which you can move around and resize during runtime.
Next steps will be to save the changes in the fmg file, ini files with all the control properties so they can be displayed dynamically in the program and other stuff i am thinking about.

@Serge Yes i've translated most of them i think. Thanks :)
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Prg2Fmg Project

Post by serge_girard »

Ok, much better !

Thx, Serge
There's nothing you can do that can't be done...
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: Prg2Fmg Project

Post by serge_girard »

Vagelis,

I succesfully added BackColor as possible item to change on the fly. It works fine !!

Serge
There's nothing you can do that can't be done...
User avatar
vagblad
Posts: 160
Joined: Tue Jun 18, 2013 12:18 pm
DBs Used: MySQL,DBF
Location: Thessaloniki, Greece

Re: Prg2Fmg Project

Post by vagblad »

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
Master.jpg (152.36 KiB) Viewed 4673 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
Details.jpg (97.42 KiB) Viewed 4673 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
Master.jpg (152.36 KiB) Viewed 4673 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
Details.jpg (97.42 KiB) Viewed 4673 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.
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Real Time Form Manager

Post by Pablo César »

Hi guys Vagelis and Nikos, congratulations for this project and arrangements. Much better to keep focus in each project. Thanks Rathinagiri for your handling too.

I hope to contribute gratefully with some ideas if you permit of course.
Pablo César wrote:Note that RTFM have not found the way yet for fmg writing...

Same difficult certainly will find vagblad and Nikos. Because if you have a form or a set of controls with its all properties (including ActionProcedures), all of these properties MUST be restored at the new form.
Regarding this my comment, I see you will find difficulty to recognize actions procedures in FMgs but not much than in Prg2Fmg case. For me is still not possible... :(
Because the difference between RTFM and Prg2Fmg you count already with FMG file. So in this case, you can do it the same I've got in FMG_Editor. Where ProcedureAction I extracting as Sub-String direct from fmg file and you can take same procedure from there or adapt it.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply