Home » U++ Library support » LineEdit, EditFields, DocEdit » DocEdit code scrolling
DocEdit code scrolling [message #36891] |
Wed, 18 July 2012 00:07 |
|
bushman
Messages: 134 Registered: February 2009
|
Experienced Member |
|
|
I'd like to write code to add contents to the end of a DocEdit ctrl, while making it scroll down to always show the end of the line just appended.
After browsing the TextEdit.h/DocEdit.cpp code, I came up with the following solution:
class MyDocEdit: public DocEdit {
...
void AppendText(String txt) {
Insert(GetLength(), txt);
PlaceCaret(GetLength());
}
};
Is there a more appropriate way to do it without having to inherit from DocEdit for getting access to its PlaceCaret (protected) method?
I also want to keep the scroll bar always hidden, regardless of the line count in the ctrl. For this I included in the constructor, which actually removes the scrollbar. Is it ok?
tks.
[Updated on: Thu, 19 July 2012 14:44] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Jun 05 09:51:37 CEST 2024
Total time taken to generate the page: 0.02583 seconds
|