FMG Editor

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

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

FMG Editor

Post by Pablo César »

Hi Marek, thanks for asking.

I stayed stagnant, maybe a little unmotivated. When I do not succeed in implementing something (like this PickUpColor from Desktop) and when I can not get any help (I am still waiting any return from Claudio about BT_BitmapCapture... issues), I accustomed to take a break, hopefully cool down and start over... but it's hard thinking because I hope not be alone in this project...

Have you took a time to see my code ? I have non received any opinion about ComboBox selection height (in this message), no more testings and feedbacks... so It would be good at least to share some opinions from others colleagues, but this it seems this is missing... :(

Upto now fmg file are loadable, was neutralized any function declared at actions in the controls of fmg. All propierties are reachable by the own HMG environment thru _HMG_SYSDATA structure. Colors and position thru Coords are also posible. So, we have a good elements to work on...

Next step shall it be for selection controls. Probably if I get any help will be very good welcome.

So, let me know some things:

Is my code so difficult to understand ?
In your opinion I made something wrong ?
Can I receive any comments, any code example ?
Shall we make some tests in conjunction ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: FMG Editor

Post by mol »

I was very busy last month - two big projects to bring to production ready state, some difficult clients, but, I'll study your work after weekend, I promiss.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: FMG Editor

Post by Javier Tovar »

Hola Pablo César,

Trato de compilar tu archivo ultimo que subiste y me da el siguiente error:

Code: Select all

Harbour 3.2.0dev (r1312060701)
Copyright (c) 1999-2013, http://harbour-project.org/
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg: In function 'HB_FUN_HMG_GETFREEMEM':
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1958:4: error: unknown type name 'MEMORYSTATUSEX'
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1959:10: error: request for member 'dwLength' in something not a structure or union
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1960:4: warning: implicit declaration of function 'GlobalMemoryStatusEx' [-Wimplicit-function-declaration]
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1961:21: error: request for member 'ullAvailPhys' in something not a structure or union
hbmk2: Error: Ejecutando compilador C/C++. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer  -W -Wall -pipe -IC:/hmg.3.2/harbour/include -I../../../../../../hmg.3.2/Mios/EditorMioPolo -IC:/hmg.3.2/include C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_ulsadi.dir/FMG_Editor.c C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_9pk49o.c
También he querido abrir un archivo *.FMG desde GetFile, pero no resulta: esta es la función que pongo en un botón. Es posible hacerlo con el operador de "&"?

Code: Select all

Procedure Test1()
Local x
PUBLIC cArchivo := ""
PUBLIC cRutaArchiFMG := ""
	x := Getfile ( { {'All Files','*.*'} } , 'Open File' , 'c:\' , .f. , .t. )
	cArchivo := SUBSTR(X,(RAT("\",X)+1))
	cArchivo := SUBSTR(cArchivo,1,Len(cArchivo)-4)
	msginfo (cArchivo)
	
*	cRutaArchiFMG := "Load Window "+DirActual+"Formularios\"+cArchivo
	cRutaArchiFMG := "Load Window "+cArchivo
	&(cRutaArchiFMG)
	&cArchivo.Activate
	
*	Load Window  Cobrar
*	Cobrar.Activate
*	RUN &cArchivo

Return
Saludos.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

FMG Editor

Post by Pablo César »

mol wrote:I was very busy last month - two big projects to bring to production ready state, some difficult clients, but, I'll study your work after weekend, I promiss.
Ok, Marek would be good to work with you.

Javier Tovar wrote:Trato de compilar tu archivo ultimo que subiste y me da el siguiente error:

Code: Select all

Harbour 3.2.0dev (r1312060701)
Copyright (c) 1999-2013, http://harbour-project.org/
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg: In function 'HB_FUN_HMG_GETFREEMEM':
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1958:4: error: unknown type name 'MEMORYSTATUSEX'
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1959:10: error: request for member 'dwLength' in something not a structure or union
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1960:4: warning: implicit declaration of function 'GlobalMemoryStatusEx' [-Wimplicit-function-declaration]
C:\hmg.3.2\Mios\EditorMioPolo\FMG_Editor.prg:1961:21: error: request for member 'ullAvailPhys' in something not a structure or union
hbmk2: Error: Ejecutando compilador C/C++. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer  -W -Wall -pipe -IC:/hmg.3.2/harbour/include -I../../../../../../hmg.3.2/Mios/EditorMioPolo -IC:/hmg.3.2/include C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_ulsadi.dir/FMG_Editor.c C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_9pk49o.c
Hola Javier, te agradezco por demonstrar tu interés en este asunto.

De facto está ocurriendo error de compilacion con version 3.2 y anteriores. El error proviene de una nueva funcion GETFREEMEM que Dr. Claudio Soto adicionó a los recursos del Coords().

Ahora hice adaptación en las nuevas funciones de lectura del REGISTRY por lo tanto lo indicado es compilarlo con HMG.3.3.0
Images.rar
(224.76 KiB) Downloaded 434 times
FMG_Editor (sources files).rar
Version 1.12
(16.07 KiB) Downloaded 379 times
FMG_Editor (executable file).rar
(1.31 MiB) Downloaded 444 times

Javier Tovar wrote:También he querido abrir un archivo *.FMG desde GetFile, pero no resulta: esta es la función que pongo en un botón. Es posible hacerlo con el operador de "&"?

Code: Select all

Procedure Test1()
Local x
PUBLIC cArchivo := ""
PUBLIC cRutaArchiFMG := ""
	x := Getfile ( { {'All Files','*.*'} } , 'Open File' , 'c:\' , .f. , .t. )
	cArchivo := SUBSTR(X,(RAT("\",X)+1))
	cArchivo := SUBSTR(cArchivo,1,Len(cArchivo)-4)
	msginfo (cArchivo)
	
*	cRutaArchiFMG := "Load Window "+DirActual+"Formularios\"+cArchivo
	cRutaArchiFMG := "Load Window "+cArchivo
	&(cRutaArchiFMG)
	&cArchivo.Activate
	
*	Load Window  Cobrar
*	Cobrar.Activate
*	RUN &cArchivo

Return
Cuanto a utilizar "&", creo que no se aplica. Pero el problema principal es que tu no estás usando las funciones adecuadas para UNICODE como:

Code: Select all

HB_USUBSTR()      <=>   SUBSTR()
HB_UTF8RAT()      <=>   RAT()
HMG_LEN()         <=>   LEN()
Pero te puedo preguntar, cual es la razón de querer cargar un archivo fmg utilizando el método Load_Fmg dentro de tu sistema ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: FMG Editor

Post by Javier Tovar »

Hola Pablo César,

Gracias por la aclaración. :D

Mi idea es la siguiente:

1.- Abrir el Archivo *.FMG
2.- Seleccionar los controles que se van a considerar a una Base de Datos por medio de un ListBox a Una Grid.
3.- Darles a esos controles Nombre del Campo, Tipo, Longitud, Decimales, Tipo de Mascara, Nombre de Array, Activo...
4.- Establecer indices de clave principal para un campo o varios. Ademas de los indices que se generan por default.
5.- Establecer Relaciones con los diferentes Bases de Datos sobre ciertos campos.
6.- Con Foto por registro?
7.- Seleccionar Tipo de Pantalla, Con Botones, Solo ToolBar o con Grid.

De aquí se generaría un archivo *.prg y otro *.FMG (ya que se va a agregar el ToolBar o los botones). El archivo *.prg va a contener todo lo necesario para dar de Altas, Bajas, Modificaciones, Consultas, Desplegados, Búsqueda, Imprimir, etc. Y se puede llevar por proyecto, con esto quiero decir que lo podamos aplicar en un proyecto en particular, para poder hacer modificaciones posteriores y no repetir lo ya configurado. Algo parecido a mi generador de Pantallas que hice, pero ahora empezando con los archivos *.FMG.

Es una idea, que la pueda realizar es otra cosa...

Saludos
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

FMG Editor

Post by Pablo César »

Ahhh ok Javier. Sos inteligente, vas a conseguir !

Y conseguiste compilar FMG_Editor con la nueva version de HMG ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: FMG Editor

Post by Javier Tovar »

Hola Pablo César,
Pablo César wrote:Y conseguiste compilar FMG_Editor con la nueva version de HMG ?
No he cargado la nueva versión de HMG, por que estoy depurando mi PC, tengo muchos archivos y programas y estoy en la etapa de depuración, y a lo mejor por lo mismo ahorita mi maquina esta lenta! sera hasta el lunes que cargue la nueva versión de HMG. :D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek: ES LO QUE ESTOY HACIENDO CON MI MAQUINA! :D

Saludos

P.D.: Y es por eso que no he compilado los demos para encontrar un posible BUG!
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: FMG Editor

Post by mol »

Hi guys!
I want to present a little sample born today morning.
It's antoher way to read definition of fmg file.
It's only tested on few controls (TEXTBOX, LABEL, COMBOBOX and BUTTON).
This sample procedure read fmg file and put control definitions into array. It would be easier to retrieve form definition in this way, I think.

Nice testing,
Regards, Marek
Attachments
sample_fmg_analyzer.zip
(3.44 KiB) Downloaded 335 times
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: FMG Editor

Post by srvet_claudio »

Instead GETFREEMEM of using using:

Code: Select all

GlobalMemoryStatusEx () --> return array with 7 numbers

[1] statex.dwMemoryLoad: approximate percentage of physical memory that is in use (0 indicates no memory use and 100 indicates full memory use)
[2] statex.ullTotalPhys: amount of actual physical memory, in bytes
[3] statex.ullAvailPhys: amount of physical memory currently available, in bytes
[4] statex.ullTotalPageFile: current committed memory limit for the system or the current process, whichever is smaller, in bytes
[5] statex.ullAvailPageFile: maximum amount of memory the current process can commit, in bytes
[6] statex.ullTotalVirtual: size of the user-mode portion of the virtual address space of the calling process, in bytes
[7] statex.ullAvailVirtual: amount of unreserved and uncommitted memory currently in the user-mode portion of the virtual address space of the calling process, in bytes
HMG_GETFREEMEM() --> GlobalMemoryStatusEx () [3]
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

FMG Editor

Post by Pablo César »

srvet_claudio wrote:HMG_GETFREEMEM() --> GlobalMemoryStatusEx () [3]
Thank you Claudio for your explanation and indication. I just replaced and working perfectly, but only compile with HMG.3.3.0. :(

I have recompiled with a new HMG version and all bmp buttons are better and more featured in colors, with better definition. Now I just have to put a background color with non used one for the transparent canl take effect. Is much better now, thank Claudio ! :D

Claudio, yo todavia no resolvi esta cuestion de poder colocar el PickupColor() cuando el FMG_Editor esté sin fmg cargado. Me gustaria que pudiera dejarlo asi como muestra la figura abajo (tela editada con el Paint):

Image

Fijate Claudio que mi ToolBarButtons aparece y el fondo que era griz quede transparente para que el usuário pueda tomar los colores del desktop, pero quisiera que mi ToolBar apareciera. Y hé intentado de todo y habia desistido dejando apenas el desktop entero como pantalla capturada/exibida. Pero no me está capturando en el clipboard ni exibiendo en el StatusBar porque mi ToolBar no está más exibiendolo. Me gustaria hacerlo funcionar como quiero, cuando tengas un tiempito y me puedas mostrar el camino, te lo agradezco.

Mi ultima modificacion está en este mensaje para download del source. :roll:
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply