Removed TABs that had gotten in to the source

Added more feature tests to the sample


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2001-05-23 13:48:04 +00:00
parent 081eb1b120
commit 69a2b59d53
2 changed files with 302 additions and 297 deletions

View File

@@ -553,7 +553,7 @@ void DatabaseDemoApp::CreateDataTable(bool recreate)
}
else
{
if (!Contact->CreateIndexes())
if (!Contact->CreateIndexes(recreate))
{
wxEndBusyCursor();
wxString tStr;
@@ -615,7 +615,9 @@ void DatabaseDemoFrame::OnRecreateTable(wxCommandEvent& event)
void DatabaseDemoFrame::OnRecreateIndexes(wxCommandEvent& event)
{
if (!wxGetApp().Contact->CreateIndexes())
wxGetApp().Contact->GetDb()->RollbackTrans(); // Make sure the current cursor is in a known/stable state
if (!wxGetApp().Contact->CreateIndexes(true))
{
while (wxIsBusy())
wxEndBusyCursor();
@@ -810,7 +812,7 @@ void Ccontact::SetupColumns()
} // Ccontact::SetupColumns
bool Ccontact::CreateIndexes(void)
bool Ccontact::CreateIndexes(bool recreate)
{
// This index could easily be accomplished with an "orderBy" clause,
// but is done to show how to construct a non-primary index.
@@ -827,7 +829,7 @@ bool Ccontact::CreateIndexes(void)
indexName = GetTableName();
indexName += "_IDX1";
Ok = CreateIndex(indexName.c_str(), TRUE, 2, idxDef);
Ok = CreateIndex(indexName.c_str(), TRUE, 2, idxDef, recreate);
return Ok;
} // Ccontact::CreateIndexes()
@@ -1177,22 +1179,23 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& event)
if (widgetName == pDataTypesBtn->GetName())
{
CheckSupportForAllDataTypes(wxGetApp().READONLY_DB);
wxMessageBox("Support datatypes was dumped to stdout.");
return;
} // Data types Button
if (widgetName == pDbDiagsBtn->GetName())
{
/*
strcpy(wxGetApp().Contact->Addr1,"12345678901234567890");
//wxString sqlStmt = "UPDATE CONTACTS set ADDRESS1='1234567890ABCEFG' where NAME='12345'";
//if (wxGetApp().Contact->GetDb()->ExecSql(sqlStmt))
if (wxGetApp().Contact->UpdateWhere("NAME = '12345'"))
wxGetApp().Contact->GetDb()->CommitTrans();
else
wxGetApp().Contact->GetDb()->RollbackTrans();
*/
DisplayDbDiagnostics(wxGetApp().READONLY_DB);
wxMessageBox("Diagnostics info was dumped to stdout.");
return;
}
if (widgetName == pCatalogBtn->GetName())
{
if (wxGetApp().Contact->GetDb()->Catalog("","catalog.txt"))
wxMessageBox("The file 'catalog.txt' was created.");
else
wxMessageBox("Creation of the file 'catalog.txt' was failed.");
return;
}
@@ -1322,6 +1325,7 @@ bool CeditorDlg::Initialize()
pLinesMsg = new wxStaticText(this, EDITOR_DIALOG_LINES_MSG, wxT("Lines of code:"), wxPoint(303, 380), wxSize( -1, -1), 0, wxT("LinesMsg"));
pLinesTxt = new wxTextCtrl(this, EDITOR_DIALOG_LINES_TEXT, wxT(""), wxPoint(303, 397), wxSize(100, 25), 0, wxDefaultValidator, wxT("LinesTxt"));
pCatalogBtn = new wxButton(this, EDITOR_DIALOG_CATALOG, wxT("Catalo&g"), wxPoint(430, 287), wxSize( 70, 35), 0, wxDefaultValidator, wxT("CatalogBtn"));
pDataTypesBtn = new wxButton(this, EDITOR_DIALOG_DATATYPES, wxT("Data&types"), wxPoint(430, 337), wxSize( 70, 35), 0, wxDefaultValidator, wxT("DataTypesBtn"));
pDbDiagsBtn = new wxButton(this, EDITOR_DIALOG_DB_DIAGS, wxT("DB Dia&gs"), wxPoint(430, 387), wxSize( 70, 35), 0, wxDefaultValidator, wxT("DbDiagsBtn"));

View File

@@ -129,7 +129,7 @@ class Ccontact : public wxDbTable, public CstructContact
// Contains all the index definitions and calls to wxDbTable::CreateIndex()
// required to create all the indexes we wish to define for this table.
bool CreateIndexes(void);
bool CreateIndexes(bool recreate);
// Since we do not wish to have duplicate code blocks all over our program
// for a common query/fetch that we will need to do in many places, we
@@ -252,7 +252,7 @@ class CeditorDlg : public wxPanel
wxButton *pCreateBtn, *pEditBtn, *pDeleteBtn, *pCopyBtn, *pSaveBtn, *pCancelBtn;
wxButton *pPrevBtn, *pNextBtn, *pQueryBtn, *pResetBtn, *pDoneBtn, *pHelpBtn;
wxButton *pNameListBtn;
wxButton *pDataTypesBtn, *pDbDiagsBtn;
wxButton *pCatalogBtn, *pDataTypesBtn, *pDbDiagsBtn;
wxTextCtrl *pNameTxt, *pAddress1Txt, *pAddress2Txt,*pCityTxt, *pStateTxt, *pCountryTxt,*pPostalCodeTxt;
wxStaticText *pNameMsg, *pAddress1Msg, *pAddress2Msg,*pCityMsg, *pStateMsg, *pCountryMsg,*pPostalCodeMsg;
wxTextCtrl *pJoinDateTxt,*pContribTxt, *pLinesTxt;
@@ -348,6 +348,7 @@ DECLARE_EVENT_TABLE()
#define EDITOR_DIALOG_DEVELOPER 236
#define EDITOR_DIALOG_JOIN_MSG 237
#define EDITOR_DIALOG_JOIN_TEXT 238
#define EDITOR_DIALOG_CATALOG 240
#define EDITOR_DIALOG_DATATYPES 250
#define EDITOR_DIALOG_DB_DIAGS 260