FMG Editor

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

Moderator: Rathinagiri

User avatar
Steed
Posts: 427
Joined: Sat Dec 12, 2009 3:40 pm

Re: FMG Editor

Post by Steed »

Hi, Pablo

Could you please modify sligthly your code , from lines 38 to 59, just to avoid chose a folderpath every time that the aplication starts, in my special case where Hmgpath can´t be located in the windows registry, and the Hmg Folder is in other Unit ("D:") and in other unsual path: ("D:\User1\Docs\work\hmg")

Original Code:

Code: Select all

If Len( aHMG_PATH ) = 0
   Do While .t.
      HMG_PATH := GetFolder('Select HMG Folder',,,.F.,.T.,,BIF_NONEWFOLDERBUTTON)
      If Empty( HMG_PATH )
         Exit
      Else
         If File(HMG_PATH+"\Version.txt")
            cVer:=hb_MemoRead(HMG_PATH+"\Version.txt")
            If "(" $ cVer
               cVer:=AllTrim(SubStr(cVer,1,At("(",cVer)-1))
            Endif
            If MsgYesNo("Do you want to use HMG "+cVer+" ?","Please confirm HMG_PATH")
               Exit
            Endif
         Else
            MsgInfo("It seems not a HMG folder !","Try again...")
         Endif
      Endif
   Enddo
Else
   HMG_PATH := aHMG_PATH[1,2]
Endif
Proposed Code:

Code: Select all

 If Len( aHMG_PATH ) = 0
	If file("FMG_Editor.ini")
		HMG_PATH:=hb_MemoRead("FMG_Editor.ini") 
	Else
	   Do While .t.
		  HMG_PATH := GetFolder('Select HMG Folder',,,.F.,.T.,,BIF_NONEWFOLDERBUTTON)
		  If Empty( HMG_PATH )
			 Exit
		  Else
			 If File(HMG_PATH+"\Version.txt")
				cVer:=hb_MemoRead(HMG_PATH+"\Version.txt")
				If "(" $ cVer
				   cVer:=AllTrim(SubStr(cVer,1,At("(",cVer)-1))
				Endif
				If MsgYesNo("Do you want to use HMG "+cVer+" ?","Please confirm HMG_PATH")
				   hb_MemoWrit("FMG_Editor.ini",HMG_PATH) 
				   Exit
				Endif
			 Else
				MsgInfo("It seems not a HMG folder !","Try again...")
			 Endif
		  Endif
	   Enddo   
	Endif
Else
   HMG_PATH := aHMG_PATH[1,2]
Endif
Thanks, Ed
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 »

Rathinagiri wrote:You can use OpenIcon Library also.
Thanks, Rathi nice icons. But now I am quite finishing. I need to do only "Propierties" one. And probably I will make a extra button for switch Menu Horizontal/Vertical too.

Steed wrote:Could you please modify sligthly your code , from lines 38 to 59, just to avoid chose a folderpath every time that the aplication starts, in my special case where Hmgpath can´t be located in the windows registry, and the Hmg Folder is in other Unit ("D:") and in other unsual path: ("D:\User1\Docs\work\hmg")
Hi Eduar, as you can see at Setup button this is expected to let fixed as an user choice. But anyway It must need to be checked if the path is valid and contains HMG inside. Also I will write INI file by normal text by BEGIN INI / GET / SET not by Memowrit/MemoRead.

Thanks for your indication, I will do this.

Secnd version of today:

There are some components that I need to make selection by Events function. I got a new aprroach changing each component event by MY_Trigger() but I not sure if I will continue with this idea. There are some components without "OnGotFocus" definition in place is "OnChange". So probably I will choose for a Event function. I will see.

<Attached files was removed. Please see last message with updated files.>
Attachments
Tela.PNG
Tela.PNG (115.04 KiB) Viewed 4324 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
mol
Posts: 3723
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: FMG Editor

Post by mol »

I'm trying to open not complicated form:
Image

and get error:

Code: Select all

