X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/13b59a33b43aca6ce874ce62c6f30a24e5800b15..ad30de59f6aa54716c3f702b03c25a3117a032c6:/demos/dbbrowse/dbtree.cpp diff --git a/demos/dbbrowse/dbtree.cpp b/demos/dbbrowse/dbtree.cpp index e5b8303a7c..29a9b3a069 100644 --- a/demos/dbbrowse/dbtree.cpp +++ b/demos/dbbrowse/dbtree.cpp @@ -60,33 +60,40 @@ 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 -// #include "bitmaps/logo.xpm" -// #include "bitmaps/dsnclose.xpm" -// #include "bitmaps/dsnopen.xpm" -// #include "bitmaps/tab.xpm" -// #include "bitmaps/key.xpm" -// #include "bitmaps/keyf.xpm" -// #include "bitmaps/d_open.xpm" -// #include "bitmaps/d_closed.xpm" -//#endif + +#if !defined(__WXMSW__) +#include "bitmaps/logo.xpm" +#include "bitmaps/dsnclose.xpm" +#include "bitmaps/dsnopen.xpm" +#include "bitmaps/tab.xpm" +#include "bitmaps/key.xpm" +#include "bitmaps/keyf.xpm" +#include "bitmaps/d_open.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,10 +118,11 @@ int DBTree::OnPopulate() wxTreeItemId Root, Folder, Docu, Funkt; int i,x,y; wxString SQL_TYPE, DB_TYPE; - wxBeginBusyCursor(); + //---------------------------------------------------------------------------------------------------------------------------- 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 @@ -122,6 +130,7 @@ int DBTree::OnPopulate() 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, @@ -187,10 +196,10 @@ 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 { - wxEndBusyCursor(); return 0; //wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed")); } @@ -208,7 +217,7 @@ int DBTree::OnPopulate() popupMenu2->AppendSeparator(); popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h ")); //---------------------------------------------------------------------------------------------------------------------------- - wxEndBusyCursor(); + return 0; } //---------------------------------------------------------------------------