From Clomosy Docs

No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:




clRTSetProperty is a part of the Clomosy library and is used to set a property of a component. This function allows you to assign a value to a specific property of a component at runtime.<br>
clRTSetProperty is a part of the Clomosy library and is used to set a property of a object. This function allows you to assign a value to a specific property of a component at runtime.<br>


The general usage is as follows:<br>
Usage areas:<br>


<div class="alert alert-secondary" role="alert" data-bs-theme="light">
 
clRTSetProperty(MyForm, 'BorderStyle', 0);<br>
<div class="table-responsive">
clRTSetProperty(MyForm, 'Caption', 'New Caption');<br>
{| class="wikitable" style="border: 2px solid #c3d7e0"
clRTSetProperty(Btn, 'Visible', True);<br>
! style="background-color: #c3d7e0"| Object !!style="background-color: #c3d7e0"| Use of !!style="background-color: #c3d7e0"| Explanation
clRTSetProperty(Btn, 'Text', 'New Text');
|-
| MyForm : TclForm || clRTSetProperty(MyForm, 'BorderStyle', fbsNone); //fbsNone, fbsSingle, fbsSizeable, fbsDialog, fbsToolWindow, fbsSizeToolWin || It is a property that determines the border style of a form (window). This property defines whether the user can resize the window, whether there is a title bar, and how the window will appear.
|-
|MyForm : TclForm || clRTSetProperty(MyForm,'ClientHeight',200);<br>clRTSetProperty(MyForm,'ClientWidth',200);|| They are properties used to adjust the dimensions of a form's visible (client) area.
|-
| MyForm : TclForm (or other objects)|| clRTSetProperty(MyForm, 'Caption', 'New Caption'); || It is used to change the text displayed on a component (form, button, label, etc.).
|-
|Btn : TclButton (or other objects)|| clRTSetProperty(Btn, 'Visible', True); // or False || The property determines whether a component (form, button, label, panel, etc.) is visible in the user interface.
|-
|Btn : TclButton (or other objects) || clRTSetProperty(Btn, 'Text', 'New Text'); || It is used to set the text content inside a component (usually components that handle text input or display).
|}
</div>
</div>


Line 50: Line 60:
<h2> See Also </h2>
<h2> See Also </h2>
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]
{{#seo:|description=Explore ClRTSetProperty in Clomosy! Effortlessly configure runtime properties to fine-tune app performance and improve dynamic behavior.}}

Latest revision as of 13:47, 21 February 2025

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.

PropValue : The new property value is assigned to PropName.


clRTSetProperty is a part of the Clomosy library and is used to set a property of a object. This function allows you to assign a value to a specific property of a component at runtime.

Usage areas:


Object Use of Explanation
MyForm : TclForm clRTSetProperty(MyForm, 'BorderStyle', fbsNone); //fbsNone, fbsSingle, fbsSizeable, fbsDialog, fbsToolWindow, fbsSizeToolWin It is a property that determines the border style of a form (window). This property defines whether the user can resize the window, whether there is a title bar, and how the window will appear.
MyForm : TclForm clRTSetProperty(MyForm,'ClientHeight',200);
clRTSetProperty(MyForm,'ClientWidth',200);
They are properties used to adjust the dimensions of a form's visible (client) area.
MyForm : TclForm (or other objects) clRTSetProperty(MyForm, 'Caption', 'New Caption'); It is used to change the text displayed on a component (form, button, label, etc.).
Btn : TclButton (or other objects) clRTSetProperty(Btn, 'Visible', True); // or False The property determines whether a component (form, button, label, panel, etc.) is visible in the user interface.
Btn : TclButton (or other objects) clRTSetProperty(Btn, 'Text', 'New Text'); It is used to set the text content inside a component (usually components that handle text input or display).

Example

var
  MainForm : TclForm;
  iconBtn : TCLProButton;

void iconBtnClick;
{
  clRTSetProperty(iconBtn,'Text','Hello World!');
}

{
  MainForm =TclForm.Create(self);
  MainForm.SetFormBGImage('https://clomosy.com/demos/bg1.png');
  
  iconBtn  = MainForm.AddNewProButton(MainForm,'iconBtn','Hello!');
  iconBtn.Align = AlTop;
  iconBtn.Height = 150;
  iconBtn.Margins.Top = 40;
  iconBtn.Margins.Left = 5;
  MainForm.AddNewEvent(iconBtn,tbeOnClick,'iconBtnClick');
  
  MainForm.Run;
}

See Also