From: Mark Johnson Date: Thu, 10 Feb 2000 15:36:10 +0000 (+0000) Subject: dbbrowse.rc dbgrid.cpp dbtree.cpp dbtree.h help.de/icons.htm X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e8c6aabeaa7392d1d50828702cc96c4a2ef21495 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 --- diff --git a/demos/dbbrowse/bitmaps/view.ico b/demos/dbbrowse/bitmaps/view.ico new file mode 100644 index 0000000000..bcbcc5a29a Binary files /dev/null and b/demos/dbbrowse/bitmaps/view.ico differ diff --git a/demos/dbbrowse/bitmaps/view.xpm b/demos/dbbrowse/bitmaps/view.xpm new file mode 100644 index 0000000000..74189b7660 --- /dev/null +++ b/demos/dbbrowse/bitmaps/view.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char* VIEW_xpm[] = { +"16 16 5 1", +" c #000000", +"! c #000080", +"# c #C0C0C0", +"$ c #808080", +"% c #FFFFFF", +"$$$$$$$$$$$$$$$$", +"$$$$$$$$$$$$$$$$", +"$#############$ ", +"$#$$$$$$$$$$$$$ ", +"$$$$$$$$$$$$$$$ ", +"$$############# ", +"$$#$$$$$$$$$$$$ ", +"$$#$$$$$$$$$$$$ ", +"$$#$$$$$$$$$$$$ ", +"$$#%%%%%%%%%%%$ ", +"$$#%!!!%!!!%!%$ ", +"$$#%%%%%%%%%%%$ ", +"$$#%!!!%!!!%!%$ ", +"$$#%%%%%%%%%%%$ ", +" $#%!!!%!!!%!% ", +"%$$$$$$$$$$$$$$$"}; diff --git a/demos/dbbrowse/dbbrowse.rc b/demos/dbbrowse/dbbrowse.rc index a1f52e29ef..ec17794d14 100644 --- a/demos/dbbrowse/dbbrowse.rc +++ b/demos/dbbrowse/dbbrowse.rc @@ -5,6 +5,7 @@ DSNOpen ICON "bitmaps\\dsnopen.ico" KEY ICON "bitmaps\\key.ico" KEYF ICON "bitmaps\\keyf.ico" TAB ICON "bitmaps\\tab.ico" +VIEW ICON "bitmaps\\view.ico" DocClosed ICON "bitmaps\\d_closed.ico" DocOpen ICON "bitmaps\\d_open.ico" FolderClosed ICON "bitmaps\\f_closed.ico" diff --git a/demos/dbbrowse/dbgrid.cpp b/demos/dbbrowse/dbgrid.cpp index 0d92e60299..1cf859b417 100644 --- a/demos/dbbrowse/dbgrid.cpp +++ b/demos/dbbrowse/dbgrid.cpp @@ -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;xnumTables;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;xnumTables;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;xnumTables;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;xnumTables;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(); } //--------------------------------------------------------------------------- - diff --git a/demos/dbbrowse/dbtree.cpp b/demos/dbbrowse/dbtree.cpp index 29a9b3a069..36837485f5 100644 --- a/demos/dbbrowse/dbtree.cpp +++ b/demos/dbbrowse/dbtree.cpp @@ -4,7 +4,7 @@ // Author: Mark Johnson // Modified by: // Created: 19991129 -/// RCS-ID: $Id$ +// RCS-ID: $Id$ // Copyright: (c) Mark Johnson, Berlin Germany, mj10777@gmx.net // Licence: wxWindows license //--------------------------------------------------------------------------- @@ -63,10 +63,10 @@ DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const w //wxFont* ft_Temp = new wxFont(10,wxSWISS,wxNORMAL,wxBOLD,FALSE,"Comic Sans MS"); wxFont* ft_Temp = new wxFont(wxSystemSettings::GetSystemFont(wxSYS_SYSTEM_FONT)); SetFont(* ft_Temp); - + // Make an image list containing small icons p_imageListNormal = new wxImageList(16, 16, TRUE); - + // should correspond to TreeIc_xxx enum #if !defined(__WXMSW__) @@ -77,7 +77,7 @@ DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const w #include "bitmaps/key.xpm" #include "bitmaps/keyf.xpm" #include "bitmaps/d_open.xpm" -#include "bitmaps/d_closed.xpm" +#include "bitmaps/d_closed.xpm" #include "bitmaps/col.xpm" #endif @@ -91,10 +91,10 @@ DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const w p_imageListNormal->Add(wxICON(DocOpen)); p_imageListNormal->Add(wxICON(DocOpen)); - - + + SetImageList(p_imageListNormal); ct_BrowserDB = NULL; } @@ -115,110 +115,123 @@ DBTree::~DBTree() //--------------------------------------------------------------------------- int DBTree::OnPopulate() { - wxTreeItemId Root, Folder, Docu, Funkt; - int i,x,y; - wxString SQL_TYPE, DB_TYPE; - - //---------------------------------------------------------------------------------------------------------------------------- - if((pDoc->db_Br+i_Which)->Initialize(FALSE)) + wxTreeItemId Root, Folder, Docu, Funkt; + int i,x,y, TableType; + wxString SQL_TYPE, DB_TYPE; + //---------------------------------------------------------------------------------------------------------------------------- + if ((pDoc->db_Br+i_Which)->Initialize(FALSE)) + { + wxBeginBusyCursor(); + ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(FALSE); + if (ct_BrowserDB) + { // Use the wxDatabase Information + Temp0.Printf("%s - (%s) (%s)", s_DSN.c_str(),ct_BrowserDB->catalog, ct_BrowserDB->schema); + // Root = AddRoot(Temp0,TreeIc_DsnOpen,TreeIc_DsnOpen,new DBTreeData("Root")); + Root = AddRoot(Temp0,TreeIc_Smile,TreeIc_Smile,new DBTreeData("Root")); + for (x=0;xnumTables;x++) + { + wxYield(); + TableType = 0; // TABLE = 1 ; VIEW = 2 ; 0 We are not interested in + if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableType,"TABLE")) // only TABLES + TableType = 1; + if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableType,"VIEW")) // and VIEWS + TableType = 2; + if (TableType) // only TABLES or Views { - wxBeginBusyCursor(); - ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(FALSE); - if (ct_BrowserDB) - { // Use the wxDatabase Information - Temp0.Printf("%s - (%s) (%s)", s_DSN.c_str(),ct_BrowserDB->catalog, ct_BrowserDB->schema); - Root = AddRoot(Temp0,TreeIc_DsnOpen,TreeIc_DsnOpen,new DBTreeData("Root")); - for (x=0;xnumTables;x++) - { - wxYield(); - if (!wxStrcmp((ct_BrowserDB->pTableInf+x)->tableType,"TABLE")) // only TABLES - { - Temp0.Printf(_("Tablename(%s) with (%d)Columns ; Remarks(%s)"), (ct_BrowserDB->pTableInf+x)->tableName, - (ct_BrowserDB->pTableInf+x)->numCols, - (ct_BrowserDB->pTableInf+x)->tableRemarks); - Temp1.Printf("TN(%s",(ct_BrowserDB->pTableInf+x)->tableName); - //---- - (ct_BrowserDB->pTableInf+x)->pColInf = (pDoc->db_Br+i_Which)->OnGetColumns((ct_BrowserDB->pTableInf+x)->tableName,(ct_BrowserDB->pTableInf+x)->numCols,FALSE); - //---- - if ((ct_BrowserDB->pTableInf+x)->pColInf) - { - Temp0.Printf(_("Tablename(%s) with (%d)Columns ; Remarks(%s)"), (ct_BrowserDB->pTableInf+x)->tableName, - (ct_BrowserDB->pTableInf+x)->numCols, - (ct_BrowserDB->pTableInf+x)->tableRemarks); - Folder = AppendItem(Root,Temp0,TreeIc_TAB,TreeIc_TAB, new DBTreeData(Temp1)); - for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) - { - Temp1.Printf("FN(%s",((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName); - // Here is where we find out if the Column is a Primary / Foreign Key - if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol != 0) // Primary Key - { - Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_KEY,TreeIc_KEY,new DBTreeData(Temp1)); - Temp2.Printf(_("This Key is used in the following Tables : %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName); - Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEY")); - } + Temp1.Printf("TN(%s",(ct_BrowserDB->pTableInf+x)->tableName); + //---- + (ct_BrowserDB->pTableInf+x)->pColInf = (pDoc->db_Br+i_Which)->OnGetColumns((ct_BrowserDB->pTableInf+x)->tableName,(ct_BrowserDB->pTableInf+x)->numCols,FALSE); + //---- + if ((ct_BrowserDB->pTableInf+x)->pColInf) + { + if (TableType == 1) // Table + { + Temp0.Printf(_("Table-Name(%s) with (%d)Columns ; Remarks(%s)"), (ct_BrowserDB->pTableInf+x)->tableName, + (ct_BrowserDB->pTableInf+x)->numCols,(ct_BrowserDB->pTableInf+x)->tableRemarks); + Folder = AppendItem(Root,Temp0,TreeIc_TAB,TreeIc_TAB, new DBTreeData(Temp1)); + } + if (TableType == 2) // View + { + Temp0.Printf(_("View-Name(%s) with (%d)Columns ; Remarks(%s)"), (ct_BrowserDB->pTableInf+x)->tableName, + (ct_BrowserDB->pTableInf+x)->numCols,(ct_BrowserDB->pTableInf+x)->tableRemarks); + Folder = AppendItem(Root,Temp0,TreeIc_VIEW,TreeIc_VIEW, new DBTreeData(Temp1)); + } + for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) + { + Temp1.Printf("FN(%s",((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName); + // Here is where we find out if the Column is a Primary / Foreign Key + if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol != 0) // Primary Key + { + Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_KEY,TreeIc_KEY,new DBTreeData(Temp1)); + Temp2.Printf(_("This Key is used in the following Tables : %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName); + Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEY")); + } else - if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkCol != 0) // Foreign Key - { - Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_KEYF,TreeIc_KEYF,new DBTreeData(Temp1)); - Temp2.Printf(_("This Foreign Key comes from the following Table : %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkTableName); - Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEYF")); - } - else - Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_COL,TreeIc_COL,new DBTreeData(Temp1)); - SQL_TYPE.Printf(_("SQL_C_???? (%d)"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType); - DB_TYPE.Printf(_("DB_DATA_TYPE_???? (%d)"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType); - for (i=1;i<=(pDoc->db_Br+i_Which)->i_SqlTyp[0];i++) - { - if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType == (pDoc->db_Br+i_Which)->i_SqlTyp[i]) - { - SQL_TYPE.Printf("%s(%d) ; ",(pDoc->db_Br+i_Which)->s_SqlTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_SqlTyp[i]); - } - } // for (i=1;i<=i_SqlTyp[0];i++) - for (i=1;i<=(pDoc->db_Br+i_Which)->i_dbTyp[0];i++) - { - if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType == (pDoc->db_Br+i_Which)->i_dbTyp[i]) - { - DB_TYPE.Printf("%s(%d)",(pDoc->db_Br+i_Which)->s_dbTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_dbTyp[i]); - } - } // for (i=1;i<=i_dbTyp[0];i++) - SQL_TYPE += DB_TYPE; - Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE)); - SQL_TYPE.Printf("%10s %d,%d",((ct_BrowserDB->pTableInf+x)->pColInf+y)->typeName, - ((ct_BrowserDB->pTableInf+x)->pColInf+y)->columnSize, - ((ct_BrowserDB->pTableInf+x)->pColInf+y)->decimalDigits); - Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE)); - } // for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) - } // if ((ct_BrowserDB->pTableInf+x)->pColInf) - else - Folder = AppendItem(Root,Temp0,TreeIc_FolderClosed,TreeIc_FolderOpen, new DBTreeData(Temp1)); - } // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE") - } // for (x=0;xnumTables;x++) - } // if (ct_BrowserDB) - else - wxLogMessage(_("\n-E-> DBTree::OnPopulate() : Invalid Catalog Pointer : Failed")); - wxEndBusyCursor(); - } // if((pDoc->db_Br+i_Which)->Initialize(FALSE)) + { + if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkCol != 0) // Foreign Key + { + Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_KEYF,TreeIc_KEYF,new DBTreeData(Temp1)); + Temp2.Printf(_("This Foreign Key comes from the following Table : %s"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkTableName); + Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData("KEYF")); + } + else + Docu = AppendItem(Folder,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName,TreeIc_COL,TreeIc_COL,new DBTreeData(Temp1)); + } + SQL_TYPE.Printf(_("SQL_C_???? (%d)"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType); + DB_TYPE.Printf(_("DB_DATA_TYPE_???? (%d)"),((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType); + for (i=1;i<=(pDoc->db_Br+i_Which)->i_SqlTyp[0];i++) + { + if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->sqlDataType == (pDoc->db_Br+i_Which)->i_SqlTyp[i]) + { + SQL_TYPE.Printf("%s(%d) ; ",(pDoc->db_Br+i_Which)->s_SqlTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_SqlTyp[i]); + } + } // for (i=1;i<=i_SqlTyp[0];i++) + for (i=1;i<=(pDoc->db_Br+i_Which)->i_dbTyp[0];i++) + { + if (((ct_BrowserDB->pTableInf+x)->pColInf+y)->dbDataType == (pDoc->db_Br+i_Which)->i_dbTyp[i]) + { + DB_TYPE.Printf("%s(%d)",(pDoc->db_Br+i_Which)->s_dbTyp[i].c_str(),(pDoc->db_Br+i_Which)->i_dbTyp[i]); + } + } // for (i=1;i<=i_dbTyp[0];i++) + SQL_TYPE += DB_TYPE; + Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE)); + SQL_TYPE.Printf("%10s %d,%d",((ct_BrowserDB->pTableInf+x)->pColInf+y)->typeName, + ((ct_BrowserDB->pTableInf+x)->pColInf+y)->columnSize,((ct_BrowserDB->pTableInf+x)->pColInf+y)->decimalDigits); + Funkt = AppendItem(Docu,SQL_TYPE,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(SQL_TYPE)); + } // for (y=0;y<(ct_BrowserDB->pTableInf+x)->numCols;y++) + } // if ((ct_BrowserDB->pTableInf+x)->pColInf) + else + Folder = AppendItem(Root,Temp0,TreeIc_FolderClosed,TreeIc_FolderOpen, new DBTreeData(Temp1)); + } // if ((ct_BrowserDB->pTableInf+x)->tableType == "TABLE" or VIEW) + // else + // wxLogMessage(_("\n-I-> if ! TABLE or VIEW >%s<"),(ct_BrowserDB->pTableInf+x)->tableType); + } // for (x=0;xnumTables;x++) + } // if (ct_BrowserDB) else - { - return 0; - //wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed")); - } - //---------------------------------------------------------------------------------------------------------------------------- - Expand(Root); - //---------------------------------------------------------------------------------------------------------------------------- - popupMenu1 = NULL; - popupMenu1 = new wxMenu(""); - popupMenu1->Append(DATA_DB, _("Make wxDB.cpp/h ")); - popupMenu1->AppendSeparator(); - popupMenu1->Append(DATA_TABLE_ALL, _("Make all wxTable.cpp/h classes")); - popupMenu2 = NULL; - popupMenu2 = new wxMenu(""); - popupMenu2->Append(DATA_SHOW, _("Show Data")); - popupMenu2->AppendSeparator(); - popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h ")); - //---------------------------------------------------------------------------------------------------------------------------- - + wxLogMessage(_("\n-E-> DBTree::OnPopulate() : Invalid Catalog Pointer : Failed")); + wxEndBusyCursor(); + } // if((pDoc->db_Br+i_Which)->Initialize(FALSE)) + else + { + wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed")); return 0; + } + //---------------------------------------------------------------------------------------------------------------------------- + Expand(Root); + //---------------------------------------------------------------------------------------------------------------------------- + popupMenu1 = NULL; + popupMenu1 = new wxMenu(""); + popupMenu1->Append(DATA_DB, _("Make wxDB.cpp/h ")); + popupMenu1->AppendSeparator(); + popupMenu1->Append(DATA_TABLE_ALL, _("Make all wxTable.cpp/h classes")); + popupMenu2 = NULL; + popupMenu2 = new wxMenu(""); + popupMenu2->Append(DATA_SHOW, _("Show Data")); + popupMenu2->AppendSeparator(); + popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h ")); + //---------------------------------------------------------------------------------------------------------------------------- + + return 0; } //--------------------------------------------------------------------------- void DBTree::OnSelChanged(wxTreeEvent& WXUNUSED(event)) diff --git a/demos/dbbrowse/dbtree.h b/demos/dbbrowse/dbtree.h index 823e3be478..61d5604385 100644 --- a/demos/dbbrowse/dbtree.h +++ b/demos/dbbrowse/dbtree.h @@ -29,11 +29,12 @@ class DBTree : public wxTreeCtrl TreeIc_DsnClosed, // dsnclose.ico TreeIc_DsnOpen, // dsnopen.ico TreeIc_TAB, // tab.ico + TreeIc_VIEW, // view.ico TreeIc_COL, // col.ico TreeIc_KEY, // key.ico TreeIc_KEYF, // keyf.ico - TreeIc_DocClosed, // d_closed.ico TreeIc_DocOpen, // d_open.ico + TreeIc_DocClosed, // d_closed.ico TreeIc_FolderClosed, // f_closed.ico TreeIc_FolderOpen // f_open.ico }; diff --git a/demos/dbbrowse/help.de/icons.htm b/demos/dbbrowse/help.de/icons.htm index 913caefac9..579f162570 100644 --- a/demos/dbbrowse/help.de/icons.htm +++ b/demos/dbbrowse/help.de/icons.htm @@ -26,8 +26,9 @@  key.ico / key.xpmdbtree.cpp :
ODBC Primärschlüssel-Spalte in eine Tablle
 keyf.ico / keyf.xpmdbtree.cpp :
