📄 d_picturepropertyeditor0.pas
字号:
unit d_PicturePropertyEditor0;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, Grids, LMDDsgPropPage, LMDDsgPropInsp, ExtDlgs, StdCtrls,
ExtCtrls, LMDDsgD5Adds;
type
TForm1 = class(TForm)
LMDPropertyInspector1: TLMDPropertyInspector;
Button1: TButton;
Image1: TImage;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TPicturePropEditor = class(TLMDClassPropEditor)
protected
function GetValue: string; override;
function GetAttrs: TLMDPropAttrs; override;
procedure Edit; override;
end;
var
Form1: TForm1;
implementation
uses d_PicturePropertyEditor1;
{$R *.dfm}
{ TPicturePropEditor }
procedure TPicturePropEditor.Edit;
begin
Form2.Picture := TPicture(GetOrdValue(0));
if Form2.Execute then
SetOrdValue(Longint(Form2.Picture));
end;
function TPicturePropEditor.GetAttrs: TLMDPropAttrs;
begin
Result := [praMultiSelect, praDialog, praReadOnly];
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
LMDPropertyInspector1.RegisterPropEditor(TypeInfo(TPicture), nil, '',
TPicturePropEditor);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
LMDPropertyInspector1.Objects.Add(Image1);
end;
function TPicturePropEditor.GetValue: string;
begin
if TPicture(GetOrdValue(0)).Graphic = nil then
Result := '(None)'
else
Result := '(Picture)';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -