]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/dbtree.cpp
Added HAVE_FTIME for all Windows compilers
[wxWidgets.git] / demos / dbbrowse / dbtree.cpp
index 89d7546c06deda7d540e55fe4bcc0f318165d1f1..8bacf0a3711baa340cd063d421667ee145403b22 100644 (file)
@@ -106,7 +106,6 @@ DBTree::~DBTree()
 //----------------------------------------------------------------------------------------
 int  DBTree::OnPopulate()
 {
- wxStopWatch sw;
  wxTreeItemId Root, Folder, Docu, Funkt;
  int i,x,y,z=0, TableType;
  wxString SQL_TYPE, DB_TYPE;
@@ -114,6 +113,7 @@ int  DBTree::OnPopulate()
  //---------------------------------------------------------------------------------------
  if ((pDoc->db_Br+i_Which)->Initialize(FALSE))
  {
+  wxStopWatch sw;
   wxBeginBusyCursor();
   ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(FALSE);
   if (ct_BrowserDB)
@@ -154,26 +154,28 @@ int  DBTree::OnPopulate()
        // 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("(%d) - %s",((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkCol,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
+        Docu = AppendItem(Folder,Temp2,TreeIc_KEY,TreeIc_KEY,new DBTreeData(Temp1));
         Temp2 = ((ct_BrowserDB->pTableInf+x)->pColInf+y)->PkTableName;
         if (Temp2 == "")
          Temp2 = _("None");
-        Temp2.Printf(_("This Key is used in the following Tables : %s"),Temp2);
+        Temp2.Printf(_("This Primary Key is used in the following Tables : %s"),Temp2);
         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("(%d) - %s",((ct_BrowserDB->pTableInf+x)->pColInf+y)->FkCol,((ct_BrowserDB->pTableInf+x)->pColInf+y)->colName);
+         Docu = AppendItem(Folder,Temp2,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);
+       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])
@@ -211,7 +213,7 @@ int  DBTree::OnPopulate()
   else
    wxLogMessage(_("\n-E-> DBTree::OnPopulate() : Invalid Catalog Pointer : Failed"));
   wxEndBusyCursor();
-  Temp0.Printf(_("-I-> DBTree::OnPopulate(%s) - %6d Tables have been read. - Time needed : %ld ms"),(ct_BrowserDB->pTableInf+x)->tableName,z,sw.Time());
+  Temp0.Printf(_("-I-> DBTree::OnPopulate() - %6d Tables have been read. - Time needed : %ld ms"),z,sw.Time());
   wxLogMessage(Temp0);
   pDoc->p_MainFrame->SetStatusText(Temp0, 0);
  }       // if((pDoc->db_Br+i_Which)->Initialize(FALSE))