From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
'''For instance''' | '''For instance''' | ||
clRTGetProperty(Btn, 'Text') | clRTGetProperty(Btn, 'Text') | ||
clRTGetProperty(Btn, 'Visible') | clRTGetProperty(Btn, 'Visible') | ||
clRTGetProperty(MyForm, 'ComponentCount') | clRTGetProperty(MyForm, 'ComponentCount') | ||
You can access the properties of objects as shown in the examples above. | You can access the properties of objects as shown in the examples above. | ||
'''Example:''' | '''Example:''' | ||
:'''Base Syntax''' | |||
MainForm : TclForm; | var | ||
MainForm : TclForm; | |||
iconBtn : TCLProButton; | |||
begin | |||
MainForm:=TclForm.Create(self); | |||
MainForm.SetFormBGImage('https://clomosy.com/demos/bg1.png'); | |||
iconBtn := MainForm.AddNewProButton(MainForm,'iconBtn','Hello!'); | |||
clComponent.SetupComponent(iconBtn,'{"Align" : "Top","MarginTop":40,"MarginLeft":5, | |||
"Height":150}'); | |||
ShowMessage(clRTGetProperty(iconBtn,'Text')); | |||
MainForm. | |||
MainForm.Run; | |||
end; | |||
:'''TRObject Syntax''' | |||
var | |||
MainForm : TclForm; | |||
iconBtn : TCLProButton; | |||
{ | |||
MainForm=TclForm.Create(self); | |||
MainForm.SetFormBGImage('https://clomosy.com/demos/bg1.png'); | |||
iconBtn = MainForm.AddNewProButton(MainForm,'iconBtn','Hello!'); | |||
clComponent.SetupComponent(iconBtn,'{"Align" : "Top","MarginTop":40,"MarginLeft":5, | |||
"Height":150}'); | |||
ShowMessage(clRTGetProperty(iconBtn,'Text')); | |||
MainForm.Run; | |||
} | |||
= See Also = | = See Also = | ||
Revision as of 14:08, 7 February 2024
clRTGetProperty is a part of the Clomosy library and is used to retrieve a property of a component. This function returns the value of a specific property of a component at runtime.
The general usage is as follows:
clRTGetProperty(PropertyObject: TComponent; PropName: String)
TComponent : The name of the component to be processed should be written.
PropName : The name of the component feature you want to get is specified.
For instance
clRTGetProperty(Btn, 'Text') clRTGetProperty(Btn, 'Visible') clRTGetProperty(MyForm, 'ComponentCount')
You can access the properties of objects as shown in the examples above.
Example:
- Base Syntax
var
MainForm : TclForm;
iconBtn : TCLProButton;
begin
MainForm:=TclForm.Create(self);
MainForm.SetFormBGImage('https://clomosy.com/demos/bg1.png');
iconBtn := MainForm.AddNewProButton(MainForm,'iconBtn','Hello!');
clComponent.SetupComponent(iconBtn,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
"Height":150}');
ShowMessage(clRTGetProperty(iconBtn,'Text'));
MainForm.Run;
end;
- TRObject Syntax
var
MainForm : TclForm;
iconBtn : TCLProButton;
{
MainForm=TclForm.Create(self);
MainForm.SetFormBGImage('https://clomosy.com/demos/bg1.png');
iconBtn = MainForm.AddNewProButton(MainForm,'iconBtn','Hello!');
clComponent.SetupComponent(iconBtn,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
"Height":150}');
ShowMessage(clRTGetProperty(iconBtn,'Text'));
MainForm.Run;
}