|
From: Paulo F. <pff...@ya...> - 2014-01-06 15:06:55
|
/*
Hi
some problems:
Esc closes the dialog with a button IDCANCEL
With NOEXIT a Button IDOK does not close the dialog
the Enter key don't move from the second GET
Using:
ON CHANGE
The msginfo will appear before the dialog
ON KEYDOWN
Pressing function keys works fine
Pressing "A" the msginfo appears twice
Best Regards,
Paulo Flecha
HWGUI 2.18 Build 1
Harbour 3.2.0dev (r1312100504)
*/
#include "windows.ch"
#include "guilib.ch"
function Main()
Local oDlg, oGet[2], aVar:= {Space(10), Space(10) }
INIT DIALOG oDlg TITLE "No Exit Enter and Esc" ;
AT 190,10 SIZE 360,240 CLIPPER NOEXIT NOEXITESC
@ 10, 10 GET oGet[1] VAR aVar[1] SIZE 200, 32 //ON KEYDOWN {|| Test(oGet, 1)}
@ 10, 50 GET oGet[2] VAR aVar[2] SIZE 200, 32 //ON CHANGE {|| Test(oGet, 2)} ;
@ 20,190 BUTTON "Ok" SIZE 100, 32 ID IDOK;
ON CLICK {|| hwg_EndDialog()}
@ 150,190 BUTTON "Cancel" SIZE 100, 32 ID IDCANCEL;
ON CLICK {|| hwg_EndDialog()}
oDlg:Activate()
Return Nil
Static Function Test(oGet, nPar)
IF nPar == 1
hwg_MsgInfo(oGet[nPar]:title, "On KeyDown")
ELSE
hwg_MsgInfo(oGet[nPar]:title, "On Change")
ENDIF
Return -1
|