Fixed code that did not work with Postgres
Removed all tabs, and replaced with spaces accordingly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5653 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -18,8 +18,6 @@
|
|||||||
The table this sample is based on is developer contact table, and shows
|
The table this sample is based on is developer contact table, and shows
|
||||||
some of the simple uses of the database classes wxDB and wxTable.
|
some of the simple uses of the database classes wxDB and wxTable.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* SYNOPSIS END
|
* SYNOPSIS END
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -120,7 +118,8 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
|
|||||||
if (pDbList->Free)
|
if (pDbList->Free)
|
||||||
continue;
|
continue;
|
||||||
// Display errors for this connection
|
// Display errors for this connection
|
||||||
for (int i = 0; i < DB_MAX_ERROR_HISTORY; i++)
|
int i;
|
||||||
|
for (i = 0; i < DB_MAX_ERROR_HISTORY; i++)
|
||||||
{
|
{
|
||||||
if (pDbList->PtrDb->errorList[i])
|
if (pDbList->PtrDb->errorList[i])
|
||||||
{
|
{
|
||||||
@@ -208,7 +207,7 @@ bool DatabaseDemoApp::OnInit()
|
|||||||
strcpy(DbConnectInf.Dsn, params.ODBCSource); // ODBC data source name (created with ODBC Administrator under Win95/NT)
|
strcpy(DbConnectInf.Dsn, params.ODBCSource); // ODBC data source name (created with ODBC Administrator under Win95/NT)
|
||||||
strcpy(DbConnectInf.Uid, params.UserName); // database username - must already exist in the data source
|
strcpy(DbConnectInf.Uid, params.UserName); // database username - must already exist in the data source
|
||||||
strcpy(DbConnectInf.AuthStr, params.Password); // password database username
|
strcpy(DbConnectInf.AuthStr, params.Password); // password database username
|
||||||
strcpy(DbConnectInf.defaultDir,params.DirPath); // path where the table exists (needed for dBase)
|
strcpy(DbConnectInf.defaultDir, params.DirPath); // path where the table exists (needed for dBase)
|
||||||
|
|
||||||
READONLY_DB = GetDbConnection(&DbConnectInf);
|
READONLY_DB = GetDbConnection(&DbConnectInf);
|
||||||
if (READONLY_DB == 0)
|
if (READONLY_DB == 0)
|
||||||
@@ -351,6 +350,7 @@ void DatabaseDemoFrame::BuildParameterDialog(wxWindow *parent)
|
|||||||
* on the database engine being used, and some database engines have a limit on the
|
* on the database engine being used, and some database engines have a limit on the
|
||||||
* number of connections (either hard limits, or license restricted) so care should
|
* number of connections (either hard limits, or license restricted) so care should
|
||||||
* be used to use as few connections as is necessary.
|
* be used to use as few connections as is necessary.
|
||||||
|
*
|
||||||
* IMPORTANT: Objects which share a wxDB pointer are ALL acted upon whenever a member
|
* IMPORTANT: Objects which share a wxDB pointer are ALL acted upon whenever a member
|
||||||
* function of pDb is called (i.e. CommitTrans() or RollbackTrans(), so if modifying
|
* function of pDb is called (i.e. CommitTrans() or RollbackTrans(), so if modifying
|
||||||
* or creating a table objects which use the same pDb, know that all the objects
|
* or creating a table objects which use the same pDb, know that all the objects
|
||||||
@@ -424,7 +424,7 @@ void Ccontact::SetupColumns()
|
|||||||
SetColDefs ( 5,"POSTCODE", DB_DATA_TYPE_VARCHAR, PostalCode, SQL_C_CHAR, sizeof(PostalCode), FALSE,TRUE);
|
SetColDefs ( 5,"POSTCODE", DB_DATA_TYPE_VARCHAR, PostalCode, SQL_C_CHAR, sizeof(PostalCode), FALSE,TRUE);
|
||||||
SetColDefs ( 6,"COUNTRY", DB_DATA_TYPE_VARCHAR, Country, SQL_C_CHAR, sizeof(Country), FALSE,TRUE);
|
SetColDefs ( 6,"COUNTRY", DB_DATA_TYPE_VARCHAR, Country, SQL_C_CHAR, sizeof(Country), FALSE,TRUE);
|
||||||
SetColDefs ( 7,"JOINDATE", DB_DATA_TYPE_DATE, &JoinDate, SQL_C_TIMESTAMP, sizeof(JoinDate), FALSE,TRUE);
|
SetColDefs ( 7,"JOINDATE", DB_DATA_TYPE_DATE, &JoinDate, SQL_C_TIMESTAMP, sizeof(JoinDate), FALSE,TRUE);
|
||||||
SetColDefs ( 8,"IS_DEV", DB_DATA_TYPE_INTEGER, &IsDeveloper, SQL_C_BOOLEAN(IsDeveloper),sizeof(IsDeveloper), FALSE,TRUE);
|
SetColDefs ( 8,"IS_DEV", DB_DATA_TYPE_INTEGER, &IsDeveloper, SQL_C_BOOLEAN(IsDeveloper), sizeof(IsDeveloper), FALSE,TRUE);
|
||||||
SetColDefs ( 9,"CONTRIBS", DB_DATA_TYPE_INTEGER, &Contributions, SQL_C_USHORT, sizeof(Contributions), FALSE,TRUE);
|
SetColDefs ( 9,"CONTRIBS", DB_DATA_TYPE_INTEGER, &Contributions, SQL_C_USHORT, sizeof(Contributions), FALSE,TRUE);
|
||||||
SetColDefs (10,"LINE_CNT", DB_DATA_TYPE_INTEGER, &LinesOfCode, SQL_C_ULONG, sizeof(LinesOfCode), FALSE,TRUE);
|
SetColDefs (10,"LINE_CNT", DB_DATA_TYPE_INTEGER, &LinesOfCode, SQL_C_ULONG, sizeof(LinesOfCode), FALSE,TRUE);
|
||||||
SetColDefs (11,"LANGUAGE", DB_DATA_TYPE_INTEGER, &NativeLanguage, SQL_C_ENUM, sizeof(NativeLanguage), FALSE,TRUE);
|
SetColDefs (11,"LANGUAGE", DB_DATA_TYPE_INTEGER, &NativeLanguage, SQL_C_ENUM, sizeof(NativeLanguage), FALSE,TRUE);
|
||||||
@@ -558,38 +558,30 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
|
|||||||
(void)new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "", wxPoint(15, 1), wxSize(497, 69), 0, "FunctionGrp");
|
(void)new wxStaticBox(this, EDITOR_DIALOG_FN_GROUP, "", wxPoint(15, 1), wxSize(497, 69), 0, "FunctionGrp");
|
||||||
(void)new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp");
|
(void)new wxStaticBox(this, EDITOR_DIALOG_SEARCH_GROUP, "", wxPoint(417, 1), wxSize(95, 242), 0, "SearchGrp");
|
||||||
|
|
||||||
pCreateBtn = new wxButton(this, EDITOR_DIALOG_CREATE, "&Create", wxPoint(25, 21), wxSize(70, 35), 0, wxDefaultValidator, "CreateBtn");
|
pCreateBtn = new wxButton(this, EDITOR_DIALOG_CREATE, "&Create", wxPoint( 25, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CreateBtn");
|
||||||
pEditBtn = new wxButton(this, EDITOR_DIALOG_EDIT, "&Edit", wxPoint(102, 21), wxSize(70, 35), 0, wxDefaultValidator, "EditBtn");
|
pEditBtn = new wxButton(this, EDITOR_DIALOG_EDIT, "&Edit", wxPoint(102, 21), wxSize( 70, 35), 0, wxDefaultValidator, "EditBtn");
|
||||||
pDeleteBtn = new wxButton(this, EDITOR_DIALOG_DELETE, "&Delete", wxPoint(179, 21), wxSize(70, 35), 0, wxDefaultValidator, "DeleteBtn");
|
pDeleteBtn = new wxButton(this, EDITOR_DIALOG_DELETE, "&Delete", wxPoint(179, 21), wxSize( 70, 35), 0, wxDefaultValidator, "DeleteBtn");
|
||||||
pCopyBtn = new wxButton(this, EDITOR_DIALOG_COPY, "Cop&y", wxPoint(256, 21), wxSize(70, 35), 0, wxDefaultValidator, "CopyBtn");
|
pCopyBtn = new wxButton(this, EDITOR_DIALOG_COPY, "Cop&y", wxPoint(256, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CopyBtn");
|
||||||
pSaveBtn = new wxButton(this, EDITOR_DIALOG_SAVE, "&Save", wxPoint(333, 21), wxSize(70, 35), 0, wxDefaultValidator, "SaveBtn");
|
pSaveBtn = new wxButton(this, EDITOR_DIALOG_SAVE, "&Save", wxPoint(333, 21), wxSize( 70, 35), 0, wxDefaultValidator, "SaveBtn");
|
||||||
pCancelBtn = new wxButton(this, EDITOR_DIALOG_CANCEL, "C&ancel", wxPoint(430, 21), wxSize(70, 35), 0, wxDefaultValidator, "CancelBtn");
|
pCancelBtn = new wxButton(this, EDITOR_DIALOG_CANCEL, "C&ancel", wxPoint(430, 21), wxSize( 70, 35), 0, wxDefaultValidator, "CancelBtn");
|
||||||
|
pPrevBtn = new wxButton(this, EDITOR_DIALOG_PREV, "<< &Prev", wxPoint(430, 81), wxSize( 70, 35), 0, wxDefaultValidator, "PrevBtn");
|
||||||
pPrevBtn = new wxButton(this, EDITOR_DIALOG_PREV, "<< &Prev", wxPoint(430, 81), wxSize(70, 35), 0, wxDefaultValidator, "PrevBtn");
|
pNextBtn = new wxButton(this, EDITOR_DIALOG_NEXT, "&Next >>", wxPoint(430, 121), wxSize( 70, 35), 0, wxDefaultValidator, "NextBtn");
|
||||||
pNextBtn = new wxButton(this, EDITOR_DIALOG_NEXT, "&Next >>", wxPoint(430, 121), wxSize(70, 35), 0, wxDefaultValidator, "NextBtn");
|
pQueryBtn = new wxButton(this, EDITOR_DIALOG_QUERY, "&Query", wxPoint(430, 161), wxSize( 70, 35), 0, wxDefaultValidator, "QueryBtn");
|
||||||
pQueryBtn = new wxButton(this, EDITOR_DIALOG_QUERY, "&Query", wxPoint(430, 161), wxSize(70, 35), 0, wxDefaultValidator, "QueryBtn");
|
pResetBtn = new wxButton(this, EDITOR_DIALOG_RESET, "&Reset", wxPoint(430, 200), wxSize( 70, 35), 0, wxDefaultValidator, "ResetBtn");
|
||||||
pResetBtn = new wxButton(this, EDITOR_DIALOG_RESET, "&Reset", wxPoint(430, 200), wxSize(70, 35), 0, wxDefaultValidator, "ResetBtn");
|
pNameMsg = new wxStaticText(this, EDITOR_DIALOG_NAME_MSG, "Name:", wxPoint( 17, 80), wxSize( -1, -1), 0, "NameMsg");
|
||||||
|
pNameTxt = new wxTextCtrl(this, EDITOR_DIALOG_NAME_TEXT, "", wxPoint( 17, 97), wxSize(308, 25), 0, wxDefaultValidator, "NameTxt");
|
||||||
pNameMsg = new wxStaticText(this, EDITOR_DIALOG_NAME_MSG, "Name:", wxPoint(17, 80), wxSize(-1, -1), 0, "NameMsg");
|
pNameListBtn = new wxButton(this, EDITOR_DIALOG_LOOKUP, "&Lookup", wxPoint(333, 99), wxSize( 70, 24), 0, wxDefaultValidator, "LookupBtn");
|
||||||
pNameTxt = new wxTextCtrl(this, EDITOR_DIALOG_NAME_TEXT, "", wxPoint(17, 97), wxSize(308, 25), 0, wxDefaultValidator, "NameTxt");
|
pAddress1Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS1_MSG, "Address:", wxPoint( 17, 130), wxSize( -1, -1), 0, "Address1Msg");
|
||||||
pNameListBtn = new wxButton(this, EDITOR_DIALOG_LOOKUP, "&Lookup", wxPoint(333, 99), wxSize(70, 24), 0, wxDefaultValidator, "LookupBtn");
|
pAddress1Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint( 17, 147), wxSize(308, 25), 0, wxDefaultValidator, "Address1Txt");
|
||||||
|
pAddress2Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS2_MSG, "Address:", wxPoint( 17, 180), wxSize( -1, -1), 0, "Address2Msg");
|
||||||
pAddress1Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS1_MSG, "Address:", wxPoint(17, 130), wxSize(-1, -1), 0, "Address1Msg");
|
pAddress2Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint( 17, 197), wxSize(308, 25), 0, wxDefaultValidator, "Address2Txt");
|
||||||
pAddress1Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint(17, 147), wxSize(308, 25), 0, wxDefaultValidator, "Address1Txt");
|
pCityMsg = new wxStaticText(this, EDITOR_DIALOG_CITY_MSG, "City:", wxPoint( 17, 230), wxSize( -1, -1), 0, "CityMsg");
|
||||||
|
pCityTxt = new wxTextCtrl(this, EDITOR_DIALOG_CITY_TEXT, "", wxPoint( 17, 247), wxSize(225, 25), 0, wxDefaultValidator, "CityTxt");
|
||||||
pAddress2Msg = new wxStaticText(this, EDITOR_DIALOG_ADDRESS2_MSG, "Address:", wxPoint(17, 180), wxSize(-1, -1), 0, "Address2Msg");
|
pStateMsg = new wxStaticText(this, EDITOR_DIALOG_STATE_MSG, "State:", wxPoint(250, 230), wxSize( -1, -1), 0, "StateMsg");
|
||||||
pAddress2Txt = new wxTextCtrl(this, EDITOR_DIALOG_ADDRESS2_TEXT, "", wxPoint(17, 197), wxSize(308, 25), 0, wxDefaultValidator, "Address2Txt");
|
|
||||||
|
|
||||||
pCityMsg = new wxStaticText(this, EDITOR_DIALOG_CITY_MSG, "City:", wxPoint(17, 230), wxSize(-1, -1), 0, "CityMsg");
|
|
||||||
pCityTxt = new wxTextCtrl(this, EDITOR_DIALOG_CITY_TEXT, "", wxPoint(17, 247), wxSize(225, 25), 0, wxDefaultValidator, "CityTxt");
|
|
||||||
|
|
||||||
pStateMsg = new wxStaticText(this, EDITOR_DIALOG_STATE_MSG, "State:", wxPoint(250, 230), wxSize(-1, -1), 0, "StateMsg");
|
|
||||||
pStateTxt = new wxTextCtrl(this, EDITOR_DIALOG_STATE_TEXT, "", wxPoint(250, 247), wxSize(153, 25), 0, wxDefaultValidator, "StateTxt");
|
pStateTxt = new wxTextCtrl(this, EDITOR_DIALOG_STATE_TEXT, "", wxPoint(250, 247), wxSize(153, 25), 0, wxDefaultValidator, "StateTxt");
|
||||||
|
pCountryMsg = new wxStaticText(this, EDITOR_DIALOG_COUNTRY_MSG, "Country:", wxPoint( 17, 280), wxSize( -1, -1), 0, "CountryMsg");
|
||||||
pCountryMsg = new wxStaticText(this, EDITOR_DIALOG_COUNTRY_MSG, "Country:", wxPoint(17, 280), wxSize(-1, -1), 0, "CountryMsg");
|
pCountryTxt = new wxTextCtrl(this, EDITOR_DIALOG_COUNTRY_TEXT, "", wxPoint( 17, 297), wxSize(225, 25), 0, wxDefaultValidator, "CountryTxt");
|
||||||
pCountryTxt = new wxTextCtrl(this, EDITOR_DIALOG_COUNTRY_TEXT, "", wxPoint(17, 297), wxSize(225, 25), 0, wxDefaultValidator, "CountryTxt");
|
pPostalCodeMsg = new wxStaticText(this, EDITOR_DIALOG_POSTAL_MSG, "Postal Code:",wxPoint(250, 280), wxSize( -1, -1), 0, "PostalCodeMsg");
|
||||||
|
|
||||||
pPostalCodeMsg = new wxStaticText(this, EDITOR_DIALOG_POSTAL_MSG, "Postal Code:", wxPoint(250, 280), wxSize(-1, -1), 0, "PostalCodeMsg");
|
|
||||||
pPostalCodeTxt = new wxTextCtrl(this, EDITOR_DIALOG_POSTAL_TEXT, "", wxPoint(250, 297), wxSize(153, 25), 0, wxDefaultValidator, "PostalCodeTxt");
|
pPostalCodeTxt = new wxTextCtrl(this, EDITOR_DIALOG_POSTAL_TEXT, "", wxPoint(250, 297), wxSize(153, 25), 0, wxDefaultValidator, "PostalCodeTxt");
|
||||||
|
|
||||||
wxString choice_strings[5];
|
wxString choice_strings[5];
|
||||||
@@ -598,21 +590,19 @@ CeditorDlg::CeditorDlg(wxWindow *parent) : wxPanel (parent, 1, 1, 460, 455)
|
|||||||
choice_strings[2] = "German";
|
choice_strings[2] = "German";
|
||||||
choice_strings[3] = "Spanish";
|
choice_strings[3] = "Spanish";
|
||||||
choice_strings[4] = "Other";
|
choice_strings[4] = "Other";
|
||||||
pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE, wxPoint(17, 346), wxSize(277, -1), 5, choice_strings);
|
|
||||||
pNativeLangMsg = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG, "Native language:", wxPoint(17, 330), wxSize(-1, -1), 0, "NativeLangMsg");
|
pNativeLangChoice = new wxChoice(this, EDITOR_DIALOG_LANG_CHOICE, wxPoint( 17, 346), wxSize(277, -1), 5, choice_strings);
|
||||||
|
pNativeLangMsg = new wxStaticText(this, EDITOR_DIALOG_LANG_MSG, "Native language:", wxPoint( 17, 330), wxSize( -1, -1), 0, "NativeLangMsg");
|
||||||
|
|
||||||
wxString radio_strings[2];
|
wxString radio_strings[2];
|
||||||
radio_strings[0] = "No";
|
radio_strings[0] = "No";
|
||||||
radio_strings[1] = "Yes";
|
radio_strings[1] = "Yes";
|
||||||
pDeveloperRadio = new wxRadioBox(this,EDITOR_DIALOG_DEVELOPER,"Developer:",wxPoint(303,330),wxSize(-1,-1),2,radio_strings,2,wxHORIZONTAL);
|
pDeveloperRadio = new wxRadioBox(this,EDITOR_DIALOG_DEVELOPER, "Developer:", wxPoint(303, 330), wxSize( -1, -1), 2, radio_strings, 2, wxHORIZONTAL);
|
||||||
|
pJoinDateMsg = new wxStaticText(this, EDITOR_DIALOG_JOIN_MSG, "Date joined:", wxPoint( 17, 380), wxSize( -1, -1), 0, "JoinDateMsg");
|
||||||
pJoinDateMsg = new wxStaticText(this, EDITOR_DIALOG_JOIN_MSG, "Date joined:", wxPoint(17, 380), wxSize(-1, -1), 0, "JoinDateMsg");
|
pJoinDateTxt = new wxTextCtrl(this, EDITOR_DIALOG_JOIN_TEXT, "", wxPoint( 17, 397), wxSize(150, 25), 0, wxDefaultValidator, "JoinDateTxt");
|
||||||
pJoinDateTxt = new wxTextCtrl(this, EDITOR_DIALOG_JOIN_TEXT, "", wxPoint(17, 397), wxSize(150, 25), 0, wxDefaultValidator, "JoinDateTxt");
|
pContribMsg = new wxStaticText(this, EDITOR_DIALOG_CONTRIB_MSG,"Contributions:", wxPoint(175, 380), wxSize( -1, -1), 0, "ContribMsg");
|
||||||
|
|
||||||
pContribMsg = new wxStaticText(this, EDITOR_DIALOG_CONTRIB_MSG, "Contributions:", wxPoint(175, 380), wxSize(-1, -1), 0, "ContribMsg");
|
|
||||||
pContribTxt = new wxTextCtrl(this, EDITOR_DIALOG_CONTRIB_TEXT, "", wxPoint(175, 397), wxSize(120, 25), 0, wxDefaultValidator, "ContribTxt");
|
pContribTxt = new wxTextCtrl(this, EDITOR_DIALOG_CONTRIB_TEXT, "", wxPoint(175, 397), wxSize(120, 25), 0, wxDefaultValidator, "ContribTxt");
|
||||||
|
pLinesMsg = new wxStaticText(this, EDITOR_DIALOG_LINES_MSG, "Lines of code:", wxPoint(303, 380), wxSize( -1, -1), 0, "LinesMsg");
|
||||||
pLinesMsg = new wxStaticText(this, EDITOR_DIALOG_LINES_MSG, "Lines of code:", wxPoint(303, 380), wxSize(-1, -1), 0, "LinesMsg");
|
|
||||||
pLinesTxt = new wxTextCtrl(this, EDITOR_DIALOG_LINES_TEXT, "", wxPoint(303, 397), wxSize(100, 25), 0, wxDefaultValidator, "LinesTxt");
|
pLinesTxt = new wxTextCtrl(this, EDITOR_DIALOG_LINES_TEXT, "", wxPoint(303, 397), wxSize(100, 25), 0, wxDefaultValidator, "LinesTxt");
|
||||||
|
|
||||||
// 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
|
||||||
@@ -633,7 +623,6 @@ 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"
|
// 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).
|
// to achieve a single row (in this case the first name in alphabetical order).
|
||||||
|
|
||||||
// commented out because PostgreSQL can't do this
|
|
||||||
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
||||||
{
|
{
|
||||||
Contact->whereStr.sprintf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->tableName);
|
Contact->whereStr.sprintf("NAME = (SELECT MIN(NAME) FROM %s)",Contact->tableName);
|
||||||
@@ -802,7 +791,6 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
// Previous record not available, retrieve first record in table
|
// Previous record not available, retrieve first record in table
|
||||||
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
||||||
{
|
{
|
||||||
// PostgreSQL can't do this
|
|
||||||
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||||
Contact->whereStr += Contact->tableName;
|
Contact->whereStr += Contact->tableName;
|
||||||
Contact->whereStr += ")";
|
Contact->whereStr += ")";
|
||||||
@@ -860,11 +848,14 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
if (strcmp(qryWhere, (const char*) Contact->qryWhereStr))
|
if (strcmp(qryWhere, (const char*) Contact->qryWhereStr))
|
||||||
{
|
{
|
||||||
|
|
||||||
// commented out because PostgreSQL can't do this
|
|
||||||
Contact->whereStr = "";
|
Contact->whereStr = "";
|
||||||
//Contact->orderBy = "NAME";
|
Contact->orderBy = "NAME";
|
||||||
//Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
|
||||||
//Contact->whereStr += CONTACT_TABLE_NAME;
|
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
||||||
|
{
|
||||||
|
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||||
|
Contact->whereStr += CONTACT_TABLE_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
// Append the query where string (if there is one)
|
// Append the query where string (if there is one)
|
||||||
Contact->qryWhereStr = qryWhere;
|
Contact->qryWhereStr = qryWhere;
|
||||||
@@ -902,14 +893,14 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
// Clear the additional where criteria established by the query feature
|
// Clear the additional where criteria established by the query feature
|
||||||
Contact->qryWhereStr = "";
|
Contact->qryWhereStr = "";
|
||||||
|
|
||||||
// Query the first record in the table
|
|
||||||
Contact->orderBy = "NAME";
|
Contact->orderBy = "NAME";
|
||||||
|
|
||||||
// commented out because PostgreSQL can't do this
|
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
||||||
//Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
{
|
||||||
//Contact->whereStr += CONTACT_TABLE_NAME;
|
Contact->whereStr = "NAME = (SELECT MIN(NAME) FROM ";
|
||||||
//Contact->whereStr += ")";
|
Contact->whereStr += CONTACT_TABLE_NAME;
|
||||||
|
Contact->whereStr += ")";
|
||||||
|
}
|
||||||
|
|
||||||
Contact->where = (char*) (const char*) Contact->whereStr;
|
Contact->where = (char*) (const char*) Contact->whereStr;
|
||||||
if (!Contact->Query())
|
if (!Contact->Query())
|
||||||
@@ -1230,7 +1221,6 @@ bool CeditorDlg::GetNextRec()
|
|||||||
|
|
||||||
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
||||||
{
|
{
|
||||||
// PostgreSQL can't do this
|
|
||||||
w = "NAME = (SELECT MIN(NAME) FROM ";
|
w = "NAME = (SELECT MIN(NAME) FROM ";
|
||||||
w += Contact->tableName;
|
w += Contact->tableName;
|
||||||
w += " WHERE NAME > '";
|
w += " WHERE NAME > '";
|
||||||
@@ -1266,7 +1256,6 @@ bool CeditorDlg::GetPrevRec()
|
|||||||
|
|
||||||
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
if (Contact->pDb->Dbms() != dbmsPOSTGRES)
|
||||||
{
|
{
|
||||||
// PostgreSQL can't do this
|
|
||||||
w = "NAME = (SELECT MAX(NAME) FROM ";
|
w = "NAME = (SELECT MAX(NAME) FROM ";
|
||||||
w += Contact->tableName;
|
w += Contact->tableName;
|
||||||
w += " WHERE NAME < '";
|
w += " WHERE NAME < '";
|
||||||
@@ -1339,20 +1328,16 @@ CparameterDlg::CparameterDlg(wxWindow *parent) : wxDialog (parent, PARAMETER_DIA
|
|||||||
// uninitialized pointers from crashing the program
|
// uninitialized pointers from crashing the program
|
||||||
widgetPtrsSet = FALSE;
|
widgetPtrsSet = FALSE;
|
||||||
|
|
||||||
pParamODBCSourceMsg = new wxStaticText(this, PARAMETER_DIALOG_SOURCE_MSG, "ODBC data sources:", wxPoint(10, 10), wxSize(-1, -1), 0, "ParamODBCSourceMsg");
|
pParamODBCSourceMsg = new wxStaticText(this, PARAMETER_DIALOG_SOURCE_MSG, "ODBC data sources:", wxPoint( 10, 10), wxSize( -1, -1), 0, "ParamODBCSourceMsg");
|
||||||
pParamODBCSourceList = new wxListBox(this, PARAMETER_DIALOG_SOURCE_LISTBOX, wxPoint(10, 29), wxSize(285, 150), 0, 0, wxLB_SINGLE|wxLB_ALWAYS_SB, wxDefaultValidator, "ParamODBCSourceList");
|
pParamODBCSourceList = new wxListBox(this, PARAMETER_DIALOG_SOURCE_LISTBOX, wxPoint( 10, 29), wxSize(285, 150), 0, 0, wxLB_SINGLE|wxLB_ALWAYS_SB, wxDefaultValidator, "ParamODBCSourceList");
|
||||||
|
pParamUserNameMsg = new wxStaticText(this, PARAMETER_DIALOG_NAME_MSG, "Database user name:", wxPoint( 10, 193), wxSize( -1, -1), 0, "ParamUserNameMsg");
|
||||||
pParamUserNameMsg = new wxStaticText(this, PARAMETER_DIALOG_NAME_MSG, "Database user name:", wxPoint(10, 193), wxSize(-1, -1), 0, "ParamUserNameMsg");
|
pParamUserNameTxt = new wxTextCtrl(this, PARAMETER_DIALOG_NAME_TEXT, "", wxPoint(10, 209), wxSize( 140, 25), 0, wxDefaultValidator, "ParamUserNameTxt");
|
||||||
pParamUserNameTxt = new wxTextCtrl(this, PARAMETER_DIALOG_NAME_TEXT, "", wxPoint(10, 209), wxSize(140, 25), 0, wxDefaultValidator, "ParamUserNameTxt");
|
pParamPasswordMsg = new wxStaticText(this, PARAMETER_DIALOG_PASSWORD_MSG, "Password:", wxPoint(156, 193), wxSize( -1, -1), 0, "ParamPasswordMsg");
|
||||||
|
pParamPasswordTxt = new wxTextCtrl(this, PARAMETER_DIALOG_PASSWORD_TEXT, "", wxPoint(156, 209), wxSize( 140, 25), 0, wxDefaultValidator, "ParamPasswordTxt");
|
||||||
pParamPasswordMsg = new wxStaticText(this, PARAMETER_DIALOG_PASSWORD_MSG, "Password:", wxPoint(156, 193), wxSize(-1, -1), 0, "ParamPasswordMsg");
|
pParamDirPathMsg = new wxStaticText(this, PARAMETER_DIALOG_DIRPATH_MSG, "Directory:", wxPoint( 10, 243), wxSize( -1, -1), 0, "ParamDirPathMsg");
|
||||||
pParamPasswordTxt = new wxTextCtrl(this, PARAMETER_DIALOG_PASSWORD_TEXT, "", wxPoint(156, 209), wxSize(140, 25), 0, wxDefaultValidator, "ParamPasswordTxt");
|
pParamDirPathTxt = new wxTextCtrl(this, PARAMETER_DIALOG_DIRPATH_TEXT, "", wxPoint( 10, 259), wxSize(140, 25), 0, wxDefaultValidator, "ParamDirPathTxt");
|
||||||
|
pParamSaveBtn = new wxButton(this, PARAMETER_DIALOG_SAVE, "&Save", wxPoint(310, 21), wxSize( 70, 35), 0, wxDefaultValidator, "ParamSaveBtn");
|
||||||
pParamDirPathMsg = new wxStaticText(this, PARAMETER_DIALOG_DIRPATH_MSG, "Directory:", wxPoint(10, 243), wxSize(-1, -1), 0, "ParamDirPathMsg");
|
pParamCancelBtn = new wxButton(this, PARAMETER_DIALOG_CANCEL, "C&ancel", wxPoint(310, 66), wxSize( 70, 35), 0, wxDefaultValidator, "ParamCancelBtn");
|
||||||
pParamDirPathTxt = new wxTextCtrl(this, PARAMETER_DIALOG_DIRPATH_TEXT, "", wxPoint(10, 259), wxSize(140, 25), 0, wxDefaultValidator, "ParamDirPathTxt");
|
|
||||||
|
|
||||||
pParamSaveBtn = new wxButton(this, PARAMETER_DIALOG_SAVE, "&Save", wxPoint(310, 21), wxSize(70, 35), 0, wxDefaultValidator, "ParamSaveBtn");
|
|
||||||
pParamCancelBtn = new wxButton(this, PARAMETER_DIALOG_CANCEL, "C&ancel", wxPoint(310, 66), wxSize(70, 35), 0, wxDefaultValidator, "ParamCancelBtn");
|
|
||||||
|
|
||||||
// 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
|
||||||
@@ -1541,7 +1526,8 @@ void CparameterDlg::FillDataSourceList()
|
|||||||
strList.Add("");
|
strList.Add("");
|
||||||
char **p = strList.ListToArray();
|
char **p = strList.ListToArray();
|
||||||
|
|
||||||
for (int i = 0; strlen(p[i]); i++)
|
int i;
|
||||||
|
for (i = 0; strlen(p[i]); i++)
|
||||||
pParamODBCSourceList->Append(p[i]);
|
pParamODBCSourceList->Append(p[i]);
|
||||||
} // CparameterDlg::CparameterDlg::FillDataSourceList()
|
} // CparameterDlg::CparameterDlg::FillDataSourceList()
|
||||||
|
|
||||||
@@ -1573,11 +1559,10 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereA
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pQueryCol1Msg = new wxStaticText(this, QUERY_DIALOG_COL_MSG, "Column 1:", wxPoint(10, 10), wxSize(69, 16), 0, "QueryCol1Msg");
|
pQueryCol1Msg = new wxStaticText(this, QUERY_DIALOG_COL_MSG, "Column 1:", wxPoint( 10, 10), wxSize( 69, 16), 0, "QueryCol1Msg");
|
||||||
pQueryCol1Choice = new wxChoice(this, QUERY_DIALOG_COL_CHOICE, wxPoint(10, 27), wxSize(250, 27), 0, 0, 0, wxDefaultValidator, "QueryCol1Choice");
|
pQueryCol1Choice = new wxChoice(this, QUERY_DIALOG_COL_CHOICE, wxPoint( 10, 27), wxSize(250, 27), 0, 0, 0, wxDefaultValidator, "QueryCol1Choice");
|
||||||
|
pQueryNotMsg = new wxStaticText(this, QUERY_DIALOG_NOT_MSG, "NOT", wxPoint(268, 10), wxSize( -1, -1), 0, "QueryNotMsg");
|
||||||
pQueryNotMsg = new wxStaticText(this, QUERY_DIALOG_NOT_MSG, "NOT", wxPoint(268, 10), wxSize(-1, -1), 0, "QueryNotMsg");
|
pQueryNotCheck = new wxCheckBox(this, QUERY_DIALOG_NOT_CHECKBOX, "", wxPoint(275, 37), wxSize( 20, 20), 0, wxDefaultValidator, "QueryNotCheck");
|
||||||
pQueryNotCheck = new wxCheckBox(this, QUERY_DIALOG_NOT_CHECKBOX, "", wxPoint(275, 37), wxSize(20, 20), 0, wxDefaultValidator, "QueryNotCheck");
|
|
||||||
|
|
||||||
wxString choice_strings[9];
|
wxString choice_strings[9];
|
||||||
choice_strings[0] = "=";
|
choice_strings[0] = "=";
|
||||||
@@ -1589,34 +1574,27 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereA
|
|||||||
choice_strings[6] = "Contains";
|
choice_strings[6] = "Contains";
|
||||||
choice_strings[7] = "Like";
|
choice_strings[7] = "Like";
|
||||||
choice_strings[8] = "Between";
|
choice_strings[8] = "Between";
|
||||||
pQueryOperatorMsg = new wxStaticText(this, QUERY_DIALOG_OP_MSG, "Operator:", wxPoint(305, 10), wxSize(-1, -1), 0, "QueryOperatorMsg");
|
|
||||||
pQueryOperatorChoice = new wxChoice(this, QUERY_DIALOG_OP_CHOICE, wxPoint(305, 27), wxSize(80, 27), 9, choice_strings, 0, wxDefaultValidator, "QueryOperatorChoice");
|
|
||||||
|
|
||||||
pQueryCol2Msg = new wxStaticText(this, QUERY_DIALOG_COL2_MSG, "Column 2:", wxPoint(10, 65), wxSize(69, 16), 0, "QueryCol2Msg");
|
pQueryOperatorMsg = new wxStaticText(this, QUERY_DIALOG_OP_MSG, "Operator:", wxPoint(305, 10), wxSize( -1, -1), 0, "QueryOperatorMsg");
|
||||||
pQueryCol2Choice = new wxChoice(this, QUERY_DIALOG_COL2_CHOICE, wxPoint(10, 82), wxSize(250, 27), 0, 0, 0, wxDefaultValidator, "QueryCol2Choice");
|
pQueryOperatorChoice = new wxChoice(this, QUERY_DIALOG_OP_CHOICE, wxPoint(305, 27), wxSize( 80, 27), 9, choice_strings, 0, wxDefaultValidator, "QueryOperatorChoice");
|
||||||
|
pQueryCol2Msg = new wxStaticText(this, QUERY_DIALOG_COL2_MSG, "Column 2:", wxPoint( 10, 65), wxSize( 69, 16), 0, "QueryCol2Msg");
|
||||||
pQuerySqlWhereMsg = new wxStaticText(this, QUERY_DIALOG_WHERE_MSG, "SQL where clause:", wxPoint(10, 141), wxSize(-1, -1), 0, "QuerySqlWhereMsg");
|
pQueryCol2Choice = new wxChoice(this, QUERY_DIALOG_COL2_CHOICE, wxPoint( 10, 82), wxSize(250, 27), 0, 0, 0, wxDefaultValidator, "QueryCol2Choice");
|
||||||
pQuerySqlWhereMtxt = new wxTextCtrl(this, QUERY_DIALOG_WHERE_TEXT, "", wxPoint(10, 159), wxSize(377, 134), wxTE_MULTILINE, wxDefaultValidator, "QuerySqlWhereMtxt");
|
pQuerySqlWhereMsg = new wxStaticText(this, QUERY_DIALOG_WHERE_MSG, "SQL where clause:", wxPoint( 10, 141), wxSize( -1, -1), 0, "QuerySqlWhereMsg");
|
||||||
|
pQuerySqlWhereMtxt = new wxTextCtrl(this, QUERY_DIALOG_WHERE_TEXT, "", wxPoint( 10, 159), wxSize(377, 134), wxTE_MULTILINE, wxDefaultValidator, "QuerySqlWhereMtxt");
|
||||||
pQueryAddBtn = new wxButton(this, QUERY_DIALOG_ADD, "&Add", wxPoint(406, 24), wxSize(56, 26), 0, wxDefaultValidator, "QueryAddBtn");
|
pQueryAddBtn = new wxButton(this, QUERY_DIALOG_ADD, "&Add", wxPoint(406, 24), wxSize( 56, 26), 0, wxDefaultValidator, "QueryAddBtn");
|
||||||
pQueryAndBtn = new wxButton(this, QUERY_DIALOG_AND, "A&nd", wxPoint(406, 58), wxSize(56, 26), 0, wxDefaultValidator, "QueryAndBtn");
|
pQueryAndBtn = new wxButton(this, QUERY_DIALOG_AND, "A&nd", wxPoint(406, 58), wxSize( 56, 26), 0, wxDefaultValidator, "QueryAndBtn");
|
||||||
pQueryOrBtn = new wxButton(this, QUERY_DIALOG_OR, "&Or", wxPoint(406, 92), wxSize(56, 26), 0, wxDefaultValidator, "QueryOrBtn");
|
pQueryOrBtn = new wxButton(this, QUERY_DIALOG_OR, "&Or", wxPoint(406, 92), wxSize( 56, 26), 0, wxDefaultValidator, "QueryOrBtn");
|
||||||
|
pQueryLParenBtn = new wxButton(this, QUERY_DIALOG_LPAREN, "(", wxPoint(406, 126), wxSize( 26, 26), 0, wxDefaultValidator, "QueryLParenBtn");
|
||||||
pQueryLParenBtn = new wxButton(this, QUERY_DIALOG_LPAREN, "(", wxPoint(406, 126), wxSize(26, 26), 0, wxDefaultValidator, "QueryLParenBtn");
|
pQueryRParenBtn = new wxButton(this, QUERY_DIALOG_RPAREN, ")", wxPoint(436, 126), wxSize( 26, 26), 0, wxDefaultValidator, "QueryRParenBtn");
|
||||||
pQueryRParenBtn = new wxButton(this, QUERY_DIALOG_RPAREN, ")", wxPoint(436, 126), wxSize(26, 26), 0, wxDefaultValidator, "QueryRParenBtn");
|
pQueryDoneBtn = new wxButton(this, QUERY_DIALOG_DONE, "&Done", wxPoint(406, 185), wxSize( 56, 26), 0, wxDefaultValidator, "QueryDoneBtn");
|
||||||
|
pQueryClearBtn = new wxButton(this, QUERY_DIALOG_CLEAR, "C&lear", wxPoint(406, 218), wxSize( 56, 26), 0, wxDefaultValidator, "QueryClearBtn");
|
||||||
pQueryDoneBtn = new wxButton(this, QUERY_DIALOG_DONE, "&Done", wxPoint(406, 185), wxSize(56, 26), 0, wxDefaultValidator, "QueryDoneBtn");
|
pQueryCountBtn = new wxButton(this, QUERY_DIALOG_COUNT, "&Count", wxPoint(406, 252), wxSize( 56, 26), 0, wxDefaultValidator, "QueryCountBtn");
|
||||||
pQueryClearBtn = new wxButton(this, QUERY_DIALOG_CLEAR, "C&lear", wxPoint(406, 218), wxSize(56, 26), 0, wxDefaultValidator, "QueryClearBtn");
|
pQueryValue1Msg = new wxStaticText(this, QUERY_DIALOG_VALUE1_MSG, "Value:", wxPoint(277, 66), wxSize( -1, -1), 0, "QueryValue1Msg");
|
||||||
pQueryCountBtn = new wxButton(this, QUERY_DIALOG_COUNT, "&Count", wxPoint(406, 252), wxSize(56, 26), 0, wxDefaultValidator, "QueryCountBtn");
|
|
||||||
|
|
||||||
pQueryValue1Msg = new wxStaticText(this, QUERY_DIALOG_VALUE1_MSG, "Value:", wxPoint(277, 66), wxSize(-1, -1), 0, "QueryValue1Msg");
|
|
||||||
pQueryValue1Txt = new wxTextCtrl(this, QUERY_DIALOG_VALUE1_TEXT, "", wxPoint(277, 83), wxSize(108, 25), 0, wxDefaultValidator, "QueryValue1Txt");
|
pQueryValue1Txt = new wxTextCtrl(this, QUERY_DIALOG_VALUE1_TEXT, "", wxPoint(277, 83), wxSize(108, 25), 0, wxDefaultValidator, "QueryValue1Txt");
|
||||||
|
pQueryValue2Msg = new wxStaticText(this, QUERY_DIALOG_VALUE2_MSG, "AND", wxPoint(238, 126), wxSize( -1, -1), 0, "QueryValue2Msg");
|
||||||
pQueryValue2Msg = new wxStaticText(this, QUERY_DIALOG_VALUE2_MSG, "AND", wxPoint(238, 126), wxSize(-1, -1), 0, "QueryValue2Msg");
|
|
||||||
pQueryValue2Txt = new wxTextCtrl(this, QUERY_DIALOG_VALUE2_TEXT, "", wxPoint(277, 120), wxSize(108, 25), 0, wxDefaultValidator, "QueryValue2Txt");
|
pQueryValue2Txt = new wxTextCtrl(this, QUERY_DIALOG_VALUE2_TEXT, "", wxPoint(277, 120), wxSize(108, 25), 0, wxDefaultValidator, "QueryValue2Txt");
|
||||||
|
pQueryHintGrp = new wxStaticBox(this, QUERY_DIALOG_HINT_GROUP, "", wxPoint( 10, 291), wxSize(377, 40), 0, "QueryHintGrp");
|
||||||
pQueryHintGrp = new wxStaticBox(this, QUERY_DIALOG_HINT_GROUP, "", wxPoint(10, 291), wxSize(377, 40), 0, "QueryHintGrp");
|
pQueryHintMsg = new wxStaticText(this, QUERY_DIALOG_HINT_MSG, "", wxPoint( 16, 306), wxSize( -1, -1), 0, "QueryHintMsg");
|
||||||
pQueryHintMsg = new wxStaticText(this, QUERY_DIALOG_HINT_MSG, "", wxPoint(16, 306), wxSize(-1, -1), 0, "QueryHintMsg");
|
|
||||||
|
|
||||||
widgetPtrsSet = TRUE;
|
widgetPtrsSet = TRUE;
|
||||||
// Initialize the dialog
|
// Initialize the dialog
|
||||||
@@ -1634,7 +1612,8 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDB *pDb, char *tblName[], char *pWhereA
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; colInf[i].colName && strlen(colInf[i].colName); i++)
|
int i;
|
||||||
|
for (i = 0; colInf[i].colName && strlen(colInf[i].colName); i++)
|
||||||
{
|
{
|
||||||
// If there is more than one table being queried, qualify
|
// If there is more than one table being queried, qualify
|
||||||
// the column names with the table name prefix.
|
// the column names with the table name prefix.
|
||||||
@@ -1912,35 +1891,6 @@ void CqueryDlg::OnCloseWindow(wxCloseEvent& event)
|
|||||||
|
|
||||||
} // CqueryDlg::OnCloseWindow()
|
} // CqueryDlg::OnCloseWindow()
|
||||||
|
|
||||||
/*
|
|
||||||
bool CqueryDlg::SetWidgetPtrs()
|
|
||||||
{
|
|
||||||
bool abort = FALSE;
|
|
||||||
|
|
||||||
abort = abort || !(pQueryCol1Choice = (wxChoice *)GetWidgetPtr("QueryCol1Choice",this));
|
|
||||||
abort = abort || !(pQueryNotCheck = (wxCheckBox *)GetWidgetPtr("QueryNotCheck",this));
|
|
||||||
abort = abort || !(pQueryOperatorChoice = (wxChoice *)GetWidgetPtr("QueryOperatorChoice",this));
|
|
||||||
abort = abort || !(pQueryCol2Choice = (wxChoice *)GetWidgetPtr("QueryCol2Choice",this));
|
|
||||||
abort = abort || !(pQueryValue1Txt = (wxTextCtrl *)GetWidgetPtr("QueryValue1Txt",this));
|
|
||||||
abort = abort || !(pQueryValue2Txt = (wxTextCtrl *)GetWidgetPtr("QueryValue2Txt",this));
|
|
||||||
abort = abort || !(pQuerySqlWhereMtxt = (wxMultiText *)GetWidgetPtr("QuerySqlWhereMtxt",this));
|
|
||||||
abort = abort || !(pQueryAddBtn = (wxButton *)GetWidgetPtr("QueryAddBtn",this));
|
|
||||||
abort = abort || !(pQueryAndBtn = (wxButton *)GetWidgetPtr("QueryAndBtn",this));
|
|
||||||
abort = abort || !(pQueryOrBtn = (wxButton *)GetWidgetPtr("QueryOrBtn",this));
|
|
||||||
abort = abort || !(pQueryLParenBtn = (wxButton *)GetWidgetPtr("QueryLParenBtn",this));
|
|
||||||
abort = abort || !(pQueryRParenBtn = (wxButton *)GetWidgetPtr("QueryRParenBtn",this));
|
|
||||||
abort = abort || !(pQueryDoneBtn = (wxButton *)GetWidgetPtr("QueryDoneBtn",this));
|
|
||||||
abort = abort || !(pQueryClearBtn = (wxButton *)GetWidgetPtr("QueryClearBtn",this));
|
|
||||||
abort = abort || !(pQueryCountBtn = (wxButton *)GetWidgetPtr("QueryCountBtn",this));
|
|
||||||
abort = abort || !(pQueryHelpBtn = (wxButton *)GetWidgetPtr("QueryHelpBtn",this));
|
|
||||||
abort = abort || !(pQueryHintMsg = (wxStaticText *)GetWidgetPtr("QueryHintMsg",this));
|
|
||||||
|
|
||||||
pFocusTxt = NULL;
|
|
||||||
|
|
||||||
return(widgetPtrsSet = !abort);
|
|
||||||
|
|
||||||
} // CqueryDlg::SetWidgetPtrs
|
|
||||||
*/
|
|
||||||
|
|
||||||
void CqueryDlg::AppendToWhere(char *s)
|
void CqueryDlg::AppendToWhere(char *s)
|
||||||
{
|
{
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
|
#include <wx/db.h>
|
||||||
#include <wx/dbtable.h>
|
#include <wx/dbtable.h>
|
||||||
|
|
||||||
enum DialogModes {mView,mCreate,mEdit,mSearch};
|
enum DialogModes {mView,mCreate,mEdit,mSearch};
|
||||||
@@ -57,17 +58,17 @@ const char paramFilename[] = "dbtest.cfg";
|
|||||||
class CstructContact : public wxObject
|
class CstructContact : public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char Name[ 50+1 ]; // Contact's name
|
char Name[50+1]; // Contact's name
|
||||||
char Addr1[ 50+1 ];
|
char Addr1[50+1];
|
||||||
char Addr2[ 50+1 ];
|
char Addr2[50+1];
|
||||||
char City[ 25+1 ];
|
char City[25+1];
|
||||||
char State[ 25+1 ];
|
char State[25+1];
|
||||||
char PostalCode[ 15+1 ];
|
char PostalCode[15+1];
|
||||||
char Country[ 20+1 ];
|
char Country[20+1];
|
||||||
TIMESTAMP_STRUCT JoinDate; // Date on which this person joined the wxWindows project
|
TIMESTAMP_STRUCT JoinDate; // Date on which this person joined the wxWindows project
|
||||||
Language NativeLanguage; // Enumerated type indicating person's native language
|
Language NativeLanguage; // Enumerated type indicating person's native language
|
||||||
bool IsDeveloper; // Is this person a developer for wxWindows, or just a subscriber
|
bool IsDeveloper; // Is this person a developer for wxWindows, or just a subscriber
|
||||||
int Contributions; // Something to show off an integer field
|
UCHAR Contributions; // Something to show off an integer field
|
||||||
ULONG LinesOfCode; // Something to show off a 'long' field
|
ULONG LinesOfCode; // Something to show off a 'long' field
|
||||||
}; // CstructContact
|
}; // CstructContact
|
||||||
|
|
||||||
@@ -166,6 +167,7 @@ class CeditorDlg : public wxPanel
|
|||||||
Ccontact *Contact; // this is the table object that will be being manipulated
|
Ccontact *Contact; // this is the table object that will be being manipulated
|
||||||
|
|
||||||
CeditorDlg(wxWindow *parent);
|
CeditorDlg(wxWindow *parent);
|
||||||
|
|
||||||
void OnCloseWindow(wxCloseEvent& event);
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
void OnButton( wxCommandEvent &event );
|
void OnButton( wxCommandEvent &event );
|
||||||
void OnCommand(wxWindow& win, wxCommandEvent& event);
|
void OnCommand(wxWindow& win, wxCommandEvent& event);
|
||||||
@@ -244,6 +246,7 @@ class CparameterDlg : public wxDialog
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
CparameterDlg(wxWindow *parent);
|
CparameterDlg(wxWindow *parent);
|
||||||
|
|
||||||
void OnCloseWindow(wxCloseEvent& event);
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
void OnButton( wxCommandEvent &event );
|
void OnButton( wxCommandEvent &event );
|
||||||
void OnCommand(wxWindow& win, wxCommandEvent& event);
|
void OnCommand(wxWindow& win, wxCommandEvent& event);
|
||||||
@@ -349,7 +352,6 @@ class CqueryDlg : public wxDialog
|
|||||||
void OnCloseWindow(wxCloseEvent& event);
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
void OnActivate(bool) {}; // necessary for hot keys
|
void OnActivate(bool) {}; // necessary for hot keys
|
||||||
|
|
||||||
// bool SetWidgetPtrs();
|
|
||||||
void AppendToWhere(char *s);
|
void AppendToWhere(char *s);
|
||||||
void ProcessAddBtn();
|
void ProcessAddBtn();
|
||||||
void ProcessCountBtn();
|
void ProcessCountBtn();
|
||||||
|
@@ -180,9 +180,9 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, char *windowTitle, char *tableName, cha
|
|||||||
noDisplayCols = 1;
|
noDisplayCols = 1;
|
||||||
col1Len = 0;
|
col1Len = 0;
|
||||||
|
|
||||||
pLookUpSelectList = new wxListBox(this, LOOKUP_DIALOG_SELECT, wxPoint(5, 15), wxSize(384, 195), 0, 0, wxLB_SINGLE|wxLB_ALWAYS_SB, wxDefaultValidator, "LookUpSelectList");
|
pLookUpSelectList = new wxListBox(this, LOOKUP_DIALOG_SELECT, wxPoint( 5, 15), wxSize(384, 195), 0, 0, wxLB_SINGLE|wxLB_ALWAYS_SB, wxDefaultValidator, "LookUpSelectList");
|
||||||
pLookUpOkBtn = new wxButton(this, LOOKUP_DIALOG_OK, "&Ok", wxPoint(113, 222), wxSize(70, 35), 0, wxDefaultValidator, "LookUpOkBtn");
|
pLookUpOkBtn = new wxButton(this, LOOKUP_DIALOG_OK, "&Ok", wxPoint(113, 222), wxSize( 70, 35), 0, wxDefaultValidator, "LookUpOkBtn");
|
||||||
pLookUpCancelBtn = new wxButton(this, LOOKUP_DIALOG_CANCEL, "C&ancel", wxPoint(212, 222), wxSize(70, 35), 0, wxDefaultValidator, "LookUpCancelBtn");
|
pLookUpCancelBtn = new wxButton(this, LOOKUP_DIALOG_CANCEL, "C&ancel", wxPoint(212, 222), wxSize( 70, 35), 0, wxDefaultValidator, "LookUpCancelBtn");
|
||||||
|
|
||||||
widgetPtrsSet = TRUE;
|
widgetPtrsSet = TRUE;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user