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 >
Wrap
Pascal/Delphi Source File
|
2001-05-06
|
7KB
|
256 lines
unit DBPlot_reg;
{$I Plot.inc}
{-----------------------------------------------------------------------------
The contents of this file are subject to the Q Public License
("QPL"); you may not use this file except in compliance
with the QPL. You may obtain a copy of the QPL from
the file QPL.html in this distribution, derived from:
http://www.trolltech.com/products/download/freelicense/license.html
The QPL prohibits development of proprietary software.
There is a Professional Version of this software available for this.
Contact sales@chemware.hypermart.net for more information.
Software distributed under the QPL is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the QPL for
the specific language governing rights and limitations under the QPL.
The Original Code is: DBPlot_reg.pas, released 12 March 2001.
The Initial Developer of the Original Code is Mat Ballard.
Portions created by Mat Ballard are Copyright (C) 1999 Mat Ballard.
Portions created by Microsoft are Copyright (C) 1998, 1999 Microsoft Corp.
All Rights Reserved.
Contributor(s): Mat Ballard e-mail: mat.ballard@chemware.hypermart.net.
Last Modified: 03/02/2001
Current Version: 2.00
You may retrieve the latest version of this file from:
http://Chemware.hypermart.net/
This work was created with the Project JEDI VCL guidelines:
http://www.delphi-jedi.org/Jedi:VCLVCL
in mind.
Purpose:
Registration unit for the TDBPlot component.
Known Issues:
-----------------------------------------------------------------------------}
{$I Plot.inc}
interface
uses
Classes,
{$IFDEF MSWINDOWS}
DsgnIntf,
{$ENDIF}
{$IFDEF LINUX}
DSIntf,
{$ENDIF}
DBPlot;
{$IFDEF MSWINDOWS}
type
TDBPlotComponentEditor = class(TComponentEditor)
public
function GetVerb(Index: Integer): String; override;
function GetVerbCount: Integer; override;
procedure ExecuteVerb(Index: Integer); override;
procedure Edit; override;
end;
{$ENDIF}
procedure Register;
implementation
{$IFDEF WINDOWS}
{$R DBPlot16.dcr}
{$ENDIF}
{$IFDEF WIN32}
{$R DBPlot32.dcr}
{$ENDIF}
{$IFDEF LINUX}
{$R DBPlot32.dcr}
{$ENDIF}
{$IFDEF MSWINDOWS}
type
TAboutProperty = class(TPropertyEditor)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue:string; override;
end;
{TDataProperty = class(TPropertyEditor)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue:string; override;
end;}
TAxesProperty = class(TPropertyEditor)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue:string; override;
end;
TSeriesProperty = class(TPropertyEditor)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue:string; override;
end;
{$ENDIF}
procedure Register;
begin
RegisterComponents('Data Controls', [TDBPlot]);
{$IFDEF MSWINDOWS}
{register the "About" property editor}
RegisterPropertyEditor(TypeInfo(String), TDBPlot, 'About', TAboutProperty);
{register the "Series" property editor}
RegisterPropertyEditor(TypeInfo(String), TDBPlot, 'SeriesProperties', TSeriesProperty);
{register the "Axes" property editor}
RegisterPropertyEditor(TypeInfo(String), TDBPlot, 'AxesProperties', TAxesProperty);
{$ENDIF}
end;
{$IFDEF MSWINDOWS}
{TDBPlotComponentEditor methods:-------------------------------------------------}
function TDBPlotComponentEditor.GetVerb(Index: Integer): String;
begin
case Index of
0: Result := '&About TDBPlot...';
1: Result := 'A&xes...';
2: Result := '&Copy';
3: Result := '&Data...';
4: Result := '&Properties...';
5: Result := '&Series...';
end;
end;
function TDBPlotComponentEditor.GetVerbCount: Integer;
begin
Result := 6;
end;
procedure TDBPlotComponentEditor.ExecuteVerb(Index: Integer);
begin
case Index of
0: (Component as TDBPlot).ShowAbout;
1: (Component as TDBPlot).ShowAxes;
2: (Component as TDBPlot).CopyClick(nil);
3: (Component as TDBPlot).ShowData;
4: (Component as TDBPlot).ShowProperties;
5: (Component as TDBPlot).ShowSeries;
end;
end;
procedure TDBPlotComponentEditor.Edit;
begin
(Component as TDBPlot).ShowProperties;
end;
{end TDBPlotComponentEditor methods:---------------------------------------------}
{About bits and pieces:------------------------------------------------------}
procedure TAboutProperty.Edit;
{call the "About" dialog window when clicking on ... in the Object Inspector}
begin
TDBPlot(GetComponent(0)).ShowAbout;
end;
function TAboutProperty.GetAttributes: TPropertyAttributes;
{set up to display a string in the Object Inspector}
begin
GetAttributes := [paDialog, paReadOnly];
end;
function TAboutProperty.GetValue: String;
{set string to appear in the Object Inspector}
begin
GetValue := '(About...)';
end;
{End About bits and pieces:--------------------------------------------------}
{Data bits and pieces:------------------------------------------------------}
{procedure TDataProperty.Edit;
begin
TDBPlot(GetComponent(0)).ShowData;
end;
function TDataProperty.GetAttributes: TPropertyAttributes;
begin
GetAttributes := [paDialog, paReadOnly];
end;
function TDataProperty.GetValue: String;
begin
GetValue := '(Data...)';
end;
}
{End Data bits and pieces:--------------------------------------------------}
{Axes bits and pieces:------------------------------------------------------}
procedure TAxesProperty.Edit;
{call the "Axes" dialog window when clicking on ... in the Object Inspector}
begin
TDBPlot(GetComponent(0)).ShowAxes;
end;
function TAxesProperty.GetAttributes: TPropertyAttributes;
{set up to display a string in the Object Inspector}
begin
GetAttributes := [paDialog, paReadOnly];
end;
function TAxesProperty.GetValue: String;
{set string to appear in the Object Inspector}
begin
GetValue := '(Axes...)';
end;
{End Axes bits and pieces:--------------------------------------------------}
{Series bits and pieces:------------------------------------------------------}
procedure TSeriesProperty.Edit;
{call the "Series" dialog window when clicking on ... in the Object Inspector}
begin
TDBPlot(GetComponent(0)).ShowSeries;
end;
function TSeriesProperty.GetAttributes: TPropertyAttributes;
{set up to display a string in the Object Inspector}
begin
GetAttributes := [paDialog, paReadOnly];
end;
function TSeriesProperty.GetValue: String;
{set string to appear in the Object Inspector}
begin
GetValue := '(Series...)';
end;
{End Series bits and pieces:--------------------------------------------------}
{$ENDIF}
end.