1 |
{************************************************************************} |
2 |
{ } |
3 |
{ Borland Delphi Visual Component Library } |
4 |
{ InterBase Express core components } |
5 |
{ } |
6 |
{ Copyright (c) 1998-2000 Inprise Corporation } |
7 |
{ } |
8 |
{ InterBase Express is based in part on the product } |
9 |
{ Free IB Components, written by Gregory H. Deatz for } |
10 |
{ Hoagland, Longo, Moran, Dunst & Doukas Company. } |
11 |
{ Free IB Components is used under license. } |
12 |
{ } |
13 |
{ The contents of this file are subject to the InterBase } |
14 |
{ Public License Version 1.0 (the "License"); you may not } |
15 |
{ use this file except in compliance with the License. You } |
16 |
{ may obtain a copy of the License at http://www.Inprise.com/IPL.html } |
17 |
{ Software distributed under the License is distributed on } |
18 |
{ an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either } |
19 |
{ express or implied. See the License for the specific language } |
20 |
{ governing rights and limitations under the License. } |
21 |
{ The Original Code was created by InterBase Software Corporation } |
22 |
{ and its successors. } |
23 |
{ Portions created by Inprise Corporation are Copyright (C) Inprise } |
24 |
{ Corporation. All Rights Reserved. } |
25 |
{ Contributor(s): Jeff Overcash, James Thorpe } |
26 |
{ } |
27 |
{************************************************************************} |
28 |
|
29 |
unit IBEventsEditor; |
30 |
|
31 |
{$MODE Delphi} |
32 |
|
33 |
interface |
34 |
|
35 |
uses |
36 |
SysUtils, {Windows,} Messages, Classes, Graphics, Controls, |
37 |
Forms, Dialogs, ExtCtrls, StdCtrls, Grids, IBEvents, LResources; |
38 |
|
39 |
type |
40 |
|
41 |
{ TIBEventsEditor } |
42 |
|
43 |
TIBEventsEditor = class(TForm) |
44 |
Panel1: TPanel; |
45 |
Panel2: TPanel; |
46 |
cEvents: TStringGrid; |
47 |
RequestedEvents: TLabel; |
48 |
bOK: TButton; |
49 |
bCancel: TButton; |
50 |
procedure FormCreate(Sender: TObject); |
51 |
private |
52 |
{ Private declarations } |
53 |
public |
54 |
{ Public declarations } |
55 |
end; |
56 |
|
57 |
function EditAlerterEvents( Events: TStrings): Boolean; |
58 |
|
59 |
implementation |
60 |
|
61 |
{$R *.lfm} |
62 |
|
63 |
function EditAlerterEvents( Events: TStrings): Boolean; |
64 |
var |
65 |
i: integer; |
66 |
begin |
67 |
result := false; |
68 |
with TIBEventsEditor.Create(Application) do |
69 |
begin |
70 |
try |
71 |
for i := 0 to Events.Count-1 do |
72 |
cEvents.Cells[1, i] := Events[i]; |
73 |
if ShowModal = mrOk then |
74 |
begin |
75 |
result := true; |
76 |
Events.Clear; |
77 |
for i := 0 to MaxEvents-1 do |
78 |
if length( cEvents.Cells[1, i]) <> 0 then |
79 |
Events.Add( cEvents.Cells[1, i]); |
80 |
end; |
81 |
finally |
82 |
Free; |
83 |
end; |
84 |
end; |
85 |
end; |
86 |
|
87 |
procedure TIBEventsEditor.FormCreate(Sender: TObject); |
88 |
var |
89 |
i: integer; |
90 |
begin |
91 |
for i := 1 to MaxEvents do |
92 |
cEvents.Cells[0, i-1] := IntToStr( i); |
93 |
end; |
94 |
|
95 |
end. |