home *** CD-ROM | disk | FTP | other *** search
-
- {*******************************************************}
- { }
- { Delphi Visual Component Library }
- { }
- { Copyright (c) 1995 Borland International }
- { }
- {*******************************************************}
-
- unit PicEdit;
-
- interface
-
- uses Windows, Classes, Graphics, Forms, Controls, Dialogs, Buttons, DsgnIntf,
- StdCtrls, ExtCtrls, ExtDlgs;
-
- type
- TPictureEditorDlg = class(TForm)
- OpenDialog: TOpenPictureDialog;
- SaveDialog: TSavePictureDialog;
- OKButton: TButton;
- CancelButton: TButton;
- HelpButton: TButton;
- GroupBox1: TGroupBox;
- ImagePanel: TPanel;
- Load: TButton;
- Save: TButton;
- Clear: TButton;
- ImagePaintBox: TPaintBox;
- procedure FormCreate(Sender: TObject);
- procedure FormDestroy(Sender: TObject);
- procedure LoadClick(Sender: TObject);
- procedure SaveClick(Sender: TObject);
- procedure ClearClick(Sender: TObject);
- procedure HelpButtonClick(Sender: TObject);
- procedure ImagePaintBoxPaint(Sender: TObject);
- end;
-
- TPictureEditor = class(TComponent)
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function Execute: Boolean;
- property GraphicClass: TGraphicClass;
- property Picture: TPicture;
- end;
-
- { TPictureProperty
- Property editor the TPicture properties (e.g. the Picture property). Brings
- up a file open dialog allowing loading a picture file. }
-
- TPictureProperty = class(TPropertyEditor)
- public
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TGraphicProperty }
-
- TGraphicProperty = class(TClassProperty)
- public
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TGraphicEditor }
-
- TGraphicEditor = class(TDefaultEditor)
- public
- procedure EditProperty(PropertyEditor: TPropertyEditor;
- var Continue, FreeEditor: Boolean); override;
- end;
-
- implementation
-