Page 2 of 3
Re: use FMG more than once
Posted: Sat Nov 23, 2019 1:23 am
by AUGE_OHR
edk wrote: ↑Fri Nov 22, 2019 9:24 pm
AUGE_OHR wrote: ↑Fri Nov 22, 2019 8:33 pm
i saw Sample with Macro as Form-Name
so when 1st Form is called by "Form_01" and 2nd Form is called "Form_02" that i can use
Code: Select all
nResult1 := Form_01.TEXT_1.Value
nResult2 := Form_02.TEXT_1.Value
so how to get this construction.
Code: Select all
nResult := GetProperty ( fMain, "TEXT_1", "Value")
AHA ...
the Form "is" a "O"bject so i can ask for Child Property.
Question : is there a Function to "test" for Member "TEXT_1"
Code: Select all
IsMemberVar( <oObject>, <cVarName>, [<nAttributes>] ) --> lExist
IsMethod( <oObject>, <cMethodName>, [<nAttributes>] ) --> lExist
Re: use FMG more than once
Posted: Sat Nov 23, 2019 3:41 am
by andyglezl
Lo siento, yo nunca he usado las formas FMG ...
Pero quizá este ejemplo ayude.
*-----------------------------------------------------------
I'm sorry, I've never used FMG forms ...
But maybe this example helps.
https://www.hmgforum.com/viewtopic.php? ... &start=110
Re: use FMG more than once
Posted: Sat Nov 23, 2019 7:07 am
by AUGE_OHR
andyglezl wrote: ↑Sat Nov 23, 2019 3:41 am
Lo siento, yo nunca he usado las formas FMG ...
Pero quizá este ejemplo ayude.
*-----------------------------------------------------------
I'm sorry, I've never used FMG forms ...
But maybe this example helps.
THX for Demo.
i saw it. when press Button on Main Form i got 2 x new Form.
but i want to press Button in Main again and again ... and each Time i want a new Form.
---
other Solution are using Tabpage like in Firefox & Co.
but it seems to be a Problem to delete a Tab No which is not last Tab
e.g. i have 3 x Tab and want to close Tab No 2 ... is this possible in HMG
does i this link point to FMG_Editor.rar
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016,
http://harbour-project.org/
C:\MiniGUI\SAMPLES\0\MAIL\8\FMG_Editor.prg

24: fatal error: c_registry.c: No such file or directory
compilation terminated.
hbmk2[FMG_Editor]: Error: Running C/C++ compiler. 1
gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -W -Wall -pipe -IC:/hmg.3.4.4/harbour/include -IC:/MiniGUI/SAMPLES/0/MAIL/8 -IC:/hmg.3.4.4/include R:/Temp/hbmk_7cvm8f.dir/FMG_Editor.c R:/Temp/hbmk_oyuyf0.c
i found other Version here
https://www.hmgforum.com/viewtopic.php? ... &start=130
but that Version give a lot of Error ... ( ANSI / UNICODE ? )
Re: use FMG more than once
Posted: Sat Nov 23, 2019 11:26 am
by danielmaximiliano
AUGE_OHR wrote: ↑Sat Nov 23, 2019 7:07 am
other Solution are using Tabpage like in Firefox & Co.
but it seems to be a Problem to delete a Tab No which is not last Tab
e.g. i have 3 x Tab and want to close Tab No 2 ... is this possible in HMG
HI. try my sample in Minigui
C:\MiniGUI\SAMPLES\BASIC\Tab_2
adapt the code so as not to create a previously created TAB since this example was created for a need that was never implemented.
Re: use FMG more than once
Posted: Sat Nov 23, 2019 7:00 pm
by edk
Or maybe something like that? In my example there are two ways for the context menu of the grid: for the Child window - regular, for the Standard window - more flexible
Re: use FMG more than once
Posted: Sat Nov 23, 2019 8:25 pm
by AUGE_OHR
edk wrote: ↑Sat Nov 23, 2019 7:00 pm
Or maybe something like that? In my example there are two ways for the context menu of the grid: for the Child window - regular, for the Standard window - more flexible
multiforms.7z
YES ... that's it THX
my Error was "different" Name while it MUST be same ( Grid_1 ) and have the same Parent ( fMain )
Code: Select all
DEFINE GRID Grid_1
PARENT fMain
DEFINE CONTROL CONTEXT MENU Grid_1 OF &fMain
Question :
Code: Select all
@ <nRow> ,<nCol>
GRID <ControlName>
[ OF | PARENT <ParentWindowName> ]
and
Code: Select all
DEFINE GRID <ControlName>
PARENT <ParentWindowName>
ROW <nValue>
COL <nValue>
why is 2nd Sample "only" PARENT while 1st Sample have "OF" and "PARENT"
what is the Differenz between "OF" and "PARENT"

