use FMG more than once

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2061
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: use FMG more than once

Post 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

Code: Select all

   DEFINE WINDOW &fMain ;
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. :idea:

Code: Select all

nResult := GetProperty ( fMain, "TEXT_1", "Value")
AHA ... :idea:
the Form "is" a "O"bject so i can ask for Child Property. :D

Question : is there a Function to "test" for Member "TEXT_1" :?:

Code: Select all

   IsMemberVar( <oObject>, <cVarName>, [<nAttributes>] ) --> lExist 
   IsMethod( <oObject>, <cMethodName>, [<nAttributes>] ) --> lExist 
have fun
Jimmy
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: use FMG more than once

Post 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.

MULTIWIN.rar
(3.27 KiB) Downloaded 187 times


https://www.hmgforum.com/viewtopic.php? ... &start=110
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
AUGE_OHR
Posts: 2061
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: use FMG more than once

Post 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:1796: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 ? )
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: use FMG more than once

Post 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
My Tab example minigui.rar
(591.14 KiB) Downloaded 177 times
adapt the code so as not to create a previously created TAB since this example was created for a need that was never implemented.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
edk
Posts: 911
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: use FMG more than once

Post 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 ;)
multiforms.7z
(2.62 KiB) Downloaded 202 times
User avatar
AUGE_OHR
Posts: 2061
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: use FMG more than once

Post 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" :?:
have fun
Jimmy
edk
Posts: 911
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: use FMG more than once

Post 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.
User avatar
AUGE_OHR
Posts: 2061
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: use FMG more than once

Post 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 ) :evil:

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()
have fun
Jimmy
edk
Posts: 911
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: use FMG more than once

Post 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 ) :evil:

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)
...
User avatar
AUGE_OHR
Posts: 2061
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: use FMG more than once

Post 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
have fun
Jimmy
Post Reply