home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 October
/
Chip_2001-10_cd1.bin
/
zkuste
/
delphi
/
kompon
/
d123456
/
CHEMPLOT.ZIP
/
TPlot
/
Axisedit.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-07-24
|
25KB
|
750 lines
unit Axisedit;
{$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: AxisEdit.pas, released 12 September 2000.
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/11/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:
To facilitate user manipluation of Axis properties.
Known Issues:
-----------------------------------------------------------------------------}
interface
uses
Classes, SysUtils, TypInfo,
{$IFDEF WINDOWS}
WinTypes, WinProcs,
Buttons, Controls, Forms, Graphics, StdCtrls,
{$ENDIF}
{$IFDEF WIN32}
Windows,
Buttons, Controls, Forms, Graphics, StdCtrls,
{$ENDIF}
{$IFDEF LINUX}
QButtons, QControls, QForms, QGraphics, QStdCtrls,
{$ENDIF}
Axis, Coloredt, Misc, Nedit, Plotdefs, Titles;
type
TAxisProperty = record
Visible: Boolean;
LabelFormat: TLabelFormat;
LabelDigits: Byte;
LabelPrecision: Byte;
LabelDirection: TDirection;
PenColor: TColor;
PenWidthIndex: Integer;
PenStyleIndex: Integer;
TickSize: Byte;
TickDirection: TOrientation;
TickStepSize: Single;
TickMinors: Byte;
ScaleMin: Single;
ScaleMax: Single;
ScaleIntercept: Single;
ScaleAuto: Boolean;
ScaleLog: Boolean;
ArrowSize: Byte;
ArrowDirection: TAlignment;
LimitLower: Single;
LimitUpper: Single;
LimitsVisible: Boolean;
ZAngle: Word;
ZInterceptY: Single;
ZLength: Word;
end;
TAxisEditorForm = class(TForm)
HelpBitBtn: TBitBtn;
CancelBitBtn: TBitBtn;
OKBitBtn: TBitBtn;
VisibleCheckBox: TCheckBox;
PenGroupBox: TGroupBox;
PenColorLabel: TLabel;
PenWidthLabel: TLabel;
PenWidthComboBox: TComboBox;
PenStyleComboBox: TComboBox;
PenStyleLabel: TLabel;
LabelsGroupBox: TGroupBox;
DigitsLabel: TLabel;
PrecisionLabel: TLabel;
FormatLabel: TLabel;
DigitsComboBox: TComboBox;
PrecisionComboBox: TComboBox;
FormatComboBox: TComboBox;
TickGroupBox: TGroupBox;
TickSizeLabel: TLabel;
TickDirectionLabel: TLabel;
TickDirectionComboBox: TComboBox;
StepSizeLabel: TLabel;
ScaleGroupBox: TGroupBox;
InterceptLabel: TLabel;
LogScaleCheckBox: TCheckBox;
MinLabel: TLabel;
MaxLabel: TLabel;
ArrowsGroupBox: TGroupBox;
ArrowSizeLabel: TLabel;
ArrowDirectionLabel: TLabel;
ArrowDirectionComboBox: TComboBox;
TitleEdit: TEdit;
TickMinorsLabel: TLabel;
MinorsComboBox: TComboBox;
NoComboBox: TComboBox;
AxisNumberLabel: TLabel;
AutoScaleCheckBox: TCheckBox;
TickSizeNEdit: TNEdit;
StepSizeNEdit: TNEdit;
MinNEdit: TNEdit;
MaxNEdit: TNEdit;
InterceptNEdit: TNEdit;
ArrowSizeNEdit: TNEdit;
PenColorEdit: TColorEdit;
ApplyBitBtn: TBitBtn;
LabelDirectionLabel: TLabel;
LabelDirectionComboBox: TComboBox;
ZAxisGroupBox: TGroupBox;
ZAngleLabel: TLabel;
ZLengthLabel: TLabel;
ZAngleNEdit: TNEdit;
ZLengthNEdit: TNEdit;
ZInterceptLabel: TLabel;
ZInterceptNEdit: TNEdit;
LimitsGroupBox: TGroupBox;
LowerLimitLabel: TLabel;
UpperLimitLabel: TLabel;
LowerLimitNEdit: TNEdit;
UpperLimitNEdit: TNEdit;
LimitsVisibleCheckBox: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure FormatComboBoxClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure PenStyleComboBoxClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure NoComboBoxClick(Sender: TObject);
procedure TitleEditChange(Sender: TObject);
procedure DigitsComboBoxClick(Sender: TObject);
procedure PrecisionComboBoxClick(Sender: TObject);
procedure TickDirectionComboBoxClick(Sender: TObject);
procedure TickSizeNEditChange(Sender: TObject);
procedure StepSizeNEditChange(Sender: TObject);
procedure MinNEditChange(Sender: TObject);
procedure MaxNEditChange(Sender: TObject);
procedure InterceptNEditChange(Sender: TObject);
procedure MinorsComboBoxClick(Sender: TObject);
procedure ArrowDirectionComboBoxClick(Sender: TObject);
procedure ArrowSizeNEditChange(Sender: TObject);
procedure VisibleCheckBoxClick(Sender: TObject);
procedure AutoScaleCheckBoxClick(Sender: TObject);
procedure LogScaleCheckBoxClick(Sender: TObject);
procedure PenWidthComboBoxClick(Sender: TObject);
procedure PenColorEditChange(Sender: TObject);
procedure ApplyBitBtnClick(Sender: TObject);
procedure LabelDirectionComboBoxClick(Sender: TObject);
procedure ZAngleNEditChange(Sender: TObject);
procedure ZLengthNEditChange(Sender: TObject);
procedure ZInterceptNEditChange(Sender: TObject);
procedure LowerLimitNEditChange(Sender: TObject);
procedure UpperLimitNEditChange(Sender: TObject);
procedure LimitsVisibleCheckBoxClick(Sender: TObject);
private
pAXP: ^TAxisProperty;
CurrentIndex: Integer;
public
AxisPropertyList: TList;
AxisNames: TStringList;
HistoryMode: Boolean;
ThePlot: TObject;
function AddAxis(AName: String; AnAxisProperty: TAxisProperty): Integer;
procedure SelectAxis(Index: Integer);
{$IFNDEF LANG_ENGLISH}
procedure DoCaptionsFromResource;
{$ENDIF}
procedure DoHintsFromResource;
end;
var
AxisEditorForm: TAxisEditorForm;
implementation
{$R *.dfm}
uses
Plot;
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.FormCreate
Description: standard FormCreate procedure
Author: Mat Ballard
Date created: 04/25/2000
Date modified: 04/25/2000 by Mat Ballard
Purpose: sets the position and populates the Color combo
Known Issues:
------------------------------------------------------------------------------}
procedure TAxisEditorForm.FormCreate(Sender: TObject);
var
i: Integer;
begin
{$IFNDEF LANG_ENGLISH}
DoCaptionsFromResource;
{$ENDIF}
DoHintsFromResource;
SetDialogGeometry(Self, ApplyBitBtn, HelpBitBtn.Left);
{set combo and edit box widths:}
for i := 0 to Self.ComponentCount - 1 do
if ((Self.Components[i] is TNEdit) or
(Self.Components[i] is TColorEdit) or
(Self.Components[i] is TComboBox)) then
TControl(Self.Components[i]).Width := 88
else if (Self.Components[i] is TBitBtn) then
TControl(Self.Components[i]).Width := 97;
{the exception:}
NoComboBox.Width := 57;
{Populate the combo boxes:}
for i := 0 to 18 do
DigitsComboBox.Items.Add(IntToStr(i));
for i := 0 to Ord(High(TLabelFormat)) do
FormatComboBox.Items.Add(Copy(GetEnumName(TypeInfo(TLabelFormat), i), 3, 99));
for i := 0 to 9 do
MinorsComboBox.Items.Add(IntToStr(i));
for i := 0 to 20 do
PenWidthComboBox.Items.Add(IntToStr(i));
for i := 0 to Ord(High(TPenStyle)) do
PenStyleComboBox.Items.Add(Copy(GetEnumName(TypeInfo(TPenStyle), i), 3, 99));
for i := 0 to 7 do
PrecisionComboBox.Items.Add(IntToStr(i));
for i := 0 to Ord(High(TDirection)) do
LabelDirectionComboBox.Items.Add(Copy(GetEnumName(TypeInfo(TDirection), i), 3, 99));
AxisPropertyList := TList.Create;
AxisNames := TStringList.Create;
end;
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.DoCaptionsFromResource
Description: standard loading of labels from resources
Author: Mat Ballard
Date created: 06/25/2001
Date modified: 06/25/2001 by Mat Ballard
Purpose: display in different languages
Known Issues:
------------------------------------------------------------------------------}
{$IFNDEF LANG_ENGLISH}
procedure TAxisEditorForm.DoCaptionsFromResource;
begin
Self.Caption := sAxis + ' ' + sEditor;
AxisNumberLabel.Caption := sAxis + ' ' + sNumber;
AutoScaleCheckBox.Caption := sAutoScalingTicking;
VisibleCheckBox.Caption := sAxis + ' ' + sVisible;
ScaleGroupBox.Caption := sScale;
MinLabel.Caption := sMin;
MaxLabel.Caption := sMax;
InterceptLabel.Caption := sIntercept;
LogScaleCheckBox.Caption := sLogarithmic;
TickGroupBox.Caption := sTicks;
TickDirectionLabel.Caption := sDirection;
TickMinorsLabel.Caption := sMinors;
TickSizeLabel.Caption := sSize;
StepSizeLabel.Caption := sStepSize;
LabelsGroupBox.Caption := sLabels;
FormatLabel.Caption := sFormat;
DigitsLabel.Caption := sDigits;
PrecisionLabel.Caption := sPrecision;
LabelDirectionLabel.Caption := sDirection;
PenGroupBox.Caption := sPen;
PenColorLabel.Caption := sColor;
PenWidthLabel.Caption := sWidth;
PenStyleLabel.Caption := sStyle;
ArrowsGroupBox.Caption := sArrows;
ArrowSizeLabel.Caption := sSize;
ArrowDirectionLabel.Caption := sDirection;
LimitsGroupBox.Caption := sLimits;
LowerLimitLabel.Caption := sLower;
UpperLimitLabel.Caption := sUpper;
LimitsVisibleCheckBox.Caption := sVisible;
ZAxisGroupBox.Caption := 'Z ' + sAxis;
ZAngleLabel.Caption := sAngle;
ZLengthLabel.Caption := sLength;
ZInterceptLabel.Caption := sIntercept;
HelpBitBtn.Caption := sHelp;
OKBitBtn.Caption := sOK;
CancelBitBtn.Caption := sCancel;
ApplyBitBtn.Caption := sApply;
end;
{$ENDIF}
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.DoHintsFromResource
Description: standard loading of labels from resources
Author: Mat Ballard
Date created: 06/25/2001
Date modified: 06/25/2001 by Mat Ballard
Purpose: display in different languages
Known Issues:
------------------------------------------------------------------------------}
procedure TAxisEditorForm.DoHintsFromResource;
begin
TitleEdit.Hint := sTitleEditHint;
NoComboBox.Hint := sAxisNumberHint;
AutoScaleCheckBox.Hint := sAutoScalingTickingHint;
VisibleCheckBox.Hint := sAxisVisibleHint;
MinNEdit.Hint := sMinHint;
MaxNEdit.Hint := sMaxHint;
InterceptNEdit.Hint := sInterceptHint;
LogScaleCheckBox.Hint := sLogarithmicHint;
TickDirectionComboBox.Hint := sTickDirectionHint;
MinorsComboBox.Hint := sMinorsHint;
TickSizeNEdit.Hint := sSizeHint;
StepSizeNEdit.Hint := sStepSizeHint;
FormatComboBox.Hint := sFormatHint;
DigitsComboBox.Hint := sDigitsHint;
PrecisionComboBox.Hint := sPrecisionHint;
LabelDirectionComboBox.Hint := sLabelDirectionHint;
ArrowSizeNEdit.Hint := sArrowSizeHint;
ArrowDirectionComboBox.Hint := sArrowDirectionHint;
LimitsGroupBox.Hint := sLimitsGroupBoxHint;
LowerLimitNEdit.Hint := sLowerLimitHint;
UpperLimitNEdit.Hint := sLowerLimitHint;
LimitsVisibleCheckBox.Hint := sLimitsVisibleHint;
ZAngleNEdit.Hint := sAngleHint;
ZLengthNEdit.Hint := sLengthHint;
ZInterceptNEdit.Hint := sZInterceptHint;
ApplyBitBtn.Hint := sApplyHint;
end;
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.FormClose
Description: standard FormClose procedure
Author: Mat Ballard
Date created: 04/25/2000
Date modified: 04/25/2000 by Mat Ballard
Purpose: checks for valid user input
Known Issues:
------------------------------------------------------------------------------}
procedure TAxisEditorForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
{Check that floating point values are valid:
Action := caHide;
try
if (not AutoScaleCheckBox.Checked) then
begin
MinEdit.SetFocus;
Test := StrToFloat(MinEdit.Text)
MaxEdit.SetFocus;
TestMax := StrToFloat(MaxEdit.Text)
if (TestMax < Test) then
ERangeError.CreateFmt('The Min (%g) MUST be less than the Max (%g)',
[Test, TestMax]);
InterceptEdit.SetFocus;
Test := StrToFloat(InterceptEdit.Text)
StepSizeEdit.SetFocus;
Test := Test + StrToFloat(StepSizeEdit.Text);
{We do the above and below the squelch the warning messages.
Tag := Trunc(Test);
end;
except
{Prevent closure:
Action := caNone;
end;}
end;
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.FormatComboBoxClick
Description: responds to NumberFormat selection
Author: Mat Ballard
Date created: 04/25/2000
Date modified: 04/25/2000 by Mat Ballard
Purpose: loads the Digits combo depending on selection
Known Issues:
------------------------------------------------------------------------------}
procedure TAxisEditorForm.FormatComboBoxClick(Sender: TObject);
var
i, iMax, OldIndex: Integer;
begin
pAXP^.LabelFormat := TLabelFormat(FormatComboBox.ItemIndex);
OldIndex := DigitsComboBox.ItemIndex;
DigitsComboBox.Clear;
iMax := 18;
if ((FormatComboBox.ItemIndex = Ord(ffGeneral)) or
(FormatComboBox.ItemIndex = Ord(ffExponent))) then
iMax := 4;
for i := 0 to iMax do
begin
DigitsComboBox.Items.Add(IntToStr(i));
end;
if (OldIndex > iMax) then OldIndex := iMax;
DigitsComboBox.ItemIndex := OldIndex;
end;
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.PenStyleComboBoxClick
Description: responds to user selection
Author: Mat Ballard
Date created: 04/25/2000
Date modified: 04/25/2000 by Mat Ballard
Purpose: sets the Width to 1 if neccessary
Known Issues:
------------------------------------------------------------------------------}
procedure TAxisEditorForm.PenStyleComboBoxClick(Sender: TObject);
begin
pAXP^.PenStyleIndex := PenStyleComboBox.ItemIndex;
if (PenStyleComboBox.ItemIndex > Ord(psSolid)) then
PenWidthComboBox.ItemIndex := 1;
end;
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.FormActivate
Description: standard FormActivate procedure
Author: Mat Ballard
Date created: 04/25/2000
Date modified: 04/25/2000 by Mat Ballard
Purpose: sets the Visibility of the Max Label
Known Issues:
------------------------------------------------------------------------------}
procedure TAxisEditorForm.FormActivate(Sender: TObject);
begin
if (MaxNEdit.Enabled = FALSE) then
MaxLabel.Enabled := FALSE;
FormatComboBoxClick(Self);
{$IFDEF LINUX}
HelpBitBtn.Kind := bkCustom;
{$ENDIF}
end;
procedure TAxisEditorForm.FormDestroy(Sender: TObject);
var
i: Integer;
begin
for i := 0 to AxisPropertyList.Count-1 do
FreeMem(AxisPropertyList.Items[i], SizeOf(TAxisProperty));
AxisPropertyList.Free;
AxisNames.Free;
end;
{------------------------------------------------------------------------------
Procedure: TAxisEditorForm.SelectAxis
Description: responds to selection of a new Axis
Author: Mat Ballard
Date created: 04/25/2000
Date modified: 04/25/2000 by Mat Ballard
Purpose: manage user input
Known Issues:
------------------------------------------------------------------------------}
procedure TAxisEditorForm.SelectAxis(Index: Integer);
begin
pAXP := AxisPropertyList.Items[Index];
CurrentIndex := Index;
{Load the combo box:}
ArrowDirectionComboBox.Clear;
TickDirectionComboBox.Clear;
if (Index = 0) then {X Axis:}
begin
if (HistoryMode) then
MaxNEdit.Enabled := FALSE;
ArrowDirectionComboBox.Items.Add(sLeft);
ArrowDirectionComboBox.Items.Add(sRight);
ArrowDirectionComboBox.Items.Add(sNone);
TickDirectionComboBox.Items.Add(sDown);
TickDirectionComboBox.Items.Add(sUp);
end
else
begin
MaxNEdit.Enabled := TRUE;
ArrowDirectionComboBox.Items.Add(sDown);
ArrowDirectionComboBox.Items.Add(sUp);
ArrowDirectionComboBox.Items.Add(sNone);
TickDirectionComboBox.Items.Add(sRight);
TickDirectionComboBox.Items.Add(sLeft);
end;
TitleEdit.Text := AxisNames.Strings[Index];
FormatComboBox.ItemIndex := Ord(pAXP^.LabelFormat);
DigitsComboBox.ItemIndex := pAXP^.LabelDigits;
PrecisionComboBox.ItemIndex := pAXP^.LabelPrecision;
LabelDirectionComboBox.ItemIndex := Ord(pAXP^.LabelDirection);
PenColorEdit.SetColour(pAXP^.PenColor);
PenWidthComboBox.ItemIndex := pAXP^.PenWidthIndex;
PenStyleComboBox.ItemIndex := pAXP^.PenStyleIndex;
TickSizeNEdit.AsInteger := pAXP^.TickSize;
TickDirectionComboBox.ItemIndex := Ord(pAXP^.TickDirection);
StepSizeNEdit.AsReal := pAXP^.TickStepSize;
MinorsComboBox.ItemIndex := pAXP^.TickMinors;
MinNEdit.AsReal := pAXP^.ScaleMin;
MaxNEdit.AsReal := pAXP^.ScaleMax;
InterceptNEdit.AsReal := pAXP^.ScaleIntercept;
ZInterceptNEdit.AsReal := pAXP^.ZInterceptY;
AutoScaleCheckBox.Checked := pAXP^.ScaleAuto;
LogScaleCheckBox.Checked := pAXP^.ScaleLog;
ArrowSizeNEdit.AsInteger := pAXP^.ArrowSize;
ArrowDirectionComboBox.ItemIndex := Ord(pAXP^.ArrowDirection);
LowerLimitNEdit.AsReal := pAXP^.LimitLower;
UpperLimitNEdit.AsReal := pAXP^.LimitUpper;
LimitsVisibleCheckBox.Checked := pAXP^.LimitsVisible;
if (pAXP^.ZLength > 0) then
begin
ZAngleNEdit.AsInteger := pAXP^.ZAngle;
ZInterceptNEdit.AsReal := pAXP^.ZInterceptY;
ZLengthNEdit.AsInteger := pAXP^.ZLength;
ZAxisGroupBox.Enabled := TRUE;
end
else
begin
ZAxisGroupBox.Enabled := FALSE;
end;
ZAngleLabel.Enabled := ZAxisGroupBox.Enabled;
ZLengthLabel.Enabled := ZAxisGroupBox.Enabled;
ZInterceptLabel.Enabled := ZAxisGroupBox.Enabled;
AutoScaleCheckBoxClick(Self);
VisibleCheckBox.Checked := pAXP^.Visible;
end;
procedure TAxisEditorForm.NoComboBoxClick(Sender: TObject);
var
Test,
TestMax: Single;
begin
try
if (not AutoScaleCheckBox.Checked) then
begin
MinNEdit.SetFocus;
Test := MinNEdit.AsReal;
MaxNEdit.SetFocus;
TestMax := MaxNEdit.AsReal;
if (TestMax < Test) then
ERangeError.CreateFmt(sNoComboBoxClick1, [Test, TestMax]);
InterceptNEdit.SetFocus;
Test := InterceptNEdit.AsReal;
StepSizeNEdit.SetFocus;
Test := Test + StepSizeNEdit.AsReal;
{We do the above and below the squelch the warning messages.}
Tag := Trunc(Test);
end;
SelectAxis(NoComboBox.ItemIndex);
except
end;
end;
{------------------------------------------------------------------------------
Function: TAxisEditorForm.AddAxis
Description: adds a new Axis to the list
Author: Mat Ballard
Date created: 04/25/2000
Date modified: 04/25/2000 by Mat Ballard
Purpose: stores the Axis properties
Known Issues:
------------------------------------------------------------------------------}
function TAxisEditorForm.AddAxis(AName: String; AnAxisProperty: TAxisProperty): Integer;
var
pDestination: Pointer;
pDest, pSource: PChar;
i: Integer;
begin
NoComboBox.Items.Add(IntToStr(AxisNames.Count));
AxisNames.Add(AName);
GetMem(pDestination, SizeOf(AnAxisProperty));
pSource := @AnAxisProperty;
{NB: this causes terminal access violations:
System.Move(pSource, pDestination, SizeOf(AnAxisProperty));}
pDest := pDestination;
for i := 1 to SizeOf(AnAxisProperty) do
begin
pDest^ := pSource^;
Inc(pSource);
Inc(pDest);
end;
AxisPropertyList.Add(pDestination);
AddAxis := AxisPropertyList.Count;
end;
procedure TAxisEditorForm.TitleEditChange(Sender: TObject);
begin
AxisNames.Strings[CurrentIndex] := TitleEdit.Text;
end;
procedure TAxisEditorForm.DigitsComboBoxClick(Sender: TObject);
begin
pAXP^.LabelDigits := DigitsComboBox.ItemIndex;
end;
procedure TAxisEditorForm.PrecisionComboBoxClick(Sender: TObject);
begin
pAXP^.LabelPrecision := PrecisionComboBox.ItemIndex;
end;
procedure TAxisEditorForm.TickDirectionComboBoxClick(Sender: TObject);
begin
pAXP^.TickDirection := TOrientation(TickDirectionComboBox.ItemIndex);
end;
procedure TAxisEditorForm.TickSizeNEditChange(Sender: TObject);
begin
pAXP^.TickSize := TickSizeNEdit.AsInteger;
end;
procedure TAxisEditorForm.StepSizeNEditChange(Sender: TObject);
begin
pAXP^.TickStepSize := StepSizeNEdit.AsReal;
end;
procedure TAxisEditorForm.MinNEditChange(Sender: TObject);
begin
pAXP^.ScaleMin := MinNEdit.AsReal;
end;
procedure TAxisEditorForm.MaxNEditChange(Sender: TObject);
begin
pAXP^.ScaleMax := MaxNEdit.AsReal;
end;
procedure TAxisEditorForm.InterceptNEditChange(Sender: TObject);
begin
pAXP^.ScaleIntercept := InterceptNEdit.AsReal;
end;
procedure TAxisEditorForm.MinorsComboBoxClick(Sender: TObject);
begin
pAXP^.TickMinors := MinorsComboBox.ItemIndex;
end;
procedure TAxisEditorForm.ArrowDirectionComboBoxClick(Sender: TObject);
begin
pAXP^.ArrowDirection := TAlignment(ArrowDirectionComboBox.ItemIndex);
end;
procedure TAxisEditorForm.ArrowSizeNEditChange(Sender: TObject);
begin
pAXP^.ArrowSize := ArrowSizeNEdit.AsInteger;
end;
procedure TAxisEditorForm.VisibleCheckBoxClick(Sender: TObject);
begin
pAXP^.Visible := VisibleCheckBox.Checked;
end;
procedure TAxisEditorForm.AutoScaleCheckBoxClick(Sender: TObject);
begin
pAXP^.ScaleAuto := AutoScaleCheckBox.Checked;
StepSizeNEdit.Enabled := not AutoScaleCheckBox.Checked;
MinNEdit.Enabled := not AutoScaleCheckBox.Checked;
MaxNEdit.Enabled := not AutoScaleCheckBox.Checked;
InterceptNEdit.Enabled := not AutoScaleCheckBox.Checked;
StepSizeLabel.Enabled := not AutoScaleCheckBox.Checked;
MinLabel.Enabled := not AutoScaleCheckBox.Checked;
MaxLabel.Enabled := not AutoScaleCheckBox.Checked;
InterceptLabel.Enabled := not AutoScaleCheckBox.Checked;
end;
procedure TAxisEditorForm.LogScaleCheckBoxClick(Sender: TObject);
begin
pAXP^.ScaleLog := LogScaleCheckBox.Checked;
end;
procedure TAxisEditorForm.PenWidthComboBoxClick(Sender: TObject);
begin
pAXP^.PenWidthIndex := PenWidthComboBox.ItemIndex;
end;
procedure TAxisEditorForm.PenColorEditChange(Sender: TObject);
begin
pAXP^.PenColor := PenColorEdit.Color;
end;
procedure TAxisEditorForm.ApplyBitBtnClick(Sender: TObject);
begin
TPlot(ThePlot).ApplyAxisChange(Self);
end;
procedure TAxisEditorForm.LabelDirectionComboBoxClick(Sender: TObject);
begin
pAXP^.LabelDirection := TDirection(LabelDirectionComboBox.ItemIndex);
end;
procedure TAxisEditorForm.ZAngleNEditChange(Sender: TObject);
begin
pAXP^.ZAngle := ZAngleNEdit.AsInteger;
end;
procedure TAxisEditorForm.ZLengthNEditChange(Sender: TObject);
begin
pAXP^.ZLength := ZLengthNEdit.AsInteger;
end;
procedure TAxisEditorForm.ZInterceptNEditChange(Sender: TObject);
begin
pAXP^.ZInterceptY := ZInterceptNEdit.AsReal;
end;
procedure TAxisEditorForm.LowerLimitNEditChange(Sender: TObject);
begin
pAXP^.LimitLower := LowerLimitNEdit.AsReal;
end;
procedure TAxisEditorForm.UpperLimitNEditChange(Sender: TObject);
begin
pAXP^.LimitUpper := UpperLimitNEdit.AsReal;
end;
procedure TAxisEditorForm.LimitsVisibleCheckBoxClick(Sender: TObject);
begin
pAXP^.LimitsVisible := LimitsVisibleCheckBox.Checked;
end;
end.