TRichViewEdit - with own VerticalScrollbar and extra buttons
Posted: Fri Aug 12, 2022 9:21 am
Hello Sergey,
I want to replace a lot TMemo controls in our forms - with TRichViewEdit and a limited set of formating possibilties for our users. The available space on our forms is very limited, so we tried this. I did create a new subclass from TRichViewEdit in the constructor I disabled the original vertical scrollbar and created a new one of your TSRVScrollBar and two additional buttons on top and bottom of it. Now it looks like this at runtime:
The burger button, will show a editing toolbar on top of the control - but not inside the control - so it is nothing you have to worry about, (the toolbar will be a shared objects for all of our memos and exists only as a single instance)
Looks nice - but doesn't work - I thought it would be enough the override AdjustClientRect() and remove the scrollbar from the "ClientArea" and so
from ClientWidth - but it seems that your painting and calculation isn't useing ClientWidth? or has a copy from it?
So if I type text in single line it will be painted behind the scrollbar.
Also if the richedit starts to scroll verticaly things go wrong - because it tries to scroll also my controls.
(the memo's in that case will use the Option.rvoClientTextWidth = TRUE, to avoid the horizontal scalebar)
Can you offer me some help / hints how to solve this - may I have to override some additional methods to get work?
I have allready found the sample that show's how to use external scrollbars and how to synchronize them with a TRichViewEdit,
that was useful - to keep my scrollbar in sync.
with best regards
André
I want to replace a lot TMemo controls in our forms - with TRichViewEdit and a limited set of formating possibilties for our users. The available space on our forms is very limited, so we tried this. I did create a new subclass from TRichViewEdit in the constructor I disabled the original vertical scrollbar and created a new one of your TSRVScrollBar and two additional buttons on top and bottom of it. Now it looks like this at runtime:
The burger button, will show a editing toolbar on top of the control - but not inside the control - so it is nothing you have to worry about, (the toolbar will be a shared objects for all of our memos and exists only as a single instance)
Looks nice - but doesn't work - I thought it would be enough the override AdjustClientRect() and remove the scrollbar from the "ClientArea" and so
from ClientWidth - but it seems that your painting and calculation isn't useing ClientWidth? or has a copy from it?
So if I type text in single line it will be painted behind the scrollbar.
Also if the richedit starts to scroll verticaly things go wrong - because it tries to scroll also my controls.
(the memo's in that case will use the Option.rvoClientTextWidth = TRUE, to avoid the horizontal scalebar)
Can you offer me some help / hints how to solve this - may I have to override some additional methods to get work?
I have allready found the sample that show's how to use external scrollbars and how to synchronize them with a TRichViewEdit,
that was useful - to keep my scrollbar in sync.
with best regards
André