To all,
I need to see if the mouse is within my dialog box. If it's outside, then I need to take actions (end dialog).
Best regards,
Otto
// Testing the Mouse events
#include "FiveWin.ch"
static oWnd, oDlg
//----------------------------------------------------------------------------//
function Main()
DEFINE WINDOW oWnd FROM 100, 100 To 500, 800 PIXEL TITLE "Testing the Mouse"
oWnd:bLClicked = { | nRow, nCol, nFlags | IIF( nRow < oDlg:nTop() .or. ;
nRow > oDlg:nBottom() .or. ;
nCol > oDlg:nRight() .or. ;
nCol < oDlg:nLeft(), oDlg:End(), NIL ) }
oWnd:bLButtonUp = { | nRow, nCol, nFl8ags | oWnd:Say( 2, 2, "LButtonUp " ) }
oWnd:bMButtonDown = { | nRow, nCol, nFlags | oWnd:Say( 2, 2, "MButtonDown" ) }
oWnd:bMButtonUp = { | nRow, nCol, nFl8ags | oWnd:Say( 2, 2, "MButtonUp " ) }
oWnd:bRClicked = { | nRow, nCol, nFlags | oWnd:Say( 2, 2, "RButtonDown" ) }
oWnd:bRButtonUp = { | nRow, nCol, nFlags | oWnd:Say( 2, 2, "RButtonUp " ) }
//oWnd:bMMoved = { | nRow, nCol, nFlags | IIF( nRow < oDlg:nTop() .or. ;
//nRow > oDlg:nBottom() .or. ;
//nCol > oDlg:nRight() .or. ;
//nCol < oDlg:nLeft(), oDlg:End(), NIL ) }
oWnd:bLDblClick = { | nRow, nCol, nFlags | MsgInfo( "Left Doble Click" ) }
SET MESSAGE OF oWnd TO "Press any mouse button" CENTERED
ACTIVATE WINDOW oWnd ;
ON INIT ShowDlg(oWnd)
return nil
//----------------------------------------------------------------------------//
function ShowDlg(oWnd)
DEFINE DIALOG oDlg FROM 150, 150 TO 300, 400 OF oWnd PIXEL TITLE "A Dialog Box"
ACTIVATE DIALOG oDlg NOWAIT ;
ON PAINT oDlg:Say( 1, 1, "Hello" ) ;
VALID ( MsgInfo( "Valid Clause" ), .t. )
oDlg:bMoved := { || oDlg:CoorsUpdate() } // !!!!
return nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 52 guests