Page 14 of 16
FMG Editor
Posted: Fri May 23, 2014 12:08 pm
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 ?
Re: FMG Editor
Posted: Fri May 23, 2014 2:37 pm
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.
Re: FMG Editor
Posted: Wed May 28, 2014 8:15 pm
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.
FMG Editor
Posted: Thu May 29, 2014 1:19 am
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
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 ?
Re: FMG Editor
Posted: Thu May 29, 2014 3:32 am
by Javier Tovar
Hola Pablo César,
Gracias por la aclaración.
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
FMG Editor
Posted: Fri May 30, 2014 12:14 am
by Pablo César
Ahhh ok Javier. Sos inteligente, vas a conseguir !
Y conseguiste compilar FMG_Editor con la nueva version de HMG ?
Re: FMG Editor
Posted: Fri May 30, 2014 6:16 pm
by Javier Tovar
Re: FMG Editor
Posted: Thu Jun 05, 2014 10:22 am
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
Re: FMG Editor
Posted: Thu Jun 05, 2014 11:52 am
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]
FMG Editor
Posted: Thu Jun 05, 2014 1:21 pm
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 !
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):
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.