TScrollingWinControl missmatch? lazarus / 7-LCL ---------------------------------------------------------------------- wotanica · 2010-09-18 21:42 Looking over the Lazarus code i spotted this: Code: [Select]function TScrollingWinControl.HasVisibleScrollbars: boolean; begin   Result := (VertScrollBar <> nil) and VertScrollBar.Visible and             (HorzScrollBar <> nil) and HorzScrollBar.Visible; end; Shouldent that be OR? E.g: Code: [Select]function TScrollingWinControl.HasVisibleScrollbars: boolean; Begin   if not (csDestroying in componentstate) then   Begin     result:=( assigned(vertscrollbar)     and vertscrollbar.visible )     or     ( assigned(horzscrollbar)     and horzscrollbar.visible );   end else   result:=False; end; There may be a horizontal scrollbar visible, but that would be ignored if the vertical scrollbar is not assigned/visible. I realize that both objects (scrollbars) are created in the constructor, but if the vertical scrollbar is invisible, the horizontal state will be eliminated from the boolean expression? ---------------------------------------------------------------------- Marc · 2010-09-19 15:22 The plural form of HasVisibleScrollbars, imply that both must be there But indeed it doesn't make sense to me. Nowhere in the LCL this function is used, so I don't know what it is supposed to do. I'll ask others. ---------------------------------------------------------------------- wotanica · 2010-09-19 20:39 Yes, i figured it had to mean both since it was plural. But since both objects are created in the constructor explicitly - the assigned() checks will always return true unless the component is being destroyed (hence i figured checking for csDestroying would be better). But both horizontal and vertical scrollbars may not be visible, either one can be visible or invisible depending on the content. In delphi this one is used to determine if there are any scrollbars visible during loading, assignment etc. I seem to remember that it's particularly called when cleaning up a view (f.ex in an imageviewer, this would be called to check if the scrollbars needs to be reseted prior to loading etc.) ---------------------------------------------------------------------- Marc · 2010-09-20 15:49 I looked in my delphi and I couldn't find it, so I thought it was a laz only. Where is it implemented ?