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
"serial" unit for windows...
by
wp
[
Today
at 12:44:54 am]
Set margins into TRichmem...
by
rretamar
[
Today
at 12:36:00 am]
Convert image to excel
by
bytebites
[October 04, 2023, 11:17:43 pm]
TScroollBar vs TControlSc...
by
jamie
[October 04, 2023, 11:16:56 pm]
VisualPlainIT and Postgre...
by
wp
[October 04, 2023, 10:42:50 pm]
Pas2JS for the masses
by
verasan
[October 04, 2023, 10:11:50 pm]
Pas2JS template / boilerp...
by
verasan
[October 04, 2023, 10:05:43 pm]
Problems installing the I...
by
Ever
[October 04, 2023, 09:59:30 pm]
Compiler Callback API => ...
by
marcov
[October 04, 2023, 09:33:08 pm]
Audio player crashes on A...
by
Igor Kokarev
[October 04, 2023, 08:50:42 pm]
I plan to use Pascal and ...
by
coradi
[October 04, 2023, 07:33:03 pm]
Component for generating ...
by
wp
[October 04, 2023, 06:59:18 pm]
For To STEP 10
by
coradi
[October 04, 2023, 06:41:11 pm]
[SOLVED] Components with ...
by
JuhaManninen
[October 04, 2023, 06:02:06 pm]
Simplify displaying data ...
by
CCRDude
[October 04, 2023, 05:55:42 pm]
ELayoutException in SendM...
by
CCRDude
[October 04, 2023, 04:42:24 pm]
Poor optimization of cons...
by
Martin_fr
[October 04, 2023, 01:54:09 pm]
Notarization under macOS ...
by
TRon
[October 04, 2023, 12:58:30 pm]
Intercept multimedia keys
by
Espectr0
[October 04, 2023, 12:02:20 pm]
Looking for property (boo...
by
wp
[October 04, 2023, 11:44:09 am]
Initialize Form Variable?
by
marcov
[October 04, 2023, 11:25:49 am]
Feature announcement: Fun...
by
bytebites
[October 04, 2023, 10:24:42 am]
Custom PopUp Menu with Co...
by
madref
[October 04, 2023, 09:38:50 am]
failed to create named pi...
by
MarkMLl
[October 04, 2023, 08:49:40 am]
Building static libraries...
by
Fibonacci
[October 04, 2023, 04:15:55 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 381 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: 9215
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