Bug in bMMoved

Post Reply
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Bug in bMMoved

Post by Enrico Maria Giordano »

In the following sample, nCol is correctly updated while moving the WINDOW but nRow is always zero:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd

    DEFINE WINDOW oWnd;
           FROM 10,10 TO 20,70

    SET MESSAGE OF oWnd

    oWnd:bMoved = { | nRow, nCol | oWnd:SetMsg( LTrim( Str( nRow ) ) + ", " + LTrim( Str( nCol ) ) ) }

    ACTIVATE WINDOW oWnd

    RETURN NIL
EMG
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Post by Natter »

you write oWnd:bMoved =... my by oWnd:bMMoved
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

bMoved is evaluated when the window is moving while bMMoved is evaluated when the mouse is moving. They are two different events.

EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

You are right, nRow shows as zero. But curiously FWH source code seems to be fine. From the Windows API docs:

WM_MOVE
xPos = (int) LOWORD(lParam); // horizontal position
yPos = (int) HIWORD(lParam); // vertical position

And this is the FWH code:

Code: Select all

      case nMsg == WM_MOVE
           return ::Moved( nLoWord( nLParam ), nHiWord( nLParam ) )
Lets double check nLoWord() source code...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

And nLoWord() source code seems to be fine.

We have a mistery :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico,

Fixed. It was a little bug in the low level source code.

I email you the fixed lib, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

It seems that the code you cited is for XPP only, if I'm not wrong:

Code: Select all

#ifdef __XPP__

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TWindow
EMG
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Antonio Linares wrote:Enrico,

Fixed. It was a little bug in the low level source code.

I email you the fixed lib, thanks
Thank you!

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

Post by Enrico Maria Giordano »

Antonio Linares wrote:Enrico,

Fixed. It was a little bug in the low level source code.

I email you the fixed lib, thanks
It works fine! Many thanks.

EMG
demont frank
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Post by demont frank »

This was already reported 9 october 2005 , also a error in fivewin.ch


ON MOVE from dialog or window


Hello,

Trying to use ON MOVE , you can try
Code:

# include "fivewin.ch"
FUNC MAIN
LOCAL oWnd
DEFINE WINDOW oWnd FROM 10,10 TO 20,70
SET MESSAGE OF oWnd TO "TEST ON MOVE" CLOCK DATE KEYBOARD NOINSET
oWnd:bMoved := {|nRow,nCol|oWnd:setMsg(LTRIM(STR(nRow)) + " , " + LTRIM(STR(nCol)))}
ACTIVATE DIALOG oWnd
RETURN



Notes :

1) The result is WRONG , nRow is always 0

2) Trying to use the ON MOVE clause can never do the same , nRow or nCol can't be used.

It is only possible when fivewin.ch and dialog.ch are changed :
<oWnd>:bMoved [ := \{ | nRow,nCol | <uMove> \} ], ;

3) I am convinced that this behaviour is a ERROR , i reported it already
a few days ago . Why no response ????????


Frank

Enrico Maria Giordano

I confirm the problem.

Patricio Avalos Aguirre

I confirm the problem.

FWH 2.6, xHarbour 0.99.5, Borland 5.5

Saludos
Patricio
Post Reply