Recent

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

Alextp

  • Hero Member
  • *****
  • Posts: 829
    • 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: 5370
    • 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: 1003
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 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5370
    • 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: 1003
Re: Custom scrollbars for SynEdit
« Reply #4 on: March 16, 2019, 05:03:32 pm »
Thanks Martin. As always, very useful information.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5370
    • 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: 829
    • 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.