Date:05/06/14 Time: 08:05:49
Error BASE/1003 Variable does not exist: _FORM_1
Called from GETFORMHANDLE(3473) 
Called from _GETWINDOWSIZEPOS(707) 
Called from BEFORE_ACTIVATE(487) 
Called from LOAD_FMG(477) 
Called from OPEN_FORM(353) 
Called from (b)MAIN(34) 
Called from (b)MAIN(120) 
Called from _DOCONTROLEVENTPROCEDURE(5625) 
Called from EVENTS(1639) 
Called from DOMESSAGELOOP(0) 
Called from _ACTIVATEWINDOW(5293) 
Called from MAIN(185) 
Besides, error message is written in folder where opened .fmg file is located, not in the FOMGEditor folder.

.FMG file is placed here:
http://www.molsystemy.pl/hmg/oknozmianywielokrotne.fmg" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
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,

Thank you to be shared your fmg file and resported error. I found the cause: is because your form was declared as MODAL and I have not prevented this situation (which should it be normal). :oops:

Errors routine, I must be also work on that situation. I will correct it for next release, very easy to be solved.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: FMG Editor

Post by danielmaximiliano »

Me sucede lo mismo
2014-05-06 08_38_32-Open form.jpg
2014-05-06 08_38_32-Open form.jpg (53.37 KiB) Viewed 4298 times
2014-05-06 08_39_05-Program Error.jpg
2014-05-06 08_39_05-Program Error.jpg (30.2 KiB) Viewed 4298 times
PrincipalOCX.rar
(907 Bytes) Downloaded 245 times
Last edited by danielmaximiliano on Tue May 06, 2014 11:51 am, edited 1 time in total.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
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 »

Si Daniel, ocurre un error que no habia prevísto esa situacion... es que las ventanas CHILD no pueden ser MODAL y yo me olvidé de corregir eso. Si sacas las palabras MODAL del archivo fmg, solo para testear (después lo debes colocar de nuevo), verás que carga normalmente.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
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 »

While the next release of FMG_Editor is not published yet and you want to solve the problem of modal. Make the following change in Function Set_Form_Define (line 925) and add:

, {"MODAL", ""}

Please note there is a space character after the letter "L" on MODAL word. See picture below:
Tela.PNG
Tela.PNG (50.29 KiB) Viewed 4294 times
Save and compile the code and test your form again.

Thank you Marek, gracias Daniel ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
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 »

Thanks to guys who reported errors about MODAL forms, now I got better error handling and this fault was correct too. Please this is the best help, testing fully and report any errors or suggestions very good welcomed. :D

<Files attached was removed. Please see last message with updated files.>
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
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 »

Hola Daniel,

Yo no habia visto que mandaste tu archivo fmg (debe ser mi falta de descanso), gracias por compartirlo. :D

Pude ver que tenemos otra situacion. Es cuando el usuário realiza alteraciones en el archivo fmg de forma manual, usando un editor de textos. Esta situacion la tenia completa antes, pero yo habia resulto sacarla. Tu DEFINE WINDOW contiene salto de linea, es decir contiene el caracter ";" que tendré que tratar nuevamente. Iré recuperar esa funcion y retorno.

Gracias Daniel por tu interés ! :)

Image

Hi Daniel,

I had not seen that you have sent your fmg file (must be my lack of sleep), thanks for sharing. :D

I could see in It, that we have another situation. It is when the user makes changes in the fmg file manually, using a text editor. I had previously thought about to prevent it, but the routine unfortunelly I have cutted off...

Your DEFINE WINDOW contains breaking lines, ie contains the character ";" I'll have to try again. 'll Regain that function and comeback.

Thanks Daniel for your interest ! :D
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: FMG Editor

Post by andyglezl »

Hola Pablo Cesar

Hice la prueba con tu ultimo ejecutable y me da estos errores al dar "click" en 2 controles.
------------------------------------------------------------------------------------------
Hi Pablo Cesar

I tested your last executable and I get these errors in giving "click" in 2 controls.
Attachments
FMGEdit01.jpg
FMGEdit01.jpg (109.95 KiB) Viewed 4263 times
FMGEdit02.jpg
FMGEdit02.jpg (118 KiB) Viewed 4263 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply