home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 February / DPPCPRO0299.ISO / February / Delphi / Install / DATA.Z / IBREG.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-06-11  |  1.7 KB  |  61 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 IBReg;
  15.  
  16. interface
  17.  
  18. procedure Register;
  19.  
  20. implementation
  21.  
  22. uses SysUtils, DsgnIntf, IBEvnts, IBCtrls, Classes, DB, LibConst;
  23.  
  24. { EventAlerter Events property Editor }
  25.  
  26. type
  27.   TIBEventListProperty = class(TClassProperty)
  28.   public
  29.     function GetAttributes: TPropertyAttributes; override;
  30.     procedure Edit; override;
  31.   end;
  32.  
  33. function TIBEventListProperty.GetAttributes: TPropertyAttributes;
  34. begin
  35.   Result := inherited GetAttributes + [paDialog] - [paSubProperties];
  36. end;
  37.  
  38. procedure TIBEventListProperty.Edit;
  39. var
  40.   Events: TStrings;
  41. begin
  42.   Events := TStringList.Create;
  43.   try
  44.     Events.Assign( TStrings(GetOrdValue));
  45.     if EditAlerterEvents( Events) then SetOrdValue( longint(Events));
  46.   finally
  47.     Events.Free;
  48.   end;
  49. end;
  50.  
  51. { IBDatabase component editor }
  52.  
  53.  
  54. procedure Register;
  55. begin
  56.   RegisterComponents(LoadStr(srSamples), [TIBEventAlerter]);
  57.   RegisterPropertyEditor(TypeInfo(TStrings), TIBEventAlerter, 'Events', TIBEventListProperty);
  58. end;
  59.  
  60. end.
  61.