From Clomosy Docs

Revision as of 14:40, 14 August 2023 by ClomosyManager (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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:

ProDateEdit2.png