From Clomosy Docs

No edit summary
No edit summary
Line 12: Line 12:


<div class="alert alert-info" role="alert" data-bs-theme="light">
<div class="alert alert-info" role="alert" data-bs-theme="light">
Refer to the [[TclButton]] page for standard panel usage.
Refer to the [[TclButton]] page for standard button usage.
</div>
</div>



Revision as of 14:32, 12 November 2024

AComponent : The variable name of the defined component is written. Here you should write the component variable name of whatever your component will be in.

xName : The name of the defined button should be written.

xCaption : You can add a title.

Unlike the standard button component, it has the feature of adding an image on the button. Apart from that, when you use the standard button, there is no clicking effect on the button when you run the application. You will see this feature when you use the TclProButton. The logic is the same as the standard button.

Feature Use of Definition
TClProButton ProButton1 : TClProButton; A variable belonging to the TClProButton class is created.
AddNewProButton ProButton1 = Form1.AddNewProButton(Form1,'ProButton1','Test Button Caption'); A new TClProButton is added to the form.

In addition to the features of a standard panel, TClProButton offers new and advanced features, which we will explain in detail below.

clProSettings Properties

  • FontColor
  • FontSize
  • FontVertAlign
  • FontHorzAlign
  • Font.Style
  • BorderColor
  • BorderWidth
  • BackgroundColor
  • IsTransparent
  • IsFill
  • IsRound
  • RoundHeight
  • RoundWidth
  • PictureAutoFit
  • PictureStretch
  • PictureSource
  • SetupComponent Properties

  • Caption
  • Width
  • Height
  • PositionX
  • PositionY
  • Align
  • TextColor
  • BackgroundColor
  • TextSize
  • TextVerticalAlign
  • TextHorizontalAlign
  • TextBold
  • MarginTop
  • MarginBottom
  • MarginRight
  • MarginLeft
  • RoundHeight
  • RoundWidth
  • BorderColor
  • BorderWidth
  • ImgFit
  • ImgStretch
  • ImgUrl

  • Example

    For clProSettings:

    Var   
      Form1:TclForm;
      ProBtn : TClProButton;
    
    void BtnOnClick;
    {
      ShowMessage('Hello..');
    }
    
    {
      Form1 = TclForm.Create(Self);
      
      ProBtn = Form1.AddNewProButton(Form1,'ProBtn','Click Hero');
      ProBtn.Align = alCenter;
      ProBtn.Width = 150;
      ProBtn.Height = 70;
      ProBtn.clProSettings.FontColor = clAlphaColor.clDarkorchid;
      ProBtn.clProSettings.FontSize = 12;
      ProBtn.clProSettings.FontVertAlign = palcenter;//palLeading , palCenter , palTrailing
      ProBtn.clProSettings.FontHorzAlign = palCenter;
      ProBtn.clProSettings.TextSettings.Font.Style = [fsBold,fsItalic];
      ProBtn.clProSettings.IsFill = True; 
      ProBtn.clProSettings.PictureSource = 'https://clomosy.com/demos/foodInformationBox.png';
      ProBtn.SetclProSettings(ProBtn.clProSettings);
      
      Form1.AddNewEvent(ProBtn,tbeOnClick,'BtnOnClick');
      Form1.Run;
    }
    

    For SetupComponent:

    Var   
      Form1:TclForm;
      ProBtn : TClProButton;
    
    void BtnOnClick;
    {
      ShowMessage('Hello..');
    }
    
    {
      Form1 = TclForm.Create(Self);
      
      ProBtn = Form1.AddNewProButton(Form1,'ProBtn','Click Hero');
      clComponent.SetupComponent(ProBtn,'{
      "Align" : "Center",
      "Width":150,
      "Height":70,
      "ImgUrl":"https://clomosy.com/demos/foodInformationBox.png",
      "TextColor":"#9932CC", 
      "TextSize":12, 
      "TextVerticalAlign":"center",
      "TextHorizontalAlign":"center", 
      "TextBold":"yes"
    }');
      ProBtn.Caption = 'Click Hero';
      Form1.AddNewEvent(ProBtn,tbeOnClick,'BtnOnClick');
      Form1.Run;
    }
    

    See Also