ODBC Fremdschlüssel-Spalte in eine Tablle
 logo.ico / logo.xpmProgramm Logo -  pgmctrl.ico / pgmctrl.xpm / pgmctrl.bmppgmctrl.cpp :
Tab Bitmap
-  tab.ico / tab.xpmdbtree.cpp :
ODBC Tabelle
+  pgmctrl.ico / pgmctrl.xpm / pgmctrl.bmppgmctrl.cpp :
Tab Bitmap
+  tab.ico / tab.xpmdbtree.cpp :
ODBC Table
+  view.ico / view.xpmdbtree.cpp :
ODBC View
diff --git a/demos/dbbrowse/help.de/problems.htm b/demos/dbbrowse/help.de/problems.htm index cfb8eee771..2864811ec1 100644 --- a/demos/dbbrowse/help.de/problems.htm +++ b/demos/dbbrowse/help.de/problems.htm @@ -5,7 +5,7 @@
Alle andere Pictograms werden nicht in DBBrowser verwendet.
(sind .png Files)

 DBBrowser : Was Funktionert nicht ?


(deutsch)

- Stand: 2000-01-22.01-mj10777 + Stand: 2000-02-04.01-mj10777


@@ -38,7 +38,7 @@
Allgemein
- +
Problem :Warum Funktioniert die Aktulisierungs-Taste (F5) nicht?
Lösung :unbekannt
Solution :pDoc->p_Hilfe-> Display("GUp_Mask_Kunden.htm#Sonstiges");

