procedure TCustomBCTrackbarUpdown.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
// inherited MouseDown(Button, Shift, X, Y); << original position, gives unexpected behaviour in Windows10
X := round(X*FCanvasScaling);
Y := round(Y*FCanvasScaling);
if Button = mbLeft then
begin
FHandlingUserInput:= true;
if X >= FUpDownLeft then
begin
if Y > FDownButtonTop then
begin
FDownClick:= true;
Value := Value-Increment;
Invalidate;
FTimer.Interval := LongTimeInterval;
FTimer.Enabled:= true;
end else
if Y < FDownButtonTop then
begin
FUpClick:= true;
Value := Value+Increment;
Invalidate;
FTimer.Interval := LongTimeInterval;
FTimer.Enabled:= true;
end;
end else
if (Y >= Height-FBarHeight-1) and (FBarWidth>1) then
begin
FBarClick:= true;
Value := BarPosToValue(X);
Repaint;
end;
FHandlingUserInput:= false;
end;
if not Focused then
begin
SetFocus;
SelectAll;
end;
inherited MouseDown(Button, Shift, X, Y); //<< this position gives expected behaviour in Linux and Windows10
end;