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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Modbus summary thread
by
jamie
[
Today
at 07:26:32 pm]
What WinAPI functions can...
by
440bx
[
Today
at 07:11:29 pm]
Loop Iteration Speed Test
by
Gustavo 'Gus' Carreno
[
Today
at 07:08:37 pm]
Error: Identifier not fou...
by
Yoghoo
[
Today
at 06:34:44 pm]
Opencv version 4.6 C++ AP...
by
gidesa
[
Today
at 06:00:09 pm]
My second "paint" program
by
TBMan
[
Today
at 05:22:18 pm]
Lazarus Release 4.0
by
JuhaManninen
[
Today
at 05:20:55 pm]
[SOLVED] RecordCount not ...
by
1HuntnMan
[
Today
at 05:10:04 pm]
How to fix "Warning: Enco...
by
ecm
[
Today
at 05:09:33 pm]
Classes vs Objects
by
TBMan
[
Today
at 04:34:59 pm]
WinInet compiling errors.
by
440bx
[
Today
at 03:50:03 pm]
Replace controls dynamica...
by
Aruna
[
Today
at 03:40:02 pm]
Status and Maintenance of...
by
Thaddy
[
Today
at 02:07:33 pm]
Hints for method name mis...
by
dbannon
[
Today
at 12:50:07 pm]
[Solved] save dbgrid colu...
by
Hansvb
[
Today
at 11:28:50 am]
connection lost
by
Nimbus
[
Today
at 10:49:26 am]
X11Libre, finally and for...
by
dbannon
[
Today
at 08:55:11 am]
[SOLVED] Firebird 5 remot...
by
Sakkie
[
Today
at 08:48:20 am]
Habari STOMP Clients Rele...
by
mjustin
[
Today
at 08:00:39 am]
TBitBtn no longer shows g...
by
jamie
[
Today
at 03:10:54 am]
InstallAware 2025 Sources...
by
msintle
[
Today
at 02:23:20 am]
Free Pascal ncurses TUI
by
Gustavo 'Gus' Carreno
[
Today
at 12:29:16 am]
[SOLVED] Strange result (...
by
tfurnivall
[June 21, 2025, 11:24:05 pm]
SnapModbus
by
bobby100
[June 21, 2025, 11:09:58 pm]
BGRA Controls
by
alan1076
[June 21, 2025, 09:06:37 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 1090 times)
Hansvb
Hero Member
Posts: 821
[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: 11355
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
Bright theme for bright minds
Hansvb
Hero Member
Posts: 821
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