FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SAY - Detecting mouse leaving
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
SAY - Detecting mouse leaving
Posted: Wed Jun 21, 2006 06:01 AM

I can use oSay:bMMove to force the font to be changed when the cursor is over the SAY, but how can I then detect that the mouse is no longer over the SAY so I can change the font back. I am trying to make the font change to underlined when the mouse is over it, then change it back after.

I have tried a bunch of things with no success.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: SAY - Detecting mouse leaving
Posted: Wed Jun 21, 2006 09:42 AM

Check tooltip management in TWindow.

EMG

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
SAY - Detecting mouse leaving
Posted: Wed Jun 21, 2006 11:54 AM

Enrico,

I already looked at tooltips in TWindow. A tooltip is displayed with a timer so it is hidden after the timer expires. Then the tooltip is ended in the LostFocus() method, but TSay never gets focus so it never looses focus.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
SAY - Detecting mouse leaving
Posted: Wed Jun 21, 2006 12:18 PM

No, a timer is used only in Clipper/FW (16 bit). Please note the #ifdef directive.

Have a look at TMsgBar:MouseMove() method and at TWindow:lButtonUp() method (specifically the call to oWnd:NcMouseMove()).

EMG

Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
SAY - Detecting mouse leaving
Posted: Wed Jun 21, 2006 02:30 PM

TSButton does it by using a transparent button.

Posts: 219
Joined: Mon Dec 26, 2005 07:25 PM
SAY - Detecting mouse leaving
Posted: Sun Jun 25, 2006 12:51 PM

Try This:

First declare oSay:Cargo := .F.
and oSay:bMMoved := { |nRow, nCol| MyFuncionMoved(nRow, nCol, oSay) }.
This function must be some thing like this:

>FUNCTION MyFuncionMoved(nRow, nCol, oSay)
> IF !oSay:Cargo
> ...
> HOW I WANT TO DO WHEN MOUSE ENTER UP THE SAY
> CHANGE oSay COLOUR, MOUSE, FONT, ETC...
> ...
> oSay:Cargo := .T.
> SetCapture(oSay:hWnd) // TAKE MOUSE CONTROL
> *
> ELSEIF oSay:Cargo .AND. !IsOverWnd( oSay:hWnd, nRow, nCol )
> ...
> HOW I WANT TO DO WHEN MOUSE LEAVE THE SAY
> RESTORE oSay COLOUR, MOUSE, FONT, ETC...
> ...
> oSay:Cargo := .F.
> ReleaseCapture() // RELEASE MOUSE CONTROL
> *
> ENDIF
>RETURN NIL

To change the oSay Colours I do

oSay:SetColor(nClrTexto,nClrFondo)
oSay:SetText(oSay:cCaption)

Without the second line, oSay's colours don't change (FW 2.3 y Clipper 5.3).
(Excuse my English)
Good Luck

Nos Gusta Programar
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
SAY - Detecting mouse leaving
Posted: Tue Jun 27, 2006 07:24 AM
Hi all,

i'm also very interested about detecting a mouse move over a get.
So i tried your suggestions. But without success.

here my code:
#include "FiveWin.ch"

////////////////
PROCEDURE Main()
////////////////
LOCAL oDlg, oSay
LOCAL cSay := "This is a Say Text"

   

   DEFINE DIALOG oDlg;
          FROM 5, 5 TO 15, 40;
          TITLE " MouseMove Test"

   @ 2, 4 SAY oSay VAR cSay SIZE 100, 10 OF oDlg BORDER CENTER
   oSay:bMMoved := { | nRow, nCol | MsgAlert( "HI" ) }

   @ 3, 9 BUTTON "E&xit" OF oDlg SIZE 40, 11 ;
          ACTION oDlg:End()

   ACTIVATE DIALOG oDlg

RETURN


When running this little program nothing happens when touching the oSay with my mouse.
I use latest xHarbour Bilder and the most recent FwH 2.7.
Am i missing something?

Regards,
Detlef
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
SAY - Detecting mouse leaving
Posted: Tue Jun 27, 2006 10:55 AM
Add

oSay:lWantClick = .T.


EMG
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
SAY - Detecting mouse leaving
Posted: Tue Jun 27, 2006 11:18 AM

Hello Enrico,

yes, it works now.
I think you are eating every morning FiveWin internals with a big spoon. :wink:

BTW:
I visited your website. And i suddenly remembered having an exciting time with playing 'Jet Set Willy' on my very first computer which was a Sinclair Spectrum ( a black one ).

Those were the days where programmers had to care about limited memory space, wasting no byte and producing amazing applications.

Thanks again for your help.
Regards,
Detlef

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
SAY - Detecting mouse leaving
Posted: Tue Jun 27, 2006 11:38 AM
Detlef Hoefner wrote:Hello Enrico,

yes, it works now.
I think you are eating every morning FiveWin internals with a big spoon. :-)


:-)))

Detlef Hoefner wrote:BTW:
I visited your website. And i suddenly remembered having an exciting time with playing 'Jet Set Willy' on my very first computer which was a Sinclair Spectrum ( a black one ).


Many programmers have their roots in the little black box, at least here in Europe. :-)

Detlef Hoefner wrote:Those were the days where programmers had to care about limited memory space, wasting no byte and producing amazing applications.


Yes. I started with Sinclair ZX81 that featured one big Kb of RAM :-)

EMG

Continue the discussion