Download Now

    Reference TScrollWindow

    Declared in Codebot.Controls.Grids.pas on line 59

    TScrollWindow is a windowed control with scroll bars which draws a scrollable area larger than itself
      TScrollWindow = class(TSurfaceCustomControl)
      protected
        { The control width less the border }
        function InternalWidth: Integer;
        { The control height less the border }
        function InternalHeight: Integer;
        { Returns true if a scroll bar is visible }
        function IsBarVisible(Kind: TScrollKind): Boolean;
        { Set the scroll position and scrollable size }
        procedure SetScrollData(const Value: TScrollData);
        { Return the scroll position and scrollable size }
        function GetScrollData: TScrollData;
        { Scroll to a position or until a rectangle is visible }
        procedure ScrollTo(X, Y: Integer); overload;
        procedure ScrollTo(const Rect: TRect); overload;
        { Invoked when the view scrolls by an amount }
        procedure SelectionScroll(DX, DY: Integer); virtual;
        { Call DoUpdate and refresh the scroll bars unless updates are suspended }
        procedure UpdateChanged;
        { Invoked when the scroll position changes }
        procedure DoScroll(X, Y: Integer); virtual;
        { Override to recalculate the scrollable size }
        procedure DoUpdate; virtual;
        { The horizontal amount scrolled by a scroll bar arrow }
        property LineWidth: Integer read FLineWidth write FLineWidth;
        { The vertical amount scrolled by a scroll bar arrow }
        property LineHeight: Integer read FLineHeight write FLineHeight;
        { OnScrollChange is invoked when the scroll position changes }
        property OnScrollChange: TScrollChangeEvent read FOnScrollChange write FOnScrollChange;
      public
        procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
        { Suspend updates until EndUpdate is called }
        procedure BeginUpdate;
        { Resume updates and apply changes }
        procedure EndUpdate;
        { CanUpdate is false while updates are suspended }
        property CanUpdate: Boolean read GetCanUpdate;
        property Anchors;
        property Canvas;
        property Color;
        { The width of the scrollable area }
        property ScrollWidth: Integer read GetScrollWidth;
        { The height of the scrollable area }
        property ScrollHeight: Integer read GetScrollHeight;
        { The horizontal scroll position }
        property ScrollLeft: Integer read GetScrollLeft;
        { The vertical scroll position }
        property ScrollTop: Integer read GetScrollTop;
        property OnResize;
      end;

    See also

    TSurfaceCustomControl in Codebot.Controls.pas