Changed the 'true's and 'false's back to TRUE and FALSE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -72,10 +72,10 @@ bool DataTypeSupported(wxDb *pDb, SWORD datatype)
|
|||||||
{
|
{
|
||||||
wxDbSqlTypeInfo sqlTypeInfo;
|
wxDbSqlTypeInfo sqlTypeInfo;
|
||||||
|
|
||||||
bool breakpoint = false;
|
bool breakpoint = FALSE;
|
||||||
|
|
||||||
if (pDb->GetDataTypeInfo(datatype, sqlTypeInfo))
|
if (pDb->GetDataTypeInfo(datatype, sqlTypeInfo))
|
||||||
breakpoint = true;
|
breakpoint = TRUE;
|
||||||
|
|
||||||
return breakpoint;
|
return breakpoint;
|
||||||
|
|
||||||
@@ -387,7 +387,7 @@ bool DatabaseDemoApp::OnInit()
|
|||||||
params.DirPath[0] = 0;
|
params.DirPath[0] = 0;
|
||||||
|
|
||||||
// Show the frame
|
// Show the frame
|
||||||
DemoFrame->Show(true);
|
DemoFrame->Show(TRUE);
|
||||||
|
|
||||||
// Passing NULL for the SQL environment handle causes
|
// Passing NULL for the SQL environment handle causes
|
||||||
// the wxDbConnectInf constructor to obtain a handle
|
// the wxDbConnectInf constructor to obtain a handle
|
||||||
@@ -411,7 +411,7 @@ bool DatabaseDemoApp::OnInit()
|
|||||||
if (!wxStrlen(params.ODBCSource))
|
if (!wxStrlen(params.ODBCSource))
|
||||||
{
|
{
|
||||||
wxDELETE(DbConnectInf);
|
wxDELETE(DbConnectInf);
|
||||||
return(false);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DbConnectInf->SetDsn(params.ODBCSource);
|
DbConnectInf->SetDsn(params.ODBCSource);
|
||||||
@@ -426,7 +426,7 @@ bool DatabaseDemoApp::OnInit()
|
|||||||
DemoFrame->BuildParameterDialog(NULL);
|
DemoFrame->BuildParameterDialog(NULL);
|
||||||
wxDELETE(DbConnectInf);
|
wxDELETE(DbConnectInf);
|
||||||
wxMessageBox(wxT("Now exiting program.\n\nRestart program to try any new settings."),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
wxMessageBox(wxT("Now exiting program.\n\nRestart program to try any new settings."),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
||||||
return(false);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DemoFrame->BuildEditorDialog();
|
DemoFrame->BuildEditorDialog();
|
||||||
@@ -434,7 +434,7 @@ bool DatabaseDemoApp::OnInit()
|
|||||||
// Show the frame
|
// Show the frame
|
||||||
DemoFrame->Refresh();
|
DemoFrame->Refresh();
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
} // DatabaseDemoApp::OnInit()
|
} // DatabaseDemoApp::OnInit()
|
||||||
|
|
||||||
|
|
||||||
@@ -447,7 +447,7 @@ bool DatabaseDemoApp::ReadParamFile(Cparameters ¶ms)
|
|||||||
tStr.Printf(wxT("Unable to open the parameter file '%s' for reading.\n\nYou must specify the data source, user name, and\npassword that will be used and save those settings."),PARAM_FILENAME);
|
tStr.Printf(wxT("Unable to open the parameter file '%s' for reading.\n\nYou must specify the data source, user name, and\npassword that will be used and save those settings."),PARAM_FILENAME);
|
||||||
wxMessageBox(tStr,wxT("File I/O Error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,wxT("File I/O Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
|
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxChar buffer[1000+1];
|
wxChar buffer[1000+1];
|
||||||
@@ -469,7 +469,7 @@ bool DatabaseDemoApp::ReadParamFile(Cparameters ¶ms)
|
|||||||
|
|
||||||
fclose(paramFile);
|
fclose(paramFile);
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
} // DatabaseDemoApp::ReadParamFile()
|
} // DatabaseDemoApp::ReadParamFile()
|
||||||
|
|
||||||
|
|
||||||
@@ -481,7 +481,7 @@ bool DatabaseDemoApp::WriteParamFile(Cparameters ¶ms)
|
|||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr.Printf(wxT("Unable to write/overwrite '%s'."),PARAM_FILENAME);
|
tStr.Printf(wxT("Unable to write/overwrite '%s'."),PARAM_FILENAME);
|
||||||
wxMessageBox(tStr,wxT("File I/O Error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(tStr,wxT("File I/O Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
fputs(wxGetApp().params.ODBCSource, paramFile);
|
fputs(wxGetApp().params.ODBCSource, paramFile);
|
||||||
@@ -494,13 +494,13 @@ bool DatabaseDemoApp::WriteParamFile(Cparameters ¶ms)
|
|||||||
fputc(wxT('\n'), paramFile);
|
fputc(wxT('\n'), paramFile);
|
||||||
fclose(paramFile);
|
fclose(paramFile);
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
} // DatabaseDemoApp::WriteParamFile()
|
} // DatabaseDemoApp::WriteParamFile()
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoApp::CreateDataTable(bool recreate)
|
void DatabaseDemoApp::CreateDataTable(bool recreate)
|
||||||
{
|
{
|
||||||
bool Ok = true;
|
bool Ok = TRUE;
|
||||||
if (recreate)
|
if (recreate)
|
||||||
Ok = (wxMessageBox(wxT("Any data currently residing in the table will be erased.\n\nAre you sure?"),wxT("Confirm"),wxYES_NO|wxICON_QUESTION) == wxYES);
|
Ok = (wxMessageBox(wxT("Any data currently residing in the table will be erased.\n\nAre you sure?"),wxT("Confirm"),wxYES_NO|wxICON_QUESTION) == wxYES);
|
||||||
|
|
||||||
@@ -509,7 +509,7 @@ void DatabaseDemoApp::CreateDataTable(bool recreate)
|
|||||||
|
|
||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
bool success = true;
|
bool success = TRUE;
|
||||||
|
|
||||||
Contact->GetDb()->RollbackTrans(); // Make sure the current cursor is in a known/stable state
|
Contact->GetDb()->RollbackTrans(); // Make sure the current cursor is in a known/stable state
|
||||||
|
|
||||||
@@ -521,7 +521,7 @@ void DatabaseDemoApp::CreateDataTable(bool recreate)
|
|||||||
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__FILE__,__LINE__),
|
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__FILE__,__LINE__),
|
||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
|
|
||||||
success = false;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -533,7 +533,7 @@ void DatabaseDemoApp::CreateDataTable(bool recreate)
|
|||||||
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__FILE__,__LINE__),
|
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),Contact->GetDb(),__FILE__,__LINE__),
|
||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
|
|
||||||
success = false;
|
success = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (wxIsBusy())
|
while (wxIsBusy())
|
||||||
@@ -579,13 +579,13 @@ DatabaseDemoFrame::~DatabaseDemoFrame()
|
|||||||
|
|
||||||
void DatabaseDemoFrame::OnCreate(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnCreate(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxGetApp().CreateDataTable(false);
|
wxGetApp().CreateDataTable(FALSE);
|
||||||
} // DatabaseDemoFrame::OnCreate()
|
} // DatabaseDemoFrame::OnCreate()
|
||||||
|
|
||||||
|
|
||||||
void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event)
|
void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxGetApp().CreateDataTable(true);
|
wxGetApp().CreateDataTable(TRUE);
|
||||||
} // DatabaseDemoFrame::OnRecreate()
|
} // DatabaseDemoFrame::OnRecreate()
|
||||||
|
|
||||||
|
|
||||||
@@ -593,7 +593,7 @@ void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
wxGetApp().Contact->GetDb()->RollbackTrans(); // Make sure the current cursor is in a known/stable state
|
wxGetApp().Contact->GetDb()->RollbackTrans(); // Make sure the current cursor is in a known/stable state
|
||||||
|
|
||||||
if (!wxGetApp().Contact->CreateIndexes(true))
|
if (!wxGetApp().Contact->CreateIndexes(TRUE))
|
||||||
{
|
{
|
||||||
while (wxIsBusy())
|
while (wxIsBusy())
|
||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
@@ -752,7 +752,7 @@ void Ccontact::Initialize()
|
|||||||
JoinDate.second = 0;
|
JoinDate.second = 0;
|
||||||
JoinDate.fraction = 0;
|
JoinDate.fraction = 0;
|
||||||
NativeLanguage = langENGLISH;
|
NativeLanguage = langENGLISH;
|
||||||
IsDeveloper = false;
|
IsDeveloper = FALSE;
|
||||||
Contributions = 0;
|
Contributions = 0;
|
||||||
LinesOfCode = 0L;
|
LinesOfCode = 0L;
|
||||||
} // Ccontact::Initialize
|
} // Ccontact::Initialize
|
||||||
@@ -783,20 +783,20 @@ void Ccontact::SetupColumns()
|
|||||||
{
|
{
|
||||||
// NOTE: Columns now are 8 character names, as that is all dBase can support. Longer
|
// NOTE: Columns now are 8 character names, as that is all dBase can support. Longer
|
||||||
// names can be used for other database engines
|
// names can be used for other database engines
|
||||||
SetColDefs ( 0,wxT("NAME"), DB_DATA_TYPE_VARCHAR, Name, SQL_C_CHAR, sizeof(Name), true, true); // Primary index
|
SetColDefs ( 0,wxT("NAME"), DB_DATA_TYPE_VARCHAR, Name, SQL_C_CHAR, sizeof(Name), TRUE, TRUE); // Primary index
|
||||||
SetColDefs ( 1,wxT("ADDRESS1"), DB_DATA_TYPE_VARCHAR, Addr1, SQL_C_CHAR, sizeof(Addr1), false,true);
|
SetColDefs ( 1,wxT("ADDRESS1"), DB_DATA_TYPE_VARCHAR, Addr1, SQL_C_CHAR, sizeof(Addr1), FALSE,TRUE);
|
||||||
SetColDefs ( 2,wxT("ADDRESS2"), DB_DATA_TYPE_VARCHAR, Addr2, SQL_C_CHAR, sizeof(Addr2), false,true);
|
SetColDefs ( 2,wxT("ADDRESS2"), DB_DATA_TYPE_VARCHAR, Addr2, SQL_C_CHAR, sizeof(Addr2), FALSE,TRUE);
|
||||||
SetColDefs ( 3,wxT("CITY"), DB_DATA_TYPE_VARCHAR, City, SQL_C_CHAR, sizeof(City), false,true);
|
SetColDefs ( 3,wxT("CITY"), DB_DATA_TYPE_VARCHAR, City, SQL_C_CHAR, sizeof(City), FALSE,TRUE);
|
||||||
SetColDefs ( 4,wxT("STATE"), DB_DATA_TYPE_VARCHAR, State, SQL_C_CHAR, sizeof(State), false,true);
|
SetColDefs ( 4,wxT("STATE"), DB_DATA_TYPE_VARCHAR, State, SQL_C_CHAR, sizeof(State), FALSE,TRUE);
|
||||||
SetColDefs ( 5,wxT("POSTCODE"), DB_DATA_TYPE_VARCHAR, PostalCode, SQL_C_CHAR, sizeof(PostalCode), false,true);
|
SetColDefs ( 5,wxT("POSTCODE"), DB_DATA_TYPE_VARCHAR, PostalCode, SQL_C_CHAR, sizeof(PostalCode), FALSE,TRUE);
|
||||||
SetColDefs ( 6,wxT("COUNTRY"), DB_DATA_TYPE_VARCHAR, Country, SQL_C_CHAR, sizeof(Country), false,true);
|
SetColDefs ( 6,wxT("COUNTRY"), DB_DATA_TYPE_VARCHAR, Country, SQL_C_CHAR, sizeof(Country), FALSE,TRUE);
|
||||||
SetColDefs ( 7,wxT("JOINDATE"), DB_DATA_TYPE_DATE, &JoinDate, SQL_C_TIMESTAMP, sizeof(JoinDate), false,true);
|
SetColDefs ( 7,wxT("JOINDATE"), DB_DATA_TYPE_DATE, &JoinDate, SQL_C_TIMESTAMP, sizeof(JoinDate), FALSE,TRUE);
|
||||||
SetColDefs ( 8,wxT("IS_DEV"), DB_DATA_TYPE_INTEGER, &IsDeveloper, SQL_C_BOOLEAN(IsDeveloper), sizeof(IsDeveloper), false,true);
|
SetColDefs ( 8,wxT("IS_DEV"), DB_DATA_TYPE_INTEGER, &IsDeveloper, SQL_C_BOOLEAN(IsDeveloper), sizeof(IsDeveloper), FALSE,TRUE);
|
||||||
SetColDefs ( 9,wxT("CONTRIBS"), DB_DATA_TYPE_INTEGER, &Contributions, SQL_C_UTINYINT, sizeof(Contributions), false,true);
|
SetColDefs ( 9,wxT("CONTRIBS"), DB_DATA_TYPE_INTEGER, &Contributions, SQL_C_UTINYINT, sizeof(Contributions), FALSE,TRUE);
|
||||||
SetColDefs (10,wxT("LINE_CNT"), DB_DATA_TYPE_INTEGER, &LinesOfCode, SQL_C_ULONG, sizeof(LinesOfCode), false,true);
|
SetColDefs (10,wxT("LINE_CNT"), DB_DATA_TYPE_INTEGER, &LinesOfCode, SQL_C_ULONG, sizeof(LinesOfCode), FALSE,TRUE);
|
||||||
SetColDefs (11,wxT("LANGUAGE"), DB_DATA_TYPE_INTEGER, &NativeLanguage, SQL_C_ENUM, sizeof(NativeLanguage), false,true);
|
SetColDefs (11,wxT("LANGUAGE"), DB_DATA_TYPE_INTEGER, &NativeLanguage, SQL_C_ENUM, sizeof(NativeLanguage), FALSE,TRUE);
|
||||||
#if wxODBC_BLOB_EXPERIMENT > 0
|
#if wxODBC_BLOB_EXPERIMENT > 0
|
||||||
SetColDefs (12,wxT("PICTURE"), DB_DATA_TYPE_BLOB, Picture, SQL_LONGVARBINARY, sizeof(Picture), false,true);
|
SetColDefs (12,wxT("PICTURE"), DB_DATA_TYPE_BLOB, Picture, SQL_LONGVARBINARY, sizeof(Picture), FALSE,TRUE);
|
||||||
#endif
|
#endif
|
||||||
} // Ccontact::SetupColumns
|
} // Ccontact::SetupColumns
|
||||||
|
|
||||||
@@ -808,17 +808,17 @@ bool Ccontact::CreateIndexes(bool recreate)
|
|||||||
wxString indexName;
|
wxString indexName;
|
||||||
wxDbIdxDef idxDef[2];
|
wxDbIdxDef idxDef[2];
|
||||||
|
|
||||||
bool Ok = true;
|
bool Ok = TRUE;
|
||||||
|
|
||||||
wxStrcpy(idxDef[0].ColName, "IS_DEV");
|
wxStrcpy(idxDef[0].ColName, "IS_DEV");
|
||||||
idxDef[0].Ascending = true;
|
idxDef[0].Ascending = TRUE;
|
||||||
|
|
||||||
wxStrcpy(idxDef[1].ColName, "NAME");
|
wxStrcpy(idxDef[1].ColName, "NAME");
|
||||||
idxDef[1].Ascending = true;
|
idxDef[1].Ascending = TRUE;
|
||||||
|
|
||||||
indexName = GetTableName();
|
indexName = GetTableName();
|
||||||
indexName += "_IDX1";
|
indexName += "_IDX1";
|
||||||
Ok = CreateIndex(indexName.c_str(), true, 2, idxDef, recreate);
|
Ok = CreateIndex(indexName.c_str(), TRUE, 2, idxDef, recreate);
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
} // Ccontact::CreateIndexes()
|
} // Ccontact::CreateIndexes()
|
||||||
@@ -836,7 +836,7 @@ bool Ccontact::FetchByName(const wxString &name)
|
|||||||
SetOrderByClause(wxT(""));
|
SetOrderByClause(wxT(""));
|
||||||
|
|
||||||
if (!Query())
|
if (!Query())
|
||||||
return(false);
|
return(FALSE);
|
||||||
|
|
||||||
// Fetch the record
|
// Fetch the record
|
||||||
return(GetNext());
|
return(GetNext());
|
||||||
@@ -870,13 +870,13 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 0, 0, 537, 480)
|
|||||||
// Since the ::OnCommand() function is overridden, this prevents the widget
|
// Since the ::OnCommand() function is overridden, this prevents the widget
|
||||||
// detection in ::OnCommand() until all widgets have been initialized to prevent
|
// detection in ::OnCommand() until all widgets have been initialized to prevent
|
||||||
// uninitialized pointers from crashing the program
|
// uninitialized pointers from crashing the program
|
||||||
widgetPtrsSet = false;
|
widgetPtrsSet = FALSE;
|
||||||
|
|
||||||
initialized = false;
|
initialized = FALSE;
|
||||||
|
|
||||||
SetMode(mView);
|
SetMode(mView);
|
||||||
|
|
||||||
Show(false);
|
Show(FALSE);
|
||||||
} // CeditorDlg constructor
|
} // CeditorDlg constructor
|
||||||
|
|
||||||
|
|
||||||
@@ -1137,7 +1137,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
if (!wxGetApp().Contact->GetNext())
|
if (!wxGetApp().Contact->GetNext())
|
||||||
wxGetApp().Contact->Initialize();
|
wxGetApp().Contact->Initialize();
|
||||||
PutData();
|
PutData();
|
||||||
pResetBtn->Enable(false);
|
pResetBtn->Enable(FALSE);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} // Reset button
|
} // Reset button
|
||||||
@@ -1154,7 +1154,7 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
/* wxChar *orderBy */ wxT("NAME"),
|
/* wxChar *orderBy */ wxT("NAME"),
|
||||||
/* wxDb *pDb */ wxGetApp().READONLY_DB,
|
/* wxDb *pDb */ wxGetApp().READONLY_DB,
|
||||||
/* const wxString &defDir */ wxGetApp().DbConnectInf->GetDefaultDir(),
|
/* const wxString &defDir */ wxGetApp().DbConnectInf->GetDefaultDir(),
|
||||||
/* bool distinctValues */ true);
|
/* bool distinctValues */ TRUE);
|
||||||
|
|
||||||
if (ListDB_Selection && wxStrlen(ListDB_Selection))
|
if (ListDB_Selection && wxStrlen(ListDB_Selection))
|
||||||
{
|
{
|
||||||
@@ -1203,7 +1203,7 @@ bool CeditorDlg::Initialize()
|
|||||||
if (!wxGetApp().Contact)
|
if (!wxGetApp().Contact)
|
||||||
{
|
{
|
||||||
wxMessageBox(wxT("Unable to instantiate an instance of Ccontact"),wxT("Error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(wxT("Unable to instantiate an instance of Ccontact"),wxT("Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the table exists or not. If it doesn't, ask the user if they want to
|
// Check if the table exists or not. If it doesn't, ask the user if they want to
|
||||||
@@ -1219,10 +1219,10 @@ bool CeditorDlg::Initialize()
|
|||||||
if (!createTable)
|
if (!createTable)
|
||||||
{
|
{
|
||||||
// Close();
|
// Close();
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxGetApp().CreateDataTable(false);
|
wxGetApp().CreateDataTable(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tables must be "opened" before anything other than creating/deleting table can be done
|
// Tables must be "opened" before anything other than creating/deleting table can be done
|
||||||
@@ -1259,7 +1259,7 @@ bool CeditorDlg::Initialize()
|
|||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the dialog
|
// Build the dialog
|
||||||
@@ -1320,7 +1320,7 @@ bool CeditorDlg::Initialize()
|
|||||||
|
|
||||||
// Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
|
// Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
|
||||||
// handle all widget processing
|
// handle all widget processing
|
||||||
widgetPtrsSet = true;
|
widgetPtrsSet = TRUE;
|
||||||
|
|
||||||
// Setup the orderBy and where clauses to return back a single record as the result set,
|
// Setup the orderBy and where clauses to return back a single record as the result set,
|
||||||
// as there will only be one record being shown on the dialog at a time, this optimizes
|
// as there will only be one record being shown on the dialog at a time, this optimizes
|
||||||
@@ -1348,15 +1348,15 @@ bool CeditorDlg::Initialize()
|
|||||||
wxGetApp().Contact->SetWhereClause(wxT(""));
|
wxGetApp().Contact->SetWhereClause(wxT(""));
|
||||||
|
|
||||||
// Perform the Query to get the result set.
|
// Perform the Query to get the result set.
|
||||||
// NOTE: If there are no rows returned, that is a valid result, so Query() would return true.
|
// NOTE: If there are no rows returned, that is a valid result, so Query() would return TRUE.
|
||||||
// Only if there is a database error will Query() come back as false
|
// Only if there is a database error will Query() come back as FALSE
|
||||||
if (!wxGetApp().Contact->Query())
|
if (!wxGetApp().Contact->Query())
|
||||||
{
|
{
|
||||||
wxString tStr;
|
wxString tStr;
|
||||||
tStr = wxT("ODBC error during Query()\n\n");
|
tStr = wxT("ODBC error during Query()\n\n");
|
||||||
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since Query succeeded, now get the row that was returned
|
// Since Query succeeded, now get the row that was returned
|
||||||
@@ -1371,10 +1371,10 @@ bool CeditorDlg::Initialize()
|
|||||||
SetMode(mView);
|
SetMode(mView);
|
||||||
PutData();
|
PutData();
|
||||||
|
|
||||||
Show(true);
|
Show(TRUE);
|
||||||
|
|
||||||
initialized = true;
|
initialized = TRUE;
|
||||||
return true;
|
return TRUE;
|
||||||
} // CeditorDlg::Initialize()
|
} // CeditorDlg::Initialize()
|
||||||
|
|
||||||
|
|
||||||
@@ -1402,18 +1402,18 @@ void CeditorDlg::FieldsEditable()
|
|||||||
|
|
||||||
void CeditorDlg::SetMode(enum DialogModes m)
|
void CeditorDlg::SetMode(enum DialogModes m)
|
||||||
{
|
{
|
||||||
bool edit = false;
|
bool edit = FALSE;
|
||||||
|
|
||||||
mode = m;
|
mode = m;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case mCreate:
|
case mCreate:
|
||||||
case mEdit:
|
case mEdit:
|
||||||
edit = true;
|
edit = TRUE;
|
||||||
break;
|
break;
|
||||||
case mView:
|
case mView:
|
||||||
case mSearch:
|
case mSearch:
|
||||||
edit = false;
|
edit = FALSE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1463,7 +1463,7 @@ bool CeditorDlg::PutData()
|
|||||||
|
|
||||||
pDeveloperRadio->SetSelection(wxGetApp().Contact->IsDeveloper);
|
pDeveloperRadio->SetSelection(wxGetApp().Contact->IsDeveloper);
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
} // Ceditor::PutData()
|
} // Ceditor::PutData()
|
||||||
|
|
||||||
|
|
||||||
@@ -1471,7 +1471,7 @@ bool CeditorDlg::PutData()
|
|||||||
* Reads the data out of all the widgets on the dialog. Some data evaluation is done
|
* Reads the data out of all the widgets on the dialog. Some data evaluation is done
|
||||||
* to ensure that there is a name entered and that the date field is valid.
|
* to ensure that there is a name entered and that the date field is valid.
|
||||||
*
|
*
|
||||||
* A return value of true means that valid data was retrieved from the dialog, otherwise
|
* A return value of TRUE means that valid data was retrieved from the dialog, otherwise
|
||||||
* invalid data was found (and a message was displayed telling the user what to fix), and
|
* invalid data was found (and a message was displayed telling the user what to fix), and
|
||||||
* the data was not placed into the appropraite fields of Ccontact
|
* the data was not placed into the appropraite fields of Ccontact
|
||||||
*/
|
*/
|
||||||
@@ -1484,16 +1484,16 @@ bool CeditorDlg::GetData()
|
|||||||
if (!wxStrcmp((const wxChar*) tStr,wxT("")))
|
if (!wxStrcmp((const wxChar*) tStr,wxT("")))
|
||||||
{
|
{
|
||||||
wxMessageBox(wxT("A name is required for entry into the contact table"),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
wxMessageBox(wxT("A name is required for entry into the contact table"),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool invalid = false;
|
bool invalid = FALSE;
|
||||||
int mm,dd,yyyy;
|
int mm,dd,yyyy;
|
||||||
int first, second;
|
int first, second;
|
||||||
|
|
||||||
tStr = pJoinDateTxt->GetValue();
|
tStr = pJoinDateTxt->GetValue();
|
||||||
if (tStr.Freq(wxT('/')) != 2)
|
if (tStr.Freq(wxT('/')) != 2)
|
||||||
invalid = true;
|
invalid = TRUE;
|
||||||
|
|
||||||
// Find the month, day, and year tokens
|
// Find the month, day, and year tokens
|
||||||
if (!invalid)
|
if (!invalid)
|
||||||
@@ -1510,30 +1510,30 @@ bool CeditorDlg::GetData()
|
|||||||
|
|
||||||
// Force Year 2000 compliance
|
// Force Year 2000 compliance
|
||||||
if (!invalid && (yyyy < 1000))
|
if (!invalid && (yyyy < 1000))
|
||||||
invalid = true;
|
invalid = TRUE;
|
||||||
|
|
||||||
// Check the token ranges for validity
|
// Check the token ranges for validity
|
||||||
if (!invalid)
|
if (!invalid)
|
||||||
{
|
{
|
||||||
if (yyyy > 9999)
|
if (yyyy > 9999)
|
||||||
invalid = true;
|
invalid = TRUE;
|
||||||
else if ((mm < 1) || (mm > 12))
|
else if ((mm < 1) || (mm > 12))
|
||||||
invalid = true;
|
invalid = TRUE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dd < 1)
|
if (dd < 1)
|
||||||
invalid = true;
|
invalid = TRUE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int days[12] = {31,28,31,30,31,30,
|
int days[12] = {31,28,31,30,31,30,
|
||||||
31,31,30,31,30,31};
|
31,31,30,31,30,31};
|
||||||
if (dd > days[mm-1])
|
if (dd > days[mm-1])
|
||||||
{
|
{
|
||||||
invalid = true;
|
invalid = TRUE;
|
||||||
if ((dd == 29) && (mm == 2))
|
if ((dd == 29) && (mm == 2))
|
||||||
{
|
{
|
||||||
if (((yyyy % 4) == 0) && (((yyyy % 100) != 0) || ((yyyy % 400) == 0)))
|
if (((yyyy % 4) == 0) && (((yyyy % 100) != 0) || ((yyyy % 400) == 0)))
|
||||||
invalid = false;
|
invalid = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1549,7 +1549,7 @@ bool CeditorDlg::GetData()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxMessageBox(wxT("Improper date format. Please check the date\nspecified and try again.\n\nNOTE: Dates are in american format (MM/DD/YYYY)"),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
wxMessageBox(wxT("Improper date format. Please check the date\nspecified and try again.\n\nNOTE: Dates are in american format (MM/DD/YYYY)"),wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
tStr = pNameTxt->GetValue();
|
tStr = pNameTxt->GetValue();
|
||||||
@@ -1567,7 +1567,7 @@ bool CeditorDlg::GetData()
|
|||||||
wxGetApp().Contact->NativeLanguage = (enum Language) pNativeLangChoice->GetSelection();
|
wxGetApp().Contact->NativeLanguage = (enum Language) pNativeLangChoice->GetSelection();
|
||||||
wxGetApp().Contact->IsDeveloper = pDeveloperRadio->GetSelection() > 0;
|
wxGetApp().Contact->IsDeveloper = pDeveloperRadio->GetSelection() > 0;
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
} // CeditorDlg::GetData()
|
} // CeditorDlg::GetData()
|
||||||
|
|
||||||
|
|
||||||
@@ -1576,17 +1576,17 @@ bool CeditorDlg::GetData()
|
|||||||
* try to insert/update the data to the table based on the current 'mode' the dialog
|
* try to insert/update the data to the table based on the current 'mode' the dialog
|
||||||
* is set to.
|
* is set to.
|
||||||
*
|
*
|
||||||
* A return value of true means the insert/update was completed successfully, a return
|
* A return value of TRUE means the insert/update was completed successfully, a return
|
||||||
* value of false means that Save() failed. If returning false, then this function
|
* value of FALSE means that Save() failed. If returning FALSE, then this function
|
||||||
* has displayed a detailed error message for the user.
|
* has displayed a detailed error message for the user.
|
||||||
*/
|
*/
|
||||||
bool CeditorDlg::Save()
|
bool CeditorDlg::Save()
|
||||||
{
|
{
|
||||||
bool failed = false;
|
bool failed = FALSE;
|
||||||
|
|
||||||
// Read the data in the widgets of the dialog to get the user's data
|
// Read the data in the widgets of the dialog to get the user's data
|
||||||
if (!GetData())
|
if (!GetData())
|
||||||
failed = true;
|
failed = TRUE;
|
||||||
|
|
||||||
// Perform any other required validations necessary before saving
|
// Perform any other required validations necessary before saving
|
||||||
if (!failed)
|
if (!failed)
|
||||||
@@ -1629,7 +1629,7 @@ bool CeditorDlg::Save()
|
|||||||
tStr = wxT("Database update failed\n\n");
|
tStr = wxT("Database update failed\n\n");
|
||||||
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
failed = true;
|
failed = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1737,16 +1737,16 @@ bool CeditorDlg::GetRec(const wxString &whereStr)
|
|||||||
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
|
|
||||||
return(false);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wxGetApp().Contact->GetNext())
|
if (wxGetApp().Contact->GetNext())
|
||||||
{
|
{
|
||||||
PutData();
|
PutData();
|
||||||
return(true);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return(false);
|
return(FALSE);
|
||||||
} // CeditorDlg::GetRec()
|
} // CeditorDlg::GetRec()
|
||||||
|
|
||||||
|
|
||||||
@@ -1766,7 +1766,7 @@ CparameterDlg::CparameterDlg(wxWindow *parent) : wxDialog (parent, PARAMETER_DIA
|
|||||||
// Since the ::OnCommand() function is overridden, this prevents the widget
|
// Since the ::OnCommand() function is overridden, this prevents the widget
|
||||||
// detection in ::OnCommand() until all widgets have been initialized to prevent
|
// detection in ::OnCommand() until all widgets have been initialized to prevent
|
||||||
// uninitialized pointers from crashing the program
|
// uninitialized pointers from crashing the program
|
||||||
widgetPtrsSet = false;
|
widgetPtrsSet = FALSE;
|
||||||
|
|
||||||
pParamODBCSourceMsg = new wxStaticText(this, PARAMETER_DIALOG_SOURCE_MSG, wxT("ODBC data sources:"), wxPoint( 10, 10), wxSize( -1, -1), 0, wxT("ParamODBCSourceMsg"));
|
pParamODBCSourceMsg = new wxStaticText(this, PARAMETER_DIALOG_SOURCE_MSG, wxT("ODBC data sources:"), wxPoint( 10, 10), wxSize( -1, -1), 0, wxT("ParamODBCSourceMsg"));
|
||||||
pParamODBCSourceList = new wxListBox(this, PARAMETER_DIALOG_SOURCE_LISTBOX, wxPoint( 10, 29), wxSize(285, 150), 0, 0, wxLB_SINGLE|wxLB_ALWAYS_SB, wxDefaultValidator, wxT("ParamODBCSourceList"));
|
pParamODBCSourceList = new wxListBox(this, PARAMETER_DIALOG_SOURCE_LISTBOX, wxPoint( 10, 29), wxSize(285, 150), 0, 0, wxLB_SINGLE|wxLB_ALWAYS_SB, wxDefaultValidator, wxT("ParamODBCSourceList"));
|
||||||
@@ -1781,9 +1781,9 @@ CparameterDlg::CparameterDlg(wxWindow *parent) : wxDialog (parent, PARAMETER_DIA
|
|||||||
|
|
||||||
// Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
|
// Now that all the widgets on the panel are created, its safe to allow ::OnCommand() to
|
||||||
// handle all widget processing
|
// handle all widget processing
|
||||||
widgetPtrsSet = true;
|
widgetPtrsSet = TRUE;
|
||||||
|
|
||||||
saved = false;
|
saved = FALSE;
|
||||||
savedParamSettings = wxGetApp().params;
|
savedParamSettings = wxGetApp().params;
|
||||||
|
|
||||||
Centre(wxBOTH);
|
Centre(wxBOTH);
|
||||||
@@ -1815,7 +1815,7 @@ void CparameterDlg::OnCloseWindow(wxCloseEvent& event)
|
|||||||
while (wxIsBusy())
|
while (wxIsBusy())
|
||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
|
|
||||||
Show(false);
|
Show(FALSE);
|
||||||
SetReturnCode(0); // added so BoundsChecker would not report use of uninitialized variable
|
SetReturnCode(0); // added so BoundsChecker would not report use of uninitialized variable
|
||||||
|
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
@@ -1847,7 +1847,7 @@ void CparameterDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
if (GetParent() != NULL) // The parameter dialog was not called during startup due to a missing cfg file
|
if (GetParent() != NULL) // The parameter dialog was not called during startup due to a missing cfg file
|
||||||
tStr += wxT("\nNew parameters will take effect the next time the program is started.");
|
tStr += wxT("\nNew parameters will take effect the next time the program is started.");
|
||||||
wxMessageBox(tStr,wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
wxMessageBox(tStr,wxT("Notice..."),wxOK | wxICON_INFORMATION);
|
||||||
saved = true;
|
saved = TRUE;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -1872,7 +1872,7 @@ bool CparameterDlg::PutData()
|
|||||||
pParamUserNameTxt->SetValue(wxGetApp().params.UserName);
|
pParamUserNameTxt->SetValue(wxGetApp().params.UserName);
|
||||||
pParamPasswordTxt->SetValue(wxGetApp().params.Password);
|
pParamPasswordTxt->SetValue(wxGetApp().params.Password);
|
||||||
pParamDirPathTxt->SetValue(wxGetApp().params.DirPath);
|
pParamDirPathTxt->SetValue(wxGetApp().params.DirPath);
|
||||||
return true;
|
return TRUE;
|
||||||
} // CparameterDlg::PutData()
|
} // CparameterDlg::PutData()
|
||||||
|
|
||||||
|
|
||||||
@@ -1887,12 +1887,12 @@ bool CparameterDlg::GetData()
|
|||||||
wxString errmsg;
|
wxString errmsg;
|
||||||
errmsg.Printf(wxT("ODBC Data source name is longer than the data structure to hold it.\n'Cparameter.ODBCSource' must have a larger character array\nto handle a data source with this long of a name\n\nThe data source currently selected is %d characters long."),tStr.Length());
|
errmsg.Printf(wxT("ODBC Data source name is longer than the data structure to hold it.\n'Cparameter.ODBCSource' must have a larger character array\nto handle a data source with this long of a name\n\nThe data source currently selected is %d characters long."),tStr.Length());
|
||||||
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
wxStrcpy(wxGetApp().params.ODBCSource, tStr);
|
wxStrcpy(wxGetApp().params.ODBCSource, tStr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return FALSE;
|
||||||
|
|
||||||
tStr = pParamUserNameTxt->GetValue();
|
tStr = pParamUserNameTxt->GetValue();
|
||||||
if (tStr.Length() > (sizeof(wxGetApp().params.UserName)-1))
|
if (tStr.Length() > (sizeof(wxGetApp().params.UserName)-1))
|
||||||
@@ -1900,7 +1900,7 @@ bool CparameterDlg::GetData()
|
|||||||
wxString errmsg;
|
wxString errmsg;
|
||||||
errmsg.Printf(wxT("User name is longer than the data structure to hold it.\n'Cparameter.UserName' must have a larger character array\nto handle a data source with this long of a name\n\nThe user name currently specified is %d characters long."),tStr.Length());
|
errmsg.Printf(wxT("User name is longer than the data structure to hold it.\n'Cparameter.UserName' must have a larger character array\nto handle a data source with this long of a name\n\nThe user name currently specified is %d characters long."),tStr.Length());
|
||||||
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
wxStrcpy(wxGetApp().params.UserName, tStr);
|
wxStrcpy(wxGetApp().params.UserName, tStr);
|
||||||
|
|
||||||
@@ -1910,7 +1910,7 @@ bool CparameterDlg::GetData()
|
|||||||
wxString errmsg;
|
wxString errmsg;
|
||||||
errmsg.Printf(wxT("Password is longer than the data structure to hold it.\n'Cparameter.Password' must have a larger character array\nto handle a data source with this long of a name\n\nThe password currently specified is %d characters long."),tStr.Length());
|
errmsg.Printf(wxT("Password is longer than the data structure to hold it.\n'Cparameter.Password' must have a larger character array\nto handle a data source with this long of a name\n\nThe password currently specified is %d characters long."),tStr.Length());
|
||||||
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
wxStrcpy(wxGetApp().params.Password,tStr);
|
wxStrcpy(wxGetApp().params.Password,tStr);
|
||||||
|
|
||||||
@@ -1921,10 +1921,10 @@ bool CparameterDlg::GetData()
|
|||||||
wxString errmsg;
|
wxString errmsg;
|
||||||
errmsg.Printf(wxT("DirPath is longer than the data structure to hold it.\n'Cparameter.DirPath' must have a larger character array\nto handle a data source with this long of a name\n\nThe password currently specified is %d characters long."),tStr.Length());
|
errmsg.Printf(wxT("DirPath is longer than the data structure to hold it.\n'Cparameter.DirPath' must have a larger character array\nto handle a data source with this long of a name\n\nThe password currently specified is %d characters long."),tStr.Length());
|
||||||
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(errmsg,wxT("Internal program error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
wxStrcpy(wxGetApp().params.DirPath,tStr);
|
wxStrcpy(wxGetApp().params.DirPath,tStr);
|
||||||
return true;
|
return TRUE;
|
||||||
} // CparameterDlg::GetData()
|
} // CparameterDlg::GetData()
|
||||||
|
|
||||||
|
|
||||||
@@ -1935,12 +1935,12 @@ bool CparameterDlg::Save()
|
|||||||
if (!GetData())
|
if (!GetData())
|
||||||
{
|
{
|
||||||
wxGetApp().params = savedParamSettings;
|
wxGetApp().params = savedParamSettings;
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxGetApp().WriteParamFile(wxGetApp().params);
|
wxGetApp().WriteParamFile(wxGetApp().params);
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
} // CparameterDlg::Save()
|
} // CparameterDlg::Save()
|
||||||
|
|
||||||
|
|
||||||
@@ -1982,7 +1982,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[],
|
|||||||
colInf = 0;
|
colInf = 0;
|
||||||
dbTable = 0;
|
dbTable = 0;
|
||||||
masterTableName = tblName[0];
|
masterTableName = tblName[0];
|
||||||
widgetPtrsSet = false;
|
widgetPtrsSet = FALSE;
|
||||||
pDB = pDb;
|
pDB = pDb;
|
||||||
|
|
||||||
// Initialize the WHERE clause from the string passed in
|
// Initialize the WHERE clause from the string passed in
|
||||||
@@ -2033,7 +2033,7 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[],
|
|||||||
pQueryHintGrp = new wxStaticBox(this, QUERY_DIALOG_HINT_GROUP, wxT(""), wxPoint( 10, 291), wxSize(377, 40), 0, wxT("QueryHintGrp"));
|
pQueryHintGrp = new wxStaticBox(this, QUERY_DIALOG_HINT_GROUP, wxT(""), wxPoint( 10, 291), wxSize(377, 40), 0, wxT("QueryHintGrp"));
|
||||||
pQueryHintMsg = new wxStaticText(this, QUERY_DIALOG_HINT_MSG, wxT(""), wxPoint( 16, 306), wxSize( -1, -1), 0, wxT("QueryHintMsg"));
|
pQueryHintMsg = new wxStaticText(this, QUERY_DIALOG_HINT_MSG, wxT(""), wxPoint( 16, 306), wxSize( -1, -1), 0, wxT("QueryHintMsg"));
|
||||||
|
|
||||||
widgetPtrsSet = true;
|
widgetPtrsSet = TRUE;
|
||||||
// Initialize the dialog
|
// Initialize the dialog
|
||||||
wxString qualName;
|
wxString qualName;
|
||||||
pQueryCol2Choice->Append(wxT("VALUE -->"));
|
pQueryCol2Choice->Append(wxT("VALUE -->"));
|
||||||
@@ -2071,8 +2071,8 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[],
|
|||||||
pQueryCol2Choice->SetSelection(0);
|
pQueryCol2Choice->SetSelection(0);
|
||||||
pQueryOperatorChoice->SetSelection(0);
|
pQueryOperatorChoice->SetSelection(0);
|
||||||
|
|
||||||
pQueryValue2Msg->Show(false);
|
pQueryValue2Msg->Show(FALSE);
|
||||||
pQueryValue2Txt->Show(false);
|
pQueryValue2Txt->Show(FALSE);
|
||||||
|
|
||||||
pQueryHintMsg->SetLabel(langQRY_EQ);
|
pQueryHintMsg->SetLabel(langQRY_EQ);
|
||||||
|
|
||||||
@@ -2144,8 +2144,8 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hide the value2 widget
|
// Hide the value2 widget
|
||||||
pQueryValue2Msg->Show(false); // BETWEEN will show this widget
|
pQueryValue2Msg->Show(FALSE); // BETWEEN will show this widget
|
||||||
pQueryValue2Txt->Show(false); // BETWEEN will show this widget
|
pQueryValue2Txt->Show(FALSE); // BETWEEN will show this widget
|
||||||
|
|
||||||
// Disable the NOT operator for <, <=, >, >=
|
// Disable the NOT operator for <, <=, >, >=
|
||||||
switch((qryOp) pQueryOperatorChoice->GetSelection())
|
switch((qryOp) pQueryOperatorChoice->GetSelection())
|
||||||
@@ -2155,10 +2155,10 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
case qryOpLE:
|
case qryOpLE:
|
||||||
case qryOpGE:
|
case qryOpGE:
|
||||||
pQueryNotCheck->SetValue(0);
|
pQueryNotCheck->SetValue(0);
|
||||||
pQueryNotCheck->Enable(false);
|
pQueryNotCheck->Enable(FALSE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
pQueryNotCheck->Enable(true);
|
pQueryNotCheck->Enable(TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2170,16 +2170,16 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
case qryOpGT:
|
case qryOpGT:
|
||||||
case qryOpLE:
|
case qryOpLE:
|
||||||
case qryOpGE:
|
case qryOpGE:
|
||||||
pQueryCol2Choice->Enable(true);
|
pQueryCol2Choice->Enable(TRUE);
|
||||||
if (pQueryCol2Choice->GetSelection()) // Column name is highlighted
|
if (pQueryCol2Choice->GetSelection()) // Column name is highlighted
|
||||||
{
|
{
|
||||||
pQueryValue1Msg->Show(false);
|
pQueryValue1Msg->Show(FALSE);
|
||||||
pQueryValue1Txt->Show(false);
|
pQueryValue1Txt->Show(FALSE);
|
||||||
}
|
}
|
||||||
else // "Value" is highlighted
|
else // "Value" is highlighted
|
||||||
{
|
{
|
||||||
pQueryValue1Msg->Show(true);
|
pQueryValue1Msg->Show(TRUE);
|
||||||
pQueryValue1Txt->Show(true);
|
pQueryValue1Txt->Show(TRUE);
|
||||||
pQueryValue1Txt->SetFocus();
|
pQueryValue1Txt->SetFocus();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2187,18 +2187,18 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
case qryOpCONTAINS:
|
case qryOpCONTAINS:
|
||||||
case qryOpLIKE:
|
case qryOpLIKE:
|
||||||
pQueryCol2Choice->SetSelection(0);
|
pQueryCol2Choice->SetSelection(0);
|
||||||
pQueryCol2Choice->Enable(false);
|
pQueryCol2Choice->Enable(FALSE);
|
||||||
pQueryValue1Msg->Show(true);
|
pQueryValue1Msg->Show(TRUE);
|
||||||
pQueryValue1Txt->Show(true);
|
pQueryValue1Txt->Show(TRUE);
|
||||||
pQueryValue1Txt->SetFocus();
|
pQueryValue1Txt->SetFocus();
|
||||||
break;
|
break;
|
||||||
case qryOpBETWEEN:
|
case qryOpBETWEEN:
|
||||||
pQueryCol2Choice->SetSelection(0);
|
pQueryCol2Choice->SetSelection(0);
|
||||||
pQueryCol2Choice->Enable(false);
|
pQueryCol2Choice->Enable(FALSE);
|
||||||
pQueryValue2Msg->Show(true);
|
pQueryValue2Msg->Show(TRUE);
|
||||||
pQueryValue2Txt->Show(true);
|
pQueryValue2Txt->Show(TRUE);
|
||||||
pQueryValue1Msg->Show(true);
|
pQueryValue1Msg->Show(TRUE);
|
||||||
pQueryValue1Txt->Show(true);
|
pQueryValue1Txt->Show(TRUE);
|
||||||
pQueryValue1Txt->SetFocus();
|
pQueryValue1Txt->SetFocus();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2212,13 +2212,13 @@ void CqueryDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
if (pQueryCol2Choice->GetSelection()) // Column name is highlighted
|
if (pQueryCol2Choice->GetSelection()) // Column name is highlighted
|
||||||
{
|
{
|
||||||
pQueryValue1Msg->Show(false);
|
pQueryValue1Msg->Show(FALSE);
|
||||||
pQueryValue1Txt->Show(false);
|
pQueryValue1Txt->Show(FALSE);
|
||||||
}
|
}
|
||||||
else // "Value" is highlighted
|
else // "Value" is highlighted
|
||||||
{
|
{
|
||||||
pQueryValue1Msg->Show(true);
|
pQueryValue1Msg->Show(TRUE);
|
||||||
pQueryValue1Txt->Show(true);
|
pQueryValue1Txt->Show(TRUE);
|
||||||
pQueryValue1Txt->SetFocus();
|
pQueryValue1Txt->SetFocus();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -2312,7 +2312,7 @@ void CqueryDlg::OnCloseWindow(wxCloseEvent& event)
|
|||||||
while (wxIsBusy())
|
while (wxIsBusy())
|
||||||
wxEndBusyCursor();
|
wxEndBusyCursor();
|
||||||
|
|
||||||
Show(false);
|
Show(FALSE);
|
||||||
SetReturnCode(1); // added so BoundsChecker would not report use of uninitialized variable
|
SetReturnCode(1); // added so BoundsChecker would not report use of uninitialized variable
|
||||||
|
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
@@ -2391,12 +2391,12 @@ void CqueryDlg::ProcessAddBtn()
|
|||||||
|
|
||||||
int col1Idx = pQueryCol1Choice->GetSelection();
|
int col1Idx = pQueryCol1Choice->GetSelection();
|
||||||
|
|
||||||
bool quote = false;
|
bool quote = FALSE;
|
||||||
if (colInf[col1Idx].sqlDataType == SQL_VARCHAR ||
|
if (colInf[col1Idx].sqlDataType == SQL_VARCHAR ||
|
||||||
oper == qryOpBEGINS ||
|
oper == qryOpBEGINS ||
|
||||||
oper == qryOpCONTAINS ||
|
oper == qryOpCONTAINS ||
|
||||||
oper == qryOpLIKE)
|
oper == qryOpLIKE)
|
||||||
quote = true;
|
quote = TRUE;
|
||||||
|
|
||||||
if (pQueryCol2Choice->GetSelection()) // Column name
|
if (pQueryCol2Choice->GetSelection()) // Column name
|
||||||
s += pQueryCol2Choice->GetStringSelection();
|
s += pQueryCol2Choice->GetStringSelection();
|
||||||
@@ -2493,14 +2493,14 @@ bool CqueryDlg::ValidateWhereClause()
|
|||||||
if (where.Freq(wxT('(')) != where.Freq(wxT(')')))
|
if (where.Freq(wxT('(')) != where.Freq(wxT(')')))
|
||||||
{
|
{
|
||||||
wxMessageBox(wxT("There are mismatched parenthesis in the constructed where clause"),wxT("Error..."),wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(wxT("There are mismatched parenthesis in the constructed where clause"),wxT("Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return(false);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
// After a wxMessageBox, the focus does not necessarily return to the
|
// After a wxMessageBox, the focus does not necessarily return to the
|
||||||
// window which was the focus when the message box popped up, so return
|
// window which was the focus when the message box popped up, so return
|
||||||
// focus to the Query dialog for certain
|
// focus to the Query dialog for certain
|
||||||
SetFocus();
|
SetFocus();
|
||||||
|
|
||||||
return(true);
|
return(TRUE);
|
||||||
|
|
||||||
} // CqueryDlg::ValidateWhereClause()
|
} // CqueryDlg::ValidateWhereClause()
|
||||||
|
|
||||||
@@ -2509,7 +2509,7 @@ bool CqueryDlg::ValidateWhereClause()
|
|||||||
void DisplayDbDiagnostics(wxDb *pDb)
|
void DisplayDbDiagnostics(wxDb *pDb)
|
||||||
{
|
{
|
||||||
wxString s, t;
|
wxString s, t;
|
||||||
bool comma = false;
|
bool comma = FALSE;
|
||||||
|
|
||||||
s = langDBINF_DB_NAME;
|
s = langDBINF_DB_NAME;
|
||||||
s += pDb->dbInf.dbmsName;
|
s += pDb->dbInf.dbmsName;
|
||||||
@@ -2651,7 +2651,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
}
|
}
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_TXN_ISOLATION_OPTS;
|
s += langDBINF_TXN_ISOLATION_OPTS;
|
||||||
if (pDb->dbInf.txnIsolationOptions & SQL_TXN_READ_UNCOMMITTED)
|
if (pDb->dbInf.txnIsolationOptions & SQL_TXN_READ_UNCOMMITTED)
|
||||||
{s += langDBINF_READ_UNCOMMITTED; comma++;}
|
{s += langDBINF_READ_UNCOMMITTED; comma++;}
|
||||||
@@ -2667,7 +2667,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
#endif
|
#endif
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_FETCH_DIRS;
|
s += langDBINF_FETCH_DIRS;
|
||||||
if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_NEXT)
|
if (pDb->dbInf.fetchDirections & SQL_FD_FETCH_NEXT)
|
||||||
{s += langDBINF_NEXT; comma++;}
|
{s += langDBINF_NEXT; comma++;}
|
||||||
@@ -2689,7 +2689,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
{if (comma++) s += ", "; s += langDBINF_BOOKMARK;}
|
{if (comma++) s += ", "; s += langDBINF_BOOKMARK;}
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_LOCK_TYPES;
|
s += langDBINF_LOCK_TYPES;
|
||||||
if (pDb->dbInf.lockTypes & SQL_LCK_NO_CHANGE)
|
if (pDb->dbInf.lockTypes & SQL_LCK_NO_CHANGE)
|
||||||
{s += langDBINF_NO_CHANGE; comma++;}
|
{s += langDBINF_NO_CHANGE; comma++;}
|
||||||
@@ -2699,7 +2699,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
{if (comma++) s += ", "; s += langDBINF_UNLOCK;}
|
{if (comma++) s += ", "; s += langDBINF_UNLOCK;}
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_POS_OPERS;
|
s += langDBINF_POS_OPERS;
|
||||||
if (pDb->dbInf.posOperations & SQL_POS_POSITION)
|
if (pDb->dbInf.posOperations & SQL_POS_POSITION)
|
||||||
{s += langDBINF_POSITION; comma++;}
|
{s += langDBINF_POSITION; comma++;}
|
||||||
@@ -2713,7 +2713,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
{if (comma++) s += ", "; s += langDBINF_ADD;}
|
{if (comma++) s += ", "; s += langDBINF_ADD;}
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_POS_STMTS;
|
s += langDBINF_POS_STMTS;
|
||||||
if (pDb->dbInf.posStmts & SQL_PS_POSITIONED_DELETE)
|
if (pDb->dbInf.posStmts & SQL_PS_POSITIONED_DELETE)
|
||||||
{s += langDBINF_POS_DEL; comma++;}
|
{s += langDBINF_POS_DEL; comma++;}
|
||||||
@@ -2723,7 +2723,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
{if (comma++) s += ", "; s += langDBINF_SELECT_FOR_UPD;}
|
{if (comma++) s += ", "; s += langDBINF_SELECT_FOR_UPD;}
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_SCROLL_CONCURR;
|
s += langDBINF_SCROLL_CONCURR;
|
||||||
if (pDb->dbInf.scrollConcurrency & SQL_SCCO_READ_ONLY)
|
if (pDb->dbInf.scrollConcurrency & SQL_SCCO_READ_ONLY)
|
||||||
{s += langDBINF_READ_ONLY; comma++;}
|
{s += langDBINF_READ_ONLY; comma++;}
|
||||||
@@ -2735,7 +2735,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
{if (comma++) s += ", "; s += langDBINF_OPT_VALUES;}
|
{if (comma++) s += ", "; s += langDBINF_OPT_VALUES;}
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_SCROLL_OPTS;
|
s += langDBINF_SCROLL_OPTS;
|
||||||
if (pDb->dbInf.scrollOptions & SQL_SO_FORWARD_ONLY)
|
if (pDb->dbInf.scrollOptions & SQL_SO_FORWARD_ONLY)
|
||||||
{s += langDBINF_FWD_ONLY; comma++;}
|
{s += langDBINF_FWD_ONLY; comma++;}
|
||||||
@@ -2749,7 +2749,7 @@ void DisplayDbDiagnostics(wxDb *pDb)
|
|||||||
{if (comma++) s += ", "; s += langDBINF_MIXED;}
|
{if (comma++) s += ", "; s += langDBINF_MIXED;}
|
||||||
s += "\n";
|
s += "\n";
|
||||||
|
|
||||||
comma = false;
|
comma = FALSE;
|
||||||
s += langDBINF_STATIC_SENS;
|
s += langDBINF_STATIC_SENS;
|
||||||
if (pDb->dbInf.staticSensitivity & SQL_SS_ADDITIONS)
|
if (pDb->dbInf.staticSensitivity & SQL_SS_ADDITIONS)
|
||||||
{s += langDBINF_ADDITIONS; comma++;}
|
{s += langDBINF_ADDITIONS; comma++;}
|
||||||
@@ -2849,7 +2849,7 @@ DbGridFrame::DbGridFrame(wxWindow *parent)
|
|||||||
: wxFrame (parent, -1, wxT("Database Table"),
|
: wxFrame (parent, -1, wxT("Database Table"),
|
||||||
wxDefaultPosition, wxSize(400, 325))
|
wxDefaultPosition, wxSize(400, 325))
|
||||||
{
|
{
|
||||||
initialized = false;
|
initialized = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2904,7 +2904,7 @@ bool DbGridFrame::Initialize()
|
|||||||
if (!Contact)
|
if (!Contact)
|
||||||
{
|
{
|
||||||
wxMessageBox(wxT("Unable to instantiate an instance of Ccontact"), wxT("Error..."), wxOK | wxICON_EXCLAMATION);
|
wxMessageBox(wxT("Unable to instantiate an instance of Ccontact"), wxT("Error..."), wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Contact->Open())
|
if (!Contact->Open())
|
||||||
@@ -2918,7 +2918,7 @@ bool DbGridFrame::Initialize()
|
|||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute the following query using the cursor designated
|
// Execute the following query using the cursor designated
|
||||||
@@ -2931,7 +2931,7 @@ bool DbGridFrame::Initialize()
|
|||||||
tStr = wxT("ODBC error during Query()\n\n");
|
tStr = wxT("ODBC error during Query()\n\n");
|
||||||
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
wxMessageBox(wxDbLogExtendedErrorMsg(tStr.c_str(),wxGetApp().Contact->GetDb(),__FILE__,__LINE__),
|
||||||
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
wxT("ODBC Error..."),wxOK | wxICON_EXCLAMATION);
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No data has been read in from the database yet, so
|
// No data has been read in from the database yet, so
|
||||||
@@ -2939,11 +2939,11 @@ bool DbGridFrame::Initialize()
|
|||||||
// so Fit() can correctly size the grid
|
// so Fit() can correctly size the grid
|
||||||
Contact->Initialize();
|
Contact->Initialize();
|
||||||
|
|
||||||
wxDbGridTableBase* db = new wxDbGridTableBase(Contact, cols, wxUSE_QUERY, true);
|
wxDbGridTableBase* db = new wxDbGridTableBase(Contact, cols, wxUSE_QUERY, TRUE);
|
||||||
|
|
||||||
delete cols;
|
delete cols;
|
||||||
|
|
||||||
grid->SetTable(db,true);
|
grid->SetTable(db,TRUE);
|
||||||
grid->SetMargins(0, 0);
|
grid->SetMargins(0, 0);
|
||||||
|
|
||||||
grid->Fit();
|
grid->Fit();
|
||||||
@@ -2951,8 +2951,8 @@ bool DbGridFrame::Initialize()
|
|||||||
size.x += 10;
|
size.x += 10;
|
||||||
size.y += 10;
|
size.y += 10;
|
||||||
SetClientSize(size);
|
SetClientSize(size);
|
||||||
initialized = true;
|
initialized = TRUE;
|
||||||
return true;
|
return TRUE;
|
||||||
} // DbGridFrame::Initialize()
|
} // DbGridFrame::Initialize()
|
||||||
|
|
||||||
#endif // #if wxUSE_NEW_GRID
|
#endif // #if wxUSE_NEW_GRID
|
||||||
@@ -2961,7 +2961,7 @@ bool DbGridFrame::Initialize()
|
|||||||
TEST CODE FOR TESTING THE wxDbCreateDataSource() FUNCTION
|
TEST CODE FOR TESTING THE wxDbCreateDataSource() FUNCTION
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
result = wxDbCreateDataSource(wxT("Microsoft Access Driver (*.mdb)"),wxT("GLT-TEST2"),wxT("GLT-Descrip"),false,wxT(""),this);
|
result = wxDbCreateDataSource(wxT("Microsoft Access Driver (*.mdb)"),wxT("GLT-TEST2"),wxT("GLT-Descrip"),FALSE,wxT(""),this);
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
// check for errors caused by ConfigDSN based functions
|
// check for errors caused by ConfigDSN based functions
|
||||||
|
@@ -135,7 +135,7 @@ Clookup::Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &de
|
|||||||
defDir)
|
defDir)
|
||||||
{
|
{
|
||||||
|
|
||||||
SetColDefs (0, colName, DB_DATA_TYPE_VARCHAR, lookupCol, SQL_C_CHAR, LOOKUP_COL_LEN+1, false, false);
|
SetColDefs (0, colName, DB_DATA_TYPE_VARCHAR, lookupCol, SQL_C_CHAR, LOOKUP_COL_LEN+1, FALSE, FALSE);
|
||||||
|
|
||||||
} // Clookup()
|
} // Clookup()
|
||||||
|
|
||||||
@@ -153,10 +153,10 @@ Clookup2::Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2,
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
SetColDefs (i, colName1, DB_DATA_TYPE_VARCHAR, lookupCol1, SQL_C_CHAR, LOOKUP_COL_LEN+1, false, false);
|
SetColDefs (i, colName1, DB_DATA_TYPE_VARCHAR, lookupCol1, SQL_C_CHAR, LOOKUP_COL_LEN+1, FALSE, FALSE);
|
||||||
|
|
||||||
if (wxStrlen(colName2) > 0)
|
if (wxStrlen(colName2) > 0)
|
||||||
SetColDefs (++i, colName2, DB_DATA_TYPE_VARCHAR, lookupCol2, SQL_C_CHAR, LOOKUP_COL_LEN+1, false, false);
|
SetColDefs (++i, colName2, DB_DATA_TYPE_VARCHAR, lookupCol2, SQL_C_CHAR, LOOKUP_COL_LEN+1, FALSE, FALSE);
|
||||||
|
|
||||||
} // Clookup2()
|
} // Clookup2()
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
wxBeginBusyCursor();
|
wxBeginBusyCursor();
|
||||||
|
|
||||||
wxStrcpy(ListDB_Selection,wxT(""));
|
wxStrcpy(ListDB_Selection,wxT(""));
|
||||||
widgetPtrsSet = false;
|
widgetPtrsSet = FALSE;
|
||||||
lookup = 0;
|
lookup = 0;
|
||||||
lookup2 = 0;
|
lookup2 = 0;
|
||||||
noDisplayCols = 1;
|
noDisplayCols = 1;
|
||||||
@@ -187,7 +187,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
pLookUpOkBtn = new wxButton(this, LOOKUP_DIALOG_OK, wxT("&Ok"), wxPoint(113, 222), wxSize( 70, 35), 0, wxDefaultValidator, wxT("LookUpOkBtn"));
|
pLookUpOkBtn = new wxButton(this, LOOKUP_DIALOG_OK, wxT("&Ok"), wxPoint(113, 222), wxSize( 70, 35), 0, wxDefaultValidator, wxT("LookUpOkBtn"));
|
||||||
pLookUpCancelBtn = new wxButton(this, LOOKUP_DIALOG_CANCEL, wxT("C&ancel"), wxPoint(212, 222), wxSize( 70, 35), 0, wxDefaultValidator, wxT("LookUpCancelBtn"));
|
pLookUpCancelBtn = new wxButton(this, LOOKUP_DIALOG_CANCEL, wxT("C&ancel"), wxPoint(212, 222), wxSize( 70, 35), 0, wxDefaultValidator, wxT("LookUpCancelBtn"));
|
||||||
|
|
||||||
widgetPtrsSet = true;
|
widgetPtrsSet = TRUE;
|
||||||
|
|
||||||
// Query the lookup table and display the result set
|
// Query the lookup table and display the result set
|
||||||
lookup = new Clookup(tableName, colName, pDb, defDir);
|
lookup = new Clookup(tableName, colName, pDb, defDir);
|
||||||
@@ -229,7 +229,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
pLookUpCancelBtn->SetDefault();
|
pLookUpCancelBtn->SetDefault();
|
||||||
pLookUpOkBtn->Enable(false);
|
pLookUpOkBtn->Enable(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display the dialog window
|
// Display the dialog window
|
||||||
@@ -248,7 +248,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
// 1) 2 columns rather than one
|
// 1) 2 columns rather than one
|
||||||
// 2) The ability to select DISTINCT column values
|
// 2) The ability to select DISTINCT column values
|
||||||
//
|
//
|
||||||
// Only set distinctValues equal to true if necessary. In many cases, the constraints
|
// Only set distinctValues equal to TRUE if necessary. In many cases, the constraints
|
||||||
// of the index(es) will enforce this uniqueness. Selecting DISTINCT does require
|
// of the index(es) will enforce this uniqueness. Selecting DISTINCT does require
|
||||||
// overhead by the database to ensure that all values returned are distinct. Therefore,
|
// overhead by the database to ensure that all values returned are distinct. Therefore,
|
||||||
// use this ONLY when you need it.
|
// use this ONLY when you need it.
|
||||||
@@ -275,7 +275,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
|
|
||||||
wxStrcpy(ListDB_Selection,wxT(""));
|
wxStrcpy(ListDB_Selection,wxT(""));
|
||||||
wxStrcpy(ListDB_Selection2,wxT(""));
|
wxStrcpy(ListDB_Selection2,wxT(""));
|
||||||
widgetPtrsSet = false;
|
widgetPtrsSet = FALSE;
|
||||||
lookup = 0;
|
lookup = 0;
|
||||||
lookup2 = 0;
|
lookup2 = 0;
|
||||||
noDisplayCols = (wxStrlen(dispCol2) ? 2 : 1);
|
noDisplayCols = (wxStrlen(dispCol2) ? 2 : 1);
|
||||||
@@ -292,7 +292,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
pLookUpOkBtn = new wxButton(this, LOOKUP_DIALOG_OK, wxT("&Ok"), wxPoint(113, 222), wxSize(70, 35), 0, wxDefaultValidator, wxT("LookUpOkBtn"));
|
pLookUpOkBtn = new wxButton(this, LOOKUP_DIALOG_OK, wxT("&Ok"), wxPoint(113, 222), wxSize(70, 35), 0, wxDefaultValidator, wxT("LookUpOkBtn"));
|
||||||
pLookUpCancelBtn = new wxButton(this, LOOKUP_DIALOG_CANCEL, wxT("C&ancel"), wxPoint(212, 222), wxSize(70, 35), 0, wxDefaultValidator, wxT("LookUpCancelBtn"));
|
pLookUpCancelBtn = new wxButton(this, LOOKUP_DIALOG_CANCEL, wxT("C&ancel"), wxPoint(212, 222), wxSize(70, 35), 0, wxDefaultValidator, wxT("LookUpCancelBtn"));
|
||||||
|
|
||||||
widgetPtrsSet = true;
|
widgetPtrsSet = TRUE;
|
||||||
|
|
||||||
// Query the lookup table and display the result set
|
// Query the lookup table and display the result set
|
||||||
lookup2 = new Clookup2(tableName, dispCol1, dispCol2, pDb, defDir);
|
lookup2 = new Clookup2(tableName, dispCol1, dispCol2, pDb, defDir);
|
||||||
@@ -359,7 +359,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
{
|
{
|
||||||
lookup2->SetOrderByClause(orderBy);
|
lookup2->SetOrderByClause(orderBy);
|
||||||
lookup2->SetWhereClause(where);
|
lookup2->SetWhereClause(where);
|
||||||
if (!lookup2->Query(false, distinctValues))
|
if (!lookup2->Query(FALSE, distinctValues))
|
||||||
{
|
{
|
||||||
wxMessageBox(wxT("ODBC error during Query()"),wxT("ODBC Error..."));
|
wxMessageBox(wxT("ODBC error during Query()"),wxT("ODBC Error..."));
|
||||||
Close();
|
Close();
|
||||||
@@ -389,7 +389,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
pLookUpCancelBtn->SetDefault();
|
pLookUpCancelBtn->SetDefault();
|
||||||
pLookUpOkBtn->Enable(false);
|
pLookUpOkBtn->Enable(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
pLookUpOkBtn->Enable(allowOk);
|
pLookUpOkBtn->Enable(allowOk);
|
||||||
@@ -405,8 +405,8 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
|
|||||||
|
|
||||||
void ClookUpDlg::OnClose(wxCloseEvent& event)
|
void ClookUpDlg::OnClose(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
widgetPtrsSet = false;
|
widgetPtrsSet = FALSE;
|
||||||
GetParent()->Enable(true);
|
GetParent()->Enable(TRUE);
|
||||||
|
|
||||||
if (lookup)
|
if (lookup)
|
||||||
delete lookup;
|
delete lookup;
|
||||||
@@ -418,7 +418,7 @@ void ClookUpDlg::OnClose(wxCloseEvent& event)
|
|||||||
while (wxIsBusy()) wxEndBusyCursor();
|
while (wxIsBusy()) wxEndBusyCursor();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
|
||||||
// return true;
|
// return TRUE;
|
||||||
|
|
||||||
} // ClookUpDlg::OnClose
|
} // ClookUpDlg::OnClose
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ class ClookUpDlg : public wxDialog
|
|||||||
// 1) 2 columns rather than one
|
// 1) 2 columns rather than one
|
||||||
// 2) The ability to select DISTINCT column values
|
// 2) The ability to select DISTINCT column values
|
||||||
//
|
//
|
||||||
// Only set distinctValues equal to true if necessary. In many cases, the constraints
|
// Only set distinctValues equal to TRUE if necessary. In many cases, the constraints
|
||||||
// of the index(es) will enforce this uniqueness. Selecting DISTINCT does require
|
// of the index(es) will enforce this uniqueness. Selecting DISTINCT does require
|
||||||
// overhead by the database to ensure that all values returned are distinct. Therefore,
|
// overhead by the database to ensure that all values returned are distinct. Therefore,
|
||||||
// use this ONLY when you need it.
|
// use this ONLY when you need it.
|
||||||
@@ -113,7 +113,7 @@ class ClookUpDlg : public wxDialog
|
|||||||
bool distinctValues, // e.g. SELECT DISTINCT ...
|
bool distinctValues, // e.g. SELECT DISTINCT ...
|
||||||
wxChar *selectStmt = 0, // If you wish to query by SQLstmt (complicated lookups)
|
wxChar *selectStmt = 0, // If you wish to query by SQLstmt (complicated lookups)
|
||||||
int maxLenCol1 = 0, // Mandatory if querying by SQLstmt
|
int maxLenCol1 = 0, // Mandatory if querying by SQLstmt
|
||||||
bool allowOk = true); // is the OK button enabled
|
bool allowOk = TRUE); // is the OK button enabled
|
||||||
|
|
||||||
void OnButton( wxCommandEvent &event );
|
void OnButton( wxCommandEvent &event );
|
||||||
void OnCommand(wxWindow& win, wxCommandEvent& event);
|
void OnCommand(wxWindow& win, wxCommandEvent& event);
|
||||||
|
Reference in New Issue
Block a user