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
Recent
Tesseract for ocr
by
cdbc
[
Today
at 07:16:05 pm]
Treeview: full-width back...
by
wp
[
Today
at 07:15:37 pm]
NTSC/CRT port for Free Pa...
by
hukka
[
Today
at 06:48:07 pm]
read keys from windows ko...
by
TRon
[
Today
at 06:27:02 pm]
BUG in InputQuery if defa...
by
robert rozee
[
Today
at 06:20:50 pm]
my programs crash
by
Bart
[
Today
at 06:06:34 pm]
MAC refuse ti rebuild IDE...
by
Johan Holstein
[
Today
at 05:15:59 pm]
using RunCommand to wrap ...
by
MarkMLl
[
Today
at 04:45:40 pm]
TOHLCChartSource
by
ronhud
[
Today
at 04:32:58 pm]
align a panel alClient in...
by
Hansvb
[
Today
at 04:29:57 pm]
Strange implicit string c...
by
nanobit
[
Today
at 03:49:40 pm]
visasession
by
MarkMLl
[
Today
at 03:34:17 pm]
"set of": order of elemen...
by
440bx
[
Today
at 03:23:58 pm]
how to change font.color ...
by
bbd666
[
Today
at 03:12:15 pm]
UADE Library
by
Gigatron
[
Today
at 01:50:35 pm]
Unselect all rows in stri...
by
Jonny
[
Today
at 01:10:54 pm]
Is there a code formatter...
by
Zvoni
[
Today
at 12:56:12 pm]
how to read cheque micr l...
by
Packs
[
Today
at 08:58:27 am]
User Domain
by
TRon
[
Today
at 08:49:48 am]
Bug in the formula MATCH
by
veb86
[
Today
at 07:28:39 am]
Error, the IF function do...
by
veb86
[
Today
at 06:47:30 am]
Source Editor - Open Sour...
by
n7800
[
Today
at 05:13:12 am]
Form Positioning (Run & D...
by
Tony Stone
[
Today
at 03:28:03 am]
StrToInt not raising an e...
by
ALLIGATOR
[
Today
at 03:17:25 am]
[solved] Issues was wrong...
by
What I can do
[
Today
at 01:03:09 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 998 times)
Hansvb
Hero Member
Posts: 728
[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: 10786
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: 728
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