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
[solved] Confusing scope(...
by
TRon
[
Today
at 12:08:06 pm]
[solved] Website(s) where...
by
TRon
[
Today
at 12:00:01 pm]
[SOLVED] Components with ...
by
alpine
[
Today
at 11:32:31 am]
Saving a Form state (rela...
by
jcmontherock
[
Today
at 11:22:52 am]
[fpspreadsheet] Cannot co...
by
wp
[
Today
at 11:20:13 am]
any workaround of nested ...
by
powerpcer
[
Today
at 11:12:52 am]
DBVirtualGrid - processin...
by
wp
[
Today
at 11:08:54 am]
Hypocycloid demo
by
TRon
[
Today
at 10:29:17 am]
[SOLVED] QRCode component
by
Fibonacci
[
Today
at 10:18:23 am]
Cannot get file opening e...
by
ranny
[
Today
at 10:06:29 am]
Improvement of DoCopyProp...
by
lagprogramming
[
Today
at 09:51:24 am]
RasPi: How can i detect t...
by
mdalacu
[
Today
at 09:45:24 am]
“case (a,b) of...” doesn’...
by
440bx
[
Today
at 09:32:39 am]
CAD program written in La...
by
zamtmn
[
Today
at 07:21:24 am]
drop picture from browser
by
mikutu
[
Today
at 04:39:35 am]
What is a .DB file
by
wp
[September 25, 2023, 11:17:31 pm]
Tedit selected text
by
Paolo
[September 25, 2023, 11:03:07 pm]
c++ library and strings
by
Remy Lebeau
[September 25, 2023, 10:58:31 pm]
LazPaint Plugins
by
lainz
[September 25, 2023, 10:30:46 pm]
Class Change Color Edit a...
by
Bart
[September 25, 2023, 09:43:02 pm]
Linker error with LLVM 15...
by
Jonas Maebe
[September 25, 2023, 08:36:02 pm]
SDL2 debug
by
cpicanco
[September 25, 2023, 08:32:19 pm]
Large system, i2C to go w...
by
ccrause
[September 25, 2023, 08:26:04 pm]
mvvm experimenting
by
nummer8
[September 25, 2023, 06:04:08 pm]
Best practice to store lo...
by
Okoba
[September 25, 2023, 05:32:35 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] SynEdit resize text (Read 373 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: 9210
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