CLASS TBitmap ( Solved )

CLASS TBitmap ( Solved )

Postby lailton.webmaster » Sat Sep 19, 2009 6:04 am

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

Thanks.
Last edited by lailton.webmaster on Sat Sep 19, 2009 8:03 am, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: CLASS TBitmap

Postby Antonio Linares » Sat Sep 19, 2009 7:44 am

Lailton,

Code: Select all  Expand view

#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: CLASS TBitmap

Postby lailton.webmaster » Sat Sep 19, 2009 8:03 am

Antonio,

It´s work FINE !!!!

Gracias. :lol:
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests