#48 Not returning negative values in MouseMove

closed-fixed
Robert May
None
1
2005-11-22
2005-08-17
Anonymous
No

See code below:

Instead of negive values we get 65521 etc.

Accoring to
http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/winui/winui/windowsuserinterface/userinput/mouseinp
ut/mouseinputreference/mouseinputmessages/wm_mou
semove.asp

we should be using:

xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);

In my version of Ming, both these macros are missing.
From initial analysis, there are two places where this fix
would need to be applied.

#!perl -w
# Left-Click on the target image, and drag
use warnings;
use strict;
use Win32::GUI;
use Win32::GUI::BitmapInline();
my $screen_width = Win32::GUI::GetSystemMetrics
(0);
my $screen_height = Win32::GUI::GetSystemMetrics
(1);
my $mw = Win32::GUI::Window->new(
-name => "MainWindow",
-title => "Win32::GUI Spy++",
-pos => [100,100],
-size => [100,100],
);
my $cursor = get_cursor();
$mw->AddLabel(
-name => "Target",
-icon => $cursor,
-notify => 1,
-onMouseDown => \&mouseDown,
-onMouseUp => \&mouseUp,
-onMouseMove => \&mouseMove,
);

$mw->Show();
Win32::GUI::Dialog();
exit(0);
###########################
###########################
sub mouseDown{
my $label = shift;
Win32::GUI::SetCursor($cursor);
$label->SetCapture();
return;
}
################
sub mouseUp{
my $label = shift;
$label->ReleaseCapture();
Win32::GUI::InvalidateRect(0,0);
return;
}
#################
sub mouseMove{
my ($label, $x, $y) = @_; # x,y in client co-ordinates
print "MouseMove $x,$y\n";
return;
}

#####################
sub get_cursor{
return Win32::GUI::BitmapInline->newCursor( q(
AAACAAEAICAAAA8AEAAwAQAAFgAAACgAAAAgAA
AAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAA
AA
AAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAHwAAAGDAAACbIAABQFAAApso
A
AUAFAAECgQACoAqAAqgqgAIBAIACqCqAAqAKgAEC
gQABQAUAAKbKAABQFAAAJsgAABgwAAAHwAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/
/////////////////////////////////g////g
D///wAf//4gj//8YMf/+ODj//nx8//wMYH/8A4B//AOAf/wDgH
/8DGB//nx8//44OP//GDH//4gj
///AB///4A////g///////////////////////////////////////8=
) );
}

Discussion

  • Robert May
    Robert May
    2005-08-20

    • assigned_to: nobody --> robertemay
     
  • Robert May
    Robert May
    2005-10-01

    • priority: 5 --> 1
    • status: open --> open-fixed
     
  • Robert May
    Robert May
    2005-10-01

    Logged In: YES
    user_id=674651

    Fix is in CVS, and should make it into the next release

     
  • Robert May
    Robert May
    2005-11-22

    • status: open-fixed --> closed-fixed