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... » Constant font size in resizeable RichEdit?
Re: Constant font size in resizeable RichEdit? [message #50785 is a reply to message #41077] Tue, 18 December 2018 16:41 Go to previous message
Tooraj
Messages: 2
Registered: December 2018
Location: Frankfurt am Main
Junior Member
It seems, that this important change was forgotten for RichTextView:

For RichTextView the override needs to be slightly modified:

class RichTextView2 : public RichTextView {
public:
	RichTextView2() {
		zoomlevel = 7;
	}
	virtual void Layout() {
		RichTextView::Layout();
		PageWidth( int(zoomlevel*GetSize().cx) );	// Smaller the total, the bigger the text
	}
	virtual void MouseWheel(Point p, int zdelta, dword keyflags) {
		if (keyflags == K_CTRL) {		// Zooms font
			zoomlevel += zdelta/240.;
			if (zoomlevel < 1)
				zoomlevel = 10;
			else if (zoomlevel > 9)
				zoomlevel = 1;
			RefreshLayoutDeep();
		} else				// Scrolls down
			RichTextView::MouseWheel(p, zdelta, keyflags);
	}
	
	double zoomlevel;
};

[Updated on: Wed, 19 December 2018 11:33] by Moderator

Report message to a moderator

 
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: EncodeRTF bullet bug
Next Topic: RichText over an image background - weird scroll (on windows)
Goto Forum:
  


Current Time: Thu Jun 13 15:04:34 CEST 2024

Total time taken to generate the page: 0.01283 seconds