Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

`Functions - NewEdit

Creates a new TEdit and sets the Left, Top and Text Properties as specified. Do not attempt to destroy or free a TEdit created with NewEdit.

Syntax:

Function: NewEdit(Left, Top: Integer; Text: String): TEdit;

Code Reference:

    • 1. Navigate to Plugin Store->Tool Manager and create a new Plugin
    • 2. Set the plugin type to Script Code and open the Editor
    • 3. Copy Code into the editor
    • 4. press run

API Call:

Code Block
linenumberstrue
collapsetrue
Var  
MyForm: TForm;
 
Procedure CheckboxChange(Sender: TObject);
Begin
  IF (Sender is TCheckBox) then
    If TCheckBox(Sender).Checked then
      TCheckBox(Sender).Caption := 'Check Box Checked'
    Else
      TCheckBox(Sender).Caption := 'Check Box Not Checked';
  If (Sender is TColorBox) then
    MyForm.Color:= TColorBox(Sender).Selected;
End;
 
Function MyDialogExecute(Caption: String): Boolean;
Var
  MyLabel: TLabel;
  MyEdit: TEdit;
  MyRadioButton1, MyRadioButton2: TRadioButton;
  MyButton1, MyButton2: TButton;
  MyComboBox: TComboBox;
  MyCheckbox: TCheckbox;
  MyColorBox: TColorBox;
Begin
  MyForm := NewForm(300, 300, Caption);
  MyLabel := NewLabel(20, 10, 'Name');
  MyEdit := NewEdit(20, 25, '');
  MyEdit.Width := 260;
  MyRadioButton1 := NewRadioButton(20, 55, 'Option 1', True);
  MyRadioButton1.Width := 260;
  MyRadioButton2 := NewRadioButton(20, 80, 'Option 2', False);
  MyRadioButton2.Width:= 260;
  MyCheckbox := NewCheckBox(20, 110, 'Check Box Active', True);
  MyCheckBox.Width := 260;
  MyCheckBox.OnClick := 'CheckBoxChange'; // Handle Onclick event...
  MyColorBox := NewColorBox(20, 140, MyForm.Color);
  MyColorBox.OnChange := 'CheckBoxChange';
  MyComboBox := NewCombobox(20, 170, 'Select One');
  MyComboBox.Width := 260;
  MyCombobox.items.Add('Option 1');
  MyComboBox.Items.Add('Option 2');
  MyButton1 := NewButton(60, 220, 'OK', mrOK);
  MyButton2 := NewButton(160, 220, 'Cancel', mrCancel);
  Result := MyForm.ShowModal = mrOK; 
End;
 
Begin
  clearoutput;
  output(MyDialogExecute('A Test'));
End;