Applied [ 880011 ] Several fixes to DbBrowse demo

ABX


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2004-02-08 11:53:48 +00:00
parent 2321962672
commit 74de91cc97
10 changed files with 457 additions and 457 deletions

View File

@@ -201,7 +201,7 @@ bool BrowserDB::OnCloseDB(int Quiet)
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
bool BrowserDB::OnGetNext(int Cols,int Quiet) bool BrowserDB::OnGetNext(int Cols,int WXUNUSED(Quiet))
{ {
SDWORD cb; SDWORD cb;
int i_dbDataType; int i_dbDataType;
@@ -215,11 +215,13 @@ bool BrowserDB::OnGetNext(int Cols,int Quiet)
//----------------------------- //-----------------------------
if (!db_BrowserDB->GetNext()) if (!db_BrowserDB->GetNext())
{ {
return FALSE; #ifdef __WXDEBUG__
Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext \n-E-> ")); Temp0.Printf(_("\n-E-> BrowserDB::OnGetNext - ODBC-Error with GetNext \n-E-> "));
Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__); Temp0 += GetExtendedDBErrorMsg(__TFILE__,__LINE__);
wxLogMessage(Temp0); wxLogMessage(Temp0);
wxMessageBox(Temp0); wxMessageBox(Temp0);
#endif
return FALSE;
} }
else else
{ {
@@ -344,7 +346,8 @@ bool BrowserDB::OnSelect(wxString tb_Name, int Quiet)
wxString SQLStmt; wxString SQLStmt;
i_Records = 0; i_Records = 0;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
SQLStmt.sprintf(_T("SELECT * FROM %s"),db_BrowserDB->SQLTableName(tb_Name.c_str())); wxString tablename = db_BrowserDB->SQLTableName(tb_Name.c_str());
SQLStmt.sprintf(_T("SELECT * FROM %s"),tablename.c_str());
if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData()))) if (!db_BrowserDB->ExecSql((wxChar *)(SQLStmt.GetData())))
{ {
Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str()); Temp0.Printf(_("\n-E-> BrowserDB::OnSelect - ODBC-Error with ExecSql of >%s<.\n-E-> "),tb_Name.c_str());
@@ -398,7 +401,7 @@ bool BrowserDB::OnExecSql(wxString SQLStmt, int Quiet)
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
wxDbInf* BrowserDB::OnGetCatalog(int Quiet) wxDbInf* BrowserDB::OnGetCatalog(int WXUNUSED(Quiet))
{ {
wxChar UName[255]; wxChar UName[255];
wxStrcpy(UName,UserName); wxStrcpy(UName,UserName);
@@ -407,7 +410,7 @@ wxDbInf* BrowserDB::OnGetCatalog(int Quiet)
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
wxDbColInf* BrowserDB::OnGetColumns(wxChar *tableName, UWORD numCols, int Quiet) wxDbColInf* BrowserDB::OnGetColumns(wxChar *tableName, UWORD numCols, int WXUNUSED(Quiet))
{ {
wxChar UName[255]; wxChar UName[255];
int i; int i;

View File

@@ -85,7 +85,7 @@ int DBGrid::OnTableView(wxString Table)
{ {
wxStopWatch sw; wxStopWatch sw;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
int i=0,x,y,z, ValidTable=0; int x,y,z;
wxString Temp0; wxString Temp0;
wxBeginBusyCursor(); wxBeginBusyCursor();
SetDefaultCellFont(* pDoc->ft_Doc); SetDefaultCellFont(* pDoc->ft_Doc);
@@ -98,13 +98,13 @@ int DBGrid::OnTableView(wxString Table)
{ {
if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableName,Table)) // is this our Table ? if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableName,Table)) // is this our Table ?
{ // Yes, the Data of this Table shall be put into the Grid { // Yes, the Data of this Table shall be put into the Grid
ValidTable = x; // Save the Tablenumber int ValidTable = x; // Save the Tablenumber
(db_Br+i_Which)->OnSelect(Table,FALSE); // Select * from "table" (db_Br+i_Which)->OnSelect(Table,FALSE); // Select * from "table"
// Set the local Pointer to the Column Information we are going to use // Set the local Pointer to the Column Information we are going to use
(db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf; (db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf;
if ((ct_BrowserDB->pTableInf+x)->pColInf) // Valid pointer (!= NULL) ? if ((ct_BrowserDB->pTableInf+x)->pColInf) // Valid pointer (!= NULL) ?
{ // Pointer is Valid, Column Informationen sind Vorhanden { // Pointer is Valid, Column Informationen sind Vorhanden
i = (db_Br+i_Which)->i_Records; // How many Records are there int i = (db_Br+i_Which)->i_Records; // How many Records are there
(db_Br+i_Which)->i_Which = ValidTable; // Still used ???? mj10777 (db_Br+i_Which)->i_Which = ValidTable; // Still used ???? mj10777
if (i == 0) // If the Table is empty, then show one empty row if (i == 0) // If the Table is empty, then show one empty row
i++; i++;
@@ -154,7 +154,7 @@ Weiter:
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnModusEdit(wxCommandEvent& event) void DBGrid::OnModusEdit(wxCommandEvent& WXUNUSED(event))
{ {
b_EditModus = TRUE; // Needed by PopupMenu b_EditModus = TRUE; // Needed by PopupMenu
EnableEditing(b_EditModus); // Activate in-place Editing EnableEditing(b_EditModus); // Activate in-place Editing
@@ -163,7 +163,7 @@ void DBGrid::OnModusEdit(wxCommandEvent& event)
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBGrid::OnModusBrowse(wxCommandEvent& event) void DBGrid::OnModusBrowse(wxCommandEvent& WXUNUSED(event))
{ {
b_EditModus = FALSE; // Needed by PopupMenu b_EditModus = FALSE; // Needed by PopupMenu
EnableEditing(b_EditModus); // Deactivate in-place Editing EnableEditing(b_EditModus); // Deactivate in-place Editing

View File

@@ -355,7 +355,7 @@ void DBTree::OnRightSelect(wxTreeEvent& WXUNUSED(event))
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBTree::OnDBGrid(wxCommandEvent& event) void DBTree::OnDBGrid(wxCommandEvent& WXUNUSED(event))
{ {
int i; int i;
// Get the Information that we need // Get the Information that we need
@@ -378,7 +378,7 @@ void DBTree::OnDBGrid(wxCommandEvent& event)
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBTree::OnDBClass(wxCommandEvent& event) void DBTree::OnDBClass(wxCommandEvent& WXUNUSED(event))
{ {
// int i; // int i;
// Get the Information that we need // Get the Information that we need
@@ -392,7 +392,7 @@ void DBTree::OnDBClass(wxCommandEvent& event)
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBTree::OnTableClass(wxCommandEvent& event) void DBTree::OnTableClass(wxCommandEvent& WXUNUSED(event))
{ {
int i; int i;
// Get the Information that we need // Get the Information that we need
@@ -414,7 +414,7 @@ void DBTree::OnTableClass(wxCommandEvent& event)
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
void DBTree::OnTableClassAll(wxCommandEvent& event) void DBTree::OnTableClassAll(wxCommandEvent& WXUNUSED(event))
{ {
// int i; // int i;
// Get the Information that we need // Get the Information that we need

View File

@@ -114,6 +114,7 @@ bool MainDoc::OnInitView()
p_TabArea->AddTab(p_PgmCtrl,_T("PgmCtrl"),p_FolderClose); p_TabArea->AddTab(p_PgmCtrl,_T("PgmCtrl"),p_FolderClose);
delete p_FolderClose; // Memory leak delete p_FolderClose; // Memory leak
p_FolderClose = NULL; p_FolderClose = NULL;
wxUnusedVar(p_FolderClose);
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// now create "output" window // now create "output" window
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
@@ -156,7 +157,7 @@ bool MainDoc::OnInitODBC()
wxChar DsDesc[255]; // BJO20002501 instead of 512 wxChar DsDesc[255]; // BJO20002501 instead of 512
Temp0 = _T(""); Temp0 = _T("");
i_DSN = 0; // Counter i_DSN = 0; // Counter
int i = 0; int i;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// Initialize the ODBC Environment for Database Operations // Initialize the ODBC Environment for Database Operations
@@ -200,7 +201,6 @@ bool MainDoc::OnInitODBC()
Temp0.Printf(_T("%02d) Dsn(%s) DsDesc(%s)"),i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str()); Temp0.Printf(_T("%02d) Dsn(%s) DsDesc(%s)"),i,(p_DSN+i)->Dsn.c_str(),(p_DSN+i)->Drv.c_str());
wxLogMessage(Temp0); wxLogMessage(Temp0);
} }
i = 0;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
// Allocate n wxDatabase objects to hold the column information // Allocate n wxDatabase objects to hold the column information
db_Br = new BrowserDB[i_DSN]; db_Br = new BrowserDB[i_DSN];

View File

@@ -157,24 +157,24 @@ wxTabbedWindow::wxTabbedWindow()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
wxTabbedWindow::~wxTabbedWindow() wxTabbedWindow::~wxTabbedWindow()
{ {
wxNode* pTab = mTabs.First(); wxNode* pTab = mTabs.GetFirst();
while( pTab ) while( pTab )
{ {
delete ((twTabInfo*)pTab->Data()); delete ((twTabInfo*)pTab->GetData());
pTab = pTab->Next(); pTab = pTab->GetNext();
} }
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool repant) void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool WXUNUSED(repant))
{ {
wxNode* pTabNode = mTabs.First(); wxNode* pTabNode = mTabs.GetFirst();
int n = 0; size_t n = 0;
while( pTabNode ) while( pTabNode )
{ {
twTabInfo& info = *((twTabInfo*)pTabNode->Data()); twTabInfo& info = *((twTabInfo*)pTabNode->GetData());
if ( n == mActiveTab ) if ( n == mActiveTab )
{ {
@@ -191,7 +191,7 @@ void wxTabbedWindow::SizeTabs(int x,int y, int width, int height, bool repant)
info.mpContent->Show(FALSE); info.mpContent->Show(FALSE);
} }
pTabNode = pTabNode->Next(); pTabNode = pTabNode->GetNext();
++n; ++n;
} }
} }
@@ -249,26 +249,26 @@ void wxTabbedWindow::AddTab( wxWindow* pContent,
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxTabbedWindow::RemoveTab( int tabNo ) void wxTabbedWindow::RemoveTab( int tabNo )
{ {
twTabInfo* pTab = ((twTabInfo*)(mTabs.Nth( tabNo )->Data())); twTabInfo* pTab = ((twTabInfo*)(mTabs.Item( tabNo )->GetData()));
pTab->mpContent->Destroy(); pTab->mpContent->Destroy();
delete pTab; delete pTab;
mTabs.DeleteNode( mTabs.Nth( tabNo ) ); mTabs.DeleteNode( mTabs.Item( tabNo ) );
// if ( mActiveTab >= mTabs.Number() ); // if ( mActiveTab >= mTabs.GetCount() );
if ( mActiveTab >= mTabs.Number() ) if ( mActiveTab >= mTabs.GetCount() )
mActiveTab = mTabs.Number() - 1; mActiveTab = mTabs.GetCount() - 1;
SetActiveTab( mActiveTab ); SetActiveTab( mActiveTab );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int wxTabbedWindow::GetTabCount() int wxTabbedWindow::GetTabCount()
{ {
return mTabs.Number(); return mTabs.GetCount();
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
wxWindow* wxTabbedWindow::GetTab( int tabNo ) wxWindow* wxTabbedWindow::GetTab( int tabNo )
{ {
return ((twTabInfo*)(mTabs.Nth( tabNo )->Data()))->mpContent; return ((twTabInfo*)(mTabs.Item( tabNo )->GetData()))->mpContent;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -363,14 +363,14 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc )
curX = mFirstTitleGap; curX = mFirstTitleGap;
curY = height - mVertGap - mTitleHeight; curY = height - mVertGap - mTitleHeight;
int tabNo = 0; size_t tabNo = 0;
wxNode* pNode = mTabs.First(); wxNode* pNode = mTabs.GetFirst();
while( pNode ) while( pNode )
{ {
// "hard-coded metafile" for decorations // "hard-coded metafile" for decorations
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
xSize = tab.mDims.x; xSize = tab.mDims.x;
ySize = mTitleHeight; ySize = mTitleHeight;
@@ -403,7 +403,7 @@ void wxTabbedWindow::DrawDecorations( wxDC& dc )
dc.DrawLine( curX+xSize-2, curY+ySize-2, curX+xSize-3, curY+ySize-2 ); dc.DrawLine( curX+xSize-2, curY+ySize-2, curX+xSize-3, curY+ySize-2 );
dc.DrawLine( curX+xSize-3, curY+ySize-1, curX+1, curY+ySize-1 ); dc.DrawLine( curX+xSize-3, curY+ySize-1, curX+1, curY+ySize-1 );
pNode = pNode->Next(); pNode = pNode->GetNext();
++tabNo; ++tabNo;
// darw image and (or without) text centered within the // darw image and (or without) text centered within the
@@ -453,15 +453,12 @@ int wxTabbedWindow::HitTest( const wxPoint& pos )
int curY = height - mVertGap - mTitleHeight; int curY = height - mVertGap - mTitleHeight;
int tabNo = 0; int tabNo = 0;
wxNode* pNode = mTabs.First(); wxNode* pNode = mTabs.GetFirst();
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
int w,h;
w = tab.mDims.x;
h = tab.mDims.y;
// hit test rectangle of the currnet tab title bar // hit test rectangle of the currnet tab title bar
if ( pos.x >= curX && pos.x < curX + tab.mDims.x && if ( pos.x >= curX && pos.x < curX + tab.mDims.x &&
pos.y >= curY && pos.y < curY + tab.mDims.y pos.y >= curY && pos.y < curY + tab.mDims.y
@@ -472,7 +469,7 @@ int wxTabbedWindow::HitTest( const wxPoint& pos )
curX += tab.mDims.x; curX += tab.mDims.x;
pNode = pNode->Next(); pNode = pNode->GetNext();
++tabNo; ++tabNo;
} }
@@ -485,18 +482,18 @@ void wxTabbedWindow::HideInactiveTabs( bool andRepaint )
if ( !andRepaint ) if ( !andRepaint )
return; return;
wxNode* pNode = mTabs.First(); wxNode* pNode = mTabs.GetFirst();
int tabNo = 0; size_t tabNo = 0;
while( pNode ) while( pNode )
{ {
if ( tabNo != mActiveTab ) if ( tabNo != mActiveTab )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
tab.mpContent->Show(FALSE); tab.mpContent->Show(FALSE);
} }
pNode = pNode->Next(); pNode = pNode->GetNext();
++tabNo; ++tabNo;
} }
} // wxTabbedWindow::HideInactiveTabs() } // wxTabbedWindow::HideInactiveTabs()
@@ -544,14 +541,14 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
mLayoutType = wxTITLE_IMG_AND_TEXT; mLayoutType = wxTITLE_IMG_AND_TEXT;
wxNode* pNode = mTabs.First(); wxNode* pNode = mTabs.GetFirst();
curX = mFirstTitleGap; // the left-side gap curX = mFirstTitleGap; // the left-side gap
mTitleHeight = 0; mTitleHeight = 0;
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
wxWindowDC dc(this); wxWindowDC dc(this);
@@ -570,19 +567,19 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
curX += tab.mDims.x; curX += tab.mDims.x;
pNode = pNode->Next(); pNode = pNode->GetNext();
} }
curX += mHorizGap; // the right-side gap curX += mHorizGap; // the right-side gap
// make all title bars of equel height // make all title bars of equel height
pNode = mTabs.First(); pNode = mTabs.GetFirst();
while( pNode ) while( pNode )
{ {
((twTabInfo*)(pNode->Data()))->mDims.y = mTitleHeight;; ((twTabInfo*)(pNode->GetData()))->mDims.y = mTitleHeight;;
pNode = pNode->Next(); pNode = pNode->GetNext();
} }
// if curX has'nt ran out of bounds, leave TITLE_IMG layout and return // if curX has'nt ran out of bounds, leave TITLE_IMG layout and return
@@ -593,11 +590,11 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
mLayoutType = wxTITLE_IMG_ONLY; mLayoutType = wxTITLE_IMG_ONLY;
pNode = mTabs.First(); pNode = mTabs.GetFirst();
curX = mFirstTitleGap; // the left-side gap curX = mFirstTitleGap; // the left-side gap
int denomiator = mTabs.Number(); int denomiator = mTabs.GetCount();
if ( denomiator == 0 ) if ( denomiator == 0 )
++denomiator; ++denomiator;
@@ -605,7 +602,7 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
if ( tab.HasImg() ) if ( tab.HasImg() )
{ {
@@ -620,7 +617,7 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
curX += tab.mDims.x; curX += tab.mDims.x;
pNode = pNode->Next(); pNode = pNode->GetNext();
} }
curX += mHorizGap; // the right-side gap curX += mHorizGap; // the right-side gap
@@ -633,37 +630,37 @@ void wxTabbedWindow::RecalcLayout(bool andRepaint)
mLayoutType = wxTITLE_BORDER_ONLY; mLayoutType = wxTITLE_BORDER_ONLY;
pNode = mTabs.First(); pNode = mTabs.GetFirst();
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
tab.mDims.x = mBorderOnlyWidth; tab.mDims.x = mBorderOnlyWidth;
tab.mDims.y = mTitleHeight; tab.mDims.y = mTitleHeight;
pNode = pNode->Next(); pNode = pNode->GetNext();
} }
} // wxTabbedWindow::RecalcLayout() } // wxTabbedWindow::RecalcLayout()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// wx event handlers // wx event handlers
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxTabbedWindow::OnPaint( wxPaintEvent& event ) void wxTabbedWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
DrawDecorations( dc ); DrawDecorations( dc );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxTabbedWindow::OnSize ( wxSizeEvent& event ) void wxTabbedWindow::OnSize ( wxSizeEvent& WXUNUSED(event) )
{ {
SetBackgroundColour( wxColour( 192,192,192 ) ); SetBackgroundColour( wxColour( 192,192,192 ) );
RecalcLayout(TRUE); RecalcLayout(TRUE);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxTabbedWindow::OnBkErase( wxEraseEvent& event ) void wxTabbedWindow::OnBkErase( wxEraseEvent& WXUNUSED(event) )
{ {
// do nothing // do nothing
} }
@@ -749,7 +746,7 @@ wxFont wxPagedWindow::GetLabelingFont()
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxPagedWindow::OnTabAdded( twTabInfo* pInfo ) void wxPagedWindow::OnTabAdded( twTabInfo* WXUNUSED(pInfo) )
{ {
int units = GetWholeTabRowLen() / 20; int units = GetWholeTabRowLen() / 20;
@@ -771,16 +768,16 @@ wxScrollBar& wxPagedWindow::GetHorizontalScrollBar()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int wxPagedWindow::GetWholeTabRowLen() int wxPagedWindow::GetWholeTabRowLen()
{ {
wxNode* pNode = mTabs.First(); wxNode* pNode = mTabs.GetFirst();
int len = 0; int len = 0;
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
len += tab.mDims.x; len += tab.mDims.x;
pNode = pNode->Next(); pNode = pNode->GetNext();
} }
return len; return len;
@@ -864,8 +861,8 @@ void wxPagedWindow::DrawDecorations( wxDC& dc )
// draw inactive tab title bars frist (left-to-right) // draw inactive tab title bars frist (left-to-right)
wxNode* pNode = mTabs.First(); wxNode* pNode = mTabs.GetFirst();
int tabNo = 0; size_t tabNo = 0;
/* OLD STUFF:: /* OLD STUFF::
curX = mTitleRowStart; curX = mTitleRowStart;
@@ -892,27 +889,27 @@ void wxPagedWindow::DrawDecorations( wxDC& dc )
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
if ( tabNo != mActiveTab ) if ( tabNo != mActiveTab )
DrawPaperBar( tab, curX, curY, mGrayBrush, mBlackPen, tmpDc ); DrawPaperBar( tab, curX, curY, mGrayBrush, mBlackPen, tmpDc );
curX += tab.mDims.x; curX += tab.mDims.x;
pNode = pNode->Next(); pNode = pNode->GetNext();
++tabNo; ++tabNo;
} }
// finally, draw the active tab (white-filled) // finally, draw the active tab (white-filled)
pNode = mTabs.First(); pNode = mTabs.GetFirst();
tabNo = 0; tabNo = 0;
curX = mTabTrianGap; curX = mTabTrianGap;
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
if ( tabNo == mActiveTab ) if ( tabNo == mActiveTab )
{ {
@@ -926,7 +923,7 @@ void wxPagedWindow::DrawDecorations( wxDC& dc )
} }
curX += tab.mDims.x; curX += tab.mDims.x;
pNode = pNode->Next(); pNode = pNode->GetNext();
++tabNo; ++tabNo;
} }
@@ -1036,11 +1033,11 @@ void wxPagedWindow::RecalcLayout(bool andRepaint)
mLayoutType = wxTITLE_IMG_AND_TEXT; mLayoutType = wxTITLE_IMG_AND_TEXT;
wxNode* pNode = mTabs.First(); wxNode* pNode = mTabs.GetFirst();
while( pNode ) while( pNode )
{ {
twTabInfo& tab = *((twTabInfo*)(pNode->Data())); twTabInfo& tab = *((twTabInfo*)(pNode->GetData()));
wxWindowDC dc(this); wxWindowDC dc(this);
@@ -1055,7 +1052,7 @@ void wxPagedWindow::RecalcLayout(bool andRepaint)
tab.mDims.y = mTitleHeight; tab.mDims.y = mTitleHeight;
pNode = pNode->Next(); pNode = pNode->GetNext();
} }
// disable title-bar scroller if there's nowhere to scroll to // disable title-bar scroller if there's nowhere to scroll to
@@ -1066,7 +1063,7 @@ void wxPagedWindow::RecalcLayout(bool andRepaint)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// event handlers // event handlers
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxPagedWindow::OnPaint( wxPaintEvent& event ) void wxPagedWindow::OnPaint( wxPaintEvent& WXUNUSED(event) )
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
DrawDecorations( dc ); DrawDecorations( dc );
@@ -1097,7 +1094,7 @@ void wxPagedWindow::OnLButtonDown( wxMouseEvent& event )
} // wxPagedWindow::OnLButtonDown() } // wxPagedWindow::OnLButtonDown()
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void wxPagedWindow::OnLButtonUp( wxMouseEvent& event ) void wxPagedWindow::OnLButtonUp( wxMouseEvent& WXUNUSED(event) )
{ {
if ( mIsDragged ) if ( mIsDragged )
{ {

View File

@@ -83,7 +83,7 @@ public:
wxPen mDarkPen; // default: RGB(128,128,128) wxPen mDarkPen; // default: RGB(128,128,128)
wxPen mBlackPen; // default: RGB( 0, 0, 0) wxPen mBlackPen; // default: RGB( 0, 0, 0)
int mActiveTab; size_t mActiveTab;
int mTitleHeight; int mTitleHeight;
int mLayoutType; int mLayoutType;

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,7 @@
enum DialogModes {mView,mCreate,mEdit,mSearch}; enum DialogModes {mView,mCreate,mEdit,mSearch};
// ID for the menu quit command // ID for the menu quit command
#define FILE_CREATE 100 #define FILE_CREATE_ID 100
#define FILE_RECREATE_TABLE 110 #define FILE_RECREATE_TABLE 110
#define FILE_RECREATE_INDEXES 120 #define FILE_RECREATE_INDEXES 120
#if wxUSE_NEW_GRID #if wxUSE_NEW_GRID
@@ -39,7 +39,7 @@ enum DialogModes {mView,mCreate,mEdit,mSearch};
#endif #endif
// Name of the table to be created/opened // Name of the table to be created/opened
const wxChar CONTACT_TABLE_NAME[] = "contacts"; const wxChar CONTACT_TABLE_NAME[] = wxT("contacts");
#define wxODBC_BLOB_EXPERIMENT 1 #define wxODBC_BLOB_EXPERIMENT 1
@@ -51,7 +51,7 @@ const int CONTACT_NO_COLS = 13; // 0-12
const int CONTACT_NO_COLS = 12; // 0-11 const int CONTACT_NO_COLS = 12; // 0-11
#endif #endif
const wxChar PARAM_FILENAME[] = "dbtest.cfg"; const wxChar PARAM_FILENAME[] = wxT("dbtest.cfg");
enum Language {langENGLISH, langFRENCH, langGERMAN, langSPANISH, langOTHER}; enum Language {langENGLISH, langFRENCH, langGERMAN, langSPANISH, langOTHER};
@@ -460,15 +460,15 @@ enum qryOp
// Query strings // Query strings
wxChar * const langQRY_EQ = "column = column | value"; wxChar * const langQRY_EQ = wxT("column = column | value");
wxChar * const langQRY_LT = "column < column | value"; wxChar * const langQRY_LT = wxT("column < column | value");
wxChar * const langQRY_GT = "column > column | value"; wxChar * const langQRY_GT = wxT("column > column | value");
wxChar * const langQRY_LE = "column <= column | value"; wxChar * const langQRY_LE = wxT("column <= column | value");
wxChar * const langQRY_GE = "column >= column | value"; wxChar * const langQRY_GE = wxT("column >= column | value");
wxChar * const langQRY_BEGINS = "columns that BEGIN with the string entered"; wxChar * const langQRY_BEGINS = wxT("columns that BEGIN with the string entered");
wxChar * const langQRY_CONTAINS = "columns that CONTAIN the string entered"; wxChar * const langQRY_CONTAINS = wxT("columns that CONTAIN the string entered");
wxChar * const langQRY_LIKE = "% matches 0 or more of any char; _ matches 1 char"; wxChar * const langQRY_LIKE = wxT("% matches 0 or more of any char; _ matches 1 char");
wxChar * const langQRY_BETWEEN = "column BETWEEN value AND value"; wxChar * const langQRY_BETWEEN = wxT("column BETWEEN value AND value");
class CqueryDlg : public wxDialog class CqueryDlg : public wxDialog
@@ -560,95 +560,95 @@ DECLARE_EVENT_TABLE()
#define QUERY_DIALOG_HINT_GROUP 323 #define QUERY_DIALOG_HINT_GROUP 323
#define QUERY_DIALOG_HINT_MSG 324 #define QUERY_DIALOG_HINT_MSG 324
char * const langNO = "No"; wxChar * const langNO = wxT("No");
char * const langYES = "Yes"; wxChar * const langYES = wxT("Yes");
char * const langDBINF_DB_NAME = "Database Name = "; wxChar * const langDBINF_DB_NAME = wxT("Database Name = ");
char * const langDBINF_DB_VER = "Database Version = "; wxChar * const langDBINF_DB_VER = wxT("Database Version = ");
char * const langDBINF_DRIVER_NAME = "Driver Name = "; wxChar * const langDBINF_DRIVER_NAME = wxT("Driver Name = ");
char * const langDBINF_DRIVER_ODBC_VER = "Driver ODBC Version = "; wxChar * const langDBINF_DRIVER_ODBC_VER = wxT("Driver ODBC Version = ");
char * const langDBINF_DRIVER_MGR_ODBC_VER = "Driver Manager ODBC Version = "; wxChar * const langDBINF_DRIVER_MGR_ODBC_VER = wxT("Driver Manager ODBC Version = ");
char * const langDBINF_DRIVER_VER = "Driver Version = "; wxChar * const langDBINF_DRIVER_VER = wxT("Driver Version = ");
char * const langDBINF_SERVER_NAME = "Server Name = "; wxChar * const langDBINF_SERVER_NAME = wxT("Server Name = ");
char * const langDBINF_FILENAME = "Filename = "; wxChar * const langDBINF_FILENAME = wxT("Filename = ");
char * const langDBINF_OUTER_JOINS = "Outer Joins = "; wxChar * const langDBINF_OUTER_JOINS = wxT("Outer Joins = ");
char * const langDBINF_STORED_PROC = "Stored Procedures = "; wxChar * const langDBINF_STORED_PROC = wxT("Stored Procedures = ");
char * const langDBINF_MAX_HDBC = "Max # of Db connections = "; wxChar * const langDBINF_MAX_HDBC = wxT("Max # of Db connections = ");
char * const langDBINF_MAX_HSTMT = "Max # of cursors (per db connection) = "; wxChar * const langDBINF_MAX_HSTMT = wxT("Max # of cursors (per db connection) = ");
char * const langDBINF_UNLIMITED = "Unlimited or Unknown"; wxChar * const langDBINF_UNLIMITED = wxT("Unlimited or Unknown");
char * const langDBINF_API_LVL = "ODBC API conformance level = "; wxChar * const langDBINF_API_LVL = wxT("ODBC API conformance level = ");
char * const langDBINF_CLI_LVL = "Client (SAG) conformance level = "; wxChar * const langDBINF_CLI_LVL = wxT("Client (SAG) conformance level = ");
char * const langDBINF_SQL_LVL = "SQL conformance level = "; wxChar * const langDBINF_SQL_LVL = wxT("SQL conformance level = ");
char * const langDBINF_COMMIT_BEHAVIOR = "Commit Behavior = "; wxChar * const langDBINF_COMMIT_BEHAVIOR = wxT("Commit Behavior = ");
char * const langDBINF_ROLLBACK_BEHAVIOR = "Rollback Behavior = "; wxChar * const langDBINF_ROLLBACK_BEHAVIOR = wxT("Rollback Behavior = ");
char * const langDBINF_SUPP_NOT_NULL = "Support NOT NULL clause = "; wxChar * const langDBINF_SUPP_NOT_NULL = wxT("Support NOT NULL clause = ");
char * const langDBINF_SUPP_IEF = "Support IEF = "; wxChar * const langDBINF_SUPP_IEF = wxT("Support IEF = ");
char * const langDBINF_TXN_ISOLATION = "Transaction Isolation Level (default) = "; wxChar * const langDBINF_TXN_ISOLATION = wxT("Transaction Isolation Level (default) = ");
char * const langDBINF_TXN_ISOLATION_CURR = "Transaction Isolation Level (current) = "; wxChar * const langDBINF_TXN_ISOLATION_CURR = wxT("Transaction Isolation Level (current) = ");
char * const langDBINF_TXN_ISOLATION_OPTS = "Transaction Isolation Options Available = "; wxChar * const langDBINF_TXN_ISOLATION_OPTS = wxT("Transaction Isolation Options Available = ");
char * const langDBINF_FETCH_DIRS = "Fetch Directions = "; wxChar * const langDBINF_FETCH_DIRS = wxT("Fetch Directions = ");
char * const langDBINF_LOCK_TYPES = "Lock Types (SQLSetPos) = "; wxChar * const langDBINF_LOCK_TYPES = wxT("Lock Types (SQLSetPos) = ");
char * const langDBINF_POS_OPERS = "Position Operations (SQLSetPos) = "; wxChar * const langDBINF_POS_OPERS = wxT("Position Operations (SQLSetPos) = ");
char * const langDBINF_POS_STMTS = "Position Statements = "; wxChar * const langDBINF_POS_STMTS = wxT("Position Statements = ");
char * const langDBINF_SCROLL_CONCURR = "Concurrency Options (scrollable cursors) = "; wxChar * const langDBINF_SCROLL_CONCURR = wxT("Concurrency Options (scrollable cursors) = ");
char * const langDBINF_SCROLL_OPTS = "Scroll Options (scrollable cursors) = "; wxChar * const langDBINF_SCROLL_OPTS = wxT("Scroll Options (scrollable cursors) = ");
char * const langDBINF_STATIC_SENS = "Static Sensitivity = "; wxChar * const langDBINF_STATIC_SENS = wxT("Static Sensitivity = ");
char * const langDBINF_TXN_CAPABLE = "Transaction Support = "; wxChar * const langDBINF_TXN_CAPABLE = wxT("Transaction Support = ");
char * const langDBINF_LOGIN_TIMEOUT = "Login Timeout = "; wxChar * const langDBINF_LOGIN_TIMEOUT = wxT("Login Timeout = ");
char * const langDBINF_NONE = "None"; wxChar * const langDBINF_NONE = wxT("None");
char * const langDBINF_LEVEL1 = "Level 1"; wxChar * const langDBINF_LEVEL1 = wxT("Level 1");
char * const langDBINF_LEVEL2 = "Level 2"; wxChar * const langDBINF_LEVEL2 = wxT("Level 2");
char * const langDBINF_NOT_COMPLIANT = "Not Compliant"; wxChar * const langDBINF_NOT_COMPLIANT = wxT("Not Compliant");
char * const langDBINF_COMPLIANT = "Compliant"; wxChar * const langDBINF_COMPLIANT = wxT("Compliant");
char * const langDBINF_MIN_GRAMMAR = "Minimum Grammer"; wxChar * const langDBINF_MIN_GRAMMAR = wxT("Minimum Grammer");
char * const langDBINF_CORE_GRAMMAR = "Core Grammer"; wxChar * const langDBINF_CORE_GRAMMAR = wxT("Core Grammer");
char * const langDBINF_EXT_GRAMMAR = "Extended Grammer"; wxChar * const langDBINF_EXT_GRAMMAR = wxT("Extended Grammer");
char * const langDBINF_DELETE_CURSORS = "Delete cursors"; wxChar * const langDBINF_DELETE_CURSORS = wxT("Delete cursors");
char * const langDBINF_CLOSE_CURSORS = "Close cursors"; wxChar * const langDBINF_CLOSE_CURSORS = wxT("Close cursors");
char * const langDBINF_PRESERVE_CURSORS = "Preserve cursors"; wxChar * const langDBINF_PRESERVE_CURSORS = wxT("Preserve cursors");
char * const langDBINF_READ_UNCOMMITTED = "Read Uncommitted"; wxChar * const langDBINF_READ_UNCOMMITTED = wxT("Read Uncommitted");
char * const langDBINF_READ_COMMITTED = "Read Committed"; wxChar * const langDBINF_READ_COMMITTED = wxT("Read Committed");
char * const langDBINF_REPEATABLE_READ = "Repeatable Read"; wxChar * const langDBINF_REPEATABLE_READ = wxT("Repeatable Read");
char * const langDBINF_SERIALIZABLE = "Serializable"; wxChar * const langDBINF_SERIALIZABLE = wxT("Serializable");
char * const langDBINF_VERSIONING = "Versioning"; wxChar * const langDBINF_VERSIONING = wxT("Versioning");
char * const langDBINF_NEXT = "Next"; wxChar * const langDBINF_NEXT = wxT("Next");
char * const langDBINF_PREV = "Prev"; wxChar * const langDBINF_PREV = wxT("Prev");
char * const langDBINF_FIRST = "First"; wxChar * const langDBINF_FIRST = wxT("First");
char * const langDBINF_LAST = "Last"; wxChar * const langDBINF_LAST = wxT("Last");
char * const langDBINF_ABSOLUTE = "Absolute"; wxChar * const langDBINF_ABSOLUTE = wxT("Absolute");
char * const langDBINF_RELATIVE = "Relative"; wxChar * const langDBINF_RELATIVE = wxT("Relative");
char * const langDBINF_RESUME = "Resume"; wxChar * const langDBINF_RESUME = wxT("Resume");
char * const langDBINF_BOOKMARK = "Bookmark"; wxChar * const langDBINF_BOOKMARK = wxT("Bookmark");
char * const langDBINF_NO_CHANGE = "No Change"; wxChar * const langDBINF_NO_CHANGE = wxT("No Change");
char * const langDBINF_EXCLUSIVE = "Exclusive"; wxChar * const langDBINF_EXCLUSIVE = wxT("Exclusive");
char * const langDBINF_UNLOCK = "Unlock"; wxChar * const langDBINF_UNLOCK = wxT("Unlock");
char * const langDBINF_POSITION = "Position"; wxChar * const langDBINF_POSITION = wxT("Position");
char * const langDBINF_REFRESH = "Refresh"; wxChar * const langDBINF_REFRESH = wxT("Refresh");
char * const langDBINF_UPD = "Upd"; wxChar * const langDBINF_UPD = wxT("Upd");
char * const langDBINF_DEL = "Del"; wxChar * const langDBINF_DEL = wxT("Del");
char * const langDBINF_ADD = "Add"; wxChar * const langDBINF_ADD = wxT("Add");
char * const langDBINF_POS_DEL = "Pos Delete"; wxChar * const langDBINF_POS_DEL = wxT("Pos Delete");
char * const langDBINF_POS_UPD = "Pos Update"; wxChar * const langDBINF_POS_UPD = wxT("Pos Update");
char * const langDBINF_SELECT_FOR_UPD = "Select For Update"; wxChar * const langDBINF_SELECT_FOR_UPD = wxT("Select For Update");
char * const langDBINF_READ_ONLY = "Read Only"; wxChar * const langDBINF_READ_ONLY = wxT("Read Only");
char * const langDBINF_LOCK = "Lock"; wxChar * const langDBINF_LOCK = wxT("Lock");
char * const langDBINF_OPT_ROWVER = "Opt. Rowver"; wxChar * const langDBINF_OPT_ROWVER = wxT("Opt. Rowver");
char * const langDBINF_OPT_VALUES = "Opt. Values"; wxChar * const langDBINF_OPT_VALUES = wxT("Opt. Values");
char * const langDBINF_FWD_ONLY = "Fwd Only"; wxChar * const langDBINF_FWD_ONLY = wxT("Fwd Only");
char * const langDBINF_STATIC = "Static"; wxChar * const langDBINF_STATIC = wxT("Static");
char * const langDBINF_KEYSET_DRIVEN = "Keyset Driven"; wxChar * const langDBINF_KEYSET_DRIVEN = wxT("Keyset Driven");
char * const langDBINF_DYNAMIC = "Dynamic"; wxChar * const langDBINF_DYNAMIC = wxT("Dynamic");
char * const langDBINF_MIXED = "Mixed"; wxChar * const langDBINF_MIXED = wxT("Mixed");
char * const langDBINF_ADDITIONS = "Additions"; wxChar * const langDBINF_ADDITIONS = wxT("Additions");
char * const langDBINF_DELETIONS = "Deletions"; wxChar * const langDBINF_DELETIONS = wxT("Deletions");
char * const langDBINF_UPDATES = "Updates"; wxChar * const langDBINF_UPDATES = wxT("Updates");
char * const langDBINF_DML_ONLY = "DML Only"; wxChar * const langDBINF_DML_ONLY = wxT("DML Only");
char * const langDBINF_DDL_COMMIT = "DDL Commit"; wxChar * const langDBINF_DDL_COMMIT = wxT("DDL Commit");
char * const langDBINF_DDL_IGNORE = "DDL Ignore"; wxChar * const langDBINF_DDL_IGNORE = wxT("DDL Ignore");
char * const langDBINF_DDL_AND_DML = "DDL and DML"; wxChar * const langDBINF_DDL_AND_DML = wxT("DDL and DML");
char * const langDBINF_ORACLE_BANNER = ">>> ORACLE STATISTICS AND TUNING INFORMATION <<<"; wxChar * const langDBINF_ORACLE_BANNER = wxT(">>> ORACLE STATISTICS AND TUNING INFORMATION <<<");
char * const langDBINF_DB_BLOCK_GETS = "DB block gets"; wxChar * const langDBINF_DB_BLOCK_GETS = wxT("DB block gets");
char * const langDBINF_CONSISTENT_GETS = "Consistent gets"; wxChar * const langDBINF_CONSISTENT_GETS = wxT("Consistent gets");
char * const langDBINF_PHYSICAL_READS = "Physical reads"; wxChar * const langDBINF_PHYSICAL_READS = wxT("Physical reads");
char * const langDBINF_CACHE_HIT_RATIO = "Cache hit ratio"; wxChar * const langDBINF_CACHE_HIT_RATIO = wxT("Cache hit ratio");
char * const langDBINF_TABLESPACE_IO = "TABLESPACE I/O LEVELS"; wxChar * const langDBINF_TABLESPACE_IO = wxT("TABLESPACE I/O LEVELS");
char * const langDBINF_PHYSICAL_WRITES = "Physical writes"; wxChar * const langDBINF_PHYSICAL_WRITES = wxT("Physical writes");

View File

@@ -89,7 +89,7 @@ extern wxApp *DatabaseDemoApp;
* NOTE: The value returned by this function is for temporary use only and * NOTE: The value returned by this function is for temporary use only and
* should be copied for long term use * should be copied for long term use
*/ */
const char *GetExtendedDBErrorMsg2(wxDb *pDb, char *ErrFile, int ErrLine) const wxChar *GetExtendedDBErrorMsg2(wxDb *pDb, wxChar *ErrFile, int ErrLine)
{ {
static wxString msg; static wxString msg;
msg = wxT(""); msg = wxT("");
@@ -307,7 +307,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
{ {
wxString tStr; wxString tStr;
tStr.Printf(wxT("Unable to open the table '%s'."),tableName); tStr.Printf(wxT("Unable to open the table '%s'."),tableName);
tStr += GetExtendedDBErrorMsg2(pDb,__FILE__,__LINE__); tStr += GetExtendedDBErrorMsg2(pDb,__TFILE__,__LINE__);
wxMessageBox(tStr,wxT("ODBC Error...")); wxMessageBox(tStr,wxT("ODBC Error..."));
Close(); Close();
return; return;
@@ -339,7 +339,7 @@ ClookUpDlg::ClookUpDlg(wxWindow *parent, wxChar *windowTitle, wxChar *tableName,
return; return;
} }
if (lookup2->GetNext()) if (lookup2->GetNext())
maxColLen = col1Len = atoi(lookup2->lookupCol1); maxColLen = col1Len = wxAtoi(lookup2->lookupCol1);
else else
wxMessageBox(wxT("ODBC error during GetNext()"),wxT("ODBC Error...")); wxMessageBox(wxT("ODBC error during GetNext()"),wxT("ODBC Error..."));
} }
@@ -430,7 +430,7 @@ void ClookUpDlg::OnButton( wxCommandEvent &event )
} }
void ClookUpDlg::OnCommand(wxWindow& win, wxCommandEvent& event) void ClookUpDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event))
{ {
wxString widgetName = win.GetName(); wxString widgetName = win.GetName();

View File

@@ -32,7 +32,7 @@ class Clookup : public wxDbTable
wxChar lookupCol[LOOKUP_COL_LEN+1]; wxChar lookupCol[LOOKUP_COL_LEN+1];
Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &defDir=""); Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &defDir=wxT(""));
}; // Clookup }; // Clookup
@@ -45,7 +45,7 @@ class Clookup2 : public wxDbTable
wxChar lookupCol1[LOOKUP_COL_LEN+1]; wxChar lookupCol1[LOOKUP_COL_LEN+1];
wxChar lookupCol2[LOOKUP_COL_LEN+1]; wxChar lookupCol2[LOOKUP_COL_LEN+1];
Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2, wxDb *pDb, const wxString &defDir=""); Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2, wxDb *pDb, const wxString &defDir=wxT(""));
}; // Clookup2 }; // Clookup2