FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CLASS TBitmap ( Solved )
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
CLASS TBitmap ( Solved )
Posted: Sat Sep 19, 2009 06:04 AM

HI,
SOmeone can help me with this,
How add method OnMouseOver and OnMouseOut to this class;

Thanks.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: CLASS TBitmap
Posted: Sat Sep 19, 2009 07:44 AM
Lailton,

Code (fw): Select all Collapse
#include "FiveWin.ch"

#define TME_LEAVE        2
#define WM_MOUSELEAVE  675

function Main()

   local oWnd, oBmp

   DEFINE WINDOW oWnd

   oBmp = TMyBitmap():New( 50, 50,,,, "test.bmp", .T., oWnd,,,,,,,,, .T. )  
   
   oBmp:bMMoved = { || oWnd:SetText( "Over me" ), TrackMouseEvent( oBmp:hWnd, TME_LEAVE ) }

   oBmp:bMLeave = { || oWnd:SetText( "Out of me" ) }
 
   ACTIVATE WINDOW oWnd

return nil

CLASS TMyBitmap FROM TBitmap

   DATA   bMLeave

   METHOD HandleEvent( nMsg, nWParam, nLParam )

   METHOD MouseLeave( nRow, nCol, nFlags )
   
ENDCLASS

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TMyBitmap

   if nMsg == WM_MOUSELEAVE
      return ::MouseLeave( nHiWord( nLParam ), nLoWord( nLParam ), nWParam )
   endif
   
return Super:HandleEvent( nMsg, nWParam, nLParam )      

METHOD MouseLeave( nRow, nCol, nFlags ) CLASS TMyBitmap

   if ! Empty( ::bMLeave )
      Eval( ::bMLeave, nRow, nCol, nFlags, Self )
   endif   

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: CLASS TBitmap
Posted: Sat Sep 19, 2009 08:03 AM

Antonio,

It´s work FINE !!!!

Gracias. :lol:

Continue the discussion