Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED] SynEdit resize text
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
NiceGrid freezes when res...
by
wp
[
Today
at 07:21:47 pm]
Lazarus | locate on numer...
by
paweld
[
Today
at 07:20:58 pm]
reset
by
Bart
[
Today
at 05:44:02 pm]
QRCode component
by
wp
[
Today
at 05:24:59 pm]
Problem with Windows API ...
by
cpicanco
[
Today
at 04:16:54 pm]
LAMW - Getting text in jC...
by
maurobio
[
Today
at 04:15:47 pm]
Speech recognition?
by
cpicanco
[
Today
at 04:14:43 pm]
Hypocycloid demo
by
lainz
[
Today
at 03:48:27 pm]
form transparency
by
jamie
[
Today
at 03:26:44 pm]
PRNG: Why transition to X...
by
MarkMLl
[
Today
at 02:40:15 pm]
[Discussion] Expanding wi...
by
MarkMLl
[
Today
at 02:29:34 pm]
Large system, i2C to go w...
by
pascalbythree
[
Today
at 01:23:18 pm]
mvvm experimenting
by
cdbc
[
Today
at 10:10:43 am]
Mazemaker (efg)
by
Lulu
[
Today
at 09:57:03 am]
Strange behavior of TGrap...
by
simsee
[
Today
at 09:28:59 am]
How I can validate if con...
by
MarkMLl
[
Today
at 09:01:07 am]
[SOLVED] Internationaliza...
by
Mongkey
[
Today
at 02:54:16 am]
Switching IDE context for...
by
Martin_fr
[September 22, 2023, 11:02:13 pm]
Resize projectwizard dial...
by
wp
[September 22, 2023, 11:01:01 pm]
TListView vsIcon view sho...
by
wp
[September 22, 2023, 10:46:26 pm]
moving project, extending...
by
Weiss
[September 22, 2023, 10:28:52 pm]
[Solved] Cocoa window sho...
by
FangQ
[September 22, 2023, 08:39:17 pm]
Changing the superclass o...
by
alpine
[September 22, 2023, 07:59:48 pm]
static link libc.a
by
toby
[September 22, 2023, 06:28:35 pm]
Best practice to store lo...
by
Okoba
[September 22, 2023, 05:31:10 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 371 times)
Hansvb
Hero Member
Posts: 510
[SOLVED] SynEdit resize text
«
on:
May 29, 2023, 07:38:02 pm »
Hi,
I would like to resize the text in a TSynEdit with mouse scrolling. I have the following but it doesn't work well. If you reduce the size, the text suddenly becomes large again.
Code: Pascal
[Select]
[+]
[-]
procedure
TFrmMain
.
SynEditJsonDataMouseWheelDown
(
Sender
:
TObject
;
Shift
:
TShiftState
;
MousePos
:
TPoint
;
var
Handled
:
Boolean
)
;
begin
if
(
ssCtrl
in
Shift
)
and
Sender
.
InheritsFrom
(
TSynEdit
)
then
begin
TSynEdit
(
Sender
)
.
Font
.
Size
:
=
TSynEdit
(
Sender
)
.
Font
.
Size
-
1
;
Handled
:
=
true
;
end
;
end
;
procedure
TFrmMain
.
SynEditJsonDataMouseWheelUp
(
Sender
:
TObject
;
Shift
:
TShiftState
;
MousePos
:
TPoint
;
var
Handled
:
Boolean
)
;
begin
if
(
ssCtrl
in
Shift
)
and
Sender
.
InheritsFrom
(
TSynEdit
)
then
begin
TSynEdit
(
Sender
)
.
Font
.
Size
:
=
TSynEdit
(
Sender
)
.
Font
.
Size
+
1
;
end
;
end
;
It is for Windows only.
«
Last Edit: June 03, 2023, 03:42:32 pm by Hansvb
»
Logged
Martin_fr
Administrator
Hero Member
Posts: 9209
Debugger - SynEdit - and more
Re: SynEdit resize text
«
Reply #1 on:
May 29, 2023, 08:00:01 pm »
Make sure you don't go through zero.
Negative font sizes are valid values, and the font becomes larger. (IIRC pixels vs points).
SynEdit already has zoom.
add emCtrlWheelZoom to SynEdit.MouseOptions.
Logged
From the wiki:
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
Hansvb
Hero Member
Posts: 510
Re: SynEdit resize text
«
Reply #2 on:
June 03, 2023, 03:42:16 pm »
Quote
add emCtrlWheelZoom to SynEdit.MouseOptions.
I had overlooked that option.
Thanks, zoom now works fine.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED] SynEdit resize text
TinyPortal
© 2005-2018