From Clomosy Docs
(Created page with " AddNewProDateEdit(TComponent, xName): TClProDateEdit; Represents a single-line editable text box containing a date.<br> When you click or tap the TClProDateEdit control, it displays a date picker that allows you to select a date. Its definition is as follows.<br> <blockquote style="background-color:#F7F5EB"> testProDateEdit: TClProDateEdit; </blockquote> It has properties defined by json structure for the use of ProDateEdit. Parameters used for ProDateEdit:<br> * Wi...") |
No edit summary |
||
| Line 2: | Line 2: | ||
Represents a single-line editable text box containing a date.<br> | Represents a single-line editable text box containing a date.<br> | ||
When you click or tap the TClProDateEdit control, it displays a date picker that allows you to select a date | When you click or tap the TClProDateEdit control, it displays a date picker that allows you to select a date.<br> | ||
'''The available SetupComponent properties for TclProDateEdit are:'''<br> | |||
* Width | * Width | ||
* Height | * Height | ||
| Line 14: | Line 10: | ||
* PositionY | * PositionY | ||
* Align | * Align | ||
* TextColor | * TextColor.. | ||
* BackgroundColor | * BackgroundColor | ||
* TextSize | * TextSize | ||
* TextBold | * TextBold | ||
* MarginTop | * MarginTop | ||
* MarginBottom | * MarginBottom | ||
* MarginRight | * MarginRight | ||
* MarginLeft | * MarginLeft | ||
* RoundHeight | * RoundHeight | ||
* RoundWidth | * RoundWidth | ||
* BorderColor | * BorderColor | ||
* BorderWidth | * BorderWidth | ||
<blockquote style="background-color:#CBEDD5">To learn the purpose and usage of the '''SetupComponent''' and '''clProSettings''' properties, please refer to [[JSON Design| the page]]. </blockquote> | |||
Let's add the object to the form. Then, we'll assign properties to our TclProDateEdit using both the SetupComponent structure and clProSettings.<br> | |||
DateEdit1 : '''TClProDateEdit'''; | |||
Let's define in the form and give properties to the ProDateEdit component. You can design it according to your project as follows.<br> | Let's define in the form and give properties to the ProDateEdit component. You can design it according to your project as follows.<br> | ||
:''For clProSettings:'' | |||
<pre> | |||
DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1'); | |||
DateEdit1.Align = alCenter; | |||
DateEdit1.Width = 150; | |||
DateEdit1.Height = 50; | |||
DateEdit1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#323d8c'); | |||
DateEdit1.clProSettings.RoundHeight = 10; | |||
DateEdit1.clProSettings.RoundWidth = 10; | |||
DateEdit1.clProSettings.BorderWidth = 2; | |||
DateEdit1.clProSettings.IsFill = True; | |||
DateEdit1.clProSettings.IsRound = True; | |||
DateEdit1.SetclProSettings(DateEdit1.clProSettings); | |||
</pre> | |||
:''For SetupComponent:'' | |||
<pre> | |||
DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1'); | |||
clComponent.SetupComponent(DateEdit1,'{"Align":"Center", | |||
"Width" :150, "Height":50, "RoundHeight":10, "RoundWidth":10, "BorderColor":"#323d8c", "BorderWidth":2, "BackgroundColor":"#a6ade3"}'); | |||
</pre> | |||
'''Sample:'''<br> | '''Sample:'''<br> | ||
Let's add a button and dateEdit as an example. Here, when the button is clicked, get the dateEdit value.<br> | Let's add a button and dateEdit as an example. Here, when the button is clicked, get the dateEdit value.<br> | ||
''' | |||
:'''TRObject Syntax''' | |||
<pre> | |||
Var | |||
Form1:TclForm; | |||
DateEdit1: TClProDateEdit; | |||
Button1 : TclButton; | |||
void ProDateEditShowStr; | |||
{ | |||
ShowMessage(DateEdit1.DateStr); | |||
} | |||
void SetTestDate; | |||
{ | |||
DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1'); | |||
DateEdit1.Align = alCenter; | |||
DateEdit1.Width = 150; | |||
DateEdit1.Height = 50; | |||
DateEdit1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#323d8c'); | |||
DateEdit1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#a6ade3'); | |||
DateEdit1.clProSettings.RoundHeight = 10; | |||
DateEdit1.clProSettings.RoundWidth = 10; | |||
DateEdit1.clProSettings.BorderWidth = 2; | |||
DateEdit1.clProSettings.FontHorzAlign = palCenter; | |||
DateEdit1.clProSettings.TextSettings.Font.Style = [fsBold]; | |||
DateEdit1.clProSettings.FontSize = 20; | |||
DateEdit1.clProSettings.IsFill = True; | |||
DateEdit1.clProSettings.IsRound = True; | |||
DateEdit1.SetclProSettings(DateEdit1.clProSettings); | |||
} | |||
{ | |||
Form1 = TclForm.Create(Self); | |||
SetTestDate; | |||
Button1= Form1.AddNewButton(Form1,'Button1','Click'); | |||
Button1.TextSettings.Font.Size=50; | |||
Button1.Align = alBottom; | |||
Button1.Margins.Left = 60; | |||
Button1.Margins.Right = 60; | |||
Button1.Margins.Bottom = 50; | |||
Button1.Height = 50; | |||
Button1.Width = 100; | |||
Form1.AddNewEvent(Button1,tbeOnClick,'ProDateEditShowStr'); | |||
Form1.Run; | |||
} | |||
</pre> | |||
:'''Base Syntax''' | |||
<pre> | |||
Var | |||
Form1:TclForm; | |||
DateEdit1: TClProDateEdit; | |||
Button1 : TclButton; | |||
procedure ProDateEditShowStr; | |||
begin | |||
ShowMessage(DateEdit1.DateStr); | |||
end; | |||
procedure SetTestDate; | |||
begin | |||
DateEdit1 := Form1.AddNewProDateEdit(Form1,'DateEdit1'); | |||
DateEdit1.Align := alCenter; | |||
DateEdit1.Width := 150; | |||
DateEdit1.Height := 50; | |||
DateEdit1.clProSettings.BorderColor := clAlphaColor.clHexToColor('#323d8c'); | |||
DateEdit1.clProSettings.BackgroundColor := clAlphaColor.clHexToColor('#a6ade3'); | |||
DateEdit1.clProSettings.RoundHeight := 10; | |||
DateEdit1.clProSettings.RoundWidth := 10; | |||
DateEdit1.clProSettings.BorderWidth := 2; | |||
DateEdit1.clProSettings.FontHorzAlign := palCenter; | |||
DateEdit1.clProSettings.TextSettings.Font.Style := [fsBold]; | |||
DateEdit1.clProSettings.FontSize := 20; | |||
DateEdit1.clProSettings.IsFill := True; | |||
DateEdit1.clProSettings.IsRound := True; | |||
DateEdit1.SetclProSettings(DateEdit1.clProSettings); | |||
end; | |||
begin | |||
Form1 := TclForm.Create(Self); | |||
SetTestDate; | |||
Button1:= Form1.AddNewButton(Form1,'Button1','Click'); | |||
Button1.TextSettings.Font.Size:=50; | |||
Button1.Align := alBottom; | |||
Button1.Margins.Left := 60; | |||
Button1.Margins.Right := 60; | |||
Button1.Margins.Bottom := 50; | |||
Button1.Height := 50; | |||
Button1.Width := 100; | |||
Form1.AddNewEvent(Button1,tbeOnClick,'ProDateEditShowStr'); | |||
Form1.Run; | |||
end; | |||
</pre> | |||
'''Output:'''<br> | '''Output:'''<br> | ||
[[File:ProDateEdit2.png|frameless|400px]] | [[File:ProDateEdit2.png|frameless|400px]] | ||
Revision as of 15:06, 21 August 2024
AddNewProDateEdit(TComponent, xName): TClProDateEdit;
Represents a single-line editable text box containing a date.
When you click or tap the TClProDateEdit control, it displays a date picker that allows you to select a date.
The available SetupComponent properties for TclProDateEdit are:
- Width
- Height
- PositionX
- PositionY
- Align
- TextColor..
- BackgroundColor
- TextSize
- TextBold
- MarginTop
- MarginBottom
- MarginRight
- MarginLeft
- RoundHeight
- RoundWidth
- BorderColor
- BorderWidth
To learn the purpose and usage of the SetupComponent and clProSettings properties, please refer to the page.
Let's add the object to the form. Then, we'll assign properties to our TclProDateEdit using both the SetupComponent structure and clProSettings.
DateEdit1 : TClProDateEdit;
Let's define in the form and give properties to the ProDateEdit component. You can design it according to your project as follows.
- For clProSettings:
DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1');
DateEdit1.Align = alCenter;
DateEdit1.Width = 150;
DateEdit1.Height = 50;
DateEdit1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#323d8c');
DateEdit1.clProSettings.RoundHeight = 10;
DateEdit1.clProSettings.RoundWidth = 10;
DateEdit1.clProSettings.BorderWidth = 2;
DateEdit1.clProSettings.IsFill = True;
DateEdit1.clProSettings.IsRound = True;
DateEdit1.SetclProSettings(DateEdit1.clProSettings);
- For SetupComponent:
DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1');
clComponent.SetupComponent(DateEdit1,'{"Align":"Center",
"Width" :150, "Height":50, "RoundHeight":10, "RoundWidth":10, "BorderColor":"#323d8c", "BorderWidth":2, "BackgroundColor":"#a6ade3"}');
Sample:
Let's add a button and dateEdit as an example. Here, when the button is clicked, get the dateEdit value.
- TRObject Syntax
Var
Form1:TclForm;
DateEdit1: TClProDateEdit;
Button1 : TclButton;
void ProDateEditShowStr;
{
ShowMessage(DateEdit1.DateStr);
}
void SetTestDate;
{
DateEdit1 = Form1.AddNewProDateEdit(Form1,'DateEdit1');
DateEdit1.Align = alCenter;
DateEdit1.Width = 150;
DateEdit1.Height = 50;
DateEdit1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#323d8c');
DateEdit1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#a6ade3');
DateEdit1.clProSettings.RoundHeight = 10;
DateEdit1.clProSettings.RoundWidth = 10;
DateEdit1.clProSettings.BorderWidth = 2;
DateEdit1.clProSettings.FontHorzAlign = palCenter;
DateEdit1.clProSettings.TextSettings.Font.Style = [fsBold];
DateEdit1.clProSettings.FontSize = 20;
DateEdit1.clProSettings.IsFill = True;
DateEdit1.clProSettings.IsRound = True;
DateEdit1.SetclProSettings(DateEdit1.clProSettings);
}
{
Form1 = TclForm.Create(Self);
SetTestDate;
Button1= Form1.AddNewButton(Form1,'Button1','Click');
Button1.TextSettings.Font.Size=50;
Button1.Align = alBottom;
Button1.Margins.Left = 60;
Button1.Margins.Right = 60;
Button1.Margins.Bottom = 50;
Button1.Height = 50;
Button1.Width = 100;
Form1.AddNewEvent(Button1,tbeOnClick,'ProDateEditShowStr');
Form1.Run;
}
- Base Syntax
Var
Form1:TclForm;
DateEdit1: TClProDateEdit;
Button1 : TclButton;
procedure ProDateEditShowStr;
begin
ShowMessage(DateEdit1.DateStr);
end;
procedure SetTestDate;
begin
DateEdit1 := Form1.AddNewProDateEdit(Form1,'DateEdit1');
DateEdit1.Align := alCenter;
DateEdit1.Width := 150;
DateEdit1.Height := 50;
DateEdit1.clProSettings.BorderColor := clAlphaColor.clHexToColor('#323d8c');
DateEdit1.clProSettings.BackgroundColor := clAlphaColor.clHexToColor('#a6ade3');
DateEdit1.clProSettings.RoundHeight := 10;
DateEdit1.clProSettings.RoundWidth := 10;
DateEdit1.clProSettings.BorderWidth := 2;
DateEdit1.clProSettings.FontHorzAlign := palCenter;
DateEdit1.clProSettings.TextSettings.Font.Style := [fsBold];
DateEdit1.clProSettings.FontSize := 20;
DateEdit1.clProSettings.IsFill := True;
DateEdit1.clProSettings.IsRound := True;
DateEdit1.SetclProSettings(DateEdit1.clProSettings);
end;
begin
Form1 := TclForm.Create(Self);
SetTestDate;
Button1:= Form1.AddNewButton(Form1,'Button1','Click');
Button1.TextSettings.Font.Size:=50;
Button1.Align := alBottom;
Button1.Margins.Left := 60;
Button1.Margins.Right := 60;
Button1.Margins.Bottom := 50;
Button1.Height := 50;
Button1.Width := 100;
Form1.AddNewEvent(Button1,tbeOnClick,'ProDateEditShowStr');
Form1.Run;
end;
Output: