From: George Tasker Date: Wed, 1 Mar 2000 01:01:01 +0000 (+0000) Subject: Fixed the QUERY dialog so it would not crash on exit, and the COUNT button now works X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4c4a393f3e5b8ff1fb66e61b4705b1d1c8295d36 Fixed the QUERY dialog so it would not crash on exit, and the COUNT button now works git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/db/dbtest.cpp b/samples/db/dbtest.cpp index b859661ca3..89de6e5a13 100644 --- a/samples/db/dbtest.cpp +++ b/samples/db/dbtest.cpp @@ -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 diff --git a/samples/db/dbtest.h b/samples/db/dbtest.h index 7180429f51..c7f7b399c7 100644 --- a/samples/db/dbtest.h +++ b/samples/db/dbtest.h @@ -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);