IonicWind Software

IWBasic => General Questions => Topic started by: Allan on June 22, 2009, 05:16:19 PM

Title: Drag and Drop example - mousemove event for pallette
Post by: Allan on June 22, 2009, 05:16:19 PM
I have been reading through the example code for the drag and drop and have hit a brick wall trying to understand some of the code in the Mousemove (OnMMPalette())?


' lParam
' The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to
' the upper-left corner of the client area. (@mousex)

' The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to
' the upper-left corner of the client area  (@mousey)

' @LPARAM / @QUAL

Sub OnMMPalette(),INT
' @QUAL + LPARAM - Holds the X Y Coord of the Mouse
' if mouse L Button down
DEBUGPRINT STR$(@QUAL) + "  _  " + STR$(@LPARAM)
if @QUAL & 1
dragstart++


I do not understand how @Qual is = 1. If i use the right-button it will equal 2, No button @Qual = 0.

I thought those messages were supposed to be  in the WPARAM.

What am I missing here please?

Allan
Title: Re: Drag and Drop example - mousemove event for pallette
Post by: LarryMc on June 22, 2009, 05:33:10 PM
You use the left button down to drag.

Larry
Title: Re: Drag and Drop example - mousemove event for pallette
Post by: Allan on June 22, 2009, 05:45:53 PM
Yes, but isnt the left-button down supposed to be shown in the WPARAM?

Allan
Title: Re: Drag and Drop example - mousemove event for pallette
Post by: Ionic Wind Support Team on June 22, 2009, 06:11:26 PM
Normally

@QUAL =@LPARAM
@CODE =@WPARAM

However for the mouse messages emergence translates wparam and lparam for you as such:

@QUAL = wparam
@MOUSEX = lParam & 0xFFFFu
@MOUSEY = (lParam >> 16) & 0xFFFFu

Old terminology, used by the Amiga QUAL = "Qualifier" , and it stuck with my languages.  Put into Emergence for IBasic Pro compatibility.  Listed in the users guide.

Emergence does a lot of internal processing, so you don't have to.

Paul.
Title: Re: Drag and Drop example - mousemove event for pallette
Post by: Allan on June 22, 2009, 08:14:34 PM
Thanks for the understanding on the Mouse Messages.

I missed the part about  @QUAL = wparam  in the user guide.

Allan