Skip to content

MotionDetector_EnumGridDialogControls

function

Delphi
function MotionDetector_EnumGridDialogControls (FirstControl: Boolean): TComponent;
C++Builder
System::Classes::TComponent* __fastcall MotionDetector_EnumGridDialogControls(bool FirstControl);

Enumerates the controls of the grid dialog, including the dialog form. This makes it possible to e.g. customize the button names, the dialog size, etc.

  • invoking MotionDetector_EnumGridDialogControls(True) returns the first control (in fact the dialog form), and resets the counter,

  • invoking MotionDetector_EnumGridDialogControls(False) returns the next control, if any, or nil when the last control of the dialog has been reached.

E.g.:

procedure TForm1.Button1Click(Sender: TObject);

var

Control: TComponent;

begin

VideoGrabber1.MotionDetector_ShowGridDialog; // BEFORE...

Control := VideoGrabber1.MotionDetector_EnumGridDialogControls (True); // resets the counter and returns the first control (the dialog form)

while assigned (Control) do begin // for each control...

Memo1.Lines.Add (Control.Name + ': ' + Control.ClassName); // shows the control name and its type

if Control.Name = 'frmGridDialog' then begin

TForm(Control).Caption := 'this is my custom dialog title';

end

else if Control.Name = 'btnOK' then begin

TButton(Control).Caption := 'DONE';

end

else if Control.Name = 'btnCancel' then begin

TButton(Control).Caption := 'Discard';

end;

Control := VideoGrabber1.MotionDetector_EnumGridDialogControls (False); // returns the next control, or nil when the last control is reached

end;

VideoGrabber1.MotionDetector_ShowGridDialog; // AFTER.

end;