]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/dbtree.cpp
Patch from Bo for new API, various fixes, live update for column header
[wxWidgets.git] / demos / dbbrowse / dbtree.cpp
index b2e6f15a29c8f41cf05dedc4b865be2c1ca49d6b..751e730d0dfdc450f43e43a8544d24627db0781d 100644 (file)
@@ -8,13 +8,7 @@
 // Copyright:   (c) Mark Johnson, Berlin Germany
 // Licence:     wxWindows license
 //----------------------------------------------------------------------------------------
-//-- all #ifdefs that the whole Project needs. -------------------------------------------
-//----------------------------------------------------------------------------------------
-#ifdef __GNUG__
-#pragma implementation
-#pragma interface
-#endif
-//----------------------------------------------------------------------------------------
+
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 //----------------------------------------------------------------------------------------
@@ -38,7 +32,7 @@
 //----------------------------------------------------------------------------------------
 static inline const wxChar *bool2String(bool b)
 {
-    return b ? _T("") : _T("not ");
+    return b ? wxEmptyString : _T("not ");
 }
 
 //----------------------------------------------------------------------------------------
@@ -174,7 +168,7 @@ int DBTree::OnPopulate()
                                 Temp2.Printf(_T("(%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 == _T(""))
+                                if (Temp2.empty())
                                     Temp2 = _("None");
                                 Temp2.Printf(_("This Primary Key is used in the following Tables : %s"),Temp2.c_str());
                                 Funkt = AppendItem(Docu,Temp2,TreeIc_DocClosed,TreeIc_DocOpen,new DBTreeData(_T("KEY")));
@@ -250,12 +244,12 @@ int DBTree::OnPopulate()
     Expand(Root);
     //---------------------------------------------------------------------------------------
     popupMenu1 = NULL;
-    popupMenu1 = new wxMenu(_T(""));
+    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(_T(""));
+    popupMenu2 = new wxMenu;
     popupMenu2->Append(DATA_SHOW, _("Show Data"));
     popupMenu2->AppendSeparator();
     popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h "));
@@ -281,7 +275,7 @@ void DBTree::OnSelChanged(wxTreeEvent& WXUNUSED(event))
         //-------------------------------------------------------------------------------------
         if (Temp1.Contains(_T("ODBC-")))
         {
-            Temp1 = Temp1.Mid(5,wxSTRING_MAXLEN);
+            Temp1 = Temp1.Mid(5);
             for (i=0;i<pDoc->i_DSN;i++)
             {
                 if (Temp1 == (pDoc->p_DSN+i)->Dsn)