Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,112
    • Issues 2,112
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • LazarusLazarus
  • LazarusLazarus
  • Issues
  • #35472
Closed
Open
Issue created Apr 30, 2019 by FPC Admin account@fpc_adminOwner

TStringGrid/TDrawGrid horizontal scrollbar bug after form maximize

Original Reporter info from Mantis: ps
  • Reporter name: Pavol S

Description:

Horizontal scrollbar is still visible at wrong position after form maximzed and scrollbar is no longer needed.

Platform:Windows 10.

Steps to reproduce:

  1. Place TStringGrid on form
  2. set aling alClient
  3. set ColCount at least 12 (or until Horizontal scrollbar is visible)
    (don't add rows)
    Run app and scroll with scrollbar to right (at least 1px). Maximize form. -> Scrollbar is in original position.

Additional information:

Fix:

lcl\grids.pas:

procedure TCustomGrid.UpdateHorzScrollBar(const aVisible: boolean;
  const aRange,aPage,aPos: Integer);
var
  NeedUpdate: Boolean;
begin
  {$ifdef DbgScroll}
  DebugLn('TCustomGrid.UpdateHorzScrollbar: Vis=%s Range=%d Page=%d aPos=%d',
    [dbgs(aVisible),aRange, aPage, aPos]);
  {$endif}
  NeedUpdate := FHSbVisible<>Ord(aVisible);
  if NeedUpdate then
    ScrollBarShow(SB_HORZ, aVisible);
  if aVisible or NeedUpdate then
    ScrollBarRange(SB_HORZ, aRange, aPage, aPos);
{  original code here
  if FHSbVisible<>Ord(aVisible) then
    ScrollBarShow(SB_HORZ, aVisible);
  if aVisible then
    ScrollBarRange(SB_HORZ, aRange, aPage, aPos);
}
end;   

Mantis conversion info:

  • Mantis ID: 35472
  • Build: 60307
  • Version: 2.0
  • Fixed in revision: r62031 (#9cad1b3f)
  • Target version: 2.0.6
Assignee
Assign to
Time tracking