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

  1. unit Axisedit;
  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: AxisEdit.pas, released 12 September 2000.
  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/11/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. To facilitate user manipluation of Axis properties.
  45.  
  46. Known Issues:
  47. -----------------------------------------------------------------------------}
  48.  
  49. interface
  50.  
  51. uses
  52.   Classes, SysUtils, TypInfo,
  53. {$IFDEF WINDOWS}
  54.   WinTypes, WinProcs,
  55.   Buttons, Controls, Forms, Graphics, StdCtrls,
  56. {$ENDIF}
  57. {$IFDEF WIN32}
  58.   Windows,
  59.   Buttons, Controls, Forms, Graphics, StdCtrls,
  60. {$ENDIF}
  61. {$IFDEF LINUX}
  62.   QButtons, QControls, QForms, QGraphics, QStdCtrls,
  63. {$ENDIF}
  64.  
  65.   Axis, Misc, Titles, Nedit, Coloredt;
  66.  
  67.  
  68. type
  69.   TAxisProperty = record
  70.     Visible: Boolean;
  71.     LabelFormat: TLabelFormat;
  72.     LabelDigits: Byte;
  73.     LabelPrecision: Byte;
  74.     LabelDirection: TDirection;
  75.     PenColor: TColor;
  76.     PenWidthIndex: Integer;
  77.     PenStyleIndex: Integer;
  78.     TickSize: Byte;
  79.     TickDirection: TOrientation;
  80.     TickStepSize: Single;
  81.     TickMinors: Byte;
  82.     ScaleMin: Single;
  83.     ScaleMax: Single;
  84.     ScaleIntercept: Single;
  85.     ScaleAuto: Boolean;
  86.     ScaleLog: Boolean;
  87.     ArrowSize: Byte;
  88.     ArrowDirection: TAlignment;
  89.     ZAngle: Word;
  90.     ZLength: Word;
  91.   end;
  92.  
  93.   TAxisEditorForm = class(TForm)
  94.     HelpBitBtn: TBitBtn;
  95.     CancelBitBtn: TBitBtn;
  96.     OKBitBtn: TBitBtn;
  97.     VisibleCheckBox: TCheckBox;
  98.     PenGroupBox: TGroupBox;
  99.     Label2: TLabel;
  100.     Label4: TLabel;
  101.     PenWidthComboBox: TComboBox;
  102.     PenStyleComboBox: TComboBox;
  103.     Label5: TLabel;
  104.     GroupBox1: TGroupBox;
  105.     Label6: TLabel;
  106.     Label7: TLabel;
  107.     Label9: TLabel;
  108.     DigitsComboBox: TComboBox;
  109.     PrecisionComboBox: TComboBox;
  110.     FormatComboBox: TComboBox;
  111.     GroupBox2: TGroupBox;
  112.     Label10: TLabel;
  113.     Label11: TLabel;
  114.     TickDirectionComboBox: TComboBox;
  115.     StepSizeLabel: TLabel;
  116.     GroupBox3: TGroupBox;
  117.     InterceptLabel: TLabel;
  118.     LogScaleCheckBox: TCheckBox;
  119.     MinLabel: TLabel;
  120.     MaxLabel: TLabel;
  121.     GroupBox4: TGroupBox;
  122.     Label1: TLabel;
  123.     Label3: TLabel;
  124.     ArrowDirectionComboBox: TComboBox;
  125.     TitleEdit: TEdit;
  126.     Label13: TLabel;
  127.     MinorsComboBox: TComboBox;
  128.     NoComboBox: TComboBox;
  129.     AxisNumberLabel: TLabel;
  130.     AutoScaleCheckBox: TCheckBox;
  131.     TickSizeNEdit: TNEdit;
  132.     StepSizeNEdit: TNEdit;
  133.     MinNEdit: TNEdit;
  134.     MaxNEdit: TNEdit;
  135.     InterceptNEdit: TNEdit;
  136.     ArrowSizeNEdit: TNEdit;
  137.     PenColorEdit: TColorEdit;
  138.     ApplyBitBtn: TBitBtn;
  139.     Label8: TLabel;
  140.     LabelDirectionComboBox: TComboBox;
  141.     ZAxisGroupBox: TGroupBox;
  142.     ZAngleLabel: TLabel;
  143.     ZLengthLabel: TLabel;
  144.     ZAngleNEdit: TNEdit;
  145.     ZLengthNEdit: TNEdit;
  146.     procedure FormCreate(Sender: TObject);
  147.     procedure FormatComboBoxClick(Sender: TObject);
  148.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  149.     procedure PenStyleComboBoxClick(Sender: TObject);
  150.     procedure FormActivate(Sender: TObject);
  151.     procedure FormDestroy(Sender: TObject);
  152.     procedure NoComboBoxClick(Sender: TObject);
  153.     procedure TitleEditChange(Sender: TObject);
  154.     procedure DigitsComboBoxClick(Sender: TObject);
  155.     procedure PrecisionComboBoxClick(Sender: TObject);
  156.     procedure TickDirectionComboBoxClick(Sender: TObject);
  157.     procedure TickSizeNEditChange(Sender: TObject);
  158.     procedure StepSizeNEditChange(Sender: TObject);
  159.     procedure MinNEditChange(Sender: TObject);
  160.     procedure MaxNEditChange(Sender: TObject);
  161.     procedure InterceptNEditChange(Sender: TObject);
  162.     procedure MinorsComboBoxClick(Sender: TObject);
  163.     procedure ArrowDirectionComboBoxClick(Sender: TObject);
  164.     procedure ArrowSizeNEditChange(Sender: TObject);
  165.     procedure VisibleCheckBoxClick(Sender: TObject);
  166.     procedure AutoScaleCheckBoxClick(Sender: TObject);
  167.     procedure LogScaleCheckBoxClick(Sender: TObject);
  168.     procedure PenWidthComboBoxClick(Sender: TObject);
  169.     procedure PenColorEditChange(Sender: TObject);
  170.     procedure ApplyBitBtnClick(Sender: TObject);
  171.     procedure LabelDirectionComboBoxClick(Sender: TObject);
  172.     procedure ZAngleNEditChange(Sender: TObject);
  173.     procedure ZLengthNEditChange(Sender: TObject);
  174.   private
  175.     pAXP: ^TAxisProperty;
  176.     CurrentIndex: Integer;
  177.  
  178. {$IFDEF LINUX}
  179.     function FormOnHelp(
  180.       HelpType: THelpType;
  181.       HelpContext: Integer;
  182.       HelpKeyword: string;
  183.       HelpFile: string;
  184.       var Handled: Boolean): Boolean;
  185. {$ENDIF}
  186.   public
  187.     AxisPropertyList: TList;
  188.     AxisNames: TStringList;
  189.     HistoryMode: Boolean;
  190.     ThePlot: TObject;
  191.     
  192.     function AddAxis(AName: String; AnAxisProperty: TAxisProperty): Integer;
  193.     procedure SelectAxis(Index: Integer);
  194.   end;
  195.  
  196. var
  197.   AxisEditorForm: TAxisEditorForm;
  198.  
  199. implementation
  200.  
  201. {$R *.dfm}
  202.  
  203. uses
  204.   Plot;
  205.  
  206. {------------------------------------------------------------------------------
  207.     Procedure: TAxisEditorForm.FormCreate
  208.   Description: standard FormCreate procedure
  209.        Author: Mat Ballard
  210.  Date created: 04/25/2000
  211. Date modified: 04/25/2000 by Mat Ballard
  212.       Purpose: sets the position and populates the Color combo
  213.  Known Issues:
  214.  ------------------------------------------------------------------------------}
  215. procedure TAxisEditorForm.FormCreate(Sender: TObject);
  216. var
  217.   i: TColor;
  218. begin
  219.   SetDialogGeometry(Self, ApplyBitBtn, AxisNumberLabel.Left);
  220.  
  221. {set combo and edit box widths:}
  222.   for i := 0 to Self.ComponentCount - 1 do
  223.     if ((Self.Components[i] is TNEdit) or
  224.         (Self.Components[i] is TColorEdit) or
  225.         (Self.Components[i] is TComboBox)) then
  226.       TControl(Self.Components[i]).Width := 88;
  227. {the exception:}
  228.   NoComboBox.Width := 48;
  229.  
  230. {Populate the combo boxes:}
  231.   for i := 0 to 18 do
  232.     DigitsComboBox.Items.Add(IntToStr(i));
  233.   for i := 0 to Ord(High(TLabelFormat)) do
  234.     FormatComboBox.Items.Add(Copy(GetEnumName(TypeInfo(TLabelFormat), i), 3, 99));
  235.   for i := 0 to 9 do
  236.     MinorsComboBox.Items.Add(IntToStr(i));
  237.   for i := 0 to 20 do
  238.     PenWidthComboBox.Items.Add(IntToStr(i));
  239.   for i := 0 to Ord(High(TPenStyle)) do
  240.     PenStyleComboBox.Items.Add(Copy(GetEnumName(TypeInfo(TPenStyle), i), 3, 99));
  241.   for i := 0 to 7 do
  242.     PrecisionComboBox.Items.Add(IntToStr(i));
  243.   for i := 0 to Ord(High(TDirection)) do
  244.     LabelDirectionComboBox.Items.Add(Copy(GetEnumName(TypeInfo(TDirection), i), 3, 99));
  245.  
  246.   AxisPropertyList := TList.Create;
  247.   AxisNames := TStringList.Create;
  248.  
  249. {$IFDEF LINUX}
  250.   OnHelp := FormOnHelp;
  251. {$ENDIF}
  252. end;
  253.  
  254. {------------------------------------------------------------------------------
  255.     Procedure: TAxisEditorForm.FormClose
  256.   Description: standard FormClose procedure
  257.        Author: Mat Ballard
  258.  Date created: 04/25/2000
  259. Date modified: 04/25/2000 by Mat Ballard
  260.       Purpose: checks for valid user input
  261.  Known Issues:
  262.  ------------------------------------------------------------------------------}
  263. procedure TAxisEditorForm.FormClose(Sender: TObject;
  264.   var Action: TCloseAction);
  265. begin
  266. {Check that floating point values are valid:
  267.   Action := caHide;
  268.   try
  269.     if (not AutoScaleCheckBox.Checked) then
  270.     begin
  271.       MinEdit.SetFocus;
  272.       Test := StrToFloat(MinEdit.Text)
  273.       MaxEdit.SetFocus;
  274.       TestMax := StrToFloat(MaxEdit.Text)
  275.       if (TestMax < Test) then
  276.         ERangeError.CreateFmt('The Min (%g) MUST be less than the Max (%g)',
  277.           [Test, TestMax]);
  278.       InterceptEdit.SetFocus;
  279.       Test := StrToFloat(InterceptEdit.Text)
  280.       StepSizeEdit.SetFocus;
  281.       Test := Test + StrToFloat(StepSizeEdit.Text);
  282.   {We do the above and below the squelch the warning messages.
  283.       Tag := Trunc(Test);
  284.     end;
  285.   except
  286. {Prevent closure:
  287.     Action := caNone;
  288.   end;}
  289. end;
  290.  
  291. {------------------------------------------------------------------------------
  292.     Procedure: TAxisEditorForm.FormatComboBoxClick
  293.   Description: responds to NumberFormat selection
  294.        Author: Mat Ballard
  295.  Date created: 04/25/2000
  296. Date modified: 04/25/2000 by Mat Ballard
  297.       Purpose: loads the Digits combo depending on selection
  298.  Known Issues:
  299.  ------------------------------------------------------------------------------}
  300. procedure TAxisEditorForm.FormatComboBoxClick(Sender: TObject);
  301. var
  302.   i, iMax, OldIndex: Integer;
  303. begin
  304.   pAXP^.LabelFormat := TLabelFormat(FormatComboBox.ItemIndex);
  305.   OldIndex := DigitsComboBox.ItemIndex;
  306.   DigitsComboBox.Clear;
  307.   iMax := 18;
  308.   if ((FormatComboBox.ItemIndex = Ord(ffGeneral)) or
  309.       (FormatComboBox.ItemIndex = Ord(ffExponent))) then
  310.     iMax := 4;
  311.   for i := 0 to iMax do
  312.   begin
  313.     DigitsComboBox.Items.Add(IntToStr(i));
  314.   end;
  315.   if (OldIndex > iMax) then OldIndex := iMax;
  316.   DigitsComboBox.ItemIndex := OldIndex;
  317. end;
  318.  
  319. {------------------------------------------------------------------------------
  320.     Procedure: TAxisEditorForm.PenStyleComboBoxClick
  321.   Description: responds to user selection
  322.        Author: Mat Ballard
  323.  Date created: 04/25/2000
  324. Date modified: 04/25/2000 by Mat Ballard
  325.       Purpose: sets the Width to 1 if neccessary
  326.  Known Issues:
  327.  ------------------------------------------------------------------------------}
  328. procedure TAxisEditorForm.PenStyleComboBoxClick(Sender: TObject);
  329. begin
  330.   pAXP^.PenStyleIndex := PenStyleComboBox.ItemIndex;
  331.   if (PenStyleComboBox.ItemIndex > Ord(psSolid)) then
  332.     PenWidthComboBox.ItemIndex := 1;
  333. end;
  334.  
  335. {------------------------------------------------------------------------------
  336.     Procedure: TAxisEditorForm.FormActivate
  337.   Description: standard FormActivate procedure
  338.        Author: Mat Ballard
  339.  Date created: 04/25/2000
  340. Date modified: 04/25/2000 by Mat Ballard
  341.       Purpose: sets the Visibility of the Max Label
  342.  Known Issues:
  343.  ------------------------------------------------------------------------------}
  344. procedure TAxisEditorForm.FormActivate(Sender: TObject);
  345. begin
  346.   if (MaxNEdit.Enabled = FALSE) then
  347.     MaxLabel.Enabled := FALSE;
  348.   FormatComboBoxClick(Self);
  349. {$IFDEF LINUX}
  350.   HelpBitBtn.Kind := bkCustom;
  351. {$ENDIF}
  352. end;
  353.  
  354. procedure TAxisEditorForm.FormDestroy(Sender: TObject);
  355. var
  356.   i: Integer;
  357. begin
  358.   for i := 0 to AxisPropertyList.Count-1 do
  359.     FreeMem(AxisPropertyList.Items[i], SizeOf(TAxisProperty));
  360.  
  361.   AxisPropertyList.Free;
  362.   AxisNames.Free;
  363. end;
  364.  
  365. {------------------------------------------------------------------------------
  366.     Procedure: TAxisEditorForm.SelectAxis
  367.   Description: responds to selection of a new Axis
  368.        Author: Mat Ballard
  369.  Date created: 04/25/2000
  370. Date modified: 04/25/2000 by Mat Ballard
  371.       Purpose: manage user input
  372.  Known Issues:
  373.  ------------------------------------------------------------------------------}
  374. procedure TAxisEditorForm.SelectAxis(Index: Integer);
  375. begin
  376.   pAXP := AxisPropertyList.Items[Index];
  377.   CurrentIndex := Index;
  378.  
  379. {Load the combo box:}
  380.   ArrowDirectionComboBox.Clear;
  381.   TickDirectionComboBox.Clear;
  382.   if (Index = 0) then {X Axis:}
  383.   begin
  384.     if (HistoryMode) then
  385.       MaxNEdit.Enabled := FALSE;
  386.     ArrowDirectionComboBox.Items.Add('Left');
  387.     ArrowDirectionComboBox.Items.Add('Right');
  388.     ArrowDirectionComboBox.Items.Add('None');
  389.     TickDirectionComboBox.Items.Add('Up');
  390.     TickDirectionComboBox.Items.Add('Down');
  391.   end
  392.   else
  393.   begin
  394.     MaxNEdit.Enabled := TRUE;
  395.     ArrowDirectionComboBox.Items.Add('Down');
  396.     ArrowDirectionComboBox.Items.Add('Up');
  397.     ArrowDirectionComboBox.Items.Add('None');
  398.     TickDirectionComboBox.Items.Add('Left');
  399.     TickDirectionComboBox.Items.Add('Right');
  400.   end;                  
  401.  
  402.   TitleEdit.Text := AxisNames.Strings[Index];
  403.   FormatComboBox.ItemIndex := Ord(pAXP^.LabelFormat);
  404.   DigitsComboBox.ItemIndex := pAXP^.LabelDigits;
  405.   PrecisionComboBox.ItemIndex := pAXP^.LabelPrecision;
  406.   LabelDirectionComboBox.ItemIndex := Ord(pAXP^.LabelDirection);
  407.   PenColorEdit.SetColour(pAXP^.PenColor);
  408.   PenWidthComboBox.ItemIndex := pAXP^.PenWidthIndex;
  409.   PenStyleComboBox.ItemIndex := pAXP^.PenStyleIndex;
  410.   TickSizeNEdit.AsInteger := pAXP^.TickSize;
  411.   TickDirectionComboBox.ItemIndex := Ord(pAXP^.TickDirection);
  412.   StepSizeNEdit.AsReal := pAXP^.TickStepSize;
  413.   MinorsComboBox.ItemIndex := pAXP^.TickMinors;
  414.   MinNEdit.AsReal := pAXP^.ScaleMin;
  415.   MaxNEdit.AsReal :=  pAXP^.ScaleMax;
  416.   InterceptNEdit.AsReal := pAXP^.ScaleIntercept;
  417.   AutoScaleCheckBox.Checked :=  pAXP^.ScaleAuto;
  418.   LogScaleCheckBox.Checked :=  pAXP^.ScaleLog;
  419.   ArrowSizeNEdit.AsInteger := pAXP^.ArrowSize;
  420.   ArrowDirectionComboBox.ItemIndex := Ord(pAXP^.ArrowDirection);
  421.   if (pAXP^.ZLength > 0) then
  422.   begin
  423.     ZAngleNEdit.AsInteger := pAXP^.ZAngle;
  424.     ZLengthNEdit.AsInteger := pAXP^.ZLength;
  425.     ZAxisGroupBox.Enabled := TRUE;
  426.     ZAngleLabel.Enabled := TRUE;
  427.     ZLengthLabel.Enabled := TRUE;
  428.   end
  429.   else
  430.   begin
  431.     ZAxisGroupBox.Enabled := FALSE;
  432.     ZAngleLabel.Enabled := FALSE;
  433.     ZLengthLabel.Enabled := FALSE;
  434.   end;
  435.  
  436.   AutoScaleCheckBoxClick(Self);
  437.  
  438.   VisibleCheckBox.Checked := pAXP^.Visible;
  439. end;
  440.  
  441. procedure TAxisEditorForm.NoComboBoxClick(Sender: TObject);
  442. var
  443.   Test,
  444.   TestMax: Single;
  445. begin
  446.   try
  447.     if (not AutoScaleCheckBox.Checked) then
  448.     begin
  449.       MinNEdit.SetFocus;
  450.       Test := MinNEdit.AsReal;
  451.       MaxNEdit.SetFocus;
  452.       TestMax := MaxNEdit.AsReal;
  453.       if (TestMax < Test) then
  454.         ERangeError.CreateFmt('The Min (%g) MUST be less than the Max (%g)',
  455.           [Test, TestMax]);
  456.       InterceptNEdit.SetFocus;
  457.       Test := InterceptNEdit.AsReal;
  458.       StepSizeNEdit.SetFocus;
  459.       Test := Test + StepSizeNEdit.AsReal;
  460. {We do the above and below the squelch the warning messages.}
  461.       Tag := Trunc(Test);
  462.     end;
  463.     SelectAxis(NoComboBox.ItemIndex);
  464.   except
  465.   end;
  466. end;
  467.  
  468. {------------------------------------------------------------------------------
  469.      Function: TAxisEditorForm.AddAxis
  470.   Description: adds a new Axis to the list
  471.        Author: Mat Ballard
  472.  Date created: 04/25/2000
  473. Date modified: 04/25/2000 by Mat Ballard
  474.       Purpose: stores the Axis properties
  475.  Known Issues:
  476.  ------------------------------------------------------------------------------}
  477. function TAxisEditorForm.AddAxis(AName: String; AnAxisProperty: TAxisProperty): Integer;
  478. var
  479.   pDestination: Pointer;
  480.   pDest, pSource: PChar;
  481.   i: Integer;
  482. begin
  483.   NoComboBox.Items.Add(IntToStr(AxisNames.Count));
  484.  
  485.   AxisNames.Add(AName);
  486.  
  487.   GetMem(pDestination, SizeOf(AnAxisProperty));
  488.   pSource := @AnAxisProperty;
  489. {NB: this causes terminal access violations:
  490.   System.Move(pSource, pDestination, SizeOf(AnAxisProperty));}
  491.  
  492.   pDest := pDestination;
  493.   for i := 1 to SizeOf(AnAxisProperty) do
  494.   begin
  495.     pDest^ := pSource^;
  496.     Inc(pSource);
  497.     Inc(pDest);
  498.   end;
  499.  
  500.   AxisPropertyList.Add(pDestination);
  501.   AddAxis := AxisPropertyList.Count;
  502. end;
  503.  
  504. procedure TAxisEditorForm.TitleEditChange(Sender: TObject);
  505. begin
  506.   AxisNames.Strings[CurrentIndex] := TitleEdit.Text;
  507. end;
  508.  
  509. procedure TAxisEditorForm.DigitsComboBoxClick(Sender: TObject);
  510. begin
  511.   pAXP^.LabelDigits := DigitsComboBox.ItemIndex;
  512. end;
  513.  
  514. procedure TAxisEditorForm.PrecisionComboBoxClick(Sender: TObject);
  515. begin
  516.   pAXP^.LabelPrecision := PrecisionComboBox.ItemIndex;
  517. end;
  518.  
  519. procedure TAxisEditorForm.TickDirectionComboBoxClick(Sender: TObject);
  520. begin
  521.   pAXP^.TickDirection := TOrientation(TickDirectionComboBox.ItemIndex);
  522. end;
  523.  
  524. procedure TAxisEditorForm.TickSizeNEditChange(Sender: TObject);
  525. begin
  526.   pAXP^.TickSize := TickSizeNEdit.AsInteger;
  527. end;
  528.  
  529. procedure TAxisEditorForm.StepSizeNEditChange(Sender: TObject);
  530. begin
  531.   pAXP^.TickStepSize := StepSizeNEdit.AsReal;
  532. end;
  533.  
  534. procedure TAxisEditorForm.MinNEditChange(Sender: TObject);
  535. begin
  536.   pAXP^.ScaleMin := MinNEdit.AsReal;
  537. end;
  538.  
  539. procedure TAxisEditorForm.MaxNEditChange(Sender: TObject);
  540. begin
  541.   pAXP^.ScaleMax := MaxNEdit.AsReal;
  542. end;
  543.  
  544. procedure TAxisEditorForm.InterceptNEditChange(Sender: TObject);
  545. begin
  546.   pAXP^.ScaleIntercept := InterceptNEdit.AsReal;
  547. end;
  548.  
  549. procedure TAxisEditorForm.MinorsComboBoxClick(Sender: TObject);
  550. begin
  551.   pAXP^.TickMinors := MinorsComboBox.ItemIndex;
  552. end;
  553.  
  554. procedure TAxisEditorForm.ArrowDirectionComboBoxClick(Sender: TObject);
  555. begin
  556.   pAXP^.ArrowDirection := TAlignment(ArrowDirectionComboBox.ItemIndex);
  557. end;
  558.  
  559. procedure TAxisEditorForm.ArrowSizeNEditChange(Sender: TObject);
  560. begin
  561.   pAXP^.ArrowSize := ArrowSizeNEdit.AsInteger;
  562. end;
  563.  
  564. procedure TAxisEditorForm.VisibleCheckBoxClick(Sender: TObject);
  565. begin
  566.   pAXP^.Visible := VisibleCheckBox.Checked;
  567. end;
  568.  
  569. procedure TAxisEditorForm.AutoScaleCheckBoxClick(Sender: TObject);
  570. begin
  571.   pAXP^.ScaleAuto := AutoScaleCheckBox.Checked;
  572.  
  573.   StepSizeNEdit.Enabled := not AutoScaleCheckBox.Checked;
  574.   MinNEdit.Enabled := not AutoScaleCheckBox.Checked;
  575.   MaxNEdit.Enabled := not AutoScaleCheckBox.Checked;
  576.   InterceptNEdit.Enabled := not AutoScaleCheckBox.Checked;
  577.  
  578.   StepSizeLabel.Enabled := not AutoScaleCheckBox.Checked;
  579.   MinLabel.Enabled := not AutoScaleCheckBox.Checked;
  580.   MaxLabel.Enabled := not AutoScaleCheckBox.Checked;
  581.   InterceptLabel.Enabled := not AutoScaleCheckBox.Checked;
  582. end;
  583.  
  584. procedure TAxisEditorForm.LogScaleCheckBoxClick(Sender: TObject);
  585. begin
  586.   pAXP^.ScaleLog := LogScaleCheckBox.Checked;
  587. end;
  588.  
  589. procedure TAxisEditorForm.PenWidthComboBoxClick(Sender: TObject);
  590. begin
  591.   pAXP^.PenWidthIndex := PenWidthComboBox.ItemIndex;
  592. end;
  593.  
  594. procedure TAxisEditorForm.PenColorEditChange(Sender: TObject);
  595. begin
  596.   pAXP^.PenColor := PenColorEdit.Color;
  597. end;
  598.  
  599. procedure TAxisEditorForm.ApplyBitBtnClick(Sender: TObject);
  600. begin
  601.   TPlot(ThePlot).ApplyAxisChange(Self);
  602. end;
  603.  
  604. procedure TAxisEditorForm.LabelDirectionComboBoxClick(Sender: TObject);
  605. begin
  606.   pAXP^.LabelDirection := TDirection(LabelDirectionComboBox.ItemIndex);
  607. end;
  608.  
  609.  
  610. procedure TAxisEditorForm.ZAngleNEditChange(Sender: TObject);
  611. begin
  612.   pAXP^.ZAngle := ZAngleNEdit.AsInteger;
  613. end;
  614.  
  615. procedure TAxisEditorForm.ZLengthNEditChange(Sender: TObject);
  616. begin
  617.   pAXP^.ZLength := ZLengthNEdit.AsInteger;
  618. end;
  619.  
  620. {------------------------------------------------------------------------------
  621.      Function: FormOnHelp
  622.   Description: displays a topic from a HTML-based help website
  623.        Author: Mat Ballard
  624.  Date created: 05/10/2001
  625. Date modified: 05/10/2001 by Mat Ballard
  626.       Purpose: help management
  627.  Return Value: Boolean
  628.  Known Issues:
  629.  ------------------------------------------------------------------------------}
  630. {$IFDEF LINUX}
  631. function TAxisEditorForm.FormOnHelp(
  632.   HelpType: THelpType;
  633.   HelpContext: Integer;
  634.   HelpKeyword: string;
  635.   HelpFile: string;
  636.   var Handled: Boolean): Boolean;
  637. var
  638.   MyHTMLHelpTopicFile: String;
  639.   HelpPath: String;
  640. begin
  641.   HelpPath := ExtractFilePath(HelpFile);
  642.   MyHTMLHelpTopicFile := HelpPath + 'hs' + IntToStr(HelpContext) + '.htm';
  643.   if FileExists(MyHTMLHelpTopicFile) then
  644.   begin                //konqueror
  645.     ShellExec('Netscape ' + MyHTMLHelpTopicFile);
  646.     Handled := TRUE;
  647.   end;
  648. end;
  649. {$ENDIF}
  650.  
  651.  
  652. end.
  653.