Home » U++ Library support » RichText,QTF,RTF... » Constant font size in resizeable RichEdit?
Re: Constant font size in resizeable RichEdit? [message #41029 is a reply to message #41020] |
Tue, 22 October 2013 16:10 |
|
koldo
Messages: 3358 Registered: August 2008
|
Senior Veteran |
|
|
My proposal:
class RichEdit2 : public RichEdit {
public:
RichEdit2() {
zoomlevel = 7;
}
virtual void Layout() {
RichEdit::Layout();
SetPage(Size(int(zoomlevel*GetSize().cx), INT_MAX)); // 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
RichEdit::MouseWheel(p, zdelta, keyflags);
}
double zoomlevel;
};
Best regards
IƱaki
[Updated on: Tue, 22 October 2013 16:11] Report message to a moderator
|
|
|
|
|
Constant font size in resizeable RichEdit?
|
|
|
Re: Constant font size in resizeable RichEdit?
By: mirek on Sun, 27 December 2009 19:57
|
|
|
Re: Constant font size in resizeable RichEdit?
By: iST1 on Mon, 07 October 2013 18:18
|
|
|
Re: Constant font size in resizeable RichEdit?
By: mirek on Tue, 08 October 2013 08:05
|
|
|
Re: Constant font size in resizeable RichEdit?
By: koldo on Tue, 08 October 2013 12:22
|
|
|
Re: Constant font size in resizeable RichEdit?
By: mirek on Tue, 08 October 2013 19:59
|
|
|
Re: Constant font size in resizeable RichEdit?
By: koldo on Wed, 09 October 2013 08:15
|
|
|
Re: Constant font size in resizeable RichEdit?
By: iST1 on Fri, 11 October 2013 11:02
|
|
|
Re: Constant font size in resizeable RichEdit?
By: koldo on Fri, 11 October 2013 14:21
|
|
|
Re: Constant font size in resizeable RichEdit?
By: iST1 on Fri, 11 October 2013 14:23
|
|
|
Re: Constant font size in resizeable RichEdit?
By: iST1 on Mon, 21 October 2013 17:58
|
|
|
Re: Constant font size in resizeable RichEdit?
By: koldo on Tue, 22 October 2013 16:10
|
|
|
Re: Constant font size in resizeable RichEdit?
By: iST1 on Tue, 22 October 2013 16:28
|
|
|
Re: Constant font size in resizeable RichEdit?
By: mirek on Tue, 29 October 2013 18:57
|
|
|
Re: Constant font size in resizeable RichEdit?
By: koldo on Wed, 30 October 2013 13:04
|
|
|
Re: Constant font size in resizeable RichEdit?
By: mirek on Wed, 30 October 2013 13:07
|
|
|
Re: Constant font size in resizeable RichEdit?
By: koldo on Wed, 30 October 2013 23:07
|
|
|
Re: Constant font size in resizeable RichEdit?
By: Tooraj on Tue, 18 December 2018 16:41
|
Goto Forum:
Current Time: Thu May 02 15:28:54 CEST 2024
Total time taken to generate the page: 0.44680 seconds
|