On 13/04/2013 at 20:40, xxxxxxxx wrote:
There seems to be an issue with this. My mouse X and Y coordinate values won't update if I put a while loop in the message. Example below:
case BFM_GETCURSORINFO:
{
BaseContainer bc;
LONG mX = msg.GetLong(BFM_DRAG_SCREENX);
LONG mY = msg.GetLong(BFM_DRAG_SCREENY);
Screen2Local(&mX;,&mY;);
LONG Xs = 40;
LONG Yl = 40;
while(mX >= Xs-10 && mX <= Xs+10 && mY >= Yl+10 && mY <= Yl-10)
{
GeShowMouse(MOUSE_ARROW_H);
GePrint("Looping..");
mX = msg.GetLong(BFM_DRAG_SCREENX); // this is an issue, because BFM_DRAG_SCREENX/Y is NOT refreshed during the message loop...
mY = msg.GetLong(BFM_DRAG_SCREENY);
Screen2Local(&mX;,&mY;);
if(mX < Xs-10)// || mXt > (Xs+10) || mYt > (Yl+10) || mYt < (Yl-10))
{
GePrint("Breaking..");
break;
}
GetInputState(BFM_INPUT_MOUSE, BFM_INPUT_MOUSELEFT, bc);
if(bc.GetLong(BFM_INPUT_VALUE) == 1)
{
GePrint("Mouse down..");
break;
}
}
break;
}
Are we not able to do this? Or is there a bug in there somewhere? I've had to strip my code above of things related to my userarea so I hope it's as general as can be. Is someone able to confirm this one way or another?
All I'm trying to do is change the mouse while it's coordinates are over a certain part of the userarea. Everything works except for any loop I put in. The coordinates are not refreshed and hence my mouse changes to the appropriate arrow, but it won't change back without me having to make a user interaction of some sort.
Printing the co-ords in the loop prints the same numbers all the time, despite having some code that I thought would update them.
WP.