Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » RichText scrolling problem
Re: RichText scrolling problem [message #25364 is a reply to message #25363] Fri, 19 February 2010 07:14 Go to previous messageGo to previous message
javelin is currently offline  javelin
Messages: 3
Registered: November 2009
Junior Member
Hello Sergey,

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!

Mark
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Default font and fontsize in RichEdit
Next Topic: Strange memory problem in QTF RichView
Goto Forum:
  


Current Time: Mon Apr 29 18:57:34 CEST 2024

Total time taken to generate the page: 0.03072 seconds