SAY - Detecting mouse leaving
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
SAY - Detecting mouse leaving
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
I have tried a bunch of things with no success.
James
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
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
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
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
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:
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
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
I use latest xHarbour Bilder and the most recent FwH 2.7.
Am i missing something?
Regards,
Detlef
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Detlef Hoefner
- Posts: 312
- Joined: Sat Oct 08, 2005 9:12 am
- Location: Germany
- Contact:
Hello Enrico,
yes, it works now.
I think you are eating every morning FiveWin internals with a big spoon.
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
yes, it works now.
I think you are eating every morning FiveWin internals with a big spoon.
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
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
))Detlef Hoefner wrote:Hello Enrico,
yes, it works now.
I think you are eating every morning FiveWin internals with a big spoon.
Many programmers have their roots in the little black box, at least here in Europe.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 ).
Yes. I started with Sinclair ZX81 that featured one big Kb of RAMDetlef Hoefner wrote:Those were the days where programmers had to care about limited memory space, wasting no byte and producing amazing applications.
EMG