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

  1. //----------------------------------------------------------------------------
  2. //Borland C++ Builder
  3. //Copyright (c) 1987 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. #include <VCL\vcl.h>
  6. #pragma hdrstop
  7.  
  8. #include <memory>       //for STL auto_ptr class
  9. #include "SaveQAs.h"
  10. #pragma resource "*.DFM"
  11. //---------------------------------------------------------------------------
  12.  
  13. __fastcall TSaveQueryAs::TSaveQueryAs(TComponent* AOwner)
  14.                                 :TForm(AOwner)
  15. {
  16. }
  17. __fastcall TSaveQueryAs::~TSaveQueryAs(void)
  18. {
  19. }
  20. //---------------------------------------------------------------------------
  21.  
  22. bool __fastcall GetNewName(AnsiString& QueryName)
  23. {
  24.    bool Result;
  25.    std::auto_ptr<TSaveQueryAs> pQuery(new TSaveQueryAs(Application));
  26.  
  27.    pQuery->NameEdit->Text = QueryName;
  28.    Result = pQuery->ShowModal() == mrOk;
  29.    if(Result){
  30.      QueryName = pQuery->NameEdit->Text;
  31.    }
  32.    return Result;
  33. };
  34.  
  35. void __fastcall TSaveQueryAs::NameEditChange( TObject* Sender)
  36. {
  37.   OKBtn->Enabled = NameEdit->Text != "";
  38. };
  39.  
  40. //End of conversion...
  41.