Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Widgetset
»
CustomDrawn
»
[SOLVED] class function TCDWSButton.GetText doesn't return a result
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
DBVirtualGrid - processin...
by
TRon
[
Today
at 02:49:32 am]
TBufDataset is behaving i...
by
Gustavo 'Gus' Carreno
[
Today
at 01:00:24 am]
Hypocycloid demo
by
Boleeman
[
Today
at 12:50:10 am]
GTK 3 Widget Set Status?
by
sysrpl
[September 26, 2023, 11:44:15 pm]
FPC 3.2.2 / Lazarus 2.2.6...
by
TRon
[September 26, 2023, 10:39:47 pm]
[SOLVED] Components with ...
by
Kurt
[September 26, 2023, 10:39:37 pm]
Cannot get file opening e...
by
Josh
[September 26, 2023, 08:59:47 pm]
Lazarus.exe does nothing ...
by
wp
[September 26, 2023, 08:23:50 pm]
Is it possible to jump in...
by
Dzandaa
[September 26, 2023, 07:54:12 pm]
is there a way to Forward...
by
440bx
[September 26, 2023, 07:24:23 pm]
weirdness with fnmatch (l...
by
robert rozee
[September 26, 2023, 05:54:06 pm]
SaveDialog asks for filen...
by
gjunk
[September 26, 2023, 03:50:26 pm]
Saving a Form state (rela...
by
Curt Carpenter
[September 26, 2023, 03:50:01 pm]
Stem and Leaf Plot and In...
by
Zvoni
[September 26, 2023, 03:43:51 pm]
Creating a new unit out o...
by
Okoba
[September 26, 2023, 03:13:28 pm]
Large system, i2C to go w...
by
pascalbythree
[September 26, 2023, 02:14:59 pm]
Linker error with LLVM 15...
by
ChrisR
[September 26, 2023, 01:36:49 pm]
Class Change Color Edit a...
by
emivaldo
[September 26, 2023, 01:19:39 pm]
[fpspreadsheet] Cannot co...
by
veb86
[September 26, 2023, 01:07:53 pm]
LazPaint Plugins
by
circular
[September 26, 2023, 01:02:10 pm]
[SOLVED] QRCode component
by
Pe3s
[September 26, 2023, 12:35:31 pm]
[solved] Confusing scope(...
by
TRon
[September 26, 2023, 12:08:06 pm]
[solved] Website(s) where...
by
TRon
[September 26, 2023, 12:00:01 pm]
any workaround of nested ...
by
powerpcer
[September 26, 2023, 11:12:52 am]
Improvement of DoCopyProp...
by
lagprogramming
[September 26, 2023, 09:51:24 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] class function TCDWSButton.GetText doesn't return a result (Read 627 times)
lagprogramming
Sr. Member
Posts: 374
[SOLVED] class function TCDWSButton.GetText doesn't return a result
«
on:
March 27, 2023, 11:40:25 am »
lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas contains the following function. It can be noticed that it doesn't return a result.
Code: Pascal
[Select]
[+]
[-]
class
function
TCDWSButton
.
GetText
(
const
AWinControl
:
TWinControl
;
var
AText
:
String
)
:
Boolean
;
var
lCDWinControl
:
TCDWinControl
;
begin
lCDWinControl
:
=
TCDWinControl
(
AWinControl
.
Handle
)
;
if
lCDWinControl
.
CDControl
=
nil
then
Exit
;
AText
:
=
TCDIntfButton
(
lCDWinControl
.
CDControl
)
.
Caption
;
end
;
New code mimics result assignment of class function TCDWSCustomEdit.GetText
Code: Pascal
[Select]
[+]
[-]
class
function
TCDWSButton
.
GetText
(
const
AWinControl
:
TWinControl
;
var
AText
:
String
)
:
Boolean
;
var
lCDWinControl
:
TCDWinControl
;
begin
Result
:
=
False
;
lCDWinControl
:
=
TCDWinControl
(
AWinControl
.
Handle
)
;
if
lCDWinControl
.
CDControl
=
nil
then
Exit
;
AText
:
=
TCDIntfButton
(
lCDWinControl
.
CDControl
)
.
Caption
;
Result
:
=
True
;
end
;
«
Last Edit: March 30, 2023, 06:21:01 pm by lagprogramming
»
Logged
Bart
Hero Member
Posts: 5070
Re: class function TCDWSButton.GetText doesn't return a result
«
Reply #1 on:
March 27, 2023, 11:59:12 am »
Please report in the bugtracker and attach your patch (as a proper diff).
Bart
Logged
lagprogramming
Sr. Member
Posts: 374
Re: class function TCDWSButton.GetText doesn't return a result
«
Reply #2 on:
March 27, 2023, 04:49:53 pm »
Here is a patch
Code: Pascal
[Select]
[+]
[-]
diff
--
git a
/
lcl
/
interfaces
/
customdrawn
/
customdrawnwsstdctrls
.
pas
b
/
lcl
/
interfaces
/
customdrawn
/
customdrawnwsstdctrls
.
pas
index
795ca36d3e
..
1a90af04e9
100644
---
a
/
lcl
/
interfaces
/
customdrawn
/
customdrawnwsstdctrls
.
pas
+++
b
/
lcl
/
interfaces
/
customdrawn
/
customdrawnwsstdctrls
.
pas
@@
-
1704
,
9
+
1704
,
11
@@
class
function
TCDWSButton
.
GetText
(
const
AWinControl
:
TWinControl
;
var
lCDWinControl
:
TCDWinControl
;
begin
+
Result
:
=
False
;
lCDWinControl
:
=
TCDWinControl
(
AWinControl
.
Handle
)
;
if
lCDWinControl
.
CDControl
=
nil
then
Exit
;
AText
:
=
TCDIntfButton
(
lCDWinControl
.
CDControl
)
.
Caption
;
+
Result
:
=
True
;
end
;
class
procedure
TCDWSButton
.
SetText
(
const
AWinControl
:
TWinControl
;
Logged
Bart
Hero Member
Posts: 5070
Re: class function TCDWSButton.GetText doesn't return a result
«
Reply #3 on:
March 27, 2023, 06:27:52 pm »
Please put it in the bugtracker, so it won't be forgotten.
I know next to nothing about CD widgetset.
Bart
Logged
wp
Hero Member
Posts: 11222
Re: class function TCDWSButton.GetText doesn't return a result
«
Reply #4 on:
March 30, 2023, 03:49:05 pm »
Like Bart I have no experience with customdrawn WS, but since your solution is obvious and straightforward, I committed it. But please, report issues in the bugtracker where it is easier for us to trace regressions and side-effects.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Widgetset
»
CustomDrawn
»
[SOLVED] class function TCDWSButton.GetText doesn't return a result
TinyPortal
© 2005-2018