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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Extended Module Player
by
bobby100
[
Today
at 12:21:08 am]
Class designer/editor
by
VisualLab
[
Today
at 12:18:52 am]
TryStrToFloat
by
silvercoder70
[
Today
at 12:06:13 am]
Using synapse to send ema...
by
hamacker
[September 12, 2024, 11:52:21 pm]
Searching for a safe alte...
by
jamie
[September 12, 2024, 11:05:25 pm]
Browser User Agent & Frie...
by
Aruna
[September 12, 2024, 09:53:42 pm]
TDBF Recordcount
by
gidesa
[September 12, 2024, 08:32:55 pm]
CLI | Wildcard parameters...
by
MarkMLl
[September 12, 2024, 07:47:14 pm]
TListView.OnChange Event ...
by
Bart
[September 12, 2024, 07:10:00 pm]
LazCAD – First Release!
by
jcarlos77
[September 12, 2024, 05:27:40 pm]
Listview how to custom or...
by
VisualLab
[September 12, 2024, 04:59:00 pm]
Broken Icon Display on ma...
by
msintle
[September 12, 2024, 04:46:35 pm]
programming with Lazarus
by
srvaldez
[September 12, 2024, 04:03:11 pm]
Change execution order wh...
by
Khrys
[September 12, 2024, 03:02:06 pm]
7zip DLL is super broken
by
rvk
[September 12, 2024, 01:55:47 pm]
Hints.
by
seghele0
[September 12, 2024, 12:29:35 pm]
Error code 5
by
ccrause
[September 12, 2024, 11:14:19 am]
Font draw in customdraw i...
by
mikutu
[September 12, 2024, 08:02:02 am]
Problems with Gitlab
by
Joanna
[September 12, 2024, 07:35:08 am]
Cannot open Access databa...
by
Khrys
[September 12, 2024, 06:59:12 am]
TMemo and paste from clip...
by
Aruna
[September 12, 2024, 05:58:24 am]
environment variables
by
dbannon
[September 12, 2024, 01:59:07 am]
[SOLVED] TDBDateEdit comp...
by
wp
[September 11, 2024, 11:56:30 pm]
TStateMachine
by
matthius
[September 11, 2024, 11:40:00 pm]
Any support for Perpendic...
by
circular
[September 11, 2024, 09:05:59 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] Object properties (Read 778 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: 6518
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