Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED] Object properties
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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Getting results from sql ...
by
paweld
[
Today
at 10:22:05 pm]
Is it me or is there some...
by
mossbruc
[
Today
at 09:21:12 pm]
[SOLVED] GTK3 : Icons hav...
by
Schmitty2005
[
Today
at 08:43:28 pm]
emuloader: help to resurr...
by
arcadegamer
[
Today
at 08:33:06 pm]
emuloader: help to resurr...
by
arcadegamer
[
Today
at 08:30:31 pm]
mORMot again (HttpServer/...
by
BSaidus
[
Today
at 07:53:24 pm]
CONCAT formula
by
veb86
[
Today
at 07:11:03 pm]
Hello! Anything new?
by
440bx
[
Today
at 06:54:06 pm]
AutoSize TMemo.Height?
by
wp
[
Today
at 05:55:05 pm]
Initialization & finaliza...
by
Martin_fr
[
Today
at 05:24:36 pm]
could Ardour's YTK be use...
by
robert rozee
[
Today
at 05:11:59 pm]
Possible Enhancement to t...
by
jamie
[
Today
at 04:10:38 pm]
lazarus 4.99 and missing ...
by
wp
[
Today
at 03:11:43 pm]
Debian releases a Gtk3 La...
by
paweld
[
Today
at 12:45:32 pm]
Questions about TFuncSeri...
by
hedgehog
[
Today
at 06:58:29 am]
Problem with drawing orde...
by
wp
[
Today
at 12:57:00 am]
CryptoLib4Pascal
by
Xor-el
[March 14, 2026, 06:17:32 pm]
Extended Module Player
by
Gigatron
[March 14, 2026, 05:32:06 pm]
[AGGPas] Difference betwe...
by
Roland57
[March 14, 2026, 04:36:02 pm]
declaring Array
by
Thaddy
[March 14, 2026, 01:24:11 pm]
TChart: Wrong default val...
by
wp
[March 14, 2026, 11:30:54 am]
Text Fill (Memo)
by
paweld
[March 14, 2026, 09:09:13 am]
Qt6/Wayland clipboard: pa...
by
AlexTP
[March 14, 2026, 08:56:58 am]
Pocketbase
by
PierceNg
[March 14, 2026, 06:29:04 am]
ADUG Symposium 2026
by
Mathias Burbach
[March 14, 2026, 04:45:57 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Object properties (Read 1370 times)
pcurtis
Hero Member
Posts: 951
[SOLVED] Object properties
«
on:
September 02, 2020, 08:52:37 pm »
Hi All,
Today I saw a very interesting program called DFM Editor (
http://www.mitec.cz/dfm.html
) where you could open a DFM or LFM file and it would show, along with other things, a list of ALL properties and methods for a selected component on the form.
I was wondering is it possible (and how) to get a list of properties / methods in Lazarus?
Thanks in advance.
«
Last Edit: September 02, 2020, 09:05:27 pm by pcurtis
»
Logged
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2
jamie
Hero Member
Posts: 7605
Re: Object properties
«
Reply #1 on:
September 02, 2020, 08:59:13 pm »
Just open your file manager in the IDE (OPEN) and propagate to your *.LFM file.. and open it.
it will show in the IDE editor.
Logged
The only true wisdom is knowing you know nothing
pcurtis
Hero Member
Posts: 951
Re: Object properties
«
Reply #2 on:
September 02, 2020, 09:04:13 pm »
It's OK, I found the solution.
Code: Pascal
[Select]
[+]
[-]
unit
Unit1
;
{$mode objfpc}{$H+}
interface
uses
Classes
,
SysUtils
,
Forms
,
Controls
,
Graphics
,
Dialogs
,
StdCtrls
,
TypInfo
;
type
{ TForm1 }
TForm1
=
class
(
TForm
)
Button1
:
TButton
;
ListBox1
:
TListBox
;
procedure
Button1Click
(
Sender
:
TObject
)
;
private
public
end
;
var
Form1
:
TForm1
;
implementation
{$R *.lfm}
{ TForm1 }
procedure
ListComponentProperties
(
Component
:
TComponent
;
Strings
:
TStrings
)
;
var
Count
,
Size
,
I
:
Integer
;
List
:
PPropList
;
PropInfo
:
PPropInfo
;
PropOrEvent
,
PropValue
:
string
;
begin
Count
:
=
GetPropList
(
Component
.
ClassInfo
,
tkAny
,
nil
)
;
Size
:
=
Count
*
SizeOf
(
Pointer
)
;
GetMem
(
List
,
Size
)
;
try
Count
:
=
GetPropList
(
Component
.
ClassInfo
,
tkAny
,
List
)
;
for
I
:
=
0
to
Count
-
1
do
begin
PropInfo
:
=
List
^
[
I
]
;
if
PropInfo
^
.
PropType
^
.
Kind
in
tkMethods
then
PropOrEvent
:
=
'Event'
else
PropOrEvent
:
=
'Property'
;
PropValue
:
=
GetPropValue
(
Component
,
PropInfo
^
.
Name
)
;
Strings
.
Add
(
Format
(
'[%s] %s: %s = %s'
,
[
PropOrEvent
,
PropInfo
^
.
Name
,
PropInfo
^
.
PropType
^
.
Name
,
PropValue
]
)
)
;
end
;
finally
FreeMem
(
List
)
;
end
;
end
;
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
)
;
begin
ListComponentProperties
(
Button1
,
ListBox1
.
Items
)
;
end
;
end
.
Logged
Windows 10 20H2
Laz 2.2.0
FPC 3.2.2
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
[SOLVED] Object properties
TinyPortal
© 2005-2018