@@ -61,7 +61,15 @@
- + +
Problem :Wenn wxGrid in wxPaggedWindows verwendet wird, funktioniert die Scrollbars nicht.
Lösung :unbekannt
Lösung :04.02.2000 : mit neue Grid Version gelößt

+ +


+ +
wxGrid (newe Version) 04.02.2000
+ + +
Problem :Often : Error: wxGrid::CreateGrid(numRows, numCols) called more than once
Solution :in Arbeit


diff --git a/demos/dbbrowse/help.png/view.png b/demos/dbbrowse/help.png/view.png new file mode 100644 index 0000000000..51f776f12c Binary files /dev/null and b/demos/dbbrowse/help.png/view.png differ diff --git a/demos/dbbrowse/help.std/icons.htm b/demos/dbbrowse/help.std/icons.htm index 51b0947c7d..dbce0fcbd1 100644 --- a/demos/dbbrowse/help.std/icons.htm +++ b/demos/dbbrowse/help.std/icons.htm @@ -25,8 +25,9 @@ - - + + +
 key.ico / key.xpmdbtree.cpp :
ODBC Primary-Key Column in a Table
 keyf.ico / keyf.xpmdbtree.cpp :
ODBC Foreign-Key Column in a Table
 logo.ico / logo.xpmProgramm Logo
 pgmctrl.ico / pgmctrl.xpm / pgmctrl.bmppgmctrl.cpp :
