trichview.support
Re: DocumentHeight Question |
Author |
Message |
Mark DeMichele |
Posted: 07/02/2002 17:41:25 Well, that kind of fixes it, but then you have a lot of extra space underneath. In my application, I'm stacking RichViews, so the extra space is ugly and will probably be not acceptable to my customer. I've been looking into it and I discovered a few things. 1. When you call TRVScroll.UpdateScrollBars from TRichViewRVData.SetDocumentAreaSize you pass in YS based on the the DocumentHeight. 2. In side UpdateScrollBars the ScrollPage is calculated from ClientHeight and ScrollMax is calculated from the Passed in YS value that was based on DocumentHeight. 3. Windows hides the scrollbars whenever ScrollMax < ScrollPage and shows them when ScrollMax >= ScrollPage (the way I understand it). 4. In my code I set the ClientHeight = DocumentHeight, but when you step through the code, you can see that afterwards ClientHeight and DocumentHeight are not the same. Which means that you're calculating ScrollMax and ScrollPage base on different things. 5. One thing that I noticed that if I removed the "+1" from call to UpdateScrollBars in TRichViewRVData.SetDocumentAreaSize, it helped. However, as you resize the width there are cases when the scroll bar will show. My experience tells me that this is not caused by roundoff error. It has something to do with the fact that I set ClientHeight to DocumentHeight, but after that's done the ClientHeight is not equal to the DocumentHeight. It's wierd. Any help would be appreciated. Thanks, Mark DeMichele If you want I can probably slap together a simple test from to demonstrate the problem. "Sergey Tkachenko" <[email protected]> wrote in message news:[email protected]... > It is because of rounding off error. Vertical scrollbar unit is larger than > pixel. > > Add VSmallStep to height: > > RichViewEdit1.ClientHeight := > RichViewEdit1.DocumentHeight+RichViewEdit1.VSmallStep; > > Or just hide vertical scrollbar (VScrollVisible) > > > It says in the help that DocumentHeight includes TopMargin and > BottomMargin. > > However, if I size the Height of my RichView control to DocumentHeight, it > > seems that I need to add TopMargin and BottomMargin for it not to have > > scrollbars. Sometimes I even need to add a couple of pixels to stop it > > from scrolling. Why, I don't know. > > > > Mark DeMichele > > > > > > > > > > > > > > |
Powered by ABC Amber Outlook Express Converter