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
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
AI interactions
by
gidesa
[
Today
at 12:58:52 pm]
TLazSerial : serial port ...
by
dbannon
[
Today
at 12:41:12 pm]
Error: Enumeration symbol...
by
nanobit
[
Today
at 12:35:40 pm]
Recomendations for conver...
by
kompustelnik
[
Today
at 11:20:05 am]
Qt6 / X11: problem with G...
by
paweld
[
Today
at 11:14:43 am]
[Solved] Lookup field: er...
by
BlueIcaro
[
Today
at 09:59:57 am]
connecting to mariadb
by
Zvoni
[
Today
at 09:31:54 am]
delete cookies
by
tintinux
[
Today
at 09:26:01 am]
[hacked for now] Changing...
by
Zvoni
[
Today
at 09:25:15 am]
Why does the call via fun...
by
Thaddy
[
Today
at 08:57:45 am]
LCL Web Native with D2Bri...
by
egsuh
[
Today
at 08:10:14 am]
Access Violation - Databa...
by
Xenno
[
Today
at 06:21:52 am]
Question re. FCL's ssocke...
by
Curt Carpenter
[
Today
at 12:22:45 am]
SpkToolbar custom update
by
wp
[December 14, 2025, 11:55:55 pm]
MVP made easier.
by
cdbc
[December 14, 2025, 05:14:40 pm]
Lazarus is not working
by
Fred vS
[December 14, 2025, 05:14:20 pm]
TIBDataSet "Closing"? on ...
by
RedOctober
[December 14, 2025, 04:52:18 pm]
Running External Tools
by
JuhaManninen
[December 14, 2025, 04:08:28 pm]
The start of yet another ...
by
TBMan
[December 14, 2025, 03:16:21 pm]
Need help with Runcommand...
by
marcov
[December 14, 2025, 12:46:25 pm]
Military Grade Directives
by
Thaddy
[December 14, 2025, 11:46:44 am]
Cannot find Online Packag...
by
Thaddy
[December 14, 2025, 11:37:58 am]
Anyone interested in help...
by
ad1mt
[December 14, 2025, 08:56:20 am]
Hashing pointers by using...
by
440bx
[December 14, 2025, 03:16:33 am]
exception external SIGSEG...
by
dseligo
[December 14, 2025, 02:24:28 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 1197 times)
Hansvb
Hero Member
Posts: 867
[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: 11926
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
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
Hansvb
Hero Member
Posts: 867
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