home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 February / DPPCPRO0299.ISO / February / Delphi / Install / DATA.Z / IBEVNTS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-06-11  |  2.1 KB  |  84 lines

  1. {********************************************************}
  2. {                                                        }
  3. {       InterBase EventAlerter components                }
  4. {       Copyright (c) 1995 Borland International         }
  5. {                                                        }
  6. {       Written by:                                      }
  7. {         James Thorpe                                   }
  8. {         CSA Australasia                                }
  9. {         Compuserve: 100035,2064                        }
  10. {         Internet:   csa@csaa.com.au                    }
  11. {                                                        }
  12. {********************************************************}
  13.  
  14. unit Ibevnts;
  15.  
  16. interface
  17.  
  18. uses
  19.   SysUtils, Windows, Messages, Classes, Graphics, Controls,
  20.   Forms, Dialogs, ExtCtrls, StdCtrls, Grids, IBCtrls;
  21.  
  22. type
  23.   TIBEAEventsEditor = class(TForm)
  24.     Panel1: TPanel;
  25.     Panel2: TPanel;
  26.     cEvents: TStringGrid;
  27.     RequestedEvents: TLabel;
  28.     bOK: TButton;
  29.     bCancel: TButton;
  30.     procedure FormCreate(Sender: TObject);
  31.   private
  32.     { Private declarations }
  33.   public
  34.     { Public declarations }
  35.   end;
  36.  
  37. function EditAlerterEvents( Events: TStrings): Boolean;
  38.  
  39. var
  40.   IBEAEventsEditor: TIBEAEventsEditor;
  41.  
  42. implementation
  43.  
  44. {$R *.DFM}
  45.  
  46. function EditAlerterEvents( Events: TStrings): Boolean;
  47. var
  48.   i: integer;
  49. begin
  50.   result := false;
  51.   with TIBEAEventsEditor.Create(Application) do
  52.   begin
  53.     try
  54.       for i := 0 to Events.Count-1 do
  55.         cEvents.Cells[1, i] := Events[i];
  56.       if ShowModal = idOk then
  57.       begin
  58.         result := true;
  59.         Events.Clear;
  60.         for i := 0 to MaxEvents-1 do
  61.           if length( cEvents.Cells[1, i]) <> 0 then
  62.             Events.Add( cEvents.Cells[1, i]);
  63.       end;
  64.     finally
  65.       Free;
  66.     end;
  67.   end;
  68. end;
  69.  
  70.  
  71. procedure TIBEAEventsEditor.FormCreate(Sender: TObject);
  72. var
  73.   i: integer;
  74. begin
  75.   for i := 1 to MaxEvents do
  76.     cEvents.Cells[0, i-1] := IntToStr( i);
  77.   RequestedEvents.caption := LoadStr(57810);
  78.   bOK.caption := LoadStr(57811);
  79.   bCancel.caption := LoadStr(57812);
  80. end;
  81.  
  82.  
  83. end.
  84.