reduced overhead in TWinControl.IsControlMouseMsg from Darek

git-svn-id: trunk@9164 -
This commit is contained in:
mattias 2006-04-23 20:20:22 +00:00
parent baa2ccb6bc
commit 422e644e54
7 changed files with 24 additions and 21 deletions

View File

@ -915,6 +915,8 @@ type
FAsyncCallQueue: PAsyncCallQueueItem;
FShowHint: Boolean;
FShowMainForm: Boolean;
FLastMousePos : TPoint;
FLastMouseControl : tControl;
procedure DoOnIdleEnd;
function GetCurrentHelpFile: string;
function GetExename: String;

View File

@ -407,9 +407,15 @@ var
P: TPoint;
begin
GetCursorPos(P);
Result := FindControlAtPosition(P, True);
if (P.X=FLastMousePos.x) and (P.Y=FLastMousePos.Y) then Result:=FLastMouseControl
else Result := FindControlAtPosition(P, True);
if (Result <> nil) and (csDesigning in Result.ComponentState) then
Result := nil;
if Result<> nil then begin
FLastMousePos:=p;
FLastMouseControl:=Result;
end;
end;
procedure TApplication.SetNavigation(const AValue: TApplicationNavigationOptions

View File

@ -144,7 +144,7 @@ end;
Procedure TCheckbox.WMKeyDown(var Message : TLMKeyDown);
begin
ControlState := ControlState - [csClicked];
Exclude(FControlState, csClicked);
Case Message.CharCode of
32:
begin

View File

@ -1805,7 +1805,7 @@ begin
if csClicked in ControlState then
begin
Exclude(FControlState, csClicked);
//DebugLn('TControl.WMLButtonUp B ',ClientRect.Left,',',ClientRect.Top,',',ClientRect.Right,',',ClientRect.Bottom,' ',Message.Pos.X,',',Message.Pos.Y);
//DebugLn('TControl.WMLButtonUp B ',dbgs(ClientRect.Left),',',dbgs(ClientRect.Top),',',dbgs(ClientRect.Right),',',dbgs(ClientRect.Bottom),' ',dbgs(Message.Pos.X),',',dbgs(Message.Pos.Y));
if PtInRect(ClientRect, SmallPointToPoint(Message.Pos))
then begin
//DebugLn('TControl.WMLButtonUp C');

View File

@ -230,7 +230,6 @@ begin
AutoCalcVRange
else
AutoCalcHRange;
ControlUpdateScrollBars;
end;
end;
@ -264,12 +263,13 @@ begin
SBSize := OtherScrollbar.Size
else
SBSize := 0;
if Kind=sbVertical then
FAutoRange := (FRange - ClientHeight)
*Shortint(FRange >= ClientHeight + SBSize)
else
FAutoRange := (FRange - ClientWidth)
*Shortint(FRange >= ClientWidth + SBSize);
if Kind=sbVertical then begin
SBSize:=ClientHeight - SBSize;
end else begin
SBSize:=ClientWidth - SBSize;
end;
if (fRange>SBSize) and (SBSize>0) then FAutoRange := (FRange - SBSize)
else FAutoRange := 0;
ScrollInfo.nMax := FRange;
// visible

View File

@ -2797,6 +2797,7 @@ end;
function TWinControl.IsControlMouseMsg(var TheMessage: TLMMouse) : Boolean;
var
Control : TControl;
ScrolledOffset,
P : TPoint;
ClientBounds: TRect;
begin
@ -2817,8 +2818,10 @@ begin
if Control <> nil then
begin
// map mouse coordinates to control
P.X := TheMessage.XPos - Control.Left;
P.Y := TheMessage.YPos - Control.Top;
ScrolledOffset:=GetClientScrollOffset;
P.X := TheMessage.XPos - Control.Left + ScrolledOffset.X;
P.Y := TheMessage.YPos - Control.Top + ScrolledOffset.Y;
if (Control is TWinControl) and TWinControl(Control).HandleAllocated then
begin
// map coordinates to client area of control
@ -2950,7 +2953,7 @@ var
P: TPoint;
{$ENDIF}
begin
//DebugLn('[TWinControl.PaintControls] ',Name,':',ClassName,' DC=',DbgS(DC,8));
//DebugLn('[TWinControl.PaintControls] ',Name,':',ClassName,' DC=',DbgS(DC,8));
if (csDestroying in ComponentState)
or ((DC=0) and (not HandleAllocated)) then
exit;

View File

@ -2199,14 +2199,6 @@ var
Flags := 4;
end;
end;
if parser.TokenSymbolIs('OBJECT') then
Flags :=0 { IsInherited := False }
else if parser.TokenSymbolIs('INHERITED') then
Flags := 1 { IsInherited := True; }
else begin
parser.CheckTokenSymbol('INLINE');
Flags := 4;
end;
parser.NextToken;
parser.CheckToken(toSymbol);
ObjectName := '';