From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
TclDrawForm is a custom form object that contains many graphic objects and properties. It can be used for drawing operations and can present drawing, graphics or other visual interactions to the user. For example, it can give the user the ability to draw a picture or create graphics using drawing tools.
TclDrawForm is a custom form object that contains many graphic objects and properties. It can be used for drawing operations and can present drawing, graphics or other visual interactions to the user.<br>
For example, it can give the user the ability to draw a picture or create graphics using drawing tools.<br>


TclDrawForm has customizable properties and events. For example, it can respond to the user's mouse events and synchronize drawing operations with these events. It also provides direct access to graphic objects used for drawing.


It should start by making the identification process.
Before using these features, the form must be initialized.<br>
An object of the TclDrawForm class should be defined.
<pre>
var
  DrawForm1 : TclDrawForm;
</pre>


var
The defined object must be created using the "Create" function.
   MyDrawForm : TclDrawForm;
<pre>
{
   DrawForm1 = TclDrawForm.Create(Self);
  DrawForm1.Run;
}
</pre>


Let's create the form.
The features are provided in the table below.<br>
<div class="table-responsive">
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Feature !!style="background-color: #c3d7e0"| Use of !!style="background-color: #c3d7e0"| Definition
|-
|clSetStyle ||DrawForm1.clSetStyle(DrawForm1.DarkSB); //DrawForm1.LightSB || The form can be given a dark and light theme. The clSetStyle property should be used for this. DarkSB is used for dark color and LightSB is used for light color.
|-
|DrawApp ||DrawForm1.DrawApp(True); || It is a feature that allows it to be used as a drawing application.
|}
</div>


MyDrawForm := TclDrawForm.Create(Self);
<b>Example</b><br>
 
<pre>
The form can be given a dark and light theme. The clSetStyle property should be used for this. DarkSB is used for dark color and LightSB is used for light color.
  var
 
  DrawForm1 : TclDrawForm;
MyDrawForm.clSetStyle(MyDrawForm.DarkSB); //MyDrawForm.LightSB
 
{
The DrawApp property of the TclDrawForm class is a property that enables this class to be used as a drawing application. The DrawApp feature provides the tools and functions to perform drawing operations using the properties and methods of the TclDrawForm component.
  DrawForm1 = TclDrawForm.Create(Self);
 
  DrawForm1.clSetStyle(DrawForm1.DarkSB); //DrawForm1.DarkSB - DrawForm1.LightSB
  MyDrawForm.DrawApp(True);
  DrawForm1.DrawApp(True);   
 
'''Example:'''
  DrawForm1.Run;
 
}
:'''TRObject Syntax'''
</pre>
  var
    MyDrawForm : TclDrawForm;
 
  {
    MyDrawForm = TclDrawForm.Create(Self);
    MyDrawForm.clSetStyle(MyDrawForm.DarkSB); //MyDrawForm.DarkSB - MyDrawForm.LightSB
    MyDrawForm.DrawApp(True);   
 
    MyDrawForm.Run;
  }
 
:'''Base Syntax'''
 
  var
    MyDrawForm : TclDrawForm;
 
  begin
    MyDrawForm := TclDrawForm.Create(Self);
    MyDrawForm.clSetStyle(MyDrawForm.DarkSB); //MyDrawForm.DarkSB - MyDrawForm.LightSB
    MyDrawForm.DrawApp(True); 
 
    MyDrawForm.Run;
  end;


'''Output:'''<br>
<b>Output:</b><br>
[[File:TclDrawFormScreen.png|frameless|350px]]
[[File:TclDrawFormScreen.png|frameless|350px]]<br>


== Also See ==
<h2> See Also </h2>
* [[Virtual Keyboard]]
* [[Virtual Keyboard]]
* [[TclForm]]

Revision as of 08:50, 6 November 2024

TclDrawForm is a custom form object that contains many graphic objects and properties. It can be used for drawing operations and can present drawing, graphics or other visual interactions to the user.
For example, it can give the user the ability to draw a picture or create graphics using drawing tools.


Before using these features, the form must be initialized.
An object of the TclDrawForm class should be defined.

var
  DrawForm1 : TclDrawForm;

The defined object must be created using the "Create" function.

{
  DrawForm1 = TclDrawForm.Create(Self);
  DrawForm1.Run;
}

The features are provided in the table below.

Feature Use of Definition
clSetStyle DrawForm1.clSetStyle(DrawForm1.DarkSB); //DrawForm1.LightSB The form can be given a dark and light theme. The clSetStyle property should be used for this. DarkSB is used for dark color and LightSB is used for light color.
DrawApp DrawForm1.DrawApp(True); It is a feature that allows it to be used as a drawing application.

Example

 var
   DrawForm1 : TclDrawForm;
 
 {
   DrawForm1 = TclDrawForm.Create(Self);
   DrawForm1.clSetStyle(DrawForm1.DarkSB); //DrawForm1.DarkSB - DrawForm1.LightSB
   DrawForm1.DrawApp(True);  
 
   DrawForm1.Run;
 }

Output:
TclDrawFormScreen.png

See Also