Recent

Author Topic: Custom scrollbars for SynEdit  (Read 3884 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Custom scrollbars for SynEdit
« 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.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Custom scrollbars for SynEdit
« Reply #1 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?

Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: Custom scrollbars for SynEdit
« Reply #2 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.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Custom scrollbars for SynEdit
« Reply #3 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.



Edson

  • Hero Member
  • *****
  • Posts: 1301
Re: Custom scrollbars for SynEdit
« Reply #4 on: March 16, 2019, 05:03:32 pm »
Thanks Martin. As always, very useful information.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Custom scrollbars for SynEdit
« Reply #5 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....

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
Re: Custom scrollbars for SynEdit
« Reply #6 on: April 07, 2019, 10:18:11 pm »
OK, so now changing scrollbars to ATScrollbar is not possible yet.

 

TinyPortal © 2005-2018