]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed the QUERY dialog so it would not crash on exit, and the COUNT button now works
authorGeorge Tasker <gtasker@allenbrook.com>
Wed, 1 Mar 2000 01:01:01 +0000 (01:01 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Wed, 1 Mar 2000 01:01:01 +0000 (01:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/db/dbtest.cpp
samples/db/dbtest.h

index b859661ca3d573b092145608295c2098cb4106d7..89de6e5a138381b50b47cb38d120c911c73196f5 100644 (file)
@@ -865,7 +865,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
                 Contact->whereStr += Contact->qryWhereStr;
             }
             // Close the expression with a right paren
-            // Contact->whereStr += ")";
+            Contact->whereStr += ")";
             // Requery the table
             Contact->where = (char*) (const char*) Contact->whereStr;
             if (!Contact->Query())
@@ -1650,6 +1650,11 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereA
 }  // CqueryDlg() constructor
 
 
+CqueryDlg::~CqueryDlg()
+{
+}  // CqueryDlg::~CqueryDlg() destructor
+
+
 void CqueryDlg::OnButton( wxCommandEvent &event )
 {
   wxWindow *win = (wxWindow*) event.GetEventObject();
@@ -1887,6 +1892,7 @@ void CqueryDlg::OnCloseWindow(wxCloseEvent& event)
     while (wxIsBusy())
         wxEndBusyCursor();
 
+        Show(FALSE);
     this->Destroy();
 
 }  // CqueryDlg::OnCloseWindow()
@@ -2025,7 +2031,10 @@ void CqueryDlg::ProcessCountBtn()
     }
 
     // Count() with WHERE clause
-    dbTable->where = (char*) (const char*) pQuerySqlWhereMtxt->GetValue();
+        wxString whereStr;
+
+    whereStr = pQuerySqlWhereMtxt->GetValue();
+        dbTable->where = (char *)whereStr.GetData();
     ULONG whereCnt = dbTable->Count();
 
     // Count() of all records in the table
index 7180429f51a04ecd7c5857ec909dff27ad208916..c7f7b399c7c12dcf74777832bbff729389229659 100644 (file)
@@ -346,6 +346,7 @@ class CqueryDlg : public wxDialog
         wxTextCtrl                 *pFocusTxt;
 
         CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereArg);
+        ~CqueryDlg();
 
         void        OnButton( wxCommandEvent &event );
         void        OnCommand(wxWindow& win, wxCommandEvent& event);