home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / picedit.int < prev    next >
Encoding:
Text File  |  1998-02-09  |  2.3 KB  |  79 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Visual Component Library                 }
  5. {                                                       }
  6. {       Copyright (c) 1995 Borland International        }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit PicEdit;
  11.  
  12. interface
  13.  
  14. uses Windows, Classes, Graphics, Forms, Controls, Dialogs, Buttons, DsgnIntf,
  15.   StdCtrls, ExtCtrls, ExtDlgs;
  16.  
  17. type
  18.   TPictureEditorDlg = class(TForm)
  19.     OpenDialog: TOpenPictureDialog;
  20.     SaveDialog: TSavePictureDialog;
  21.     OKButton: TButton;
  22.     CancelButton: TButton;
  23.     HelpButton: TButton;
  24.     GroupBox1: TGroupBox;
  25.     ImagePanel: TPanel;
  26.     Load: TButton;
  27.     Save: TButton;
  28.     Clear: TButton;
  29.     ImagePaintBox: TPaintBox;
  30.     procedure FormCreate(Sender: TObject);
  31.     procedure FormDestroy(Sender: TObject);
  32.     procedure LoadClick(Sender: TObject);
  33.     procedure SaveClick(Sender: TObject);
  34.     procedure ClearClick(Sender: TObject);
  35.     procedure HelpButtonClick(Sender: TObject);
  36.     procedure ImagePaintBoxPaint(Sender: TObject);
  37.   end;
  38.  
  39.   TPictureEditor = class(TComponent)
  40.   public
  41.     constructor Create(AOwner: TComponent); override;
  42.     destructor Destroy; override;
  43.     function Execute: Boolean;
  44.     property GraphicClass: TGraphicClass;
  45.     property Picture: TPicture;
  46.   end;
  47.  
  48. { TPictureProperty
  49.   Property editor the TPicture properties (e.g. the Picture property).  Brings
  50.   up a file open dialog allowing loading a picture file. }
  51.  
  52.   TPictureProperty = class(TPropertyEditor)
  53.   public
  54.     procedure Edit; override;
  55.     function GetAttributes: TPropertyAttributes; override;
  56.     function GetValue: string; override;
  57.     procedure SetValue(const Value: string); override;
  58.   end;
  59.  
  60. { TGraphicProperty }
  61.  
  62.   TGraphicProperty = class(TClassProperty)
  63.   public
  64.     procedure Edit; override;
  65.     function GetAttributes: TPropertyAttributes; override;
  66.     function GetValue: string; override;
  67.     procedure SetValue(const Value: string); override;
  68.   end;
  69.  
  70. { TGraphicEditor }
  71.  
  72.   TGraphicEditor = class(TDefaultEditor)
  73.   public
  74.     procedure EditProperty(PropertyEditor: TPropertyEditor;
  75.       var Continue, FreeEditor: Boolean); override;
  76.   end;
  77.  
  78. implementation
  79.