{-----------------------------------------------------------------------------
 Unit Name: Coordinates
 Author:    kaetzel
 Purpose:   This unit contains the third form for the agglomerate configuration
 Comments:  As the whole reading procedure is already defined in numspheres.pas
            here only the intialization procedure and the check for the
            OK-Button Click is implemented
-----------------------------------------------------------------------------}

unit Coordinates;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, JvEdit, JvAngleLabel, JvLabel;

type
  TCoordinateWindow = class(TForm)
    Panel1: TPanel;
    OkButton: TBitBtn;
    NumberLabel: TLabel;
    Label2: TLabel;
    DiameterInput: TJvEdit;
    XcoordInput: TJvEdit;
    YcoordInput: TJvEdit;
    ZcoordInput: TJvEdit;
    JvLabel1: TJvLabel;
    JvLabel2: TJvLabel;
    JvAngleLabel1: TJvAngleLabel;
    JvAngleLabel2: TJvAngleLabel;
    Label3: TLabel;
    JvLabel3: TJvLabel;
    Label4: TLabel;
    JvLabel4: TJvLabel;
    Label5: TLabel;
    JvLabel5: TJvLabel;
    RealPartInput: TJvEdit;
    ImagPartInput: TJvEdit;
    JvAngleLabel3: TJvAngleLabel;
    JvAngleLabel4: TJvAngleLabel;
    Label1: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    procedure OkButtonClick(Sender: TObject);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  CoordinateWindow: TCoordinateWindow;

implementation

uses NumSpheres, Main;

{$R *.dfm}


{-----------------------------------------------------------------------------
  Procedure: TCoordinateWindow.OkButtonClick
  Purpose:   Sends the signal for the Click of the OK-Button to NumSpheres.pas
  Comments:
-----------------------------------------------------------------------------}

procedure TCoordinateWindow.OkButtonClick(Sender: TObject);
begin
  ButtonClicked:=True;
end;


{-----------------------------------------------------------------------------
  Procedure: TCoordinateWindow.FormActivate
  Purpose:   Initialization of the Edit Components
  Comments:
-----------------------------------------------------------------------------}

procedure TCoordinateWindow.FormActivate(Sender: TObject);
begin
  if Nl=1 then
    begin
      XcoordInput.Text:='0';
      YCoordInput.Text:='0';
      ZcoordInput.Text:='0';
      XcoordInput.Enabled:=False;
      YCoordInput.Enabled:=False;
      ZCoordInput.Enabled:=False;
    end
  else
    begin
      XcoordInput.Text:='';
      YcoordInput.Text:='';
      ZcoordInput.Text:='';
    end;
  DiameterInput.Text:='';
  DiameterInput.SetFocus;
  RealPartInput.Text:='';
  ImagPartInput.Text:='';
end;

end.
