{"action":"opened","issue":{"url":"https://api.github.com/repos/Virtual-TreeView/Virtual-TreeView/issues/367","labels_url":"https://api.github.com/repos/Virtual-TreeView/Virtual-TreeView/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/Virtual-TreeView/Virtual-TreeView/issues/367/comments","events_url":"https://api.github.com/repos/Virtual-TreeView/Virtual-TreeView/issues/367/events","html_url":"https://github.com/Virtual-TreeView/Virtual-TreeView/issues/367","id":55021629,"number":367,"title":"Enhancement: Scrollbars status, if they are visible and what width they are","user":{"login":"vincentparrett","id":1037262,"avatar_url":"https://avatars.githubusercontent.com/u/1037262?v=3","gravatar_id":"","url":"https://api.github.com/users/vincentparrett","html_url":"https://github.com/vincentparrett","followers_url":"https://api.github.com/users/vincentparrett/followers","following_url":"https://api.github.com/users/vincentparrett/following{/other_user}","gists_url":"https://api.github.com/users/vincentparrett/gists{/gist_id}","starred_url":"https://api.github.com/users/vincentparrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincentparrett/subscriptions","organizations_url":"https://api.github.com/users/vincentparrett/orgs","repos_url":"https://api.github.com/users/vincentparrett/repos","events_url":"https://api.github.com/users/vincentparrett/events{/privacy}","received_events_url":"https://api.github.com/users/vincentparrett/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Virtual-TreeView/Virtual-TreeView/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/Virtual-TreeView/Virtual-TreeView/labels/imported","name":"imported","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-21T13:57:26Z","updated_at":"2015-01-21T13:57:26Z","closed_at":null,"body":"_From [Arioch...@gmail.com](https://code.google.com/u/101175546080106411874/) on September 06, 2013 19:50:04_\n\nPart of https://groups.google.com/forum/?hl=ru#!topic/virtual-treeview/84WAMRb299E To calculate space, available for the node content, application may have to know whether scrollbars are shown, and if they are - how much do they subtract from .ClientRect/.ClientWidth/.ClientHeight\r\n\r\nI propose the following changes:\r\n\r\n{$If CompilerVersion \\< 23 } // or which one introduced it ?\r\nconst CM_STYLECHANGED = CM_THEMECHANGED;\r\n{$IfEnd}\r\n\r\ntype\r\n TVirtualStringTree = class(VirtualTrees.TVirtualStringTree)\r\n protected\r\n    FScrollBarsBands: TSize;\r\n    procedure DoShowScrollbar(Bar: Integer; Show: Boolean); override;\r\n\r\n    procedure CMStyleChanged(var Message: TMessage); message CM_STYLECHANGED; // declared for ALL compiler versions!!!\r\n\r\n    procedure CMSystemParametersChanged(var Message: TMessage); message CM_WININICHANGE;\r\n\r\n    procedure QueryScrollBarsSizes;\r\n public\r\n    property ScrollBarVisibleWidth: integer read FScrollBarsBands.cx;\r\n    property ScrollBarVisibleHeight: integer read FScrollBarsBands.cx;\r\n end;\r\n\r\nprocedure TVirtualStringTree.DoShowScrollbar(Bar: Integer; Show: Boolean);\r\nvar _H, _V: boolean;\r\nbegin\r\n   inherited;\r\n\r\n   _H := Bar in [SB_HORZ, SB_BOTH];\r\n   _V := Bar in [SB_VERT, SB_BOTH];\r\n\r\n  if Show then begin\r\n      if _H then FScrollBarsBands.cx := GetSystemMetrics(SM_CXHSCROLL);\r\n      if _V then FScrollBarsBands.cy := GetSystemMetrics(SM_CXVSCROLL);\r\n  end else begin\r\n     if _H then FScrollBarsBands.cx := 0;\r\n     if _V then FScrollBarsBands.cy := 0;\r\n  end;\r\nend;\r\n\r\nprocedure TVirtualStringTree.QueryScrollBarsSizes;\r\nbegin\r\n  if FScrollBarsBands.cx > 0 then\r\n     FScrollBarsBands.cx := GetSystemMetrics(SM_CXHSCROLL);\r\n  if FScrollBarsBands.cy > 0 then\r\n     FScrollBarsBands.cy := GetSystemMetrics(SM_CXVSCROLL);\r\nend;\r\n\r\nprocedure TVirtualStringTree.CMSystemParametersChanged;\r\nbegin\r\n   inherited;\r\n   QueryScrollBarsSizes;\r\nend;\r\n\r\nprocedure TVirtualStringTree.CMStyleChanged;\r\nbegin\r\n   inherited;\r\n   QueryScrollBarsSizes; \r\n{$If CompilerVersion >= 23}\r\n/// current code to call VclStylesChanged\r\n{$IfEnd} \r\nend;\n\n_Original issue: http://code.google.com/p/virtual-treeview/issues/detail?id=367_"}}