Thanks for the suggestion but the scollbar and scroller instances of RichTextView are private and so can't be accessed. Anyway, I think I found the solution. I found out that if you get the difference of ScrollBar::Get() and ScrollBar::GetTotal() (both exposed respectively as RichTextView::GetSb() and RichTextView::GetSbTotal()), you get a certain magic number which means that you're scrolled to the very bottom of the whole text. I don't know how to get this number so I just did a sort of hack to get it:
int sb = output_.GetSb(), tsb = output_.GetSbTotal();
output_ <<= ~output + qtf;
if (!sb && !tsb) { //Both are still zero if view has nothing.
_output.ScrollEnd();
_sbConst = _output_.GetSbTotal() - _output_.GetSb(); //_sbConst is a member var initialized here to contain the magic number
} else {
ASSERT(_sbConst > 0);
if (tsb - sb != _sbConst) _output_.SetSb(sb);
else _output_.ScrollEnd();
}
Thanks to all the people behind U++ for such an awesome platform!