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

use FMG more than once

Post by AUGE_OHR »

hi,

i have create my 1st FMG and it work. :D
now i think how does it work if i want to use same FMG twice (or more) at same time :?:

what i mean :
let say we have a GRID a select 1st Item. now you want "more" and press ENTER and FMG appear.
even if FMG is still open i like to change to GRID an choise other Item and "open" it -> FMG twice

so how to do it with harbour / HMG :?:
have fun
Jimmy
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: use FMG more than once

Post by mol »

As I understand well, you should open child window after ENTER is pressed
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,

Yes Form open after ENTER or DblClick on GRID Item.

but what when have Form open, change to GRID and choise other ITEM and open 2nd FORM :idea:

Code: Select all

Function Setup()
   DEFINE WINDOW Win_Setup ;
   ...
   @ 050,200+50 TEXTBOX TEXT_1 ;
                FIELD POP3->POP3     ; 
in MAIN i do this

Code: Select all

   nResult := Win_Setup.TEXT_1.Value
but which Result is it :?: from 1st Form or from 2nd Form :?:

this is my Problem with "multi" Form.
in Xbase++ i use OOP so Result is ok
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 »

I don't understand what you really need, the translation is not faithful when translating the page.

I think you should use the code provided by EDK.

Code: Select all

#include "hmg.ch"

Function Main

Local aRows [20] [3]

_HMG_LastActiveGridIndex := 0

	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 800 ;
		HEIGHT 550 ;
		TITLE 'Hello World!' ;
		MAIN 

		aRows [1]	:= {'Simpson','Homer','555-5555'}
		aRows [2]	:= {'Mulder','Fox','324-6432'} 
		aRows [3]	:= {'Smart','Max','432-5892'} 
		aRows [4]	:= {'Grillo','Pepe','894-2332'} 
		aRows [5]	:= {'Kirk','James','346-9873'} 
		aRows [6]	:= {'Barriga','Carlos','394-9654'} 
		aRows [7]	:= {'Flanders','Ned','435-3211'} 
		aRows [8]	:= {'Smith','John','123-1234'} 
		aRows [9]	:= {'Pedemonti','Flavio','000-0000'} 
		aRows [10]	:= {'Gomez','Juan','583-4832'} 
		aRows [11]	:= {'Fernandez','Raul','321-4332'} 
		aRows [12]	:= {'Borges','Javier','326-9430'} 
		aRows [13]	:= {'Alvarez','Alberto','543-7898'} 
		aRows [14]	:= {'Gonzalez','Ambo','437-8473'} 
		aRows [15]	:= {'Batistuta','Gol','485-2843'} 
		aRows [16]	:= {'Vinazzi','Amigo','394-5983'} 
		aRows [17]	:= {'Pedemonti','Flavio','534-7984'} 
		aRows [18]	:= {'Samarbide','Armando','854-7873'} 
		aRows [19]	:= {'Pradon','Alejandra','???-????'} 
		aRows [20]	:= {'Reyes','Monica','432-5836'} 

		DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 30,30 

			BUTTON B_FIND CAPTION "[F2] Find" ACTION ShowLastFocusedGrid()
          
		END TOOLBAR
		
		@ 50,10 GRID Grid_Master ;
			WIDTH 760 ;
			HEIGHT 180 ;
			HEADERS {'Last Name','First Name','Phone'} ;
			WIDTHS {140,140,140};
			ITEMS aRows ;
			VALUE {1,1} ;
			TOOLTIP 'Editable Grid Control' ;
			ON GOTFOCUS _HMG_LastActiveGridIndex := GetLastActiveControlIndex ();
			EDIT ;
			JUSTIFY { GRID_JTFY_CENTER,GRID_JTFY_RIGHT, GRID_JTFY_RIGHT } ;
			CELLNAVIGATION 


		@ 240,10 GRID Grid_Detail ;
			WIDTH 760 ;
			HEIGHT 180 ;
			HEADERS {'Last Name','First Name','Phone'} ;
			WIDTHS {140,140,140};
			ITEMS aRows ;
			VALUE 1 ;
			ON GOTFOCUS _HMG_LastActiveGridIndex := GetLastActiveControlIndex ();
			EDIT ;
			TOOLTIP 'Editable Grid Control' ;
			ON HEADCLICK { {||MsgInfo('Click 1')} , {||MsgInfo('Click 2')} , {||MsgInfo('Click 3')} } ;
			JUSTIFY { GRID_JTFY_LEFT,GRID_JTFY_CENTER, GRID_JTFY_CENTER }
                	
		@ 440, 10 BUTTON Button_1 CAPTION "Last GRID" ACTION ShowLastFocusedGrid() 
                	
		ON KEY F2 ACTION ShowLastFocusedGrid() 
                	
	END WINDOW

	CENTER WINDOW Form_1

	ACTIVATE WINDOW Form_1

Return


***********************************
Function ShowLastFocusedGrid()
Local i := _HMG_LastActiveGridIndex
Local aCtrlData
IF i > 0 
	aCtrlData := GetControlDataByIndex (i)
	MsgInfo (e"Control name\t: " + aCtrlData [2] + CRLF +;
		    e"Control type\t: " + aCtrlData [1] + CRLF +;
		    e"Form name\t: " + aCtrlData [40] [40], "The last focused grid" )
ENDIF
RETURN
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
martingz
Posts: 395
Joined: Wed Nov 18, 2009 11:14 pm
Location: Mexico

Re: use FMG more than once

Post by martingz »

AUGE
Something like this, the background screen is the grid, I double click and the window appears in the front with the information,
Attachments
UNdqwdTITLED.jpg
UNdqwdTITLED.jpg (80.83 KiB) Viewed 3700 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 »

martingz wrote: Fri Nov 22, 2019 4:34 pm Something like this, the background screen is the grid, I double click and the window appears in the front with the information,
YES ... but now, leave Detail Form open, i want to go to GRID an take another Item and DblClick.
i'm now on a other Record an got Data from "this" Record, or :?:
---

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:
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: 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")
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 »

AUGE_OHR

No logro ver el panorama completo de lo que quieres hacer...

Si doy 20 veces "dobleclick" en uno o varios registros del grid,
voy a tener 20 ventanas abiertas en mi pantalla ???
*----------------------------------------------------------------------------
AUGE_OHR

I can't see the full picture of what you want to do ...

If I give doubleclick 20 times in one or more grid records,
Will I have 20 windows open on my screen ???
Andrés González López
Desde Guadalajara, Jalisco. México.
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 »

It is not understood what you really want to do
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
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: Fri Nov 22, 2019 9:27 pm Si doy 20 veces "dobleclick" en uno o varios registros del grid,
voy a tener 20 ventanas abiertas en mi pantalla ???
*----------------------------------------------------------------------------
If I give doubleclick 20 times in one or more grid records,
Will I have 20 windows open on my screen ???
YES ... not 20 but more than 1

guess you working on Client "A" and than Client "B" call on Phone.
i do not want to close "work of A", just open a new Form with Data of Client "B"

it is Windows not Cl*pper so User can have many if they need.
but i need to "control" them and i have to figure out how it work with FMG file

---

under Xbase++ i use OOP and i can

Code: Select all

   AADD(aThread, oThread)
later i can ASCAN for Object

Code: Select all

   nPosi := ASCAN(aThread, {|e| e = oThread } )
so i have full Control of every Object
PDRLFU.jpg
PDRLFU.jpg (930.57 KiB) Viewed 3443 times
have fun
Jimmy
Post Reply