[lazarus] How to scroll TMemo control in code

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Mar 29 04:29:19 EST 2003


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 think, we can simple use GetScrollInfo and SetScrollInfo.

Ok?


Mattias




> 
> Andrew
> 
> On Fri, 2003-03-28 at 08:49, Shane Miller wrote:
> > I agree with this.  Either place the property statement into the private
> > section (so the visibility is less than it's parent class) or simply
> > override the methods that actually set the range.  I think that it
> > really should inherit from TCOntrolScrollBar to stay consistent.
> > 
> > Shane
> > 
> > 
> > >What about
> > >
> > >TCustomMemoScrollBar = class(TControlScrollbar)
> > >
> > >and overload the properties?
> > >
> > >
> > >Mattias
> > 
> > 
> > 
> > CONFIDENTIALITY NOTICE:
> > This e-mail message, including any attachments, is for the sole use of
> > the intended recipient(s) and may contain confidential and privileged
> > information. Any unauthorized review, use, disclosure or distribution is
> > prohibited. If you are not the intended recipient, please contact the
> > sender by reply e-mail and destroy all copies of the original message.
> > 
> > _________________________________________________________________
> >      To unsubscribe: mail lazarus-request at miraclec.com with
> >                 "unsubscribe" as the Subject
> >    archives at http://www.lazarus.freepascal.org/mailarchives
> 
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives






More information about the Lazarus mailing list