image update

listbox fix
  iODBC fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-01-12 17:53:45 +00:00
parent 4a1acb45b0
commit f6fcbb63d0
19 changed files with 304 additions and 144 deletions

View File

@@ -478,6 +478,11 @@ bool Ccontact::FetchByName(char *name)
* An instance of Ccontact is created - "Contact" - which is used to hold the Ccontact
* object that is currently being worked with.
*/
BEGIN_EVENT_TABLE(CeditorDlg, wxPanel)
EVT_BUTTON(-1, CeditorDlg::OnButton)
END_EVENT_TABLE()
CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
{
// Since the ::OnCommand() function is overridden, this prevents the widget
@@ -616,8 +621,12 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
//
// The constructed where clause below has a sub-query within it "SELECT MIN(NAME) FROM %s"
// to achieve a single row (in this case the first name in alphabetical order).
Contact->whereStr.Printf("NAME = 'Robert'",Contact->tableName);
/*
Contact->whereStr.Printf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->tableName);
*/
// NOTE: (const char*) returns a pointer which may not be valid later, so this is short term use only
Contact->where = (char*) (const char*) Contact->whereStr;
@@ -665,6 +674,12 @@ bool CeditorDlg::OnClose()
} // CeditorDlg::OnClose()
void CeditorDlg::OnButton( wxCommandEvent &event )
{
wxWindow *win = (wxWindow*) event.GetEventObject();
OnCommand( *win, event );
}
void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
{
wxString widgetName;
@@ -771,10 +786,12 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
}
// Previous record not available, retrieve first record in table
Contact->whereStr = "NAME = 'Robert' ";
/*
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += Contact->tableName;
Contact->whereStr += ")";
*/
Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query())
{
@@ -825,8 +842,10 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
if (strcmp(qryWhere, (const char*) Contact->qryWhereStr))
{
Contact->orderBy = "NAME";
/*
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += CONTACT_TABLE_NAME;
*/
// Append the query where string (if there is one)
Contact->qryWhereStr = qryWhere;
if (strlen(qryWhere))
@@ -866,9 +885,12 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
// Query the first record in the table
Contact->orderBy = "NAME";
Contact->whereStr = "NAME = 'Robert' ";
/*
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
Contact->whereStr += CONTACT_TABLE_NAME;
Contact->whereStr += ")";
*/
Contact->where = (char*) (const char*) Contact->whereStr;
if (!Contact->Query())
{
@@ -1188,7 +1210,10 @@ bool CeditorDlg::GetNextRec()
{
wxString w;
/*
w = "NAME = (SELECT MIN(NAME) FROM ";
*/
w = "NAME = (SELECT NAME FROM ";
w += Contact->tableName;
w += " WHERE NAME > '";
w += Contact->Name;
@@ -1203,7 +1228,6 @@ bool CeditorDlg::GetNextRec()
}
w += ")";
return(GetRec((char*) (const char*) w));
} // CeditorDlg::GetNextRec()
@@ -1458,6 +1482,10 @@ void CparameterDlg::FillDataSourceList()
} // CparameterDlg::CparameterDlg::FillDataSourceList()
BEGIN_EVENT_TABLE(CqueryDlg, wxDialog)
EVT_BUTTON(-1, CqueryDlg::OnButton)
END_EVENT_TABLE()
// CqueryDlg() constructor
CqueryDlg::CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereArg) : wxDialog (parent, QUERY_DIALOG, "Query", wxPoint(-1, -1), wxSize(480, 360))
{
@@ -1567,6 +1595,12 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereA
} // CqueryDlg() constructor
void CqueryDlg::OnButton( wxCommandEvent &event )
{
wxWindow *win = (wxWindow*) event.GetEventObject();
OnCommand( *win, event );
}
void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
{
// Widget pointers won't be set when the dialog is constructed.