1
0
lazarus-tutorials/edit_props/umain.pas

54 lines
821 B
ObjectPascal
Raw Permalink Normal View History

2021-10-12 11:24:36 -04:00
unit umain;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
RTTIGrids;
type
{ TForm1 }
TForm1 = class(TForm)
Edit1: TEdit;
LabeledEdit1: TLabeledEdit;
TIPropertyGrid1: TTIPropertyGrid;
ToggleBox1: TToggleBox;
procedure ToggleBox1Change(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.ToggleBox1Change(Sender: TObject);
begin
case ToggleBox1.Checked of
False: begin
TIPropertyGrid1.TIObject := Edit1;
Edit1.SetFocus;
ToggleBox1.Caption := 'Point grid to LabeledEdit';
end;
True: begin
TIPropertyGrid1.TIObject := LabeledEdit1;
LabeledEdit1.SetFocus;
ToggleBox1.Caption := 'Point grid to Edit';
end;
end;
end;
end.