// C:\FWH\SAMPLES\NATTER3.PRG
#include "Fivewin.ch"
STATIC cName1
FUNCTION Main()
LOCAL oWnd
cName1 := "Test"
DEFINE WINDOW oWnd
oWnd:bRClicked := {| nRow, nCol, nFlags | MyMenu( oWnd, nRow, nCol ) }
ACTIVATE WINDOW oWnd CENTERED
RETURN NIL
FUNCTION MyMenu( oWnd, nRow, nCol )
LOCAL oMenu, oItem1, oItem2, oItem3
LOCAL cName := "Test.."
LOCAL cName2 := "Test2"
MENU oMenu POPUP 2007
// IF lOptionLeft
SwapMouseButton( 1 ) // For Left-handers
// ENDIF
MENUITEM oItem1 PROMPT "Natter Click" ;
ACTION( oWnd:End() )
MENUITEM oItem2 PROMPT cName1
SEPARATOR
MENUITEM oITem3 PROMPT "Others" ACTION MsgInfo( Len( oMenu:aMenuItems ) )
ENDMENU
ACTIVATE POPUP oMenu WINDOW oWnd AT 140, 10
SwapMouseButton( 0 )
RETURN( oMenu )
DLL32 FUNCTION SwapMouseButton(swap AS 7) AS 7 PASCAL LIB "USER32.DLL"
// FIN / END
Natter wrote:Is it possible to handle right-clicking on the TMenuItem object ?
Natter wrote:Thanks, I'll be waiting !
oWnd:bRButtonMenuUp := { | nOrdItem, hMnu, nRow, nCol, o | MsgInfo( "Hello" ) }
Eval( ::bRButtonMenuUp, nOrdIt, hMnu, aPoint[ 1 ], aPoint[ 2 ], Self )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 24 guests