home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / zkuste / delphi / kolekce / d12345 / CHEMPLOT.ZIP / TPlot / DBPlot_reg.pas < prev    next >
Pascal/Delphi Source File  |  2001-05-06  |  7KB  |  256 lines

  1. unit DBPlot_reg;
  2.  
  3. {$I Plot.inc}
  4.  
  5. {-----------------------------------------------------------------------------
  6. The contents of this file are subject to the Q Public License
  7. ("QPL"); you may not use this file except in compliance
  8. with the QPL. You may obtain a copy of the QPL from 
  9. the file QPL.html in this distribution, derived from:
  10.  
  11. http://www.trolltech.com/products/download/freelicense/license.html
  12.  
  13. The QPL prohibits development of proprietary software. 
  14. There is a Professional Version of this software available for this. 
  15. Contact sales@chemware.hypermart.net for more information.
  16.  
  17. Software distributed under the QPL is distributed on an "AS IS" basis,
  18. WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the QPL for
  19. the specific language governing rights and limitations under the QPL.
  20.  
  21. The Original Code is: DBPlot_reg.pas, released 12 March 2001.
  22.  
  23. The Initial Developer of the Original Code is Mat Ballard.
  24. Portions created by Mat Ballard are Copyright (C) 1999 Mat Ballard.
  25. Portions created by Microsoft are Copyright (C) 1998, 1999 Microsoft Corp.
  26. All Rights Reserved.
  27.  
  28. Contributor(s): Mat Ballard                 e-mail: mat.ballard@chemware.hypermart.net.
  29.  
  30. Last Modified: 03/02/2001
  31. Current Version: 2.00
  32.  
  33. You may retrieve the latest version of this file from:
  34.  
  35.         http://Chemware.hypermart.net/
  36.  
  37. This work was created with the Project JEDI VCL guidelines:
  38.  
  39.         http://www.delphi-jedi.org/Jedi:VCLVCL
  40.  
  41. in mind. 
  42.  
  43. Purpose:
  44. Registration unit for the TDBPlot component.
  45.  
  46.  
  47. Known Issues:
  48. -----------------------------------------------------------------------------}
  49.  
  50. {$I Plot.inc}
  51.  
  52. interface
  53.  
  54. uses
  55.   Classes,
  56. {$IFDEF MSWINDOWS}
  57.   DsgnIntf,
  58. {$ENDIF}
  59. {$IFDEF LINUX}
  60.   DSIntf,
  61. {$ENDIF}
  62.  
  63.   DBPlot;
  64.  
  65. {$IFDEF MSWINDOWS}
  66. type
  67.   TDBPlotComponentEditor = class(TComponentEditor)
  68.   public
  69.     function GetVerb(Index: Integer): String; override;
  70.     function GetVerbCount: Integer; override;
  71.     procedure ExecuteVerb(Index: Integer); override;
  72.     procedure Edit; override;
  73.   end;
  74. {$ENDIF}
  75.  
  76. procedure Register;
  77.  
  78. implementation
  79.  
  80.  
  81. {$IFDEF WINDOWS}
  82. {$R DBPlot16.dcr}
  83. {$ENDIF}
  84. {$IFDEF WIN32}
  85. {$R DBPlot32.dcr}
  86. {$ENDIF}
  87. {$IFDEF LINUX}
  88. {$R DBPlot32.dcr}
  89. {$ENDIF}
  90.  
  91. {$IFDEF MSWINDOWS}
  92. type
  93.   TAboutProperty = class(TPropertyEditor)
  94.   public
  95.     procedure Edit; override;
  96.     function GetAttributes: TPropertyAttributes; override;
  97.     function GetValue:string; override;
  98.   end;
  99.  
  100.   {TDataProperty = class(TPropertyEditor)
  101.   public
  102.     procedure Edit; override;
  103.     function GetAttributes: TPropertyAttributes; override;
  104.     function GetValue:string; override;
  105.   end;}
  106.  
  107.   TAxesProperty = class(TPropertyEditor)
  108.   public
  109.     procedure Edit; override;
  110.     function GetAttributes: TPropertyAttributes; override;
  111.     function GetValue:string; override;
  112.   end;
  113.  
  114.   TSeriesProperty = class(TPropertyEditor)
  115.   public
  116.     procedure Edit; override;
  117.     function GetAttributes: TPropertyAttributes; override;
  118.     function GetValue:string; override;
  119.   end;
  120. {$ENDIF}
  121.  
  122. procedure Register;
  123. begin
  124.   RegisterComponents('Data Controls', [TDBPlot]);
  125.  
  126. {$IFDEF MSWINDOWS}
  127. {register the "About" property editor}
  128.   RegisterPropertyEditor(TypeInfo(String), TDBPlot, 'About', TAboutProperty);
  129. {register the "Series" property editor}
  130.   RegisterPropertyEditor(TypeInfo(String), TDBPlot, 'SeriesProperties', TSeriesProperty);
  131. {register the "Axes" property editor}
  132.   RegisterPropertyEditor(TypeInfo(String), TDBPlot, 'AxesProperties', TAxesProperty);
  133. {$ENDIF}
  134. end;
  135.  
  136. {$IFDEF MSWINDOWS}
  137. {TDBPlotComponentEditor methods:-------------------------------------------------}
  138. function TDBPlotComponentEditor.GetVerb(Index: Integer): String;
  139. begin
  140.   case Index of
  141.     0: Result := '&About TDBPlot...';
  142.     1: Result := 'A&xes...';
  143.     2: Result := '&Copy';
  144.     3: Result := '&Data...';
  145.     4: Result := '&Properties...';
  146.     5: Result := '&Series...';
  147.   end;
  148. end;
  149.  
  150. function TDBPlotComponentEditor.GetVerbCount: Integer;
  151. begin
  152.   Result := 6;
  153. end;
  154.  
  155. procedure TDBPlotComponentEditor.ExecuteVerb(Index: Integer);
  156. begin
  157.   case Index of
  158.     0: (Component as TDBPlot).ShowAbout;
  159.     1: (Component as TDBPlot).ShowAxes;
  160.     2: (Component as TDBPlot).CopyClick(nil);
  161.     3: (Component as TDBPlot).ShowData;
  162.     4: (Component as TDBPlot).ShowProperties;
  163.     5: (Component as TDBPlot).ShowSeries;
  164.   end;
  165. end;
  166.  
  167. procedure TDBPlotComponentEditor.Edit;
  168. begin
  169.   (Component as TDBPlot).ShowProperties;
  170. end;
  171. {end TDBPlotComponentEditor methods:---------------------------------------------}
  172.  
  173. {About bits and pieces:------------------------------------------------------}
  174. procedure TAboutProperty.Edit;
  175. {call the "About" dialog window when clicking on ... in the Object Inspector}
  176. begin
  177.   TDBPlot(GetComponent(0)).ShowAbout;
  178. end;
  179.  
  180. function TAboutProperty.GetAttributes: TPropertyAttributes;
  181. {set up to display a string in the Object Inspector}
  182. begin
  183.   GetAttributes := [paDialog, paReadOnly];
  184. end;
  185.  
  186. function TAboutProperty.GetValue: String;
  187. {set string to appear in the Object Inspector}
  188. begin
  189.   GetValue := '(About...)';
  190. end;
  191.  
  192. {End About bits and pieces:--------------------------------------------------}
  193.  
  194. {Data bits and pieces:------------------------------------------------------}
  195. {procedure TDataProperty.Edit;
  196. begin
  197.   TDBPlot(GetComponent(0)).ShowData;
  198. end;
  199.  
  200. function TDataProperty.GetAttributes: TPropertyAttributes;
  201. begin
  202.   GetAttributes := [paDialog, paReadOnly];
  203. end;
  204.  
  205. function TDataProperty.GetValue: String;
  206. begin
  207.   GetValue := '(Data...)';
  208. end;
  209. }
  210. {End Data bits and pieces:--------------------------------------------------}
  211.  
  212. {Axes bits and pieces:------------------------------------------------------}
  213. procedure TAxesProperty.Edit;
  214. {call the "Axes" dialog window when clicking on ... in the Object Inspector}
  215. begin
  216.   TDBPlot(GetComponent(0)).ShowAxes;
  217. end;
  218.  
  219. function TAxesProperty.GetAttributes: TPropertyAttributes;
  220. {set up to display a string in the Object Inspector}
  221. begin
  222.   GetAttributes := [paDialog, paReadOnly];
  223. end;
  224.  
  225. function TAxesProperty.GetValue: String;
  226. {set string to appear in the Object Inspector}
  227. begin
  228.   GetValue := '(Axes...)';
  229. end;
  230. {End Axes bits and pieces:--------------------------------------------------}
  231.  
  232. {Series bits and pieces:------------------------------------------------------}
  233. procedure TSeriesProperty.Edit;
  234. {call the "Series" dialog window when clicking on ... in the Object Inspector}
  235. begin
  236.   TDBPlot(GetComponent(0)).ShowSeries;
  237. end;
  238.  
  239. function TSeriesProperty.GetAttributes: TPropertyAttributes;
  240. {set up to display a string in the Object Inspector}
  241. begin
  242.   GetAttributes := [paDialog, paReadOnly];
  243. end;
  244.  
  245. function TSeriesProperty.GetValue: String;
  246. {set string to appear in the Object Inspector}
  247. begin
  248.   GetValue := '(Series...)';
  249. end;
  250.  
  251. {End Series bits and pieces:--------------------------------------------------}
  252.  
  253. {$ENDIF}
  254.  
  255. end.
  256.