ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/DBAdmin/dlg/ShutdownRegDlgUnit.pas
Revision: 209
Committed: Wed Mar 14 12:48:51 2018 UTC (6 years, 1 month ago) by tony
Content type: text/x-pascal
File size: 1954 byte(s)
Log Message:
Fixes Merged

File Contents

# User Rev Content
1 tony 158 (*
2     * ShutdownRegDlgUnit.pas
3     * Copyright (C) 2018 Tony Whyman <tony@mwasoftware.co.uk>
4     *
5     * DBAdmin is free software: you can redistribute it and/or modify it
6     * under the terms of the GNU General Public License as published by the
7     * Free Software Foundation, either version 3 of the License, or
8     * (at your option) any later version.
9     *
10     * DBAdmin is distributed in the hope that it will be useful, but
11     * WITHOUT ANY WARRANTY; without even the implied warranty of
12     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13     * See the GNU General Public License for more details.
14     *
15     * You should have received a copy of the GNU General Public License along
16     * with this program. If not, see <http://www.gnu.org/licenses/>.
17     *)
18     unit ShutdownRegDlgUnit;
19    
20     {$mode objfpc}{$H+}
21    
22     interface
23    
24     uses
25     Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
26 tony 209 StdCtrls, IBXServices;
27 tony 158
28     type
29    
30     { TShutdownReqDlg }
31    
32     TShutdownReqDlg = class(TForm)
33     Bevel1: TBevel;
34     CancelBtn: TButton;
35     DatabaseName: TEdit;
36     Delay: TEdit;
37     Label1: TLabel;
38     Label2: TLabel;
39     Label3: TLabel;
40     OKBtn: TButton;
41     ShutdownOptions: TRadioGroup;
42     procedure FormShow(Sender: TObject);
43     private
44    
45     public
46 tony 209 function ShowModal(const aDatabaseName: string; var aShutDownmode: TDBShutdownMode;
47 tony 158 var aDelay: integer): TModalResult;
48     end;
49    
50     var
51     ShutdownReqDlg: TShutdownReqDlg;
52    
53     implementation
54    
55     {$R *.lfm}
56    
57     { TShutdownReqDlg }
58    
59     procedure TShutdownReqDlg.FormShow(Sender: TObject);
60     begin
61     Delay.Text := '60';
62     end;
63    
64     function TShutdownReqDlg.ShowModal(const aDatabaseName: string;
65 tony 209 var aShutDownmode: TDBShutdownMode; var aDelay: integer): TModalResult;
66 tony 158 begin
67     ShutdownOptions.ItemIndex := ord(aShutDownmode);
68     DatabaseName.Text := aDatabaseName;
69     Result := inherited ShowModal;
70     if Result = mrOK then
71     begin
72     aDelay := StrToInt(Delay.Text);
73 tony 209 aShutDownmode := TDBShutdownMode(ShutdownOptions.ItemIndex);
74 tony 158 end;
75     end;
76    
77     end.
78