Re: use FMG more than once
Posted: Sat Nov 23, 2019 9:02 pm
by edk
AUGE_OHR wrote: ↑Sat Nov 23, 2019 8:25 pm
Question :
Code: Select all
@ <nRow> ,<nCol>
GRID <ControlName>
[ OF | PARENT <ParentWindowName> ]
and
Code: Select all
DEFINE GRID <ControlName>
PARENT <ParentWindowName>
ROW <nValue>
COL <nValue>
why is 2nd Sample "only" PARENT while 1st Sample have "OF" and "PARENT"
what is the Differenz between "OF" and "PARENT"
Many controls have two syntax, OF/PARENT means the same: the name of the form to which the control should be assigned.
Re: use FMG more than once
Posted: Mon Nov 25, 2019 3:46 am
by AUGE_OHR
hi,
next Problem when using many Form with Variable and Macro in a Loop
i have create 8 x Form with Image in a loop.
Code: Select all
FOR i = 1 TO iMax
cForm := "Form_"+strzero(i, 2)
cImage := "Image_"+strzero(i, 2)
aData[1] := cForm
aData[2] := hBitmap
DEFINE WINDOW &cForm ;
AT nTop, nLeft ;
WIDTH aSubSize[ 1 ] HEIGHT aSubSize[ 2 ] ;
...
ON PAINT Paint_Background_Window(cForm,aData)
@ 0,0 IMAGE &cImage ;
PICTURE aLights[i][1] ;
WIDTH aSubSize[ 1 ] HEIGHT aSubSize[ 2 ] ;
STRETCH
END WINDOW
// add to Array for later
aAdd(a_Forms, "Form_" + strzero(i,2))
nLeft += aSubSize[ 1 ] + 2
NEXT
i want to use PAINT Event to change Background (see Wallpaper Sample)
Problem : cForm or aData[1] is always "last Number" ( Form_08 )
general i know this Problem so i use a function to "detache" Variable
Code: Select all
ON PAINT Paint_Background_Window( Detache_var(cForm) ,hBitmap) ;
FUNCTION Detache_var(cVar)
LOCAL cNewVar := cVar
RETURN cNewVar
but this does not help using harbour / HMG
p.s. i do not want to use 8 x Function Paint_Background_WindowXX()
Re: use FMG more than once
Posted: Mon Nov 25, 2019 9:11 am
by edk
AUGE_OHR wrote: ↑Mon Nov 25, 2019 3:46 am
hi,
next Problem when using many Form with Variable and Macro in a Loop
i have create 8 x Form with Image in a loop.
Code: Select all
FOR i = 1 TO iMax
cForm := "Form_"+strzero(i, 2)
cImage := "Image_"+strzero(i, 2)
aData[1] := cForm
aData[2] := hBitmap
DEFINE WINDOW &cForm ;
AT nTop, nLeft ;
WIDTH aSubSize[ 1 ] HEIGHT aSubSize[ 2 ] ;
...
ON PAINT Paint_Background_Window(cForm,aData)
@ 0,0 IMAGE &cImage ;
PICTURE aLights[i][1] ;
WIDTH aSubSize[ 1 ] HEIGHT aSubSize[ 2 ] ;
STRETCH
END WINDOW
// add to Array for later
aAdd(a_Forms, "Form_" + strzero(i,2))
nLeft += aSubSize[ 1 ] + 2
NEXT
i want to use PAINT Event to change Background (see Wallpaper Sample)
Problem : cForm or aData[1] is always "last Number" ( Form_08 )
general i know this Problem so i use a function to "detache" Variable
Code: Select all
ON PAINT Paint_Background_Window( Detache_var(cForm) ,hBitmap) ;
FUNCTION Detache_var(cVar)
LOCAL cNewVar := cVar
RETURN cNewVar
but this does not help using harbour / HMG
p.s. i do not want to use 8 x Function Paint_Background_WindowXX()
try:
Code: Select all
FOR i = 1 TO iMax
cForm := "Form_"+strzero(i, 2)
cImage := "Image_"+strzero(i, 2)
aData[1] := cForm
aData[2] := hBitmap
cOnPaintProc := "Paint_Background_Window( '" + cForm + "', '" + hb_Serialize(aData) + "')"
DEFINE WINDOW &cForm ;
AT nTop, nLeft ;
WIDTH aSubSize[ 1 ] HEIGHT aSubSize[ 2 ] ;
...
ON PAINT &cOnPaintProc
@ 0,0 IMAGE &cImage ;
PICTURE aLights[i][1] ;
WIDTH aSubSize[ 1 ] HEIGHT aSubSize[ 2 ] ;
STRETCH
END WINDOW
// add to Array for later
aAdd(a_Forms, "Form_" + strzero(i,2))
nLeft += aSubSize[ 1 ] + 2
NEXT
...
***************************************
Function Paint_Background_Window(cForm,cData)
Local aData := hb_DeSerialize(cData)
...
Or
Code: Select all
...
cOnPaintProc := 'Paint_Background_Window( '+ hb_ValToExp( cForm) + ' , ' + hb_ValToExp( aData ) +')'
...
Function Paint_Background_Window(cForm,aData)
...
Re: use FMG more than once
Posted: Mon Nov 25, 2019 9:04 pm
by AUGE_OHR
edk wrote: ↑Mon Nov 25, 2019 9:11 am
try:
Code: Select all
cOnPaintProc := "Paint_Background_Window( '" + cForm + "', '" + hb_Serialize(aData) + "')"
ON PAINT &cOnPaintProc
Function Paint_Background_Window(cForm,cData)
Local aData := hb_DeSerialize(cData)
...
Or
Code: Select all
...
cOnPaintProc := 'Paint_Background_Window( '+ hb_ValToExp( cForm) + ' , ' + hb_ValToExp( aData ) +')'
...
Function Paint_Background_Window(cForm,aData)
...
YES... that it, THX