-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from cybertec-postgresql/30-pop-up-editor-for-…
…cron-values [+] implement pop-up editor for chain Cron values, closes #30
- Loading branch information
Showing
12 changed files
with
474 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
object BaseFrame: TBaseFrame | ||
Left = 0 | ||
Height = 360 | ||
Top = 0 | ||
Width = 480 | ||
ClientHeight = 360 | ||
ClientWidth = 480 | ||
DesignTimePPI = 144 | ||
LCLVersion = '2.2.4.0' | ||
OnExit = FrameExit | ||
ParentFont = False | ||
TabOrder = 0 | ||
DesignLeft = 2785 | ||
DesignTop = 1022 | ||
object pnlButtons: TPanel | ||
Left = 0 | ||
Height = 56 | ||
Top = 304 | ||
Width = 480 | ||
Align = alBottom | ||
ClientHeight = 56 | ||
ClientWidth = 480 | ||
TabOrder = 0 | ||
object btnOK: TButton | ||
Left = 344 | ||
Height = 38 | ||
Top = 8 | ||
Width = 113 | ||
Caption = 'OK' | ||
OnClick = btnOKClick | ||
TabOrder = 0 | ||
end | ||
object btnCancel: TButton | ||
Left = 16 | ||
Height = 38 | ||
Top = 8 | ||
Width = 113 | ||
Caption = 'Cancel' | ||
OnExit = FrameExit | ||
TabOrder = 1 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
unit framebase; | ||
|
||
{$mode ObjFPC}{$H+} | ||
|
||
interface | ||
|
||
uses | ||
Classes, SysUtils, Forms, Controls, ExtCtrls, StdCtrls, SynEdit, | ||
SynHighlighterSQL, ComCtrls, LCLType, Db; | ||
|
||
type | ||
|
||
{ TBaseFrame } | ||
|
||
TBaseFrame = class(TFrame) | ||
btnOK: TButton; | ||
btnCancel: TButton; | ||
pnlButtons: TPanel; | ||
procedure btnOKClick(Sender: TObject); | ||
procedure FrameExit(Sender: TObject); | ||
protected | ||
fldCommand: TField; | ||
function GetEditorValue(): string; virtual; abstract; | ||
procedure SetEditorValue(AText: string); virtual; abstract; | ||
public | ||
procedure ShowEditor(AField: TField; ATopLeft: TPoint); | ||
procedure HideEditor(); | ||
procedure ApplyChanges(); | ||
end; | ||
|
||
implementation | ||
|
||
{$R *.lfm} | ||
|
||
{ TBaseFrame } | ||
|
||
procedure TBaseFrame.FrameExit(Sender: TObject); | ||
begin | ||
HideEditor(); | ||
end; | ||
|
||
procedure TBaseFrame.btnOKClick(Sender: TObject); | ||
begin | ||
ApplyChanges(); | ||
end; | ||
|
||
procedure TBaseFrame.ShowEditor(AField: TField; ATopLeft: TPoint); | ||
begin | ||
SetEditorValue(AField.AsString); | ||
fldCommand := AField; | ||
Left := ATopLeft.X; | ||
Top := ATopLeft.Y; | ||
Show(); | ||
SetFocus(); | ||
end; | ||
|
||
procedure TBaseFrame.HideEditor; | ||
begin | ||
Hide(); | ||
Parent.SetFocus(); | ||
end; | ||
|
||
procedure TBaseFrame.ApplyChanges; | ||
begin | ||
fldCommand.DataSet.Edit; | ||
fldCommand.AsString := GetEditorValue(); | ||
HideEditor(); | ||
end; | ||
|
||
end. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
inherited frmCronEditor: TfrmCronEditor | ||
Width = 472 | ||
ClientWidth = 472 | ||
inherited pnlButtons: TPanel | ||
Width = 472 | ||
ClientWidth = 472 | ||
inherited btnCancel: TButton | ||
OnClick = FrameExit | ||
OnExit = nil | ||
end | ||
end | ||
object pnlEditor: TPanel[1] | ||
Left = 0 | ||
Height = 304 | ||
Top = 0 | ||
Width = 472 | ||
Align = alClient | ||
ClientHeight = 304 | ||
ClientWidth = 472 | ||
TabOrder = 1 | ||
object edCron: TEdit | ||
Left = 48 | ||
Height = 35 | ||
Top = 41 | ||
Width = 375 | ||
Alignment = taCenter | ||
Font.Height = -24 | ||
Font.Name = 'Courier New' | ||
Font.Pitch = fpFixed | ||
OnChange = edCronChange | ||
ParentFont = False | ||
TabOrder = 0 | ||
Text = '* * * * *' | ||
end | ||
object mmRuns: TMemo | ||
Left = 48 | ||
Height = 180 | ||
Top = 112 | ||
Width = 375 | ||
Color = clInfoBk | ||
Lines.Strings = ( | ||
'mmRuns' | ||
) | ||
TabOrder = 1 | ||
end | ||
object lblNextRuns: TLabel | ||
Left = 26 | ||
Height = 25 | ||
Top = 80 | ||
Width = 79 | ||
Caption = 'Next runs:' | ||
ParentColor = False | ||
end | ||
object lblDayMonth: TLabel | ||
Left = 198 | ||
Height = 25 | ||
Top = 16 | ||
Width = 75 | ||
Alignment = taCenter | ||
AutoSize = False | ||
Caption = 'Day' | ||
ParentColor = False | ||
end | ||
object lblMonth: TLabel | ||
Left = 273 | ||
Height = 25 | ||
Top = 16 | ||
Width = 75 | ||
Alignment = taCenter | ||
AutoSize = False | ||
Caption = 'Month' | ||
ParentColor = False | ||
end | ||
object lblWeekday: TLabel | ||
Left = 348 | ||
Height = 25 | ||
Top = 16 | ||
Width = 75 | ||
Alignment = taCenter | ||
AutoSize = False | ||
Caption = 'Week' | ||
ParentColor = False | ||
end | ||
object lblHour: TLabel | ||
Left = 123 | ||
Height = 25 | ||
Top = 16 | ||
Width = 75 | ||
Alignment = taCenter | ||
AutoSize = False | ||
Caption = 'Hour' | ||
ParentColor = False | ||
end | ||
object lblMinute: TLabel | ||
Left = 48 | ||
Height = 25 | ||
Top = 17 | ||
Width = 75 | ||
Alignment = taCenter | ||
AutoSize = False | ||
Caption = 'Minute' | ||
ParentColor = False | ||
end | ||
end | ||
object timerChange: TTimer[2] | ||
Enabled = False | ||
OnTimer = timerChangeTimer | ||
Left = 416 | ||
Top = 88 | ||
end | ||
end |
Oops, something went wrong.