SAY - Detecting mouse leaving

SAY - Detecting mouse leaving

Postby James Bott » Wed Jun 21, 2006 6: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: SAY - Detecting mouse leaving

Postby Enrico Maria Giordano » Wed Jun 21, 2006 9:42 am

Check tooltip management in TWindow.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

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

Postby Gale FORd » Wed Jun 21, 2006 2:30 pm

TSButton does it by using a transparent button.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Postby manuramos » 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
manuramos
 
Posts: 219
Joined: Mon Dec 26, 2005 7:25 pm
Location: Jerez de la Frontera (Spain)

Postby Detlef Hoefner » Tue Jun 27, 2006 7: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:
Code: Select all  Expand view  RUN
#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

Postby Enrico Maria Giordano » Tue Jun 27, 2006 10:55 am

Add

Code: Select all  Expand view  RUN
oSay:lWantClick = .T.


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests