Expose sbVert TScrollBar object
Joined: 14 Dec 2012
Topic: Expose sbVert TScrollBar object
Posted: 15 Dec 2012 at 5:12pm
I am emulating Delphi's editor, and in order to vertically scroll using Ctrl+ArrowUp and Ctrl+ArrowDn, I have exposed a few properties. I realize this is not true oop, but unless I am missing something, I don't have a choice.
In order to access some protected properties/methods I use this in a locally scoped section of the unit:
TInternalAdvMemo = Class(TAdvMemo)
Then in the On Key Down method of they key trap:
If (ssCtrl In Shift) And (Key = VK_DOWN) Then Begin
i := FAdvMemo.TopLine+1 ;
End Else If (ssCtrl In Shift) And (Key = VK_UP) Then Begin
i := FAdvMemo.TopLine - 1 ;
I also moved
sbVert, sbHorz: TScrollBar;
from line 1212 in AdvMemo.pas (Private section) to line 1497 (Protected section).
If your next release could make these things a little easier to access, that would be helpful.
Joined: 11 May 2010
|Post Options Quote Reply Posted: 16 Dec 2012 at 4:02am|
Thanks for this good suggestion. We can confirm the next update of TAdvMemo will have this behavior directly built-in.
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum