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
Difference between TSpeed...
by
Hansvb
[
Today
at 11:49:07 am]
BGRA Controls Package Ico...
by
paweld
[
Today
at 11:48:50 am]
unable to rebuild Lazarus
by
Paolo
[
Today
at 11:36:47 am]
TAnchorDockPanel - Save a...
by
zamtmn
[
Today
at 11:25:56 am]
Lazarus png file
by
Pe3s
[
Today
at 11:22:32 am]
Can I disable procedure '...
by
Hartmut
[
Today
at 11:12:33 am]
Unable to write "/usr/sha...
by
Rbart
[
Today
at 11:10:58 am]
Advance Record operators ...
by
ad1mt
[
Today
at 11:10:00 am]
[SOLVED] How to force Eve...
by
Hartmut
[
Today
at 10:54:57 am]
[SOLVED] TStringGrid colo...
by
Hansvb
[
Today
at 10:33:43 am]
[SOLVED] TPanel slider po...
by
Pe3s
[
Today
at 10:30:24 am]
How to detect uninitialis...
by
kwyan
[
Today
at 10:28:19 am]
Is there an indexable str...
by
cdbc
[
Today
at 10:24:58 am]
Online Package Manager
by
lainz
[
Today
at 09:54:36 am]
Lazarus Release Candidate...
by
dedrasta
[
Today
at 09:52:02 am]
Error: -macosx_version_mi...
by
dbannon
[
Today
at 09:06:18 am]
BGRABitmap - showcase -
by
Mongkey
[
Today
at 08:27:14 am]
Date-Stamp DBDateEdit
by
cdbc
[
Today
at 08:00:06 am]
i can't inatall Dam dialo...
by
paweld
[
Today
at 07:12:41 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 03:28:20 am]
[SOLVED]Bash commands and...
by
TRon
[
Today
at 02:52:35 am]
Interesting work on Unive...
by
WayneSherman
[
Today
at 12:58:30 am]
How to 'Hello world' on l...
by
wp
[
Today
at 12:44:08 am]
Two paintbox, how to set ...
by
VisualLab
[December 02, 2023, 10:54:37 pm]
IsWayland value can be ca...
by
AlexTP
[December 02, 2023, 10:11:17 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 553 times)
Hansvb
Hero Member
Posts: 518
[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: 9354
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: 518
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