ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/services/ShutdownRegDlgUnit.pas
Revision: 143
Committed: Fri Feb 23 12:11:21 2018 UTC (6 years, 8 months ago) by tony
Content type: text/x-pascal
File size: 2111 byte(s)
Log Message:
Fixes Merged

File Contents

# User Rev Content
1 tony 143 (*
2     * IBX For Lazarus (Firebird Express)
3     *
4     * The contents of this file are subject to the Initial Developer's
5     * Public License Version 1.0 (the "License"); you may not use this
6     * file except in compliance with the License. You may obtain a copy
7     * of the License here:
8     *
9     * http://www.firebirdsql.org/index.php?op=doc&id=idpl
10     *
11     * Software distributed under the License is distributed on an "AS
12     * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
13     * implied. See the License for the specific language governing rights
14     * and limitations under the License.
15     *
16     * The Initial Developer of the Original Code is Tony Whyman.
17     *
18     * The Original Code is (C) 2015 Tony Whyman, MWA Software
19     * (http://www.mwasoftware.co.uk).
20     *
21     * All Rights Reserved.
22     *
23     * Contributor(s): ______________________________________.
24     *
25     *)
26    
27     unit ShutdownRegDlgUnit;
28    
29     {$mode objfpc}{$H+}
30    
31     interface
32    
33     uses
34     Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
35     StdCtrls, IBServices;
36    
37     type
38    
39     { TShutdownReqDlg }
40    
41     TShutdownReqDlg = class(TForm)
42     Bevel1: TBevel;
43     CancelBtn: TButton;
44     DatabaseName: TEdit;
45     Delay: TEdit;
46     Label1: TLabel;
47     Label2: TLabel;
48     Label3: TLabel;
49     OKBtn: TButton;
50     ShutdownOptions: TRadioGroup;
51     procedure FormShow(Sender: TObject);
52     private
53    
54     public
55     function ShowModal(var aDatabaseName: string; var aShutDownmode: TShutdownMode;
56     var aDelay: integer): TModalResult;
57     end;
58    
59     var
60     ShutdownReqDlg: TShutdownReqDlg;
61    
62     implementation
63    
64     {$R *.lfm}
65    
66     { TShutdownReqDlg }
67    
68     procedure TShutdownReqDlg.FormShow(Sender: TObject);
69     begin
70     Delay.Text := '60';
71     end;
72    
73     function TShutdownReqDlg.ShowModal(var aDatabaseName: string;
74     var aShutDownmode: TShutdownMode; var aDelay: integer): TModalResult;
75     begin
76     ShutdownOptions.ItemIndex := ord(aShutDownmode);
77     DatabaseName.Text := aDatabaseName;
78     Result := inherited ShowModal;
79     if Result = mrOK then
80     begin
81     aDelay := StrToInt(Delay.Text);
82     aShutDownmode := TShutdownMode(ShutdownOptions.ItemIndex);
83     aDatabaseName := DatabaseName.Text;
84     end;
85     end;
86    
87     end.
88