Page 1 of 1
Bug in bMMoved
Posted: Thu Jun 05, 2008 1:28 pm
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
Posted: Thu Jun 05, 2008 1:40 pm
by Natter
you write oWnd:bMoved =... my by oWnd:bMMoved
Posted: Thu Jun 05, 2008 4:50 pm
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
Posted: Thu Jun 05, 2008 5:09 pm
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...
Posted: Thu Jun 05, 2008 5:16 pm
by Antonio Linares
And nLoWord() source code seems to be fine.
We have a mistery
Posted: Thu Jun 05, 2008 5:24 pm
by Antonio Linares
Enrico,
Fixed. It was a little bug in the low level source code.
I email you the fixed lib, thanks
Posted: Thu Jun 05, 2008 5:27 pm
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
Posted: Thu Jun 05, 2008 5:28 pm
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
Posted: Thu Jun 05, 2008 5:54 pm
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
Posted: Fri Jun 06, 2008 7:09 am
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