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
Order of dialog buttons?
by
dsiders
[
Today
at 11:16:21 am]
Where do I get IdHTTP, ...
by
Remy Lebeau
[
Today
at 10:35:12 am]
Output directory for exe
by
d2010
[
Today
at 10:22:51 am]
Debugging a new package?
by
Martin_fr
[
Today
at 10:13:05 am]
Programs writing programs...
by
alpine
[
Today
at 10:02:44 am]
Making sense of pparser, ...
by
JernejL
[
Today
at 09:46:54 am]
CPU-View
by
Alexander (Rouse_) Bagel
[
Today
at 09:36:12 am]
TIdSMTP problems
by
Remy Lebeau
[
Today
at 09:30:03 am]
const declaration
by
MarkMLl
[
Today
at 09:17:03 am]
MQTT Client
by
cdbc
[
Today
at 08:54:07 am]
Lazarus Release Candidate...
by
SerJ_Pooh
[
Today
at 08:28:05 am]
TImage colors incorrect
by
Mr.Madguy
[
Today
at 07:50:52 am]
Bug in the formula MATCH
by
veb86
[
Today
at 07:41:04 am]
Form editer strange behav...
by
TheMouseAUS
[
Today
at 06:40:58 am]
Problem in writing formul...
by
veb86
[
Today
at 06:26:52 am]
How to add new methods to...
by
eolandro
[
Today
at 05:10:38 am]
Connection issues, contin...
by
jksmithiii
[
Today
at 04:50:44 am]
Problem with cell comment
by
kjteng
[
Today
at 04:37:08 am]
Nested declarations insid...
by
440bx
[
Today
at 04:15:30 am]
RegEx Patterns: Fractals
by
Boleeman
[
Today
at 01:43:40 am]
H2Pas can't handle EXP CA...
by
TRon
[January 16, 2025, 11:46:56 pm]
Iterator on non-existing ...
by
Warfley
[January 16, 2025, 10:54:14 pm]
[SOLVED]Troubles when con...
by
bytebites
[January 16, 2025, 10:32:35 pm]
[SOLVED] Operators overri...
by
ackarwow
[January 16, 2025, 10:32:18 pm]
The Silver Coder on YouTu...
by
silvercoder70
[January 16, 2025, 10:21:42 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 949 times)
Hansvb
Hero Member
Posts: 718
[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: 10664
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: 718
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