diff --git a/lcl/forms.pp b/lcl/forms.pp index 0864b57d3e..53043c085a 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -915,6 +915,8 @@ type FAsyncCallQueue: PAsyncCallQueueItem; FShowHint: Boolean; FShowMainForm: Boolean; + FLastMousePos : TPoint; + FLastMouseControl : tControl; procedure DoOnIdleEnd; function GetCurrentHelpFile: string; function GetExename: String; diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 38a6681bf5..9dbf8e1cd7 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -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 diff --git a/lcl/include/checkbox.inc b/lcl/include/checkbox.inc index eff773a8d6..c3dfa29c75 100644 --- a/lcl/include/checkbox.inc +++ b/lcl/include/checkbox.inc @@ -144,7 +144,7 @@ end; Procedure TCheckbox.WMKeyDown(var Message : TLMKeyDown); begin - ControlState := ControlState - [csClicked]; + Exclude(FControlState, csClicked); Case Message.CharCode of 32: begin diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 0f38e94646..d4b23ef104 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -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'); diff --git a/lcl/include/controlscrollbar.inc b/lcl/include/controlscrollbar.inc index af9975da0c..be670b95b7 100644 --- a/lcl/include/controlscrollbar.inc +++ b/lcl/include/controlscrollbar.inc @@ -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 diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 102725eb98..9e3265495a 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -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; diff --git a/lcl/lresources.pp b/lcl/lresources.pp index 1a40ab3d9a..a758fe026d 100644 --- a/lcl/lresources.pp +++ b/lcl/lresources.pp @@ -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 := '';