From Clomosy Docs

Revision as of 13:28, 24 December 2024 by ClomosyAdmin (talk | contribs)

AComponent : Specifies the parent of the object to be defined.

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

xCaption : You can enter the label title here.

It creates a text label used to provide explanations or information in the user interface. TclProLabel is preferred for labeling other components on the form or providing information to the user.

Feature Use of Definition
TclProLabel ProLabel1 : TclLabel; A variable belonging to the TclProLabel class is created.
AddNewProLabel ProLabel1 = Form1.AddNewProLabel(Form1,'ProLabel1','Test ProLabel Caption'); A new TclProLabel is added to the form.

In addition to the features of a standard label, TclProLabel 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
  • SetupComponent Properties

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

  • Example

    For clProSettings:

    Var   
      Form1:TclForm;
      Label1: TClProLabel;
    
    void setLabel;
    {
      Label1 = Form1.AddNewProLabel(Form1,'Label1','Clomosy PROLABEL');
      Label1.Align = alCenter;
      Label1.Width = 150;
      Label1.Height = 30;
      Label1.clProSettings.FontColor = clAlphaColor.clHexToColor('#f5428d');
      Label1.clProSettings.FontSize = 12;
      Label1.clProSettings.FontVertAlign = palcenter;
      Label1.clProSettings.FontHorzAlign = palLeading;
      Label1.clProSettings.TextSettings.Font.Style = [fsBold];
      Label1.clProSettings.IsFill = True; 
      Label1.clProSettings.IsRound = True;
      Label1.SetclProSettings(Label1.clProSettings);
    }
    
    {
      Form1 = TclForm.Create(Self);
      setLabel;
      Form1.Run;
    }
    

    For SetupComponent:

    Var   
      Form1:TclForm;
      Label1: TClProLabel;
    
    void setLabel;
    {
      Label1 = Form1.AddNewProLabel(Form1,'Label1','Clomosy PROLABEL');
      
      clComponent.SetupComponent(Label1,'{
      "Align" : "Center",
      "Width":150,
      "Height":30,
      "TextColor":"#f5428d",
      "TextSize":12, 
      "TextBold":"yes",
      "TextVerticalAlign":"center",
      "TextHorizontalAlign":"bottom" 
    }');
      
    }
    
    {
      Form1 = TclForm.Create(Self);
      setLabel;
      Form1.Run;
    }
    

    See Also