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
C operators and shift
by
Okoba
[
Today
at 09:54:38 am]
Type Library Viewer, Impo...
by
marcov
[
Today
at 09:47:07 am]
Developing a Kernel Modul...
by
MarkMLl
[
Today
at 09:28:16 am]
ZDataset.Locate + loParti...
by
tintinux
[
Today
at 09:14:48 am]
Problem with Hints
by
Alexandr R
[
Today
at 08:20:29 am]
Storing line colors
by
Khrys
[
Today
at 07:51:29 am]
Use tts0, This example is...
by
Thaddy
[
Today
at 06:28:12 am]
Python4Lazarus Undefined ...
by
Jurassic Pork
[
Today
at 02:07:28 am]
Show Form at Top
by
TRon
[
Today
at 12:48:24 am]
Zaos Transliteration on l...
by
hamacker
[December 03, 2024, 11:12:53 pm]
Breakpoint dosn't work
by
Joanna from IRC
[December 03, 2024, 11:04:55 pm]
[SOLVED] Howto use a DEFI...
by
PascalDragon
[December 03, 2024, 09:42:38 pm]
Random SnowFlakes:
by
Boleeman
[December 03, 2024, 09:07:14 pm]
AVRPascal – free code edi...
by
ackarwow
[December 03, 2024, 09:04:00 pm]
Secondary Installation fo...
by
TRon
[December 03, 2024, 08:21:03 pm]
Error when attempting to ...
by
dsiders
[December 03, 2024, 08:01:39 pm]
The Form cannot be resize...
by
daxnet
[December 03, 2024, 02:51:42 pm]
Api/component pack for Ra...
by
MarkMLl
[December 03, 2024, 02:15:57 pm]
kernel 6.8 and checking s...
by
MarkMLl
[December 03, 2024, 02:13:41 pm]
storing string
by
Thaddy
[December 03, 2024, 09:38:41 am]
OverLapping Snowflake Fra...
by
Boleeman
[December 03, 2024, 09:04:01 am]
[SOLVED] StringGrid color...
by
Vodnik
[December 03, 2024, 08:26:44 am]
YM Player
by
TRon
[December 03, 2024, 02:32:16 am]
How single procedure ends...
by
Marion
[December 03, 2024, 01:57:43 am]
ct2laz - convertor betwee...
by
Sharfik
[December 03, 2024, 01:26:03 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 864 times)
Hansvb
Hero Member
Posts: 715
[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: 10546
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: 715
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