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
[ANN] PasBuild v1.9.0 Rel...
by
Graeme
[
Today
at 08:14:26 pm]
Instruction-level paralle...
by
MathMan
[
Today
at 08:11:33 pm]
[New Component] ExtTabCtr...
by
ovidio
[
Today
at 08:09:05 pm]
If FileExists(
by
Remy Lebeau
[
Today
at 07:58:06 pm]
Codepage issue in console...
by
Hartmut
[
Today
at 07:52:43 pm]
Lazarus syntax helpers
by
Weiss
[
Today
at 07:48:31 pm]
Which Control should I us...
by
J-G
[
Today
at 07:24:59 pm]
Implementing an Elo ratin...
by
Warfley
[
Today
at 06:33:56 pm]
Fpcupdeluxe
by
totya
[
Today
at 06:17:34 pm]
Can /my/ AI help me with ...
by
Thaddy
[
Today
at 05:45:52 pm]
[SOLVED]Program experienc...
by
Thaddy
[
Today
at 05:39:33 pm]
RunFormula: math expressi...
by
stormray
[
Today
at 03:30:10 pm]
Error with last fixes_3.2...
by
patyit
[
Today
at 01:54:04 pm]
Message CM_ShowingChanged...
by
AlexTP
[
Today
at 01:21:03 pm]
Single and Double, Conver...
by
MathMan
[
Today
at 10:36:23 am]
MOVED: Eye Candy TESCheme
by
theo
[
Today
at 10:06:43 am]
storing assets for releas...
by
Handoko
[
Today
at 08:35:23 am]
What am I missing here? [...
by
Handoko
[
Today
at 05:45:28 am]
TCHATGPT — An Artificial ...
by
marcelomaurinmartins@gmai
[
Today
at 02:20:11 am]
Mundo Medieval 3D MMORPG ...
by
Rodrigo Robles
[June 14, 2026, 05:26:38 pm]
Fast Canvas Library V1.05...
by
Gigatron
[June 14, 2026, 04:57:35 pm]
SynEdit theme
by
LemonParty
[June 14, 2026, 02:01:33 pm]
What happened to CocoaWSC...
by
Frank
[June 14, 2026, 01:31:19 pm]
Very rough version of a s...
by
Hansvb
[June 14, 2026, 12:44:31 pm]
Pdf Viewer in Pascal
by
Dzandaa
[June 14, 2026, 11:44:26 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 1267 times)
Hansvb
Hero Member
Posts: 922
[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: 12429
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: 922
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