unit uIPSP;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, AbNumEdit, PropSaveMain,
  JvExStdCtrls, JvHtControls, JvExControls, JvLinkLabel;

type
  TfrmIPSP = class(TForm)
    gbIPSP: TGroupBox;
    lblVRest: TLabel;
    Label1: TLabel;
    Label2: TLabel;
    neIPSP: TAbNumEdit;
    SetIPSP: TAbNumSpin;
    btnEPSPIPSPHelp: TButton;
    procedure neIPSPValueChanged(Sender: TObject);
    procedure SetIPSPChange(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure lblHelpIPSPClick(Sender: TObject);
    procedure btnEPSPIPSPHelpClick(Sender: TObject);
  private
    { Private declarations }

  public
    { Public declarations }
    IPSP: Single;
  end;

var
  frmIPSP: TfrmIPSP;

implementation

{$R *.dfm}

uses uBodyPlan, ShellAPI;

procedure TfrmIPSP.btnEPSPIPSPHelpClick(Sender: TObject);
begin
  // ShellExecute(Handle, 'open', PCHAR('https://seti.net/Neuron%20Lab/1.%20Cells%20and%20Ions/Cells%20and%20Ions.php'), PCHAR(''), PCHAR(''),
  // SW_SHOWNORMAL);
  // ShellExecute(Handle, 'open', PChar('http://www.google.com/'), nil, nil, SW_SHOW);
  ShellExecute(Handle, 'open', PChar('https://seti.net/Neuron%20Lab/1.%20Cells%20and%20Ions/Cells%20and%20Ions.php/#IPSP'), nil,
    nil, SW_SHOW);

end;

procedure TfrmIPSP.FormCreate(Sender: TObject);
begin
  neIPSP.Value :=  frmBodyPlan.Vr_mV + SetIPSP.Value;
  IPSP := neIPSP.Value;
end;

procedure TfrmIPSP.lblHelpIPSPClick(Sender: TObject);
begin
  ShellExecute(Handle, 'open', PChar('http://www.seti.net'), PChar(''), PChar(''), SW_SHOWNORMAL);

end;

procedure TfrmIPSP.neIPSPValueChanged(Sender: TObject);
begin
  // neIPSP.Value := frmBodyPlan.VRest + SetIPSP.Value;
end;

procedure TfrmIPSP.SetIPSPChange(Sender: TObject);
begin
  IPSP :=  frmBodyPlan.Vr_mV + SetIPSP.Value;
  neIPSP.Value := IPSP;
end;

end.
