home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / full / delphi / RUNIMAGE / DELPHI30 / SOURCE / SAMPLES / IBEVNTS.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-08-04  |  2.0 KB  |  79 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. procedure TIBEAEventsEditor.FormCreate(Sender: TObject);
  71. var
  72.   i: integer;
  73. begin
  74.   for i := 1 to MaxEvents do
  75.     cEvents.Cells[0, i-1] := IntToStr( i);
  76. end;
  77.  
  78. end.
  79.