]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/dbtree.cpp
Added support for transparency in rotation code
[wxWidgets.git] / demos / dbbrowse / dbtree.cpp
index 0bd0fb0c1126dc5273cc69f90fb1c2745846b72a..29a9b3a069e1342ed759a72a506ab967a509bdea 100644 (file)
@@ -60,24 +60,16 @@ BEGIN_EVENT_TABLE(DBTree, wxTreeCtrl)
 DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const wxSize& size, long style)
   : wxTreeCtrl(parent, id, pos, size, style)
 {
-  wxFont* ft_Temp = new wxFont(10,wxSWISS,wxNORMAL,wxBOLD,FALSE,"Comic Sans MS");
+  //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__)
-  p_imageListNormal->Add(wxICON(Logo));
-  p_imageListNormal->Add(wxICON(DsnClosed));
-  p_imageListNormal->Add(wxICON(DsnOpen));
-  p_imageListNormal->Add(wxICON(TAB));
-  p_imageListNormal->Add(wxICON(COL));
-  p_imageListNormal->Add(wxICON(KEY));
-  p_imageListNormal->Add(wxICON(KEYF));
-  p_imageListNormal->Add(wxICON(DocOpen));
-  p_imageListNormal->Add(wxICON(DocOpen));
-#else
+
+#if !defined(__WXMSW__)
 #include "bitmaps/logo.xpm"
 #include "bitmaps/dsnclose.xpm"
 #include "bitmaps/dsnopen.xpm"
@@ -85,8 +77,23 @@ 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
+
+   p_imageListNormal->Add(wxICON(Logo));
+   p_imageListNormal->Add(wxICON(DsnClosed));
+   p_imageListNormal->Add(wxICON(DsnOpen));
+   p_imageListNormal->Add(wxICON(TAB));
+   p_imageListNormal->Add(wxICON(COL));
+   p_imageListNormal->Add(wxICON(KEY));
+   p_imageListNormal->Add(wxICON(KEYF));
+   p_imageListNormal->Add(wxICON(DocOpen));
+   p_imageListNormal->Add(wxICON(DocOpen));
+
+
+
   
   SetImageList(p_imageListNormal);
   ct_BrowserDB = NULL;
@@ -111,9 +118,11 @@ 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))
     {
+      wxBeginBusyCursor();
       ct_BrowserDB = (pDoc->db_Br+i_Which)->OnGetCatalog(FALSE);
       if (ct_BrowserDB)
        { // Use the wxDatabase Information
@@ -121,6 +130,7 @@ int  DBTree::OnPopulate()
          Root = AddRoot(Temp0,TreeIc_DsnOpen,TreeIc_DsnOpen,new DBTreeData("Root"));
          for (x=0;x<ct_BrowserDB->numTables;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,
@@ -186,10 +196,12 @@ int  DBTree::OnPopulate()
        }      // if (ct_BrowserDB)
       else
        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;
+      //wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed"));
     }
   //----------------------------------------------------------------------------------------------------------------------------
   Expand(Root);
@@ -205,6 +217,7 @@ int  DBTree::OnPopulate()
   popupMenu2->AppendSeparator();
   popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h "));
   //----------------------------------------------------------------------------------------------------------------------------
+
   return 0;
 }
 //---------------------------------------------------------------------------