Hay alguna forma de que desde cualquier parte del programa se pueda llamar a una función que nos de informe de tablas abiertas, indices etc..
Poniendo ON KEY en cada Form funciona, pero me gustaría tener una única llamada.
Saludos cordiales
Informe de la aplicacion
Moderator: Rathinagiri
- srvet_claudio
- Posts: 2220
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Informe de la aplicacion
See this demo:
Code: Select all
#include "hmg.ch"
Function Main
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 500 HEIGHT 300 ;
TITLE "Press ALT+F9";
MAIN
@ 30,10 EDITBOX Edit_1 ;
WIDTH 400 ;
HEIGHT 100 ;
VALUE 'Hello'
@ 200, 100 BUTTON Button_1 CAPTION "Modal" ACTION ModalWin()
END WINDOW
DEFINE WINDOW Form_Info;
AT 0,0;
WIDTH 700;
HEIGHT 600;
FONTNAME "Courier New" FONTSIZE 10;
NOAUTORELEASE
@ 10 , 10 LABEL Label_1 VALUE "Display your Info" AUTOSIZE
@ 30 , 10 LABEL Label_2 VALUE "" AUTOSIZE
END WINDOW
CREATE EVENT PROCNAME FormInfoKeyProc()
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil
Function FormInfoKeyProc()
IF HMG_VirtualKeyIsPressed (VK_F9) .AND. HMG_VirtualKeyIsPressed (VK_ALT)
Form_Info.SHOW
ENDIF
IF ISWINDOWENABLED (Form_Info.HANDLE) == .F.
ENABLEWINDOW (Form_Info.HANDLE) // avoid disable Form_Info for Modal Windows
ENDIF
Form_Info.Label_2.VALUE := "Modal Window : " + IF (_IsWindowDefined ( "Form_2" ) == .F., "OFF","ON")
Return NIL
Procedure ModalWin
IF _IsWindowDefined ( "Form_2" ) == .F.
DEFINE WINDOW Form_2;
AT 0,0;
WIDTH 200;
HEIGHT 200;
MODAL
@ 10 , 10 LABEL Label_1 VALUE "Modal Window" AUTOSIZE
END WINDOW
CENTER WINDOW Form_2
ACTIVATE WINDOW Form_2
ENDIF
Return
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Informe de la aplicacion
Gracias Dr. Claudio Soto por compartir, y un excelente demo!
Saludos



Saludos
Re: Informe de la aplicacion
Muchisimas gracias por su ayuda.
Re: Informe de la aplicacion
I want to modify FormInfoKeyProc() for replacing pressed comma to dot "on the fly".
I don't know, why comma does not appear in the editbox:
I don't know, why comma does not appear in the editbox:
Code: Select all
Function FormInfoKeyProc()
IF xtemp := HMG_VirtualKeyIsPressed (VK_DECIMAL) // kropka
msgdebug("Decimal on the numeric keyboard was pressed!")
HMG_SendCharacter (Form_1.Handle , "," )
return 1
endif
IF HMG_VirtualKeyIsPressed (VK_F9) .AND. HMG_VirtualKeyIsPressed (VK_ALT)
Form_Info.SHOW
ENDIF
IF ISWINDOWENABLED (Form_Info.HANDLE) == .F.
ENABLEWINDOW (Form_Info.HANDLE) // avoid disable Form_Info for Modal Windows
ENDIF
Form_Info.Label_2.VALUE := "Modal Window : " + IF (_IsWindowDefined ( "Form_2" ) == .F., "OFF","ON")
Return NIL
- srvet_claudio
- Posts: 2220
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Informe de la aplicacion
Hi Marek,mol wrote:I want to modify FormInfoKeyProc() for replacing pressed comma to dot "on the fly".
I don't know, why comma does not appear in the editbox:Code: Select all
Function FormInfoKeyProc() IF xtemp := HMG_VirtualKeyIsPressed (VK_DECIMAL) // kropka msgdebug("Decimal on the numeric keyboard was pressed!") HMG_SendCharacter (Form_1.Handle , "," ) return 1 endif IF HMG_VirtualKeyIsPressed (VK_F9) .AND. HMG_VirtualKeyIsPressed (VK_ALT) Form_Info.SHOW ENDIF IF ISWINDOWENABLED (Form_Info.HANDLE) == .F. ENABLEWINDOW (Form_Info.HANDLE) // avoid disable Form_Info for Modal Windows ENDIF Form_Info.Label_2.VALUE := "Modal Window : " + IF (_IsWindowDefined ( "Form_2" ) == .F., "OFF","ON") Return NIL
see this code:
Code: Select all
Function FormInfoKeyProc()
IF HMG_GetLastVirtualKeyDown() == VK_DECIMAL
HMG_CleanLastVirtualKeyDown() // avoid re-entry
// msgdebug("Decimal on the numeric keyboard was pressed!")
HMG_SendCharacter (Form_1.Edit_1.Handle , "," )
return 1
endif
IF HMG_VirtualKeyIsPressed (VK_F9) .AND. HMG_VirtualKeyIsPressed (VK_ALT)
Form_Info.SHOW
ENDIF
IF ISWINDOWENABLED (Form_Info.HANDLE) == .F.
ENABLEWINDOW (Form_Info.HANDLE) // avoid disable Form_Info for Modal Windows
ENDIF
Form_Info.Label_2.VALUE := "Modal Window : " + IF (_IsWindowDefined ( "Form_2" ) == .F., "OFF","ON")
Return NIL