From Clomosy Docs
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. Its definition is as follows.
testProDateEdit: TClProDateEdit;
It has properties defined by json structure for the use of ProDateEdit. Parameters used for ProDateEdit:
- Width
- Height
- PositionX
- PositionY
- Align
- TextColor ---
- BackgroundColor
- TextSize----
- TextBold -----
- MarginTop
- MarginBottom
- MarginRight
- MarginLeft ----
- RoundHeight
- RoundWidth
- BorderColor
- BorderWidth
Let's define in the form and give properties to the ProDateEdit component. You can design it according to your project as follows.
testDate := MyForm.AddNewProDateEdit(MyForm,'testDate');
clComponent.SetupComponent(testDate,'{"Align":"Center","MarginLeft" : 5,"MarginTop":20, "MarginBottom":10,"MarginRight":10,"Width" :120,"Height":40,"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.
Var MyForm:TclForm; testDate: TClProDateEdit; testButton : TclButton;
procedure ProDateEditShowStr; begin ShowMessage(testDate.DateStr); end;
procedure SetTestDate; begin testDate := MyForm.AddNewProDateEdit(MyForm,'testDate'); clComponent.SetupComponent(testDate,'{"Align":"Center","MarginLeft" : 5,"MarginTop":20, "MarginBottom":10,"MarginRight":10, "Width" :120, "Height":40,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#323d8c","BorderWidth":2, "BackgroundColor":"#a6ade3"}'); end;
begin MyForm := TclForm.Create(Self); SetTestDate; testButton:= MyForm.AddNewButton(MyForm,'testButton','Click'); testButton.TextSettings.Font.Size:=50; testButton.Align := alBottom; testButton.Margins.Left := 60; testButton.Margins.Right := 60; testButton.Margins.Bottom := 50; testButton.Height := 50; testButton.Width := 100; MyForm.AddNewEvent(testButton,tbeOnClick,'ProDateEditShowStr'); MyForm.Run; end;
Output: