home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 December
/
Chip_2001-12_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
DM2KVCL.ZIP
/
PLOTEDIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-08-20
|
2KB
|
83 lines
{****************************************************************************}
{ Data Master 2000 }
{****************************************************************************}
unit PlotEdit;
{$B-,X+}
interface
uses
Classes, Graphics, Forms, Buttons, Controls, StdCtrls,
{$ifdef VER140}
DesignIntf, DesignEditors;
{$else}
DsgnIntf, DsgnWnds;
{$endif}
type
TAxisProperty=class(TClassProperty)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
end;
TSerieProperty=class(TClassProperty)
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
end;
procedure Register;
implementation
uses Common, Plot, AxisDlg, SerieDlg, Windows, SysUtils;
{ TAxisProperty }
procedure TAxisProperty.Edit;
var Axis: TAxis;
begin
Axis:=TAxis(GetOrdValue);
AxisPropsForm:=TAxisPropsForm.Create(Application);
try
if AxisPropsForm.Execute(Axis) then Modified; {notify designer if changed}
finally
AxisPropsForm.Free;
end;
end;
function TAxisProperty.GetAttributes: TPropertyAttributes;
begin Result:=[paDialog, paSubProperties]; end;
{ TSerieProperty }
procedure TSerieProperty.Edit;
var Serie: TSerie; I: integer;
begin
Serie:=TSerie(GetOrdValue);
if Serie=nil then begin MessageBeep($ffffffff); Exit; end;
SeriePropsForm:=TSeriePropsForm.Create(Application);
SeriePropsForm.XColumnComboBox.Clear;
for I:=1 to MaxCols do
SeriePropsForm.XColumnComboBox.Items.Add('Column '+IntToStr(I));
with SeriePropsForm do YColumnComboBox.Items.Assign(XColumnComboBox.Items);
{TODO: It's a good idea to fill worksheet combobox with form's containers
references. Also we can support global stringlist for expressions history!}
try
if SeriePropsForm.Execute(Serie) then Modified;
finally
SeriePropsForm.Free;
end;
end;
function TSerieProperty.GetAttributes: TPropertyAttributes;
begin Result:=[paDialog]; end;
procedure Register;
begin
RegisterPropertyEditor(TypeInfo(TAxis), TPlot, '', TAxisProperty);
RegisterPropertyEditor(TypeInfo(TSerie), TPlot, '', TSerieProperty);
end;
end.