[lazarus] How to scroll TMemo control in code

Marc Weustink marc at dommelstein.net
Sat Mar 29 05:59:38 EST 2003


At 10:45 29-3-2003 +0100, you wrote:
>On 28 Mar 2003 11:07:59 -0500
>andrew johnson <acjgenius at earthlink.net> wrote:
>
> > I think this is a great idea. And FYI.. the only reasons
> > TControlScrollBar is so inflexible is because, a) I didn't know what I
> > was doing. and b) because I was only attempting to implement what was
> > needed for TScrollingWinControl stuff. So, if it is possible to make as
> > many of these changes as possible directly in TControlScrollBar without
> > breaking TScrollingWinControl, and Delphi compatibility in that regard I
> > think it would make more sense to do so.
>
>Yep.
>I changed the FControl in TControlScrollbar into a TWincontrol. Most of code
>only works if the FControl is a TScollingWinControl. For all other it does
>nothing.
>
>Now it's time for implementation.
>The TMemoScrollBar should be mostly readonly, but the position property. The
>TControlScrollbar is currently quite the opposite. It updates the position
>due to messages and set all other values (min, max, page) and even
>calculates the visibility itself.
>Therefore TControlScrollbar should for non-TScrollWinControls only read the
>values from the interface and raise an exception on writing the properties.
>TMemoScrollbar should implement SetPosition.
>TMemo must create/destroy the two TMemoScrollbar.
>
>So, we need functions to read
>Increment, Page, Min, Max, Range, Size, Position, Smooth
>and a function to set the
>Position

I don't see any harm in setting Increment, Page and Smooth as well (half 
page scrolling in stead of pagescrolling or so)

>I think, we can simple use GetScrollInfo and SetScrollInfo.
>
>Ok?

Think so.

Marc






More information about the Lazarus mailing list