From Clomosy Docs
(Created page with "QR codes are actually barcodes using cryptology. So there is no visible information. Only when the QR code is deciphered, information is available at the address you go to. AddNewQRCodeGenerator(TComponent, xName, xCaption): TclQRCodeGenerator <span style="color:blue"> TComponent</span> : The variable name of the defined component is written. Here you should write the component variable name of whatever your component will be in. <span style="color:blue"> xName</span...") |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (6 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
function AddNewQRCodeGenerator(AComponent: TCLComponent; xName, xCaption: string): TclQRCodeGenerator; | |||
</div> | |||
<span style="color:blue"><b>AComponent</b></span> : Specifies the parent of the object to be defined.<br> | |||
<span style="color:blue"> | <span style="color:blue"><b>xName</b></span> : The name of the defined QrCodeGenerator should be written.<br> | ||
<span style="color:blue"> | <span style="color:blue"><b>xCaption</b></span> : You can add a title.<br> | ||
< | A component used to generate QR codes. It converts information, such as text or URLs, into a QR code, which can be used for purposes like sharing links, encoding contact information, or displaying payment details. The generated QR code can be displayed within the application and can easily be scanned by mobile devices to retrieve the embedded information.<br> | ||
<div class="alert alert-success" role="alert" data-bs-theme="light"> | |||
Visit the [[CallBarcodeReader]] page to enable scanning the generated QR code on mobile devices. | |||
</div> | |||
<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 | |||
|- | |||
|TclQRCodeGenerator || QRGen : TclQRCodeGenerator; || A variable belonging to the TclQRCodeGenerator class is created. | |||
|- | |||
|AddNewQRCodeGenerator || QRGen = Form1.AddNewQRCodeGenerator(Form1,'QRGen','Test QRGen Caption'); || A new TclQRCodeGenerator is added to the form. | |||
|- | |||
|Width || QRGen.Width = 150; ||Allows adjusting the width of the QRCodeGenerator. | |||
|- | |||
|Height || QRGen.Height = 50; ||Allows adjusting the height of the QRCodeGenerator. | |||
|- | |||
|Align || QRGen.Align = alTop; ||With the Align parameter, you can specify where you want our component to be aligned in the form. This parameter has multiple positioning properties. See the [[Object_Properties#Align | page]] to learn about these features. | |||
|- | |||
|Margins || QRGen.Margins.Left = 50; // Right, Top, Bottom ||With the Margins parameter, you can give margins at any scale from the right, left, bottom, top.<br>[[File:QRCodeGeneratorMargins.jpg|frameless|200px]]<br> | |||
|- | |||
|Text || QRGen.Text = FormatDateTime('ddmmyy hhnnss', Now); || Another use of QRCodeGenerator is to add text. If we add text to our component by saying QRGen.text, when the project is run, the title does not appear and the value you have written in the text starts to appear. | |||
|- | |||
|Caption ||QRGen.Caption = 'QRGen's Text'; || It represents the text displayed on the component. The Caption specifies the textual label that the component presents to the user. | |||
|} | |||
</div> | |||
<b>Example</b><br> | |||
<pre> | |||
var | |||
MyForm:TclForm; | |||
QRGen : TClQRCodeGenerator; | |||
LytNewQrCode :TclLayout; | |||
BtnNewQrCode:TclProButton; | |||
void BtnNewQrCodeClick; | |||
{ | |||
QRGen.Text = FormatDateTime('ddmmyy hhnnss', Now); //dd=day,mm=moon,yy=year -- hh=hour,nn=minute, ss= second | |||
BtnNewQrCode.Caption = QRGen.Text; | |||
} | |||
{ | |||
MyForm = TclForm.Create(Self); | |||
LytNewQrCode = MyForm.AddNewLayout(MyForm,'LytNewQrCode'); | |||
LytNewQrCode.Align=ALTop; | |||
LytNewQrCode.Height = 200; | |||
LytNewQrCode.Margins.Top = 30; | |||
QRGen= MyForm.AddNewQRCodeGenerator(LytNewQrCode,'QRGen','QRCode'); | |||
QRGen.Height = 200; | |||
QRGen.Width = 200; | |||
QRGen.Align = alCenter; | |||
MyForm.AddNewEvent(QRGen,tbeOnGetQRCode,''); | |||
BtnNewQrCode = MyForm.AddNewProButton(MyForm,'BtnNewQrCode','RENEW'); | |||
BtnNewQrCode.Align = alCenter; | |||
BtnNewQrCode.Width = 200; | |||
BtnNewQrCode.Height = 50; | |||
BtnNewQrCode.clProSettings.BorderColor = clAlphaColor.clHexToColor('#003399'); | |||
BtnNewQrCode.clProSettings.FontColor = clAlphaColor.clHexToColor('#4682B4'); | |||
BtnNewQrCode.clProSettings.RoundHeight = 10; | |||
BtnNewQrCode.clProSettings.RoundWidth = 10; | |||
BtnNewQrCode.clProSettings.BorderWidth = 2; | |||
BtnNewQrCode.clProSettings.FontSize = 20; | |||
BtnNewQrCode.clProSettings.IsFill = True; | |||
BtnNewQrCode.clProSettings.IsRound = True; | |||
BtnNewQrCode.SetclProSettings(BtnNewQrCode.clProSettings); | |||
MyForm.AddNewEvent(BtnNewQrCode,tbeOnClick,'BtnNewQrCodeClick'); | |||
MyForm.Run; | |||
} | |||
</pre> | |||
<b>Output:</b><br> | |||
<gallery widths="350px" heights="500px" align="center" mode="nolines"> | <gallery widths="350px" heights="500px" align="center" mode="nolines"> | ||
File: QRCodeGeneratorProject.jpg | | File: QRCodeGeneratorProject.jpg | <b>When the Project Opens</b> | ||
File: QRCodeGeneratorOperatingScreen.jpg | | File: QRCodeGeneratorOperatingScreen.jpg | <b>When the Button is Clicked</b> | ||
</gallery> | </gallery> | ||
<h2> See Also </h2> | |||
* [[Components]] | |||
* [[Object Properties]] | * [[Object Properties]] | ||
* [[AddNewEvent]] | * [[AddNewEvent]] | ||
{{#seo:|description=TclQRCodeGenerator generates QR codes from text or URLs, making it easy to encode information such as contact details or links for mobile scanning.}} | |||
Latest revision as of 07:50, 24 December 2024
function AddNewQRCodeGenerator(AComponent: TCLComponent; xName, xCaption: string): TclQRCodeGenerator;
AComponent : Specifies the parent of the object to be defined.
xName : The name of the defined QrCodeGenerator should be written.
xCaption : You can add a title.
A component used to generate QR codes. It converts information, such as text or URLs, into a QR code, which can be used for purposes like sharing links, encoding contact information, or displaying payment details. The generated QR code can be displayed within the application and can easily be scanned by mobile devices to retrieve the embedded information.
Visit the CallBarcodeReader page to enable scanning the generated QR code on mobile devices.
| Feature | Use of | Definition |
|---|---|---|
| TclQRCodeGenerator | QRGen : TclQRCodeGenerator; | A variable belonging to the TclQRCodeGenerator class is created. |
| AddNewQRCodeGenerator | QRGen = Form1.AddNewQRCodeGenerator(Form1,'QRGen','Test QRGen Caption'); | A new TclQRCodeGenerator is added to the form. |
| Width | QRGen.Width = 150; | Allows adjusting the width of the QRCodeGenerator. |
| Height | QRGen.Height = 50; | Allows adjusting the height of the QRCodeGenerator. |
| Align | QRGen.Align = alTop; | With the Align parameter, you can specify where you want our component to be aligned in the form. This parameter has multiple positioning properties. See the page to learn about these features. |
| Margins | QRGen.Margins.Left = 50; // Right, Top, Bottom | With the Margins parameter, you can give margins at any scale from the right, left, bottom, top. |
| Text | QRGen.Text = FormatDateTime('ddmmyy hhnnss', Now); | Another use of QRCodeGenerator is to add text. If we add text to our component by saying QRGen.text, when the project is run, the title does not appear and the value you have written in the text starts to appear. |
| Caption | QRGen.Caption = 'QRGen's Text'; | It represents the text displayed on the component. The Caption specifies the textual label that the component presents to the user. |
Example
var
MyForm:TclForm;
QRGen : TClQRCodeGenerator;
LytNewQrCode :TclLayout;
BtnNewQrCode:TclProButton;
void BtnNewQrCodeClick;
{
QRGen.Text = FormatDateTime('ddmmyy hhnnss', Now); //dd=day,mm=moon,yy=year -- hh=hour,nn=minute, ss= second
BtnNewQrCode.Caption = QRGen.Text;
}
{
MyForm = TclForm.Create(Self);
LytNewQrCode = MyForm.AddNewLayout(MyForm,'LytNewQrCode');
LytNewQrCode.Align=ALTop;
LytNewQrCode.Height = 200;
LytNewQrCode.Margins.Top = 30;
QRGen= MyForm.AddNewQRCodeGenerator(LytNewQrCode,'QRGen','QRCode');
QRGen.Height = 200;
QRGen.Width = 200;
QRGen.Align = alCenter;
MyForm.AddNewEvent(QRGen,tbeOnGetQRCode,'');
BtnNewQrCode = MyForm.AddNewProButton(MyForm,'BtnNewQrCode','RENEW');
BtnNewQrCode.Align = alCenter;
BtnNewQrCode.Width = 200;
BtnNewQrCode.Height = 50;
BtnNewQrCode.clProSettings.BorderColor = clAlphaColor.clHexToColor('#003399');
BtnNewQrCode.clProSettings.FontColor = clAlphaColor.clHexToColor('#4682B4');
BtnNewQrCode.clProSettings.RoundHeight = 10;
BtnNewQrCode.clProSettings.RoundWidth = 10;
BtnNewQrCode.clProSettings.BorderWidth = 2;
BtnNewQrCode.clProSettings.FontSize = 20;
BtnNewQrCode.clProSettings.IsFill = True;
BtnNewQrCode.clProSettings.IsRound = True;
BtnNewQrCode.SetclProSettings(BtnNewQrCode.clProSettings);
MyForm.AddNewEvent(BtnNewQrCode,tbeOnClick,'BtnNewQrCodeClick');
MyForm.Run;
}
Output: