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... » RichTextView: Size is wrong without scrollbar
RichTextView: Size is wrong without scrollbar [message #1305] Mon, 27 February 2006 00:08 Go to next message
zsolt is currently offline  zsolt
Messages: 576
Registered: December 2005
Location: Budapest, Hungary
Contributor
The problem is, that without scrollbars, size is calculated as if there were scrollbars.

I have commented out two lines, and it seems to be OK with and without scrollbars as well:
int   RichTextView::GetPageCx() const
{
	int szcx = GetSize().cx;
	//if(!sb.IsShown() && sb.IsAutoHide())
	//	szcx -= ScrollBar::GetStdBox();
	return IsNull(zoom) ? cx: (szcx - margin.left - margin.right) / zoom;
}
Re: RichTextView: Size is wrong without scrollbar [message #1425 is a reply to message #1305] Fri, 03 March 2006 16:37 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11844
Registered: November 2005
Ultimate Member
BTW, beware this situation, it is sometimes tricky.

The trouble is that if you use view width for computation of sb layout, you will end in "flip-flop" situation, as presence of sb will affect its layout (size is reduced).

In this case it leads in relatively harmless condition, but with both scrollbars present, it can lead into "scrollbar oscillation" which results in stack-overflow crash. That is why it is advisible to provide always the size that does not depend whether scrollbar is visible.

However, in RichTextView, the bug was that this size was used for both sb calulaction and painting. This is now fixed.

Mirek
Re: RichTextView: Size is wrong without scrollbar [message #1436 is a reply to message #1425] Fri, 03 March 2006 21:29 Go to previous message
zsolt is currently offline  zsolt
Messages: 576
Registered: December 2005
Location: Budapest, Hungary
Contributor
Yes. I understand, thank you.
Previous Topic: How to add some text to RichTextview?
Next Topic: RichTextView can select more than one block of text [BUGS][FIXED]
Goto Forum:
  


Current Time: Thu Apr 25 11:50:08 CEST 2019

Total time taken to generate the page: 0.00778 seconds