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
Building static libraries...
by
Fibonacci
[
Today
at 04:15:55 am]
failed to create named pi...
by
lazpas
[
Today
at 03:55:34 am]
Web assembly in Lazarus
by
PierceNg
[
Today
at 02:54:17 am]
TScroollBar vs TControlSc...
by
jamie
[
Today
at 12:26:23 am]
Online Package Manager
by
Beazy
[October 03, 2023, 11:22:22 pm]
Tmenuitem of TpopopMenu
by
paweld
[October 03, 2023, 11:06:26 pm]
Poor optimization of cons...
by
440bx
[October 03, 2023, 11:00:18 pm]
fpsStreams unit problems
by
wp
[October 03, 2023, 10:44:02 pm]
Disable sse/avx
by
marcov
[October 03, 2023, 10:43:02 pm]
Component for generating ...
by
colo
[October 03, 2023, 08:58:24 pm]
Screen.Cursor does not wo...
by
davemoriupak
[October 03, 2023, 08:24:27 pm]
LCLIntf.SetFocus don't ca...
by
davemoriupak
[October 03, 2023, 08:23:34 pm]
Linking error - Cocoa pro...
by
davemoriupak
[October 03, 2023, 08:21:48 pm]
Wayland and Free Pascal
by
nouzi
[October 03, 2023, 07:54:01 pm]
LAMW - opening URL in ext...
by
c4p
[October 03, 2023, 06:37:06 pm]
TBufferedFileStream crash...
by
AlexTP
[October 03, 2023, 06:13:54 pm]
Notarization under macOS ...
by
TRon
[October 03, 2023, 05:16:39 pm]
FPImageException while l...
by
wp
[October 03, 2023, 05:05:57 pm]
What is a .DB file
by
wp
[October 03, 2023, 04:13:15 pm]
IntraWeb in Lazarus??
by
ginoo
[October 03, 2023, 01:32:49 pm]
Pull an icon from a runni...
by
BIT
[October 03, 2023, 01:10:29 pm]
IMAP Search command & uni...
by
Rebell
[October 03, 2023, 12:24:14 pm]
[SOLVED] Debugger do not ...
by
BSaidus
[October 03, 2023, 10:04:29 am]
pgNotex, a document and t...
by
maxnd
[October 03, 2023, 09:45:57 am]
Improvement of function E...
by
AlexTP
[October 03, 2023, 09:30:23 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 380 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: 9213
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