Bug in bMMoved

Bug in bMMoved

Postby Enrico Maria Giordano » Thu Jun 05, 2008 1:28 pm

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

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Natter » Thu Jun 05, 2008 1:40 pm

you write oWnd:bMoved =... my by oWnd:bMMoved
Natter
 
Posts: 1214
Joined: Mon May 14, 2007 9:49 am

Postby Enrico Maria Giordano » Thu Jun 05, 2008 4:50 pm

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

Postby Antonio Linares » Thu Jun 05, 2008 5:09 pm

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  Expand view
      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: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Jun 05, 2008 5:16 pm

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: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Jun 05, 2008 5:24 pm

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
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Thu Jun 05, 2008 5:27 pm

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

Code: Select all  Expand view
#ifdef __XPP__

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TWindow


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

Postby Enrico Maria Giordano » Thu Jun 05, 2008 5:28 pm

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: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Thu Jun 05, 2008 5:54 pm

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

Postby demont frank » Fri Jun 06, 2008 7:09 am

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
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 95 guests