home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / IBREG.CPP < prev    next >
C/C++ Source or Header  |  1997-01-16  |  1KB  |  45 lines

  1. //---------------------------------------------------------------------------
  2. // Borland C++Builder
  3. // Copyright (c) 1987, 1996 Borland International Inc.  All Rights Reserved.
  4. //---------------------------------------------------------------------------
  5. #pragma hdrstop
  6. #include "ibreg.h"
  7. #include "ibctrls.cpp"
  8. #include "ibevnts.cpp"
  9. #include <dsgnintf.hpp>
  10. #include <memory>       //for STL auto_ptr
  11.  
  12. //#pragma resource "*.res"   //IDE links .res automatically for components
  13.  
  14. __fastcall TIBEventListProperty::TIBEventListProperty(void)
  15.                                 : TClassProperty() { }
  16. __fastcall TIBEventListProperty::~TIBEventListProperty(void){}
  17.  
  18.  TPropertyAttributes __fastcall TIBEventListProperty::GetAttributes()
  19. {
  20.   return  (TClassProperty::GetAttributes() << paDialog ) >> paSubProperties;
  21. }
  22.  
  23. void __fastcall TIBEventListProperty::Edit()
  24. {
  25.   std::auto_ptr<TStringList> Events(new TStringList());
  26.   Events->Assign((TStrings*)GetOrdValue());
  27.   if(Ibevnts::EditAlerterEvents(Events.get()))
  28.     SetOrdValue(long(Events.get()));
  29. }
  30.  
  31. namespace Ibreg
  32. {
  33. void __fastcall Register()
  34. {
  35.   TComponentClass classes[1] = {__classid(TIBEventAlerter)};
  36.   RegisterComponents("Samples", classes, 0);
  37.   RegisterPropertyEditor(__typeinfo(TStrings),
  38.                          __classid(TIBEventAlerter),
  39.                          "Events",
  40.                          __classid(TIBEventListProperty));
  41. }
  42. }       /* namespace Ibreg */
  43.  
  44.  
  45.