From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
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.
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
function clRTGetProperty(Object: TComponent; PropName: String): String;
</div>


The general usage is as follows:
<span style="color:blue"><i>Object</i></span> : The name of the component to be processed should be written.


clRTGetProperty(PropertyObject: TComponent; PropName: String)
<span style="color:blue"><i>PropName</i></span> : The name of the component feature you want to get is specified.


<span style="color:blue">''TComponent''</span> : The name of the component to be processed should be written.
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.<br>


<span style="color:blue">''PropName''</span> : The name of the component feature you want to get is specified.
The general usage is as follows:<br>
<div class="alert alert-secondary" role="alert" data-bs-theme="light">
clRTGetProperty(Btn, 'Text')<br>
clRTGetProperty(Btn, 'Visible')<br>
clRTGetProperty(MyForm, 'ComponentCount')
</div>


'''For instance'''
<b>Example</b><br>
clRTGetProperty(Btn, 'Text')
<b>TRObject Syntax</b><br>
  clRTGetProperty(Btn, 'Visible')
<pre>
clRTGetProperty(MyForm, 'ComponentCount')
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;
  }
</pre>
<b>Base Syntax</b><br>
<pre>
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;
</pre>


You can access the properties of objects as shown in the examples above.
<h2> See Also </h2>
 
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]
'''Example:'''
 
:'''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;
  }
 
:'''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;
 
= See Also =
* [[Controls| Controls]]
* [[CLRTMethod| CLRTMethod]]
* [[ClRTSetProperty| ClRTSetProperty]]

Revision as of 13:45, 9 October 2024

Object : The name of the component to be processed should be written.

PropName : The name of the component feature you want to get is specified.

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:

Example
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;
 }

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;

See Also