Tab Bitmap
 tab.ico / tab.xpmdbtree.cpp :
ODBC Table
 pgmctrl.ico / pgmctrl.xpm / pgmctrl.bmppgmctrl.cpp :
Tab Bitmap
 tab.ico / tab.xpmdbtree.cpp :
ODBC Table
 view.ico / view.xpmdbtree.cpp :
ODBC View
diff --git a/demos/dbbrowse/help.std/problems.htm b/demos/dbbrowse/help.std/problems.htm index a6d64aa689..d08cdccfa1 100644 --- a/demos/dbbrowse/help.std/problems.htm +++ b/demos/dbbrowse/help.std/problems.htm @@ -5,7 +5,7 @@
All other Pictograms are not used in DBBrowser
(they are .png files)

 DBBrowser : What does not Work ?


(English)

- Stand: 2000-01-22.01-mj10777 + Stand: 2000-02-04.01-mj10777


@@ -39,12 +39,12 @@
General
- +
Problem :How can Help be called and a certin Page be opened (Context Help)
Solution :unknown
Solution :p_Help-> Display("GUp_Mask_Kunden.htm#Sonstiges");

- +
Problem :Why doesn't the Refresh-Button (F5) work?
Lvsung :unbekannt
solved :unbekannt

@@ -58,10 +58,18 @@


- +
wxGrid (new Versions)
wxGrid (new Version)
+ +
Problem :When wxGrid is used in wxPaggedWindows, the Scrollbars do not work.
Solution :04.02.2000 : This has been solved with the new code.

+ +


+ +
wxGrid (new Version) 04.02.2000
+ +
Problem :Often : Error: wxGrid::CreateGrid(numRows, numCols) called more than once
Solution :unknown