designer: implementation of CM_DESIGNHITTEST by Eugene Kryukov (issue #0015123)

git-svn-id: trunk@22714 -
This commit is contained in:
paul 2009-11-23 04:29:01 +00:00
parent 18f393ac31
commit f90c5c0b2f

View File

@ -379,6 +379,8 @@ implementation
type type
TCustomFormAccess = class(TCustomForm); TCustomFormAccess = class(TCustomForm);
TControlAccess = class(TControl);
const const
mk_lbutton = 1; mk_lbutton = 1;
@ -1628,6 +1630,15 @@ begin
DebugLn(', No CTRL down'); DebugLn(', No CTRL down');
{$ENDIF} {$ENDIF}
if (MouseDownComponent <> nil) and (MouseDownComponent is TControl) then
begin
if TControl(MouseDownComponent).Perform(CM_DESIGNHITTEST, 0, Longint(SmallPoint(MouseDownPos.X, MouseDownPos.Y))) > 0 then
begin
TControlAccess(MouseDownComponent).MouseDown(Button, Shift, MouseDownPos.X, MouseDownPos.Y);
Exit;
end;
end;
if Mediator<>nil then begin if Mediator<>nil then begin
Handled:=false; Handled:=false;
Mediator.MouseDown(Button,Shift,MouseDownPos,Handled); Mediator.MouseDown(Button,Shift,MouseDownPos,Handled);
@ -1963,6 +1974,15 @@ begin
DebugLn(''); DebugLn('');
{$ENDIF} {$ENDIF}
if (MouseDownComponent <> nil) and (MouseDownComponent is TControl) then
begin
if TControl(MouseDownComponent).Perform(CM_DESIGNHITTEST, 0, Longint(SmallPoint(MouseUpPos.X, MouseUpPos.Y))) > 0 then
begin
TControlAccess(MouseDownComponent).MouseUp(Button, Shift, MouseUpPos.X, MouseUpPos.Y);
Exit;
end;
end;
if Mediator<>nil then if Mediator<>nil then
begin begin
Handled:=false; Handled:=false;
@ -2061,6 +2081,15 @@ begin
if (OldMouseMovePos.X = LastMouseMovePos.X) and (OldMouseMovePos.Y = LastMouseMovePos.Y) then if (OldMouseMovePos.X = LastMouseMovePos.X) and (OldMouseMovePos.Y = LastMouseMovePos.Y) then
Exit; Exit;
if (MouseDownComponent <> nil) and (MouseDownComponent is TControl) then
begin
if TControl(MouseDownComponent).Perform(CM_DESIGNHITTEST, 0, Longint(SmallPoint(LastMouseMovePos.X, LastMouseMovePos.Y))) > 0 then
begin
TControlAccess(MouseDownComponent).MouseMove(Shift, LastMouseMovePos.X, LastMouseMovePos.Y);
Exit;
end;
end;
if Mediator <> nil then if Mediator <> nil then
begin begin
Handled := False; Handled := False;