Dear-Embarcadero-Team.
We found a bug concerning OnMouseMove in procedure TOleControl.StandardEvent - The MouseMove-Event only has 3 Arguments and due to a check on Args >=4 the code is not for MouseMove does not get executed. We checked olectrls from Delphi5 to XE6 and the problem exists in all versions.
Original Code:
DISPID_MOUSEDOWN, DISPID_MOUSEMOVE, DISPID_MOUSEUP:
if Params.cArgs >= 4 then
begin
X := Integer(Variant(Args^[3])) and 7;
Y := Integer(Variant(Args^[2])) and 7;
Button := ButtonMap[X];
Shift := ShiftMap[Y] + MouseMap[X];
X := Variant(Args^[1]);
Y := Variant(Args^[0]);
case DispID of
DISPID_MOUSEDOWN:
MouseDown(Button, Shift, X, Y);
DISPID_MOUSEMOVE:
MouseMove(Shift, X, Y);
DISPID_MOUSEUP:
MouseUp(Button, Shift, X, Y);
end;
end;
Working code (Code in bold was added/changed):
DISPID_MOUSEDOWN, DISPID_MOUSEMOVE, DISPID_MOUSEUP:
if Params.cArgs >= 3 then
begin
if Params.cArgs >3 then X := Integer(Variant(Args^[3])) and 7;
Y := Integer(Variant(Args^[2])) and 7;
Button := ButtonMap[X];
if DispID = DISPID_MOUSEMOVE then Shift := MouseMap[Y]
else Shift := ShiftMap[Y] + MouseMap[X];
X := Variant(Args^[1]);
Y := Variant(Args^[0]);
case DispID of
DISPID_MOUSEDOWN:
MouseDown(Button, Shift, X, Y);
DISPID_MOUSEMOVE:
MouseMove(Shift, X, Y);
DISPID_MOUSEUP:
MouseUp(Button, Shift, X, Y);
end;
end;