dbbrowse.rc dbgrid.cpp dbtree.cpp dbtree.h help.de/icons.htm

help.de/problems.htm help.std/icons.htm help.std/problems.htm
 	bitmaps/view.ico bitmaps/view.xpm help.png/view.png


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mark Johnson
2000-02-10 15:36:10 +00:00
parent ad30de59f6
commit e8c6aabeaa
11 changed files with 245 additions and 189 deletions

View File

@@ -76,65 +76,65 @@ DBGrid::~DBGrid()
//---------------------------------------------------------------------------
int DBGrid::OnTableView(wxString Table)
{
//---------------------------------------------------------------------------
int i=0,x,y,z, ValidTable=0;
wxString Temp0;
//SetLabelFont(* f_Temp);
wxBeginBusyCursor();
//---------------------------------------------------------------------------
ct_BrowserDB = (db_Br+i_Which)->ct_BrowserDB; // Get the DSN Pointer
//----------------------------------------------------------------------------
if (ct_BrowserDB) // Valid pointer (!= NULL) ?
{ // Pointer is Valid, use the wxDatabase Information
for (x=0;x<ct_BrowserDB->numTables;x++) // go through the Tables
{
if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableName,Table)) // is this our Table ?
{ // Yes, the Data of this Table shall be put into the Grid
ValidTable = x; // Save the Tablenumber
(db_Br+i_Which)->OnSelect(Table,FALSE); // Select * from "table"
// Set the local Pointer to the Column Information we are going to use
(db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf;
if ((ct_BrowserDB->pTableInf+x)->pColInf) // Valid pointer (!= NULL) ?
{ // Pointer is Valid, Column Informationen sind Vorhanden
i = (db_Br+i_Which)->i_Records; // How many Records are there
(db_Br+i_Which)->i_Which = ValidTable; // Still used ???? mj10777
if (i == 0) // If the Table is empty, then show one empty row
i++;
CreateGrid(i,(ct_BrowserDB->pTableInf+x)->numCols); // Records , Columns
for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) // Loop through the Fields
{ // The Field / Column name is used here as Row Titel
SetColLabelValue(y,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
SetColSize(y,95);
} // for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++)
SetColSize(((ct_BrowserDB->pTableInf+x)->numCols-1),120); // Make the last Column Wider
// The Grid has been created, now fill it
for (z=0;z<(db_Br+i_Which)->i_Records;z++) // Loop through the Records
{
Temp0.Printf("%06d",z+1); SetRowLabelValue(z,Temp0); // Set Row Lable Value
(db_Br+i_Which)->OnGetNext((ct_BrowserDB->pTableInf+ValidTable)->numCols,FALSE);
for (y=0;y<(ct_BrowserDB->pTableInf+ValidTable)->numCols;y++) // Loop through the Fields
{ // BrowserDB::OnGetNext Formats the field Value into tablename
SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName);
}
if (z % 50 == 0)
{
Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - Record %6d has been read."),Table.c_str(),z);
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
}
} // for (z=0;z<(db_Br+i_Which)->i_Records;z++)
Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - %6d Records have been read."),Table.c_str(),z);
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
// The Grid has been filled, now leave
goto Weiter;
} // if ((ct_BrowserDB->pTableInf+x)->pColInf)
else
wxLogMessage(_("\n-E-> DBGrid::OnTableView():: Invalid Column Pointer : Failed"));
} // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE")
} // for (x=0;x<ct_BrowserDB->numTables;x++)
} // if (ct_BrowserDB)
else
wxLogMessage(_("\n-E-> DBGrid::OnTableView():: Invalid DSN Pointer : Failed"));
//---------------------------------------------------------------------------
int i=0,x,y,z, ValidTable=0;
wxString Temp0;
//SetLabelFont(* f_Temp);
wxBeginBusyCursor();
//---------------------------------------------------------------------------
ct_BrowserDB = (db_Br+i_Which)->ct_BrowserDB; // Get the DSN Pointer
//----------------------------------------------------------------------------
if (ct_BrowserDB) // Valid pointer (!= NULL) ?
{ // Pointer is Valid, use the wxDatabase Information
for (x=0;x<ct_BrowserDB->numTables;x++) // go through the Tables
{
if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableName,Table)) // is this our Table ?
{ // Yes, the Data of this Table shall be put into the Grid
ValidTable = x; // Save the Tablenumber
(db_Br+i_Which)->OnSelect(Table,FALSE); // Select * from "table"
// Set the local Pointer to the Column Information we are going to use
(db_Br+i_Which)->cl_BrowserDB = (ct_BrowserDB->pTableInf+x)->pColInf;
if ((ct_BrowserDB->pTableInf+x)->pColInf) // Valid pointer (!= NULL) ?
{ // Pointer is Valid, Column Informationen sind Vorhanden
i = (db_Br+i_Which)->i_Records; // How many Records are there
(db_Br+i_Which)->i_Which = ValidTable; // Still used ???? mj10777
if (i == 0) // If the Table is empty, then show one empty row
i++;
wxLogMessage(_("\n-I-> DBGrid::OnTableView():: Vor CreateGrid"));
CreateGrid(i,(ct_BrowserDB->pTableInf+x)->numCols); // Records , Columns
for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) // Loop through the Fields
{ // The Field / Column name is used here as Row Titel
SetColLabelValue(y,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
SetColSize(y,95);
} // for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++)
SetColSize(((ct_BrowserDB->pTableInf+x)->numCols-1),120); // Make the last Column Wider
// The Grid has been created, now fill it
for (z=0;z<(db_Br+i_Which)->i_Records;z++) // Loop through the Records
{
Temp0.Printf("%06d",z+1); SetRowLabelValue(z,Temp0); // Set Row Lable Value
(db_Br+i_Which)->OnGetNext((ct_BrowserDB->pTableInf+ValidTable)->numCols,FALSE);
for (y=0;y<(ct_BrowserDB->pTableInf+ValidTable)->numCols;y++) // Loop through the Fields
{ // BrowserDB::OnGetNext Formats the field Value into tablename
SetCellValue(z, y,((db_Br+i_Which)->cl_BrowserDB+y)->tableName);
}
if (z % 50 == 0)
{
Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - Record %6d has been read."),Table.c_str(),z);
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
}
} // for (z=0;z<(db_Br+i_Which)->i_Records;z++)
Temp0.Printf(_("-I-> DBGrid::OnTableView(%s) - %6d Records have been read."),Table.c_str(),z);
pDoc->p_MainFrame->SetStatusText(Temp0, 0);
// The Grid has been filled, now leave
goto Weiter;
} // if ((ct_BrowserDB->pTableInf+x)->pColInf)
else
wxLogMessage(_("\n-E-> DBGrid::OnTableView():: Invalid Column Pointer : Failed"));
} // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE")
} // for (x=0;x<ct_BrowserDB->numTables;x++)
} // if (ct_BrowserDB)
else
wxLogMessage(_("\n-E-> DBGrid::OnTableView():: Invalid DSN Pointer : Failed"));
//---------------------------------------------------------------------------
Weiter:
SetEditInPlace(b_EditModus); // Activate in-place Editing (FALSE)
@@ -266,7 +266,7 @@ void DBGrid::OnCellLeftClick( wxGridEvent& ev )
{
logBuf = "DBGrid::OnCellLeftClick : ";
logBuf << "Cell at row " << ev.GetRow()
<< " col " << ev.GetCol();
<< " col " << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf);
logBuf += "\n";
@@ -281,7 +281,7 @@ void DBGrid::OnCellRightClick( wxGridEvent& ev )
{
logBuf = "DBGrid::OnCellRightClick : ";
logBuf << "Cell at row " << ev.GetRow()
<< " col " << ev.GetCol();
<< " col " << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf);
logBuf += "\n";
@@ -296,7 +296,7 @@ void DBGrid::OnCellLeftDClick( wxGridEvent& ev )
{
logBuf = "DBGrid::OnCellLeftDClick : ";
logBuf << "Cell at row " << ev.GetRow()
<< " col " << ev.GetCol();
<< " col " << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf);
logBuf += "\n";
@@ -311,7 +311,7 @@ void DBGrid::OnCellRightDClick( wxGridEvent& ev )
{
logBuf = "DBGrid::OnCellRightDClick : ";
logBuf << "Cell at row " << ev.GetRow()
<< " col " << ev.GetCol();
<< " col " << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf);
logBuf += "\n";
@@ -326,7 +326,7 @@ void DBGrid::OnCellChange( wxGridEvent& ev )
{
logBuf = "DBGrid::OnCellChange : ";
logBuf << "Cell at row " << ev.GetRow()
<< " col " << ev.GetCol();
<< " col " << ev.GetCol();
// wxLogMessage( "%s", logBuf.c_str() );
// wxMessageBox(logBuf);
logBuf += "\n";
@@ -354,7 +354,7 @@ void DBGrid::OnColSize( wxGridSizeEvent& ev )
// wxLogMessage( "%s", logBuf.c_str() );
logBuf += "\n";
wxLogMessage(logBuf.c_str());
ev.Skip();
}
//---------------------------------------------------------------------------
@@ -362,15 +362,14 @@ void DBGrid::OnRangeSelected( wxGridRangeSelectEvent& ev )
{
logBuf = "DBGrid::OnRangeSelected : ";
logBuf << "Selected cells from row " << ev.GetTopRow()
<< " col " << ev.GetLeftCol()
<< " to row " << ev.GetBottomRow()
<< " col " << ev.GetRightCol();
<< " col " << ev.GetLeftCol()
<< " to row " << ev.GetBottomRow()
<< " col " << ev.GetRightCol();
logBuf += "\n";
// wxLogMessage( "%s", logBuf.c_str() );
wxLogMessage(logBuf.c_str());
ev.Skip();
}
//---------------------------------------------------------------------------