//--------------------------------------------------------------------------- #include #pragma hdrstop #include "TestHosts.h" #include "DataModule.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "Grids_ts" #pragma link "TSDBGrid" #pragma link "TSGrid" #pragma resource "*.dfm" TTestHostsForm *TestHostsForm; //--------------------------------------------------------------------------- __fastcall TTestHostsForm::TTestHostsForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TTestHostsForm::SpeedButton1Click(TObject *Sender) { if ( (TestHostsQuery->State != dsEdit) && (TestHostsQuery->State != dsInsert) ) { TestHostsQuery->Append(); } else { MessageDlg("Please Save or Cancel existing database change", mtError, TMsgDlgButtons() << mbOK, 0); } } //--------------------------------------------------------------------------- void __fastcall TTestHostsForm::SpeedButton3Click(TObject *Sender) { if ( (TestHostsQuery->State == dsEdit) || (TestHostsQuery->State == dsInsert) ) { TestHostsQuery->Cancel(); } else { MessageDlg("Nothing to Cancel", mtError, TMsgDlgButtons() << mbOK, 0); } } //--------------------------------------------------------------------------- void __fastcall TTestHostsForm::SpeedButton5Click(TObject *Sender) { TestHostsQuery->Delete(); } //--------------------------------------------------------------------------- void __fastcall TTestHostsForm::CloseBtnClick(TObject *Sender) { if ( (TestHostsQuery->State == dsEdit) || (TestHostsQuery->State == dsInsert) ) { MessageDlg("There are currently unsaved changes; Please either save or cancel changes.", mtError, TMsgDlgButtons() << mbOK, 0); } else { Close(); } } //---------------------------------------------------------------------------