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... » RichEdit questions
Re: RichEdit questions [message #30230 is a reply to message #25472] Thu, 16 December 2010 22:55 Go to previous messageGo to previous message
alendar is currently offline  alendar
Messages: 47
Registered: January 2010
Location: Idaho, USA
Member
I hope this saves someone an hour or two:

	void Layout() {
		RichEdit::Layout();
		long editor_cx = GetSize().cx;
		long adaptive_cx = (editor_cx * 8); // Smaller the total, the bigger the text.  Increase the constant to decrease the font.
		SetPage(Size(adaptive_cx, INT_MAX));
	}


This inverts the size of the editor rectangle to the font logical size, i.e., the bigger the editor, the bigger the page, the smaller the font, which is then zoomed to look the same as it did. Make sense?

I gave up on SetZoom, which has some relation to this function, but mostly it just seems to increase the unusable margins or indent on the page, and it can't be regained. The Zoom must be left as default or set to 100 (100%) if you want a 0 margin.


cd7651feeb698f6ac6cec1f6deda5e5b
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [RTF format] - change tables and pictures
Next Topic: Get String from RichText
Goto Forum:
  


Current Time: Mon May 13 20:43:31 CEST 2024

Total time taken to generate the page: 0.01322 seconds