📄 frmpropsunit.pas
字号:
unit frmPropsUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
QuickRpt, QRCtrls, StdCtrls, Buttons, ExtCtrls, ComCtrls, QRPrntr,
Grids, TypInfo, DB, LmdDsgPropPage, LmdDsgPropInsp
{$IFDEF VER130} ,LmdDsgD5Adds {$ENDIF}, LMDDsgComboBox;
type
TfrmProps = class(TForm)
PropInsp: TLMDPropertyInspector;
LMDObjectComboBox1: TLMDObjectComboBox;
procedure PropInspChange(Sender: TObject);
procedure PropInspFilterProp(Sender: TObject; AInstance: TPersistent;
APropInfo: PPropInfo; var AIncludeProp: Boolean);
procedure LMDObjectComboBox1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
FDoc: TForm;
procedure SetDoc(const Value: TForm);
{ Private declarations }
public
{ Public declarations }
procedure UpdateComboBoxObjects;
procedure RemoveNotify(AnObject: TPersistent);
property Doc: TForm read FDoc write SetDoc;
end;
var
frmProps: TfrmProps;
implementation
uses frmDocUnit;
{$R *.dfm}
{ TfrmProps }
procedure TfrmProps.SetDoc(const Value: TForm);
begin
FDoc := Value;
UpdateComboBoxObjects;
end;
procedure TfrmProps.PropInspChange(Sender: TObject);
begin
if FDoc <> nil then
TfrmDoc(FDoc).Modify;
end;
procedure TfrmProps.PropInspFilterProp(Sender: TObject;
AInstance: TPersistent; APropInfo: PPropInfo; var AIncludeProp: Boolean);
begin
if (APropInfo.PropType^.Kind = tkClass) and
(GetTypeData(APropInfo.PropType^).ClassType.InheritsFrom(TDataSet) or
GetTypeData(APropInfo.PropType^).ClassType.InheritsFrom(TQuickRepBands)) then
AIncludeProp := False;
end;
procedure TfrmProps.UpdateComboBoxObjects;
var
LI: Integer;
begin
LMDObjectComboBox1.Objects.BeginUpdate;
try
LMDObjectComboBox1.Objects.Clear;
if FDoc <> nil then
for LI := 0 to TfrmDoc(FDoc).Report.ComponentCount - 1 do
LMDObjectComboBox1.Objects.Add(TfrmDoc(FDoc).Report.Components[LI]);
finally
LMDObjectComboBox1.Objects.EndUpdate;
end;
end;
procedure TfrmProps.LMDObjectComboBox1Click(Sender: TObject);
var
LList: TList;
begin
if FDoc <> nil then
begin
LList := TList.Create;
try
LMDObjectComboBox1.SelectedObjects.GetObjects(LList);
TfrmDoc(FDoc).Designer.SelectComponents(LList);
finally
LList.Free;
end;
end;
end;
procedure TfrmProps.RemoveNotify(AnObject: TPersistent);
begin
LMDObjectComboBox1.SelectedObjects.Remove(AnObject);
LMDObjectComboBox1.Objects.Remove(AnObject);
end;
procedure TfrmProps.FormCreate(Sender: TObject);
begin
RegisterStandardCategories(PropInsp);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -