Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1080 → Rev 1081

/Delphi/akTimeLog/Source/OptionsUnit.pas
0,0 → 1,74
// akTimeLog v3.0
// Copyright (c) 1999-2000 Anatoli Klassen
unit OptionsUnit;
 
interface
 
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
 
type
TOptionsForm = class(TForm)
AutoRunCheckBox: TCheckBox;
AutoRunGroupBox: TGroupBox;
OneUserCheckBox: TCheckBox;
UserNameLabel: TLabel;
UserNameEdit: TEdit;
OkButton: TButton;
CancelButton: TButton;
procedure AutoRunCheckBoxClick(Sender: TObject);
procedure OneUserCheckBoxClick(Sender: TObject);
private
public
procedure Execute;
end;
 
var
OptionsForm: TOptionsForm;
 
implementation
 
uses MainUnit, UtilsUnit;
 
{$R *.DFM}
 
procedure TOptionsForm.Execute;
begin
AutoRunCheckBox.Checked := akTimeLogMainForm.AutoRun.Registered;
 
OneUserCheckBox.Checked := arOneUserOnly;
 
UserNameEdit.Text := arUserName;
 
AutoRunCheckBoxClick(Self);
 
if ShowModal = mrOk then begin
arOneUserOnly := OneUserCheckBox.Checked;
arUserName := UserNameEdit.Text;
 
if AutoRunCheckBox.Checked then begin
akTimeLogMainForm.AutoRun.Params := GetAutoRunParams;
akTimeLogMainForm.AutoRun.Register;
end
else
akTimeLogMainForm.AutoRun.UnRegister;
end;
end;
 
procedure TOptionsForm.AutoRunCheckBoxClick(Sender: TObject);
begin
AutoRunGroupBox.Enabled := AutoRunCheckBox.Checked;
 
OneUserCheckBox.Enabled := AutoRunGroupBox.Enabled;
 
OneUserCheckBoxClick(Sender);
end;
 
procedure TOptionsForm.OneUserCheckBoxClick(Sender: TObject);
begin
UserNameLabel.Enabled := AutoRunGroupBox.Enabled and OneUserCheckBox.Checked;
UserNameEdit.Enabled := AutoRunGroupBox.Enabled and OneUserCheckBox.Checked;
end;
 
end.