Check-in [c2c21599e3]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added feature to manually adjust work and lunch times.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c2c21599e3e784a0d5c363fb4e1e4b5b170a3530
User & Date: tinus 2014-12-04 09:04:39
Context
2014-12-04
09:39
Calculate totals when adjusting times. Check for date change on update; fetch new times when that happens. New executable included. check-in: 99b04e4d68 user: tinus tags: trunk
09:04
Added feature to manually adjust work and lunch times. check-in: c2c21599e3 user: tinus tags: trunk
2014-12-03
08:22
Default start and stop time can now be specified in the .ini file. Renamed the sample .ini file. The form is now always invalidated after a refresh; even when an exception occurs. check-in: 5b7709bef6 user: tinus tags: trunk
Changes

Changes to src/F_Main.dfm.

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
...
104
105
106
107
108
109
110




111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
    Top = 120
  end
  object pumContext: TPopupMenu
    Images = imlMain
    Left = 32
    Top = 176
    object miRefresh: TMenuItem
      Caption = '&Refresh'
      ImageIndex = 1
      OnClick = miRefreshClick
    end
    object miOpacity: TMenuItem
      Caption = '&Opacity'
      object mnuOpacity100: TMenuItem
        Tag = 100
        Caption = '100%'
        OnClick = mnuOpacityClick
      end
      object N751: TMenuItem
        Tag = 90
