SAY - Detecting mouse leaving

Post Reply
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

SAY - Detecting mouse leaving

Post by James Bott »

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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

TSButton does it by using a transparent button.
manuramos
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Post by manuramos »

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
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

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:

Code: Select all

#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
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Post by Detlef Hoefner »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Detlef Hoefner wrote:Hello Enrico,

yes, it works now.
I think you are eating every morning FiveWin internals with a big spoon. :wink:
:-)))
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
Post Reply