home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / Chip_2002-05_cd1.bin / chplus / cpp / 5 / Komponety.exe / ibevnts.cpp < prev    next >
C/C++ Source or Header  |  1998-02-09  |  2KB  |  46 lines

  1. //---------------------------------------------------------------------------
  2. // Borland C++Builder
  3. // Copyright (c) 1987, 1998 Borland International Inc.  All Rights Reserved.
  4. //---------------------------------------------------------------------------
  5. // ibevnts.cpp
  6. // This file is #included in IBREG.CPP which #includes IBREG.H which
  7. // in turn #includes INEVNTS.H.  Hence #including IBEVNTS.H here is redundant with
  8. // no ramifications (there are sentries in the header file) but has been done
  9. // just to clarify that the function and class implementations in this file are
  10. // prototyped in INEVNTS.H
  11. #include <memory>     //for STL auto_ptr
  12. #include  "ibevnts.h"
  13.  
  14. #pragma resource "*.dfm"
  15. #pragma package(smart_init)
  16.  
  17. bool __fastcall Ibevnts::EditAlerterEvents(Classes::TStrings *Events)
  18. {
  19.   bool result = false;
  20.   std::auto_ptr<TIBEAEventsEditor> EEditor(new TIBEAEventsEditor(Application));
  21.   for(int i=0; i < Events->Count ;i++) //
  22.   {
  23.     EEditor->cEvents->Cells[1][i] = Events->Strings[i];
  24.   }
  25.   if( EEditor->ShowModal() == IDOK )
  26.   {
  27.     result = true;
  28.     Events->Clear();
  29.     for(int i=0; i < MaxEvents ;i++)
  30.     {
  31.       if ((EEditor->cEvents->Cells[1][i].Length()) != 0)
  32.         Events->Add( EEditor->cEvents->Cells[1][i]);
  33.     }
  34.   }
  35.   return result;
  36. }
  37.  
  38. void __fastcall TIBEAEventsEditor::FormCreate(TObject *Sender)
  39. {
  40.   for(int i=1; i < MaxEvents; i++ ) 
  41.       cEvents->Cells[0][i-1] = AnsiString(i);
  42.   RequestedEvents->Caption = LoadStr(57810);
  43.   bOK->Caption = LoadStr(57811);
  44.   bCancel->Caption = LoadStr(57812);
  45. }
  46.