home *** CD-ROM | disk | FTP | other *** search
- unit LsPicEditorRegD3;
-
- interface
-
- uses SysUtils, Controls, Graphics, TypInfo, LsPicEditorMainD3,
- LsPicEditorViewD3, DsgnIntf, Forms;
-
- type
- TLsPictureEditor = class(TClassProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- procedure Edit; override;
- end;
-
- procedure Register;
-
- implementation
-
-
-
- function TLsPictureEditor.GetAttributes: TPropertyAttributes;
- begin
- Result := [paDialog]
- end;
-
- procedure TLsPictureEditor.Edit;
- begin
- Application.CreateForm(TPEMainForm, PEMainForm);
- Application.CreateForm(TPEViewForm, PEViewForm);
- with PEMainForm do
- try
- Image1.Picture := TPicture(GetOrdValue);
- Image2.Picture := Image1.Picture;
-
- if ShowModal = mrOk then
- if (GetPropType^.Name = 'TPicture') then
- SetOrdValue(LongInt(Image1.Picture))
- else
- SetOrdValue(LongInt(Image1.Picture.Bitmap));
- finally
- Close;
- end; { finally }
- PEViewForm.Close;
- end;
-
- procedure Register;
- begin
- RegisterPropertyEditor(TypeInfo(TPicture), nil, '', TLsPictureEditor);
- RegisterPropertyEditor(TypeInfo(TBitmap), nil, '', TLsPictureEditor);
- end;
-
- end.