137 lines
2.9 KiB
ObjectPascal
137 lines
2.9 KiB
ObjectPascal
unit ImpostazioniForm;
|
|
|
|
{$mode ObjFPC}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ButtonPanel, StdCtrls,
|
|
Spin, settingsutils;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
{ TImpostazioni }
|
|
|
|
TImpostazioni = class(TForm)
|
|
CancelButton: TButton;
|
|
SaveButton: TButton;
|
|
ResetButton: TButton;
|
|
CheckBox1: TCheckBox;
|
|
LanguageBox: TComboBox;
|
|
LatitudineEdit: TFloatSpinEdit;
|
|
LongitudineEdit: TFloatSpinEdit;
|
|
CordinateGroupBox: TGroupBox;
|
|
VarieGroupBox: TGroupBox;
|
|
Label1: TLabel;
|
|
Label2: TLabel;
|
|
Label3: TLabel;
|
|
Label4: TLabel;
|
|
Label5: TLabel;
|
|
OraSimulazioneEdit: TSpinEdit;
|
|
procedure CancelButtonClick(Sender: TObject);
|
|
procedure CheckBox1Change(Sender: TObject);
|
|
procedure SaveButtonClick(Sender: TObject);
|
|
procedure ResetButtonClick(Sender: TObject);
|
|
procedure FormClick(Sender: TObject);
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure FormPaint(Sender: TObject);
|
|
procedure FormShow(Sender: TObject);
|
|
procedure LongitudineEditChange(Sender: TObject);
|
|
procedure OKButtonClick(Sender: TObject);
|
|
|
|
|
|
private
|
|
|
|
public
|
|
|
|
|
|
end;
|
|
|
|
var
|
|
Impostazioni: TImpostazioni;
|
|
ImpostazioniDati: TImpostazioniDati;
|
|
implementation
|
|
|
|
{$R *.lfm}
|
|
|
|
{ TImpostazioni }
|
|
|
|
procedure TImpostazioni.FormCreate(Sender: TObject);
|
|
|
|
begin
|
|
{$ifdef windows}
|
|
CordinateGroupBox.Caption:='';
|
|
VarieGroupBox.Caption:='';
|
|
|
|
{$endif}
|
|
end;
|
|
|
|
procedure TImpostazioni.FormPaint(Sender: TObject);
|
|
begin
|
|
{$ifdef windows}
|
|
|
|
{$endif}
|
|
end;
|
|
|
|
procedure TImpostazioni.FormShow(Sender: TObject);
|
|
begin
|
|
Impostazioni.ResetButtonClick(nil);
|
|
end;
|
|
|
|
procedure TImpostazioni.LongitudineEditChange(Sender: TObject);
|
|
begin
|
|
|
|
end;
|
|
|
|
procedure TImpostazioni.OKButtonClick(Sender: TObject);
|
|
begin
|
|
|
|
end;
|
|
|
|
procedure TImpostazioni.SaveButtonClick(Sender: TObject);
|
|
begin
|
|
impostazionidati.Latitudine:=LatitudineEdit.Value;
|
|
impostazionidati.Longitudine:=LongitudineEdit.Value;
|
|
impostazionidati.OraSimulazione:=OraSimulazioneEdit.Value;
|
|
if LanguageBox.SelText='' then impostazionidati.LinguaApp:=LanguageBox.Text
|
|
else impostazionidati.LinguaApp:=LanguageBox.SelText;
|
|
|
|
impostazionidati.httpsIsEnabled:=CheckBox1.Checked;
|
|
|
|
ScriviImpostazioni(impostazionidati);
|
|
|
|
Impostazioni.Close;
|
|
|
|
end;
|
|
|
|
procedure TImpostazioni.ResetButtonClick(Sender: TObject);
|
|
begin
|
|
ImpostazioniDati:= LeggiImpostazioni();
|
|
LatitudineEdit.Value:=ImpostazioniDati.Latitudine;
|
|
LongitudineEdit.Value:=ImpostazioniDati.Longitudine;
|
|
OraSimulazioneEdit.Value:=ImpostazioniDati.OraSimulazione;
|
|
CheckBox1.Checked:=impostazionidati.httpsIsEnabled;
|
|
LanguageBox.Text:=impostazionidati.LinguaApp;
|
|
end;
|
|
|
|
procedure TImpostazioni.CancelButtonClick(Sender: TObject);
|
|
begin
|
|
Impostazioni.Close;
|
|
end;
|
|
|
|
procedure TImpostazioni.CheckBox1Change(Sender: TObject);
|
|
begin
|
|
if CheckBox1.Checked then CheckBox1.Caption:='Abilitato' else CheckBox1.Caption:='Disabilitato';
|
|
end;
|
|
|
|
procedure TImpostazioni.FormClick(Sender: TObject);
|
|
begin
|
|
|
|
end;
|
|
|
|
end.
|
|
|