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
DBVirtualGrid - processin...
by
TRon
[
Today
at 02:49:32 am]
TBufDataset is behaving i...
by
Gustavo 'Gus' Carreno
[
Today
at 01:00:24 am]
Hypocycloid demo
by
Boleeman
[
Today
at 12:50:10 am]
GTK 3 Widget Set Status?
by
sysrpl
[September 26, 2023, 11:44:15 pm]
FPC 3.2.2 / Lazarus 2.2.6...
by
TRon
[September 26, 2023, 10:39:47 pm]
[SOLVED] Components with ...
by
Kurt
[September 26, 2023, 10:39:37 pm]
Cannot get file opening e...
by
Josh
[September 26, 2023, 08:59:47 pm]
Lazarus.exe does nothing ...
by
wp
[September 26, 2023, 08:23:50 pm]
Is it possible to jump in...
by
Dzandaa
[September 26, 2023, 07:54:12 pm]
is there a way to Forward...
by
440bx
[September 26, 2023, 07:24:23 pm]
weirdness with fnmatch (l...
by
robert rozee
[September 26, 2023, 05:54:06 pm]
SaveDialog asks for filen...
by
gjunk
[September 26, 2023, 03:50:26 pm]
Saving a Form state (rela...
by
Curt Carpenter
[September 26, 2023, 03:50:01 pm]
Stem and Leaf Plot and In...
by
Zvoni
[September 26, 2023, 03:43:51 pm]
Creating a new unit out o...
by
Okoba
[September 26, 2023, 03:13:28 pm]
Large system, i2C to go w...
by
pascalbythree
[September 26, 2023, 02:14:59 pm]
Linker error with LLVM 15...
by
ChrisR
[September 26, 2023, 01:36:49 pm]
Class Change Color Edit a...
by
emivaldo
[September 26, 2023, 01:19:39 pm]
[fpspreadsheet] Cannot co...
by
veb86
[September 26, 2023, 01:07:53 pm]
LazPaint Plugins
by
circular
[September 26, 2023, 01:02:10 pm]
[SOLVED] QRCode component
by
Pe3s
[September 26, 2023, 12:35:31 pm]
[solved] Confusing scope(...
by
TRon
[September 26, 2023, 12:08:06 pm]
[solved] Website(s) where...
by
TRon
[September 26, 2023, 12:00:01 pm]
any workaround of nested ...
by
powerpcer
[September 26, 2023, 11:12:52 am]
Improvement of DoCopyProp...
by
lagprogramming
[September 26, 2023, 09:51:24 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 375 times)
Hansvb
Hero Member
Posts: 512
[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: 9210
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: 512
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