Page 1 of 3
use FMG more than once
Posted: Thu Nov 21, 2019 9:47 pm
by AUGE_OHR
hi,
i have create my 1st FMG and it work.
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

Re: use FMG more than once
Posted: Fri Nov 22, 2019 6:37 am
by mol
As I understand well, you should open child window after ENTER is pressed
Re: use FMG more than once
Posted: Fri Nov 22, 2019 9:31 am
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
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
Re: use FMG more than once
Posted: Fri Nov 22, 2019 1:24 pm
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
Re: use FMG more than once
Posted: Fri Nov 22, 2019 4:34 pm
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,
Re: use FMG more than once
Posted: Fri Nov 22, 2019 8:33 pm
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
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.

Re: use FMG more than once
Posted: Fri Nov 22, 2019 9:24 pm
by edk
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")
Re: use FMG more than once
Posted: Fri Nov 22, 2019 9:27 pm
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 ???
Re: use FMG more than once
Posted: Fri Nov 22, 2019 11:41 pm
by danielmaximiliano
It is not understood what you really want to do
Re: use FMG more than once
Posted: Sat Nov 23, 2019 1:10 am
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
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 (930.57 KiB) Viewed 3779 times