Check-in [101b3773b8]
Not logged in

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

Overview
Comment:dmMain now sports a few Select-functions.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 101b3773b8c2ee89e4bc126c7776dc6c055889de
User & Date: MCO 2014-07-28 15:48:48
Context
2014-10-30
17:49
Updated ProjectIt to XE7. Moved popup menu and action list to data module. check-in: 32244c3e69 user: tinus tags: trunk
2014-07-28
15:48
dmMain now sports a few Select-functions. check-in: 101b3773b8 user: MCO tags: trunk
14:49
Updated dislpay of duration. check-in: 73d0f24a3d user: MCO tags: trunk
Changes

Changes to Olam/src/F_Activity.dfm.

1064
1065
1066
1067
1068
1069
1070

1071
1072
1073
1074
1075
1076
1077
    Width = 34
    Height = 22
    Anchors = [akTop, akRight]
    ImageAlignment = iaCenter
    ImageIndex = 125
    Images = dmMain.imlMain
    TabOrder = 1

  end
  object btnPhaseList: TButton
    Left = 415
    Top = 36
    Width = 34
    Height = 22
    Anchors = [akTop, akRight]







>







1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
    Width = 34
    Height = 22
    Anchors = [akTop, akRight]
    ImageAlignment = iaCenter
    ImageIndex = 125
    Images = dmMain.imlMain
    TabOrder = 1
    OnClick = btnProjectListClick
  end
  object btnPhaseList: TButton
    Left = 415
    Top = 36
    Width = 34
    Height = 22
    Anchors = [akTop, akRight]

Changes to Olam/src/F_Activity.pas.

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
...
257
258
259
260
261
262
263

264
265
266
267
268
269
270
271
272
273