................................................................................
      end
      object N301: TMenuItem
        Tag = 30
        Caption = '30%'
        OnClick = mnuOpacityClick
      end
    end




    object N1: TMenuItem
      Caption = '-'
    end
    object miClose: TMenuItem
      Caption = '&Close'
      ImageIndex = 0
      OnClick = miCloseClick
    end
  end
  object imlMain: TImageList
    Left = 32
    Top = 232
    Bitmap = {
      494C010102000400200010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
      0000000000003600000028000000400000001000000001002000000000000010
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000







|




|







 







>
>
>
>




|








|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
    Top = 120
  end
  object pumContext: TPopupMenu
    Images = imlMain
    Left = 32
    Top = 176
    object miRefresh: TMenuItem
      Caption = 'Refresh'
      ImageIndex = 1
      OnClick = miRefreshClick
    end
    object miOpacity: TMenuItem
      Caption = 'Opacity'
      object mnuOpacity100: TMenuItem
        Tag = 100
        Caption = '100%'
        OnClick = mnuOpacityClick
      end
      object N751: TMenuItem
        Tag = 90
................................................................................
      end
      object N301: TMenuItem
        Tag = 30
        Caption = '30%'
        OnClick = mnuOpacityClick
      end
    end
    object miAdjustTimes: TMenuItem
      Caption = 'Adjust...'
      OnClick = miAdjustTimesClick
    end
    object N1: TMenuItem
      Caption = '-'
    end
    object miClose: TMenuItem
      Caption = 'Close'
      ImageIndex = 0
      OnClick = miCloseClick
    end
  end
  object imlMain: TImageList
    Left = 32
    Top = 232
    Bitmap = {
      494C010102000400280010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
      0000000000003600000028000000400000001000000001002000000000000010
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000
      0000000000000000000000000000000000000000000000000000000000000000

Changes to src/F_Main.pas.

36
37
38
39
40
41
42

43
44
45
46
47
48
49
50
51
52
53
54

55
56
57
58

59
60

61
62
63
64
65
66
67
68
69
70






71
72
73
74
75






76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
...
392
393
394
395
396
397
398






399
400
401
402
403
404
405
...
431
432
433
434
435
436
437










































438
439
440
441
442
443
444
    N801: TMenuItem;
    N701: TMenuItem;
    N601: TMenuItem;
    N501: TMenuItem;
    N401: TMenuItem;
    N301: TMenuItem;
    trayIcon: TTrayIcon;

    procedure tmrFetchTimesTimer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormResize(Sender: TObject);
    procedure tmrUpdateProgressTimer(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormPaint(Sender: TObject);
    procedure miRefreshClick(Sender: TObject);
    procedure miCloseClick(Sender: TObject);
    procedure mnuOpacityClick(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure FormDeactivate(Sender: TObject);

  private
    { Private declarations }
    FSettings: TIniFile;


    FStartTime: TDateTime;
    FStopTime: TDateTime;

    FLunchStart: TDateTime;
    FLunchStop: TDateTime;

    FWaypoints: array of TControlPoint;

    FErrorFetchesAgo: Integer;

    function  DateTimeFromXML(ISODateTime: string): TDateTime;

    procedure FetchHoursOnline();






  protected
    procedure CreateParams (var Params: TCreateParams); override;
    procedure OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge); override;
  public
    { Public declarations }






  end;

var
  frmMain: TfrmMain;

implementation
uses
  DateUtils, ComObj, ActiveX, Math,
  IdURI,
  L_VersionInfoW;


{$R *.dfm}

var
  XMLFS: TFormatSettings;

{ ------------------------------------------------------------------------------------------------ }
................................................................................
                         FormatDateTime('H:nn', FStopTime - Now) ]);

  end else begin
    Self.Hint := Format('%s'#13#10'%s',
                        [FormatDateTime('dddddd', Now), FormatDateTime('H:nn', Now) ]);
  end;
end;







{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.miCloseClick(Sender: TObject);
begin
  Application.Terminate;
end;

................................................................................
procedure TfrmMain.OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge);
begin
  inherited;

  if Edge <> abeUnknown then
    SaveSettings;
end;











































{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.tmrFetchTimesTimer(Sender: TObject);
begin
  TTimer(Sender).Enabled := False;
  try
    if trayIcon.Visible then trayIcon.Visible := False;







>












>




>


>










>
>
>
>
>
>





>
>
>
>
>
>









|
>







 







>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
...
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
...
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
    N801: TMenuItem;
    N701: TMenuItem;
    N601: TMenuItem;
    N501: TMenuItem;
    N401: TMenuItem;
    N301: TMenuItem;
    trayIcon: TTrayIcon;
    miAdjustTimes: TMenuItem;
    procedure tmrFetchTimesTimer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormResize(Sender: TObject);
    procedure tmrUpdateProgressTimer(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormPaint(Sender: TObject);
    procedure miRefreshClick(Sender: TObject);
    procedure miCloseClick(Sender: TObject);
    procedure mnuOpacityClick(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure FormDeactivate(Sender: TObject);
    procedure miAdjustTimesClick(Sender: TObject);
  private
    { Private declarations }
    FSettings: TIniFile;

    FUserTimes: Boolean;
    FStartTime: TDateTime;
    FStopTime: TDateTime;
    FUserLunch: Boolean;
    FLunchStart: TDateTime;
    FLunchStop: TDateTime;

    FWaypoints: array of TControlPoint;

    FErrorFetchesAgo: Integer;

    function  DateTimeFromXML(ISODateTime: string): TDateTime;

    procedure FetchHoursOnline();
    procedure SetLunchStart(const Value: TDateTime);
    procedure SetLunchStop(const Value: TDateTime);
    procedure SetStartTime(const Value: TDateTime);
    procedure SetStopTime(const Value: TDateTime);
    procedure SetUserLunch(const Value: Boolean);
    procedure SetUserTimes(const Value: Boolean);
  protected
    procedure CreateParams (var Params: TCreateParams); override;
    procedure OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge); override;
  public
    { Public declarations }
    property UserTimes: Boolean     read FUserTimes   write SetUserTimes;
    property StartTime: TDateTime   read FStartTime   write SetStartTime;
    property StopTime: TDateTime    read FStopTime    write SetStopTime;
    property UserLunch: Boolean     read FUserLunch   write SetUserLunch;
    property StartLunch: TDateTime  read FLunchStart  write SetLunchStart;
    property StopLunch: TDateTime   read FLunchStop   write SetLunchStop;
  end;

var
  frmMain: TfrmMain;

implementation
uses
  DateUtils, ComObj, ActiveX, Math,
  IdURI,
  L_VersionInfoW,
  F_Times;

{$R *.dfm}

var
  XMLFS: TFormatSettings;

{ ------------------------------------------------------------------------------------------------ }
................................................................................
                         FormatDateTime('H:nn', FStopTime - Now) ]);

  end else begin
    Self.Hint := Format('%s'#13#10'%s',
                        [FormatDateTime('dddddd', Now), FormatDateTime('H:nn', Now) ]);
  end;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.miAdjustTimesClick(Sender: TObject);
begin
  frmEditTimes.Show;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.miCloseClick(Sender: TObject);
begin
  Application.Terminate;
end;

................................................................................
procedure TfrmMain.OnAppBarStateChange(Proposed: boolean; Edge: TAppBarEdge);
begin
  inherited;

  if Edge <> abeUnknown then
    SaveSettings;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.SetLunchStart(const Value: TDateTime);
begin
  FLunchStart := Value;
  Self.Invalidate;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.SetLunchStop(const Value: TDateTime);
begin
  FLunchStop := Value;
  Self.Invalidate;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.SetStartTime(const Value: TDateTime);
begin
  FStartTime := Value;
  Self.Invalidate;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.SetStopTime(const Value: TDateTime);
begin
  FStopTime := Value;
  Self.Invalidate;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.SetUserLunch(const Value: Boolean);
begin
  FUserLunch := Value;
  Self.Invalidate;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.SetUserTimes(const Value: Boolean);
begin
  FUserTimes := Value;
  Self.Invalidate;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmMain.tmrFetchTimesTimer(Sender: TObject);
begin
  TTimer(Sender).Enabled := False;
  try
    if trayIcon.Visible then trayIcon.Visible := False;

Added src/F_Times.dfm.



















































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
object frmEditTimes: TfrmEditTimes
  Left = 0
  Top = 0
  BorderStyle = bsDialog
  Caption = 'Adjust Times'
  ClientHeight = 267
  ClientWidth = 339
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poScreenCenter
  OnActivate = FormActivate
  DesignSize = (
    339
    267)
  PixelsPerInch = 96
  TextHeight = 13
  object pnlWork: TPanel
    AlignWithMargins = True
    Left = 3
    Top = 3
    Width = 333
    Height = 107
    Align = alTop
    BevelInner = bvRaised
    BevelOuter = bvLowered
    TabOrder = 0
    ExplicitTop = 44
    ExplicitWidth = 412
    DesignSize = (
      333
      107)
    object lblStart: TLabel
      Left = 8
      Top = 44
      Width = 53
      Height = 13
      Caption = '&Start Time:'
      Enabled = False
      FocusControl = dtpStart
    end
    object lblStop: TLabel
      Left = 8
      Top = 71
      Width = 51
      Height = 13
      Caption = 'Stop &Time:'
      Enabled = False
      FocusControl = dtpStop
    end
    object dtpStart: TDateTimePicker
      Left = 96
      Top = 40
      Width = 89
      Height = 21
      Date = 41977.333333333340000000
      Format = 'HH:mm'
      Time = 41977.333333333340000000
      Enabled = False
      Kind = dtkTime
      ParseInput = True
      TabOrder = 0
      OnChange = dtpTimeChange
    end
    object dtpStop: TDateTimePicker
      Left = 96
      Top = 67
      Width = 89
      Height = 21
      Date = 41977.708333333340000000
      Format = 'HH:mm'
      Time = 41977.708333333340000000
      Enabled = False
      Kind = dtkTime
      ParseInput = True
      TabOrder = 1
      OnChange = dtpTimeChange
    end
    object chkAdjustTimes: TCheckBox
      Left = 8
      Top = 8
      Width = 320
      Height = 17
      Anchors = [akLeft, akTop, akRight]
      Caption = 'Adjust &work times'
      TabOrder = 2
      OnClick = chkAdjustTimesClick
    end
  end
  object pnlLunch: TPanel
    AlignWithMargins = True
    Left = 3
    Top = 116
    Width = 333
    Height = 101
    Align = alTop
    BevelInner = bvRaised
    BevelOuter = bvLowered
    TabOrder = 1
    ExplicitTop = 148
    ExplicitWidth = 412
    DesignSize = (
      333
      101)
    object lblLunchStart: TLabel
      Left = 8
      Top = 44
      Width = 53
      Height = 13
      Caption = 'St&art Time:'
      Enabled = False
      FocusControl = dtpLunchStart
    end
    object lblLunchStop: TLabel
      Left = 8
      Top = 71
      Width = 51
      Height = 13
      Caption = 'St&op Time:'
      Enabled = False
      FocusControl = dtpLunchStop
    end
    object dtpLunchStart: TDateTimePicker
      Left = 96
      Top = 40
      Width = 89
      Height = 21
      Date = 41977.500000000000000000
      Format = 'HH:mm'
      Time = 41977.500000000000000000
      Enabled = False
      Kind = dtkTime
      ParseInput = True
      TabOrder = 0
      OnChange = dtpTimeChange
    end
    object dtpLunchStop: TDateTimePicker
      Left = 96
      Top = 67
      Width = 89
      Height = 21
      Date = 41977.520833333340000000
      Format = 'HH:mm'
      Time = 41977.520833333340000000
      Enabled = False
      Kind = dtkTime
      ParseInput = True
      TabOrder = 1
      OnChange = dtpTimeChange
    end
    object chkAdjustLunch: TCheckBox
      Left = 8
      Top = 8
      Width = 320
      Height = 17
      Anchors = [akLeft, akTop, akRight]
      Caption = 'Adjust &lunch times'
      TabOrder = 2
      OnClick = chkAdjustLunchClick
    end
  end
  object btnClose: TButton
    Left = 241
    Top = 234
    Width = 90
    Height = 25
    Anchors = [akRight, akBottom]
    Caption = '&Close'
    Default = True
    TabOrder = 2
    OnClick = btnCloseClick
    ExplicitLeft = 320
    ExplicitTop = 224
  end
  object tmrAutosave: TTimer
    Enabled = False
    OnTimer = tmrAutosaveTimer
    Left = 288
    Top = 16
  end
end

Added src/F_Times.pas.

























































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
unit F_Times;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.ExtCtrls;

type
  TfrmEditTimes = class(TForm)
    pnlWork: TPanel;
    dtpStart: TDateTimePicker;
    lblStart: TLabel;
    lblStop: TLabel;
    dtpStop: TDateTimePicker;
    pnlLunch: TPanel;
    lblLunchStart: TLabel;
    lblLunchStop: TLabel;
    dtpLunchStart: TDateTimePicker;
    dtpLunchStop: TDateTimePicker;
    chkAdjustTimes: TCheckBox;
    chkAdjustLunch: TCheckBox;
    btnClose: TButton;
    tmrAutosave: TTimer;
    procedure chkAdjustTimesClick(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure chkAdjustLunchClick(Sender: TObject);
    procedure tmrAutosaveTimer(Sender: TObject);
    procedure dtpTimeChange(Sender: TObject);
    procedure btnCloseClick(Sender: TObject);
  private
    { Private declarations }
    procedure EnableControls;
    procedure StartTimer;
  public
    { Public declarations }
  end;

var
  frmEditTimes: TfrmEditTimes;

implementation
uses
  DateUtils,
  F_Main;

{$R *.dfm}

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.FormActivate(Sender: TObject);
begin
  dtpStart.Time := frmMain.StartTime;
  dtpStop.Time := frmMain.StopTime;
  chkAdjustTimes.Checked := frmMain.UserTimes;
  dtpLunchStart.Time := frmMain.StartLunch;
  dtpLunchStop.Time := frmMain.StopLunch;
  chkAdjustLunch.Checked := frmMain.UserLunch;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.StartTimer;
begin
  tmrAutosave.Enabled := False;
  tmrAutosave.Enabled := True;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.tmrAutosaveTimer(Sender: TObject);
begin
  tmrAutosave.Enabled := False;
  frmMain.UserTimes := chkAdjustTimes.Checked;
  if frmMain.UserTimes then begin
    frmMain.StartTime := Date + TimeOf(dtpStart.Time);
    frmMain.StopTime := Date + TimeOf(dtpStop.Time);
  end;
  frmMain.UserLunch := chkAdjustLunch.Checked;
  if frmMain.UserLunch then begin
    frmMain.StartLunch := Date + TimeOf(dtpLunchStart.Time);
    frmMain.StopLunch := Date + TimeOf(dtpLunchStop.Time);
  end;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.btnCloseClick(Sender: TObject);
begin
  Self.Hide;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.chkAdjustLunchClick(Sender: TObject);
begin
  EnableControls;
  StartTimer;
  frmMain.UserLunch := chkAdjustLunch.Checked;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.chkAdjustTimesClick(Sender: TObject);
begin
  EnableControls;
  frmMain.UserTimes := chkAdjustTimes.Checked;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.dtpTimeChange(Sender: TObject);
begin
  StartTimer;
end;

{ ------------------------------------------------------------------------------------------------ }
procedure TfrmEditTimes.EnableControls;
begin
  dtpStart.Enabled := chkAdjustTimes.Checked;
  lblStart.Enabled := chkAdjustTimes.Checked;
  dtpStop.Enabled := chkAdjustTimes.Checked;
  lblStop.Enabled := chkAdjustTimes.Checked;

  dtpLunchStart.Enabled := chkAdjustLunch.Checked;
  lblLunchStart.Enabled := chkAdjustLunch.Checked;
  dtpLunchStop.Enabled := chkAdjustLunch.Checked;
  lblLunchStop.Enabled := chkAdjustLunch.Checked;
end;

end.

Changes to src/prj/d2009/TempusFugit.dpr.

1
2
3

4
5

6
7
8
9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
program TempusFugit;

uses

  Forms, Windows,
  F_Main {frmMain},

  AppBar,
  CheckPrevious;

{$R *.res}

begin
  if not CheckPrevious.RestoreIfRunning(Application.Handle) then begin
    Application.MainFormOnTaskbar := False;
    ShowWindow(Application.Handle, SW_HIDE);
    SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
    Application.Initialize;
    Application.Title := 'Tempus Fugit';
    Application.CreateForm(TfrmMain, frmMain);

    ShowWindow(Application.Handle, SW_SHOW);
    frmMain.UpdateBar;
    Application.Run;
  end;
end.



>
|

>













>





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
program TempusFugit;

uses
  Forms,
  Windows,
  F_Main {frmMain},
  F_Times {frmEditTimes},
  AppBar,
  CheckPrevious;

{$R *.res}

begin
  if not CheckPrevious.RestoreIfRunning(Application.Handle) then begin
    Application.MainFormOnTaskbar := False;
    ShowWindow(Application.Handle, SW_HIDE);
    SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
    Application.Initialize;
    Application.Title := 'Tempus Fugit';
    Application.CreateForm(TfrmMain, frmMain);
    Application.CreateForm(TfrmEditTimes, frmEditTimes);
    ShowWindow(Application.Handle, SW_SHOW);
    frmMain.UpdateBar;
    Application.Run;
  end;
end.

Changes to src/prj/d2009/TempusFugit.dproj.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
...
133
134
135
136
137
138
139

















































































































































































































































































































































140
141
142
143

144
        <Platform Condition="'$(Platform)'==''">Win32</Platform>
        <TargetedPlatforms>1</TargetedPlatforms>
        <AppType>Application</AppType>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
        <Base>true</Base>
    </PropertyGroup>
    <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
        <Base_Win32>true</Base_Win32>
        <CfgParent>Base</CfgParent>
        <Base>true</Base>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
        <Cfg_1>true</Cfg_1>
        <CfgParent>Base</CfgParent>
        <Base>true</Base>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
        <Cfg_2>true</Cfg_2>
................................................................................
                    <Excluded_Packages Name="$(BDSBIN)\dclofficexp210.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
                </Excluded_Packages>
            </Delphi.Personality>
            <Platforms>
                <Platform value="Win32">True</Platform>
                <Platform value="Win64">False</Platform>
            </Platforms>

















































































































































































































































































































































        </BorlandProject>
        <ProjectFileVersion>12</ProjectFileVersion>
    </ProjectExtensions>
    <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>

</Project>







<
<
<
<
<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




>

10
11
12
13
14
15
16





17
18
19
20
21
22
23
...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
        <Platform Condition="'$(Platform)'==''">Win32</Platform>
        <TargetedPlatforms>1</TargetedPlatforms>
        <AppType>Application</AppType>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
        <Base>true</Base>
    </PropertyGroup>





    <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
        <Cfg_1>true</Cfg_1>
        <CfgParent>Base</CfgParent>
        <Base>true</Base>
    </PropertyGroup>
    <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
        <Cfg_2>true</Cfg_2>
................................................................................
                    <Excluded_Packages Name="$(BDSBIN)\dclofficexp210.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
                </Excluded_Packages>
            </Delphi.Personality>
            <Platforms>
                <Platform value="Win32">True</Platform>
                <Platform value="Win64">False</Platform>
            </Platforms>
            <Deployment>
                <DeployFile LocalName="..\..\..\out\TempusFugit.exe" Configuration="Debug" Class="ProjectOutput">
                    <Platform Name="Win32">
                        <RemoteName>TempusFugit.exe</RemoteName>
                        <Overwrite>true</Overwrite>
                    </Platform>
                </DeployFile>
                <DeployClass Required="true" Name="DependencyPackage">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                        <Extensions>.dylib</Extensions>
                    </Platform>
                    <Platform Name="Win32">
                        <Operation>0</Operation>
                        <Extensions>.bpl</Extensions>
                    </Platform>
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>1</Operation>
                        <Extensions>.dylib</Extensions>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                        <Extensions>.dylib</Extensions>
                    </Platform>
                </DeployClass>
                <DeployClass Name="DependencyModule">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                        <Extensions>.dylib</Extensions>
                    </Platform>
                    <Platform Name="Win32">
                        <Operation>0</Operation>
                        <Extensions>.dll;.bpl</Extensions>
                    </Platform>
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>1</Operation>
                        <Extensions>.dylib</Extensions>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                        <Extensions>.dylib</Extensions>
                    </Platform>
                </DeployClass>
                <DeployClass Name="iPad_Launch2048">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectOSXInfoPList">
                    <Platform Name="OSX32">
                        <RemoteDir>Contents</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectiOSDeviceDebug">
                    <Platform Name="iOSDevice">
                        <RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_SplashImage470">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-normal</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AndroidLibnativeX86File">
                    <Platform Name="Android">
                        <RemoteDir>library\lib\x86</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectiOSResource">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectOSXEntitlements">
                    <Platform Name="OSX32">
                        <RemoteDir>Contents</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AndroidGDBServer">
                    <Platform Name="Android">
                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="iPhone_Launch640">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_SplashImage960">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-xlarge</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_LauncherIcon96">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="iPhone_Launch320">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_LauncherIcon144">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AndroidLibnativeMipsFile">
                    <Platform Name="Android">
                        <RemoteDir>library\lib\mips</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AndroidSplashImageDef">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="DebugSymbols">
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="Win32">
                        <Operation>0</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="DependencyFramework">
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>1</Operation>
                        <Extensions>.framework</Extensions>
                    </Platform>
                    <Platform Name="Win32">
                        <Operation>0</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_SplashImage426">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-small</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectiOSEntitlements">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AdditionalDebugSymbols">
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="Win32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>0</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AndroidClassesDexFile">
                    <Platform Name="Android">
                        <RemoteDir>classes</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectiOSInfoPList">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="iPad_Launch1024">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_DefaultAppIcon">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectOSXResource">
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\Resources</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectiOSDeviceResourceRules">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="iPad_Launch768">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Required="true" Name="ProjectOutput">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="Android">
                        <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="Win32">
                        <Operation>0</Operation>
                    </Platform>
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AndroidLibnativeArmeabiFile">
                    <Platform Name="Android">
                        <RemoteDir>library\lib\armeabi</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_SplashImage640">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-large</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="File">
                    <Platform Name="iOSDevice">
                        <Operation>0</Operation>
                    </Platform>
                    <Platform Name="Android">
                        <Operation>0</Operation>
                    </Platform>
                    <Platform Name="Win32">
                        <Operation>0</Operation>
                    </Platform>
                    <Platform Name="OSX32">
                        <RemoteDir>Contents\MacOS</RemoteDir>
                        <Operation>0</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>0</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="iPhone_Launch640x1136">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_LauncherIcon36">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-ldpi</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="AndroidSplashStyles">
                    <Platform Name="Android">
                        <RemoteDir>res\values</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="iPad_Launch1536">
                    <Platform Name="iOSDevice">
                        <Operation>1</Operation>
                    </Platform>
                    <Platform Name="iOSSimulator">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_LauncherIcon48">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-mdpi</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="Android_LauncherIcon72">
                    <Platform Name="Android">
                        <RemoteDir>res\drawable-hdpi</RemoteDir>
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <DeployClass Name="ProjectAndroidManifest">
                    <Platform Name="Android">
                        <Operation>1</Operation>
                    </Platform>
                </DeployClass>
                <ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
                <ProjectRoot Platform="iOSDevice" Name="$(PROJECTNAME).app"/>
                <ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
                <ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
                <ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
                <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
            </Deployment>
        </BorlandProject>
        <ProjectFileVersion>12</ProjectFileVersion>
    </ProjectExtensions>
    <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
    <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>