Lazarus

Programming => Packages and Libraries => SynEdit => Topic started by: AlexTP on March 16, 2019, 09:37:39 am

Title: Custom scrollbars for SynEdit
Post by: AlexTP on March 16, 2019, 09:37:39 am
Hi Martin. ATSynEdit can use custom scrollbars. ie, ATScrollbar component. Pls, add option to use ATScrollbar in SynEdit too? It ll help to themetize the IDE later.
Title: Re: Custom scrollbars for SynEdit
Post by: Martin_fr on March 16, 2019, 02:07:17 pm
SynEdits scrollbars can be hidden already.

For new scrollbar SynEdit can be put into a parent container, and scrollbars can be added there.

What else is needed?
Title: Re: Custom scrollbars for SynEdit
Post by: Edson on March 16, 2019, 03:31:30 pm
SynEdits scrollbars can be hidden already.

For new scrollbar SynEdit can be put into a parent container, and scrollbars can be added there.

What else is needed?

How can I connect the new Scrollbar to the SynEdit. I mean SynEdit can fold blocks of code and that changes the vertical height. I haven't tried but I guess it's no so simple.
Title: Re: Custom scrollbars for SynEdit
Post by: Martin_fr on March 16, 2019, 04:45:04 pm
There is
Code: Pascal  [Select][+][-]
  1. property TopView: integer
It returns the top-line of the editor, counting only visible lines.
It is protected, so you need to subclass SynEdit.
- IIRC, OnStatusChange triggers if that changes

The visible count, is private: CurrentMaxTopView
But there is protected FoldedTextBuffer, which has the visible lines count (you need to add, in case of scrollpastEol), see CurrentMaxTopView
- Not sure what event triggers, if that changes.

Unfortunately there is not yet an interface defined for all of this.
And this may still take a bit, fold-view is not correctly integrated into synedit yet. Several places have hardcoded access to it. But SynEdit is meant to be modal.


Title: Re: Custom scrollbars for SynEdit
Post by: Edson on March 16, 2019, 05:03:32 pm
Thanks Martin. As always, very useful information.
Title: Re: Custom scrollbars for SynEdit
Post by: Martin_fr on March 16, 2019, 05:13:33 pm
The issue with SynEdit is, that due to time constraints, most things were implemented exactly to the needs of the current IDE.

Public interfaces, for use outside the IDE are miles behind.
I have that on my todo, but as I said: time....
Title: Re: Custom scrollbars for SynEdit
Post by: AlexTP on April 07, 2019, 10:18:11 pm
OK, so now changing scrollbars to ATScrollbar is not possible yet.
TinyPortal © 2005-2018