Page 1 of 1
How to add element to right click popup menu list in TGet.
Posted: Wed Nov 06, 2024 12:03 pm
by Horizon
Hi,
How to add element to right click popup menu list in TGet.
Thanks,
Re: How to add element to right click popup menu list in TGet.
Posted: Wed Nov 06, 2024 2:04 pm
by karinha
I do it like this. If this is not what you want, explain your intentions further, pls.
Yo lo hago así. Si esto no es lo que desea, explique más sus intenciones, por favor.
Code: Select all | Expand
REDEFINE GET aGet[10] VAR cTPSerCod PICTURE "@K !!!!" ID 21 OF oDlg ;
UPDATE COLORS CLR_BLACK, CLR_WHITE FONT oFont BITMAP "BUSCAR" ;
VALID( VERIFICA_COD_SERVICO( aGet, cTPSerCod ) ) ;
ACTION( MOSTRAR_COD_SERVICO( aGet, cTPSerCod ) )
aGet[10]:oCursor := oHand // Mostra um cursor no get
aGet[10]:cToolTip := OemToAnsi( "<F7> - Mostra o Tipo do Servi‡o" )
aGet[10]:lBtnTransparent := .T. // transparent button
// Aqui:-> Here.
aGet[10]:bKeyDown := { |nKey| IF( nKey == VK_F7, Eval( aGet[10]:bAction ), Nil ) }
FUNCTION MOSTRAR_COD_SERVICO()
...
RETURN...
// FIN / END
Regards, saludos.
Re: How to add element to right click popup menu list in TGet.
Posted: Wed Nov 06, 2024 2:37 pm
by karinha
Look,
Code: Select all | Expand
// C:\FWH\SAMPLES\MENUAFER.PRG
#include "Fivewin.ch"
FUNCTION TesteTravaBotao()
LOCAL oBtn1, oBtn2
PRIVATE oDlg
PRIVATE oGet1, cVar1 := PadR( "Test ", 20 )
PRIVATE oGet2, cVar2 := PadR( "Test2", 20 )
DEFINE DIALOG oDlg
oDlg:lHelpIcon := .F.
@ 1, 1 GET oGet1 VAR cVar1 oF oDlg
@ 2, 1 GET oGet2 VAR cVar2 oF oDlg ACTION( MenuTeste() )
@ 3, 01 BUTTON oBtn1 PROMPT "&Entrance" ACTION oDlg:End()
@ 3, 10 BUTTON oBtn2 PROMPT "&Exit" ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
FUNCTION MenuTeste()
LOCAL oMenu
MENU oMenu 2007
MENUITEM "Menu 1"
MENU
MENUITEM "Option 1"
SEPARATOR
MENUITEM "Option 2"
SEPARATOR
MENUITEM "&Exit" ACTION( oDlg:End() )
ENDMENU
MENUITEM "Menu 2"
MENU
MENUITEM "Option 1"
MENUITEM "Option 2"
SEPARATOR
MENUITEM "Option 3"
ENDMENU
ENDMENU
oDlg:SetMenu( oMenu )
RETURN( .T. )
// FIN / END - kapiabafwh@gmail.com
Regards, saludos.