274
275
276
277
278
279
280
    procedure FormHide(Sender: TObject);
    procedure dtpUntilDateEnter(Sender: TObject);
    procedure tmrDurationTimer(Sender: TObject);
    procedure dtpFromDateChange(Sender: TObject);
    procedure dtpFromTimeChange(Sender: TObject);
    procedure dtpUntilDateChange(Sender: TObject);
    procedure dtpUntilTimeChange(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
    procedure UpdateDuration;
  end;

var
  frmActivity: TfrmActivity;

implementation
uses
  DateUtils,
  ShellAPI;

{$R *.dfm}

{ ---------------------------------------------------------------------------- }
procedure TfrmActivity.FormCreate(Sender: TObject);
begin


  cbxPhase.ItemIndex := 0;

  actAddFile.ShortCut := VK_INSERT;
  actRemoveAttachment.ShortCut := VK_DELETE;
  dtpFromDate.Date := Date;
  dtpFromTime.Time := Now;
  dtpUntilDate.Date := Date;
  dtpUntilDate.Checked := False;
  dtpUntilTime.Time := Now;
................................................................................

  ErrorControl := btnOK;
  if cbxProject.ItemIndex = -1 then begin
    ErrorControl := cbxProject;
    ErrorMsg := 'Please choose a project, or create a new one.';
  end;
  if ErrorMsg <> '' then begin

    BalloonHint.Title := 'Cannot save activity';
    BalloonHint.Description := ErrorMsg + sLineBreak;
    BalloonHint.ImageIndex := 2005; // warning
    BalloonHint.Delay := 0;
    BalloonHint.ShowHint(ErrorControl);
    ModalResult := mrNone;
  end else begin
    ModalResult := mrOk;
  end;
end {TfrmActivity.btnOKClick};










{ ---------------------------------------------------------------------------- }
procedure TfrmActivity.dtpFromDateChange(Sender: TObject);
begin
  UpdateDuration;
end;








>













|






>
>

>







 







>










>
>
>
>
>
>
>
>
>







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
...
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
    procedure FormHide(Sender: TObject);
    procedure dtpUntilDateEnter(Sender: TObject);
    procedure tmrDurationTimer(Sender: TObject);
    procedure dtpFromDateChange(Sender: TObject);
    procedure dtpFromTimeChange(Sender: TObject);
    procedure dtpUntilDateChange(Sender: TObject);
    procedure dtpUntilTimeChange(Sender: TObject);
    procedure btnProjectListClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure UpdateDuration;
  end;

var
  frmActivity: TfrmActivity;

implementation
uses
  DateUtils,
  ShellAPI, F_Projects;

{$R *.dfm}

{ ---------------------------------------------------------------------------- }
procedure TfrmActivity.FormCreate(Sender: TObject);
begin
  // TODO: load all projects
  // TODO: pre-load all project phases?
  cbxPhase.ItemIndex := 0;

  actAddFile.ShortCut := VK_INSERT;
  actRemoveAttachment.ShortCut := VK_DELETE;
  dtpFromDate.Date := Date;
  dtpFromTime.Time := Now;
  dtpUntilDate.Date := Date;
  dtpUntilDate.Checked := False;
  dtpUntilTime.Time := Now;
................................................................................

  ErrorControl := btnOK;
  if cbxProject.ItemIndex = -1 then begin
    ErrorControl := cbxProject;
    ErrorMsg := 'Please choose a project, or create a new one.';
  end;
  if ErrorMsg <> '' then begin
    MessageBeep(MB_ICONWARNING);
    BalloonHint.Title := 'Cannot save activity';
    BalloonHint.Description := ErrorMsg + sLineBreak;
    BalloonHint.ImageIndex := 2005; // warning
    BalloonHint.Delay := 0;
    BalloonHint.ShowHint(ErrorControl);
    ModalResult := mrNone;
  end else begin
    ModalResult := mrOk;
  end;
end {TfrmActivity.btnOKClick};

{ ---------------------------------------------------------------------------- }
procedure TfrmActivity.btnProjectListClick(Sender: TObject);
begin
  // TODO: dmMain.SelectProject
  if frmProjects.ShowModal = mrOK then begin
    // dmMain.SelectedProject; // TODO
  end;
end {TfrmActivity.btnProjectListClick};

{ ---------------------------------------------------------------------------- }
procedure TfrmActivity.dtpFromDateChange(Sender: TObject);
begin
  UpdateDuration;
end;

Changes to Olam/src/F_Project.dfm.

1
2
3
4
5
6
7
8
9
10
11
12
13
...
852
853
854
855
856
857
858
859
860
861
862
863


864
865
866


867
868
869
870
871
872
873
...
895
896
897
898
899
900
901
902
903
904
905

906
907
908
909
910
911
912
913
914
915
916

917
918
919
920
921
922
923
924
925
926
927
928
929

930
931
932
933
934
935
936
937
938


939
940


941
942
943


944
945
946


947
948
949
950
951
952
953
954
955
956


957
958
959
960
961
962
963
964
965
966
967
968

969
970
971
972
973
974
975
976
977
978
979
980

981
982
983
984
985
986
987
988
989
990
991
992
993

994
995
996
997
998


999
1000
1001


1002
1003
1004
1005
1006
1007
1008
1009
1010
1011

1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023

1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035

1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
....
1080
1081
1082
1083
1084
1085
1086


1087
1088
1089


1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
....
1106
1107
1108
1109
1110
1111
1112


1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124

1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136

1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148

1149
1150
1151
1152
1153


1154
1155
1156
1157


1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169

1170
1171
1172
1173
1174
1175
1176
1177
1178
1179




1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200

1201
1202
1203
1204
1205
1206
1207
object frmProject: TfrmProject
  Left = 0
  Top = 0
  Caption = 'Project'
  ClientHeight = 384
  ClientWidth = 494
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  Icon.Data = {
................................................................................
  OnCreate = FormCreate
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object pnlContents: TPanel
    Left = 0
    Top = 41
    Width = 494
    Height = 343
    Align = alClient
    BevelOuter = bvNone
    TabOrder = 0


    DesignSize = (
      494
      343)


    object lblName: TLabel
      Left = 8
      Top = 8
      Width = 31
      Height = 13
      Caption = '&Name:'
      FocusControl = edtName
................................................................................
      Height = 13
      Caption = 'Contacts:'
      FocusControl = lnkContacts
    end
    object edtName: TEdit
      Left = 104
      Top = 5
      Width = 382
      Height = 21
      Anchors = [akLeft, akTop, akRight]
      TabOrder = 0

    end
    object mmoDescription: TMemo
      Left = 104
      Top = 32
      Width = 382
      Height = 89
      Anchors = [akLeft, akTop, akRight]
      ScrollBars = ssVertical
      TabOrder = 1
      OnKeyDown = mmoDescriptionKeyDown
      OnKeyUp = mmoDescriptionKeyUp

    end
    object edtLead: TButtonedEdit
      Left = 104
      Top = 127
      Width = 382
      Height = 21
      Anchors = [akLeft, akTop, akRight]
      Images = dmMain.imlMain
      LeftButton.ImageIndex = 1787
      RightButton.ImageIndex = 1964
      RightButton.Visible = True
      TabOrder = 2
      OnRightButtonClick = edtLeadRightButtonClick

    end
    object pgcLists: TPageControl
      Left = 8
      Top = 176
      Width = 478
      Height = 159
      ActivePage = tshSubprojecten
      Anchors = [akLeft, akTop, akRight, akBottom]
      Images = dmMain.imlMain


      TabOrder = 4
      OnChange = pgcListsChange


      object tshSubprojecten: TTabSheet
        Caption = '&Subprojects'
        ImageIndex = 125


        DesignSize = (
          470
          130)


        object tvwSubprojects: TTreeView
          Left = 3
          Top = 3
          Width = 343
          Height = 116
          Anchors = [akLeft, akTop, akRight, akBottom]
          Indent = 19
          TabOrder = 0
          OnClick = tvwSubprojectsClick
          OnDblClick = tvwSubprojectsDblClick


        end
        object btnAddProject: TButton
          Left = 352
          Top = 3
          Width = 115
          Height = 22
          Anchors = [akTop, akRight]
          Caption = 'Add project'
          ImageIndex = 126
          Images = dmMain.imlMain
          TabOrder = 1
          OnClick = btnAddProjectClick

        end
        object btnDeleteProject: TButton
          Left = 352
          Top = 60
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Delete project'
          Enabled = False
          ImageIndex = 127
          Images = dmMain.imlMain
          TabOrder = 2

        end
        object btnEditProject: TButton
          Left = 352
          Top = 31
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Edit project'
          Enabled = False
          ImageIndex = 128
          Images = dmMain.imlMain
          TabOrder = 3
          OnClick = btnEditProjectClick

        end
      end
      object tshPhases: TTabSheet
        Caption = '&Phases'
        ImageIndex = 956


        DesignSize = (
          470
          130)


        object btnAddPhase: TButton
          Left = 352
          Top = 3
          Width = 115
          Height = 22
          Anchors = [akTop, akRight]
          Caption = 'Add phase'
          ImageIndex = 957
          Images = dmMain.imlMain
          TabOrder = 0

        end
        object btnEditPhase: TButton
          Left = 352
          Top = 31
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Edit phase'
          Enabled = False
          ImageIndex = 959
          Images = dmMain.imlMain
          TabOrder = 1

        end
        object btnDeletePhase: TButton
          Left = 352
          Top = 60
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Delete phase'
          Enabled = False
          ImageIndex = 958
          Images = dmMain.imlMain
          TabOrder = 2

        end
        object lvwPhases: TListView
          Left = 3
          Top = 3
          Width = 343
          Height = 116
          Anchors = [akLeft, akTop, akRight, akBottom]
          Columns = <
            item
              Caption = 'N'#176
              Width = 100
            end
            item
................................................................................
          TabOrder = 3
          ViewStyle = vsReport
        end
      end
      object tshContacts: TTabSheet
        Caption = '&Contacts'
        ImageIndex = 1970


        DesignSize = (
          470
          130)


        object lvwContacts: TListView
          Left = 3
          Top = 3
          Width = 343
          Height = 116
          Anchors = [akLeft, akTop, akRight, akBottom]
          Columns = <
            item
              Caption = 'Name'
              Width = 150
            end
            item
................................................................................
              Caption = 'Organisation'
              Width = 100
            end>
          ReadOnly = True
          RowSelect = True
          TabOrder = 0
          ViewStyle = vsReport


        end
        object btnAddContact: TButton
          Left = 352
          Top = 3
          Width = 115
          Height = 22
          Anchors = [akTop, akRight]
          Caption = 'Add contact'
          ImageIndex = 1947
          Images = dmMain.imlMain
          TabOrder = 1
          OnClick = btnAddContactClick

        end
        object btnEditContact: TButton
          Left = 352
          Top = 31
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Edit contact'
          Enabled = False
          ImageIndex = 1951
          Images = dmMain.imlMain
          TabOrder = 2

        end
        object btnDeleteContact: TButton
          Left = 352
          Top = 60
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Delete contact'
          Enabled = False
          ImageIndex = 1949
          Images = dmMain.imlMain
          TabOrder = 3

        end
      end
      object tshActivities: TTabSheet
        Caption = '&Activities'
        ImageIndex = 1629


      end
      object tshStats: TTabSheet
        Caption = 'S&tats'
        ImageIndex = 348


      end
    end
    object lnkContacts: TLinkLabel
      Left = 104
      Top = 152
      Width = 382
      Height = 17
      Anchors = [akLeft, akTop, akRight]
      AutoSize = False
      Caption = '(none)'
      TabOrder = 3
      OnLinkClick = lnkContactsLinkClick

    end
  end
  object pnlParent: TPanel
    Left = 0
    Top = 0
    Width = 494
    Height = 41
    Align = alTop
    BevelOuter = bvNone
    TabOrder = 1




    object lblParent: TLabel
      Left = 9
      Top = 11
      Width = 145
      Height = 13
      Caption = 'This project is a subproject of '
      FocusControl = cbxParent
    end
    object cbxParent: TComboBoxEx
      Left = 160
      Top = 8
      Width = 326
      Height = 22
      AutoCompleteOptions = [acoAutoSuggest, acoAutoAppend, acoUpDownKeyDropsList]
      ItemsEx = <
        item
          Caption = '(none)'
          ImageIndex = 500
          SelectedImageIndex = 500
        end>
      Style = csExDropDownList

      TabOrder = 0
      Images = dmMain.imlMain
      DropDownCount = 16
    end
  end
  object mmProject: TMainMenu
    Images = dmMain.imlMain




|
|







 







|
|



>
>

<
<
>
>







 







|



>




|






>




|








>




|
|



>
>


>
>



>
>

<
<
>
>



|
|





>
>


|









>


|









>


|










>





>
>

<
<
>
>

|








>


|









>


|









>




|
|







 







>
>

<
<
>
>



|
|







 







>
>


|









>


|









>


|









>





>
>




>
>





|






>





|




>
>
>
>











|









>







1
2
3
4
5
6
7
8
9
10
11
12
13
...
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866


867
868
869
870
871
872
873
874
875
...
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955


956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017


1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
....
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110


1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
....
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
object frmProject: TfrmProject
  Left = 0
  Top = 0
  Caption = 'Project'
  ClientHeight = 481
  ClientWidth = 591
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  Icon.Data = {
................................................................................
  OnCreate = FormCreate
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object pnlContents: TPanel
    Left = 0
    Top = 41
    Width = 591
    Height = 440
    Align = alClient
    BevelOuter = bvNone
    TabOrder = 0
    ExplicitWidth = 494
    ExplicitHeight = 343
    DesignSize = (


      591
      440)
    object lblName: TLabel
      Left = 8
      Top = 8
      Width = 31
      Height = 13
      Caption = '&Name:'
      FocusControl = edtName
................................................................................
      Height = 13
      Caption = 'Contacts:'
      FocusControl = lnkContacts
    end
    object edtName: TEdit
      Left = 104
      Top = 5
      Width = 479
      Height = 21
      Anchors = [akLeft, akTop, akRight]
      TabOrder = 0
      ExplicitWidth = 382
    end
    object mmoDescription: TMemo
      Left = 104
      Top = 32
      Width = 479
      Height = 89
      Anchors = [akLeft, akTop, akRight]
      ScrollBars = ssVertical
      TabOrder = 1
      OnKeyDown = mmoDescriptionKeyDown
      OnKeyUp = mmoDescriptionKeyUp
      ExplicitWidth = 382
    end
    object edtLead: TButtonedEdit
      Left = 104
      Top = 127
      Width = 479
      Height = 21
      Anchors = [akLeft, akTop, akRight]
      Images = dmMain.imlMain
      LeftButton.ImageIndex = 1787
      RightButton.ImageIndex = 1964
      RightButton.Visible = True
      TabOrder = 2
      OnRightButtonClick = edtLeadRightButtonClick
      ExplicitWidth = 382
    end
    object pgcLists: TPageControl
      Left = 8
      Top = 176
      Width = 575
      Height = 256
      ActivePage = tshSubprojecten
      Anchors = [akLeft, akTop, akRight, akBottom]
      Images = dmMain.imlMain
      MultiLine = True
      TabHeight = 28
      TabOrder = 4
      OnChange = pgcListsChange
      ExplicitWidth = 478
      ExplicitHeight = 159
      object tshSubprojecten: TTabSheet
        Caption = '&Subprojects'
        ImageIndex = 125
        ExplicitWidth = 470
        ExplicitHeight = 121
        DesignSize = (


          567
          218)
        object tvwSubprojects: TTreeView
          Left = 3
          Top = 3
          Width = 440
          Height = 204
          Anchors = [akLeft, akTop, akRight, akBottom]
          Indent = 19
          TabOrder = 0
          OnClick = tvwSubprojectsClick
          OnDblClick = tvwSubprojectsDblClick
          ExplicitWidth = 343
          ExplicitHeight = 107
        end
        object btnAddProject: TButton
          Left = 449
          Top = 3
          Width = 115
          Height = 22
          Anchors = [akTop, akRight]
          Caption = 'Add project'
          ImageIndex = 126
          Images = dmMain.imlMain
          TabOrder = 1
          OnClick = btnAddProjectClick
          ExplicitLeft = 352
        end
        object btnDeleteProject: TButton
          Left = 449
          Top = 60
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Delete project'
          Enabled = False
          ImageIndex = 127
          Images = dmMain.imlMain
          TabOrder = 2
          ExplicitLeft = 352
        end
        object btnEditProject: TButton
          Left = 449
          Top = 31
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Edit project'
          Enabled = False
          ImageIndex = 128
          Images = dmMain.imlMain
          TabOrder = 3
          OnClick = btnEditProjectClick
          ExplicitLeft = 352
        end
      end
      object tshPhases: TTabSheet
        Caption = '&Phases'
        ImageIndex = 956
        ExplicitWidth = 470
        ExplicitHeight = 121
        DesignSize = (


          567
          218)
        object btnAddPhase: TButton
          Left = 449
          Top = 3
          Width = 115
          Height = 22
          Anchors = [akTop, akRight]
          Caption = 'Add phase'
          ImageIndex = 957
          Images = dmMain.imlMain
          TabOrder = 0
          ExplicitLeft = 352
        end
        object btnEditPhase: TButton
          Left = 449
          Top = 31
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Edit phase'
          Enabled = False
          ImageIndex = 959
          Images = dmMain.imlMain
          TabOrder = 1
          ExplicitLeft = 352
        end
        object btnDeletePhase: TButton
          Left = 449
          Top = 60
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Delete phase'
          Enabled = False
          ImageIndex = 958
          Images = dmMain.imlMain
          TabOrder = 2
          ExplicitLeft = 352
        end
        object lvwPhases: TListView
          Left = 3
          Top = 3
          Width = 440
          Height = 204
          Anchors = [akLeft, akTop, akRight, akBottom]
          Columns = <
            item
              Caption = 'N'#176
              Width = 100
            end
            item
................................................................................
          TabOrder = 3
          ViewStyle = vsReport
        end
      end
      object tshContacts: TTabSheet
        Caption = '&Contacts'
        ImageIndex = 1970
        ExplicitWidth = 470
        ExplicitHeight = 121
        DesignSize = (


          567
          218)
        object lvwContacts: TListView
          Left = 3
          Top = 3
          Width = 440
          Height = 204
          Anchors = [akLeft, akTop, akRight, akBottom]
          Columns = <
            item
              Caption = 'Name'
              Width = 150
            end
            item
................................................................................
              Caption = 'Organisation'
              Width = 100
            end>
          ReadOnly = True
          RowSelect = True
          TabOrder = 0
          ViewStyle = vsReport
          ExplicitWidth = 343
          ExplicitHeight = 116
        end
        object btnAddContact: TButton
          Left = 449
          Top = 3
          Width = 115
          Height = 22
          Anchors = [akTop, akRight]
          Caption = 'Add contact'
          ImageIndex = 1947
          Images = dmMain.imlMain
          TabOrder = 1
          OnClick = btnAddContactClick
          ExplicitLeft = 352
        end
        object btnEditContact: TButton
          Left = 449
          Top = 31
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Edit contact'
          Enabled = False
          ImageIndex = 1951
          Images = dmMain.imlMain
          TabOrder = 2
          ExplicitLeft = 352
        end
        object btnDeleteContact: TButton
          Left = 449
          Top = 60
          Width = 115
          Height = 23
          Anchors = [akTop, akRight]
          Caption = 'Delete contact'
          Enabled = False
          ImageIndex = 1949
          Images = dmMain.imlMain
          TabOrder = 3
          ExplicitLeft = 352
        end
      end
      object tshActivities: TTabSheet
        Caption = '&Activities'
        ImageIndex = 1629
        ExplicitWidth = 470
        ExplicitHeight = 121
      end
      object tshStats: TTabSheet
        Caption = 'S&tats'
        ImageIndex = 348
        ExplicitWidth = 470
        ExplicitHeight = 121
      end
    end
    object lnkContacts: TLinkLabel
      Left = 104
      Top = 152
      Width = 479
      Height = 17
      Anchors = [akLeft, akTop, akRight]
      AutoSize = False
      Caption = '(none)'
      TabOrder = 3
      OnLinkClick = lnkContactsLinkClick
      ExplicitWidth = 382
    end
  end
  object pnlParent: TPanel
    Left = 0
    Top = 0
    Width = 591
    Height = 41
    Align = alTop
    BevelOuter = bvNone
    TabOrder = 1
    ExplicitWidth = 494
    DesignSize = (
      591
      41)
    object lblParent: TLabel
      Left = 9
      Top = 11
      Width = 145
      Height = 13
      Caption = 'This project is a subproject of '
      FocusControl = cbxParent
    end
    object cbxParent: TComboBoxEx
      Left = 160
      Top = 8
      Width = 423
      Height = 22
      AutoCompleteOptions = [acoAutoSuggest, acoAutoAppend, acoUpDownKeyDropsList]
      ItemsEx = <
        item
          Caption = '(none)'
          ImageIndex = 500
          SelectedImageIndex = 500
        end>
      Style = csExDropDownList
      Anchors = [akLeft, akTop, akRight]
      TabOrder = 0
      Images = dmMain.imlMain
      DropDownCount = 16
    end
  end
  object mmProject: TMainMenu
    Images = dmMain.imlMain

Changes to Olam/src/F_Project.pas.

84
85
86
87
88
89
90

91
92
93
94
95
96
97
  mi: TMenuItem;
  i: Integer;
  Page: TTabSheet;
begin
  cbxParent.ItemIndex := 0;
  pnlParent.Visible := False;


  for i := 0 to pgcLists.PageCount - 1 do begin
    mi := TMenuItem.Create(mnuView);
    Page := pgcLists.Pages[i];
    mi.Caption := Page.Caption;
    mi.ImageIndex := Page.ImageIndex;
    mi.Hint := Page.Hint;
    mi.Tag := Page.TabIndex;







>







84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
  mi: TMenuItem;
  i: Integer;
  Page: TTabSheet;
begin
  cbxParent.ItemIndex := 0;
  pnlParent.Visible := False;

  pgcLists.ActivePageIndex := 0;
  for i := 0 to pgcLists.PageCount - 1 do begin
    mi := TMenuItem.Create(mnuView);
    Page := pgcLists.Pages[i];
    mi.Caption := Page.Caption;
    mi.ImageIndex := Page.ImageIndex;
    mi.Hint := Page.Hint;
    mi.Tag := Page.TabIndex;

Changes to Olam/src/F_Projects.dfm.

929
930
931
932
933
934
935

936
937
938
939
940
941
942
943
944

945
946
947
948
  end
  object btnActivities: TButton
    Left = 512
    Top = 183
    Width = 114
    Height = 33
    Action = dmMain.actProjectViewActivities

    Images = dmMain.imlMain
    TabOrder = 5
  end
  object btnReports: TButton
    Left = 512
    Top = 222
    Width = 114
    Height = 33
    Action = dmMain.actProjectViewReports

    Images = dmMain.imlMain
    TabOrder = 6
  end
end







>









>




929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
  end
  object btnActivities: TButton
    Left = 512
    Top = 183
    Width = 114
    Height = 33
    Action = dmMain.actProjectViewActivities
    Anchors = [akTop, akRight]
    Images = dmMain.imlMain
    TabOrder = 5
  end
  object btnReports: TButton
    Left = 512
    Top = 222
    Width = 114
    Height = 33
    Action = dmMain.actProjectViewReports
    Anchors = [akTop, akRight]
    Images = dmMain.imlMain
    TabOrder = 6
  end
end

Changes to Olam/src/M_Main.dfm.

1
2
3
4
5
6
7
8
9
10
11
.....
68542
68543
68544
68545
68546
68547
68548

68549
68550
68551
68552
68553
68554
68555
object dmMain: TdmMain
  OldCreateOrder = False
  Height = 150
  Width = 215
  object imlMain: TImageList
    ColorDepth = cd32Bit
    Left = 8
    Top = 8
    Bitmap = {
      494C01011A082808240010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
      0000000000003600000028000000400000007020000001002000000000000070
................................................................................
      Caption = 'Delete project'
      ImageIndex = 127
    end
    object actActivityAdd: TAction
      Category = 'Activity'
      Caption = 'Add activity'
      ImageIndex = 1630

    end
    object actActivityEdit: TAction
      Category = 'Activity'
      Caption = 'Edit activity'
      ImageIndex = 1634
    end
    object actActivityDelete: TAction


|
|







 







>







1
2
3
4
5
6
7
8
9
10
11
.....
68542
68543
68544
68545
68546
68547
68548
68549
68550
68551
68552
68553
68554
68555
68556
object dmMain: TdmMain
  OldCreateOrder = False
  Height = 352
  Width = 401
  object imlMain: TImageList
    ColorDepth = cd32Bit
    Left = 8
    Top = 8
    Bitmap = {
      494C01011A082808240010001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
      0000000000003600000028000000400000007020000001002000000000000070
................................................................................
      Caption = 'Delete project'
      ImageIndex = 127
    end
    object actActivityAdd: TAction
      Category = 'Activity'
      Caption = 'Add activity'
      ImageIndex = 1630
      OnExecute = actActivityAddExecute
    end
    object actActivityEdit: TAction
      Category = 'Activity'
      Caption = 'Edit activity'
      ImageIndex = 1634
    end
    object actActivityDelete: TAction

Changes to Olam/src/M_Main.pas.

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
...
111
112
113
114
115
116
117
118
































119
    actProjectViewActivities: TAction;
    dlgOpenFile: TFileOpenDialog;
    imlFileTypes: TImageList;
    procedure actProjectAddExecute(Sender: TObject);
    procedure dlgOpenPictureTypeChange(Sender: TObject);
    procedure actProjectViewActivitiesExecute(Sender: TObject);
    procedure actProjectAddActivityExecute(Sender: TObject);

  private
    { Private declarations }
    FProject: TObject;  // TODO: actual project object
    FImageTypes: TStringList;
  public
    { Public declarations }
    function ImageIndexOfFileType(const FileType: string): Integer;





    property SelectedProject: TObject read FProject write FProject;
  end;

var
  dmMain: TdmMain;

implementation
uses
  Vcl.Forms, Vcl.Graphics,
  FileIcon,
  F_Project, F_Activities, F_Activity;

{%CLASSGROUP 'Vcl.Controls.TControl'}

{$R *.dfm}







{ ---------------------------------------------------------------------------- }
procedure TdmMain.actProjectAddActivityExecute(Sender: TObject);
begin
  // TODO: Prefill the selected project
  TfrmActivity.Create(Application).ShowModal;
end {TdmMain.actProjectAddActivityExecute};
................................................................................
      Result := imlFileTypes.AddIcon(Icon);
      FImageTypes.AddObject(Ext, TObject(Result));
    finally
      Icon.Free;
    end;
  end;
end {TdmMain.ImageIndexOfFileType};

































end.







>








>
>
>
>










|




>
>
>
>
>
>







 








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

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
...
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
    actProjectViewActivities: TAction;
    dlgOpenFile: TFileOpenDialog;
    imlFileTypes: TImageList;
    procedure actProjectAddExecute(Sender: TObject);
    procedure dlgOpenPictureTypeChange(Sender: TObject);
    procedure actProjectViewActivitiesExecute(Sender: TObject);
    procedure actProjectAddActivityExecute(Sender: TObject);
    procedure actActivityAddExecute(Sender: TObject);
  private
    { Private declarations }
    FProject: TObject;  // TODO: actual project object
    FImageTypes: TStringList;
  public
    { Public declarations }
    function ImageIndexOfFileType(const FileType: string): Integer;

    function SelectProject: TObject; // TODO: TOlamProject
    function SelectPhase(const Project: TObject = nil): TObject;    //  TODO: TOlamPhase
    function SelectContact(const Project: TObject = nil): TObject;  //  TODO: TOlamContact

    property SelectedProject: TObject read FProject write FProject;
  end;

var
  dmMain: TdmMain;

implementation
uses
  Vcl.Forms, Vcl.Graphics,
  FileIcon,
  F_Project, F_Activities, F_Activity, F_Projects;

{%CLASSGROUP 'Vcl.Controls.TControl'}

{$R *.dfm}

{ ---------------------------------------------------------------------------- }
procedure TdmMain.actActivityAddExecute(Sender: TObject);
begin
  TfrmActivity.Create(Application).ShowModal;
end;

{ ---------------------------------------------------------------------------- }
procedure TdmMain.actProjectAddActivityExecute(Sender: TObject);
begin
  // TODO: Prefill the selected project
  TfrmActivity.Create(Application).ShowModal;
end {TdmMain.actProjectAddActivityExecute};
................................................................................
      Result := imlFileTypes.AddIcon(Icon);
      FImageTypes.AddObject(Ext, TObject(Result));
    finally
      Icon.Free;
    end;
  end;
end {TdmMain.ImageIndexOfFileType};

{ ---------------------------------------------------------------------------- }
function TdmMain.SelectContact(const Project: TObject): TObject;
begin
  // TODO
end;

{ ---------------------------------------------------------------------------- }
function TdmMain.SelectPhase(const Project: TObject): TObject;
begin
  // TODO
end;

{ ---------------------------------------------------------------------------- }
function TdmMain.SelectProject: TObject;
var
  Form: TfrmProjects;
begin
  Result := nil;
  Form := TfrmProjects.Create(Application);
  try
    Form.btnAddActivity.Visible := False;
    Form.btnActivities.Visible := False;
    Form.btnReports.Visible := False;

    if Form.ShowModal = mrOK then begin
      // TODO: pick up the selected project
    end;
  finally
    Form.Free;
  end;
end;

end.

Changes to Olam/src/Olam.dpr.

7
8
9
10
11
12
13
14
15
16
17
18
  F_Activities {frmActivities};

{$R *.res}

begin
  Application.Initialize;
//  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TfrmProjects, frmProjects);
  Application.CreateForm(TdmMain, dmMain);
  Application.CreateForm(TfrmActivities, frmActivities);
  Application.Run;
end.







|

|


7
8
9
10
11
12
13
14
15
16
17
18
  F_Activities {frmActivities};

{$R *.res}

begin
  Application.Initialize;
//  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TfrmActivities, frmActivities);
  Application.CreateForm(TdmMain, dmMain);
  Application.CreateForm(TfrmProjects, frmProjects);
  Application.Run;
end.