Skip to content

Commit 125b2e6

Browse files
authored
Merge pull request #50 from cybertec-postgresql/29-implement-pop-up-editor-for-task-command
[+] implement pop-up editor for task command, resolves #29
2 parents 8bcb57e + c60af52 commit 125b2e6

File tree

9 files changed

+668
-22
lines changed

9 files changed

+668
-22
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: gcarreno/setup-lazarus@v3.2
2020
with:
2121
lazarus-version: ${{ matrix.lazarus-versions }}
22-
# include-packages: "Synapse 40.1"
22+
with-cache: false
2323

2424
- name: Build the application
2525
if: ${{ matrix.operating-system != 'macos-latest' }}

.github/workflows/daily-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: gcarreno/setup-lazarus@v3.2
2828
with:
2929
lazarus-version: ${{ matrix.lazarus-versions }}
30-
# include-packages: "Synapse 40.1"
30+
with-cache: false
3131

3232
- name: Build the application
3333
if: ${{ matrix.operating-system != 'macos-latest' }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: gcarreno/setup-lazarus@v3.2
2121
with:
2222
lazarus-version: ${{ matrix.lazarus-versions }}
23-
# include-packages: "Synapse 40.1"
23+
with-cache: false
2424

2525
- name: Build the application
2626
if: ${{ matrix.operating-system != 'macos-latest' }}

forms/fmmain.lfm

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object fmMain: TfmMain
99
DesignTimePPI = 144
1010
Menu = menuMain
1111
OnCloseQuery = FormCloseQuery
12-
LCLVersion = '2.2.0.4'
12+
LCLVersion = '2.2.4.0'
1313
object pcEditors: TPageControl
1414
Left = 0
1515
Height = 1024
@@ -82,8 +82,6 @@ object fmMain: TfmMain
8282
FieldName = 'live'
8383
end
8484
item
85-
MinSize = 10
86-
MaxSize = 200
8785
PickList.Strings = (
8886
'* * * * *'
8987
'@every <interval>'
@@ -96,43 +94,33 @@ object fmMain: TfmMain
9694
FieldName = 'run_at'
9795
end
9896
item
99-
MinSize = 10
100-
MaxSize = 200
10197
Title.Alignment = taCenter
10298
Title.Caption = 'Client'
10399
Width = 264
104100
FieldName = 'client_name'
105101
end
106102
item
107-
MinSize = 10
108-
MaxSize = 200
109103
SizePriority = 0
110104
Title.Alignment = taCenter
111105
Title.Caption = 'Exclusive'
112106
Width = 150
113107
FieldName = 'exclusive_execution'
114108
end
115109
item
116-
MinSize = 10
117-
MaxSize = 200
118110
SizePriority = 0
119111
Title.Alignment = taCenter
120112
Title.Caption = 'Self Destruct'
121113
Width = 150
122114
FieldName = 'self_destruct'
123115
end
124116
item
125-
MinSize = 10
126-
MaxSize = 200
127117
SizePriority = 0
128118
Title.Alignment = taCenter
129119
Title.Caption = 'Max Instances'
130120
Width = 150
131121
FieldName = 'max_instances'
132122
end
133123
item
134-
MinSize = 10
135-
MaxSize = 200
136124
SizePriority = 0
137125
Title.Alignment = taCenter
138126
Title.Caption = 'Timeout (ms)'
@@ -281,8 +269,6 @@ object fmMain: TfmMain
281269
Color = clWindow
282270
Columns = <
283271
item
284-
MinSize = 10
285-
MaxSize = 200
286272
Title.Caption = 'Task Name'
287273
Width = 339
288274
FieldName = 'task_name'
@@ -361,6 +347,7 @@ object fmMain: TfmMain
361347
ShowHint = True
362348
TabOrder = 0
363349
OnDrawColumnCell = gridTasksDrawColumnCell
350+
OnEditButtonClick = gridTasksEditButtonClick
364351
OnSelectEditor = gridTasksSelectEditor
365352
end
366353
object toolbarTasks: TToolBar

forms/fmmain.pas

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ interface
66

77
uses
88
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, Menus,
9-
StdCtrls, DBGrids, DBCtrls, ExtCtrls, uObjects, DB, Grids, ActnList, Buttons;
9+
StdCtrls, DBGrids, DBCtrls, ExtCtrls, uObjects, DB, Grids, ActnList, Buttons,
10+
frameTaskCommand;
1011

1112
type
1213

@@ -96,12 +97,14 @@ TfmMain = class(TForm)
9697
procedure gridChainsTitleClick(Column: TColumn);
9798
procedure gridTasksDrawColumnCell(Sender: TObject; const Rect: TRect;
9899
DataCol: integer; Column: TColumn; State: TGridDrawState);
100+
procedure gridTasksEditButtonClick(Sender: TObject);
99101
procedure gridTasksSelectEditor(Sender: TObject; Column: TColumn;
100102
var Editor: TWinControl);
101103
procedure miCloseClick(Sender: TObject);
102104
procedure miLogClick(Sender: TObject);
103105
private
104106
FLastColumn: TColumn; //last sorted grid column
107+
FTaskCmd: TfrmTaskCommand;
105108
public
106109
procedure UpdateSortIndication(ACol: TColumn);
107110
end;
@@ -208,15 +211,27 @@ procedure TfmMain.gridTasksDrawColumnCell(Sender: TObject; const Rect: TRect;
208211
imglGrids.Draw(gridTasks.Canvas, aLeft, aTop, ImgIdx);
209212
end;
210213

214+
procedure TfmMain.gridTasksEditButtonClick(Sender: TObject);
215+
begin
216+
if not Assigned(FTaskCmd) then
217+
begin
218+
FTaskCmd := TfrmTaskCommand.Create(Self);
219+
FTaskCmd.Parent := gridTasks;
220+
end;
221+
FTaskCmd.ShowEditor(gridTasks.SelectedField, gridTasks.SelectedFieldRect.TopLeft);
222+
end;
223+
211224
procedure TfmMain.gridTasksSelectEditor(Sender: TObject; Column: TColumn;
212225
var Editor: TWinControl);
213226
begin
214-
if Column.FieldName = 'kind' then
227+
case Column.FieldName of
228+
'kind':
215229
with Editor as TCustomComboBox do
216230
begin
217231
Style := csDropDownList;
218232
AutoDropDown := True;
219233
end;
234+
end;
220235
end;
221236

222237
procedure TfmMain.miCloseClick(Sender: TObject);

0 commit comments

Comments
 (0)