]> git.saurik.com Git - wxWidgets.git/commitdiff
suppres some warnings, suppress assert failure for fonts
authorBart A.M. Jourquin <bart.jourquin@fucam.ac.be>
Mon, 31 Jan 2000 14:36:36 +0000 (14:36 +0000)
committerBart A.M. Jourquin <bart.jourquin@fucam.ac.be>
Mon, 31 Jan 2000 14:36:36 +0000 (14:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

demos/dbbrowse/browsedb.cpp
demos/dbbrowse/dbtree.cpp
demos/dbbrowse/pgmctrl.cpp

index 11531afeb59bddc1eb8f32052cebe08381c0e0e1..602a074ddb552ed92da85d18a3d32cc87c6cbd08 100644 (file)
@@ -30,6 +30,7 @@
 //---------------------------------------------------------------------------
 #include <wx/dbtable.h>
 #include "std.h"
+#include <iostream>
 //---------------------------------------------------------------------------
 // Global structure for holding ODBC connection information
 // - darf nur einmal im Projekte definiert werden ?? Extra Databasse Klasse ?
@@ -73,95 +74,7 @@ char *GetExtendedDBErrorMsg(char *ErrFile, int ErrLine)
   msg += "\n";
   return (char*) (const char*) msg;
 }  // GetExtendedDBErrorMsg
-//////////////////////////////////////////////////////////////////////////////////
-// BJO 20000115 : New stuff : dialog to ask for username and password
-//////////////////////////////////////////////////////////////////////////////////
-class UserDialog : public wxDialog
-{
-public:
-  UserDialog(wxWindow* parent);
-  virtual ~UserDialog();
-  void OnOK(wxCommandEvent& event);
-  wxString s_UserName, s_Password;
-  
-private:
-  wxButton *m_OK;
-  wxStaticText *m_Label1, *m_Label2;
-  wxTextCtrl *m_UserName, *m_Password;
-  
-  
-  DECLARE_EVENT_TABLE()
-    };
-//---------------------------------------------------------------------------
-BEGIN_EVENT_TABLE(UserDialog, wxDialog)
-  EVT_BUTTON(wxID_OK, UserDialog::OnOK)
-  END_EVENT_TABLE()
-  //---------------------------------------------------------------------------
-  UserDialog::UserDialog(wxWindow *parent):
-    wxDialog(parent, -1, _("ODBC user"),wxDefaultPosition, wxSize(310, 300),wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE)
-{
-  wxLayoutConstraints* layout;
-  SetAutoLayout(TRUE);
-  //-----------------------------------------------
-  m_OK = new wxButton(this, wxID_OK, _("Ok"));
-  layout = new wxLayoutConstraints;
-  layout->left.SameAs(this, wxLeft, 10);
-  layout->top.SameAs(this, wxTop,10);
-  layout->height.AsIs();
-  layout->width.Absolute(75);
-  m_OK->SetConstraints(layout);
-  
-  m_Label1 = new wxStaticText(this, -1, _("User ID:"));
-  layout = new wxLayoutConstraints;
-  layout->left.SameAs(m_OK, wxLeft);
-  layout->top.SameAs(m_OK, wxBottom, 10);
-  layout->height.AsIs();
-  layout->width.AsIs();
-  m_Label1->SetConstraints(layout);
-  
-  m_UserName = new wxTextCtrl(this, -1, "");
-  layout = new wxLayoutConstraints;
-  layout->left.SameAs(m_OK, wxLeft);
-  layout->top.SameAs(m_Label1, wxBottom, 3);
-  layout->width.AsIs();
-  layout->height.AsIs();
-  m_UserName->SetConstraints(layout);
-  
-  m_Label2 = new wxStaticText(this, -1, _("Password:"));
-  layout = new wxLayoutConstraints;
-  layout->left.SameAs(m_OK, wxLeft);
-  layout->top.SameAs(m_UserName, wxBottom, 10);
-  layout->height.AsIs();
-  layout->width.AsIs();
-  m_Label2->SetConstraints(layout);
-  
-  m_Password = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
-  layout = new wxLayoutConstraints;
-  layout->left.SameAs(m_OK, wxLeft);
-  layout->width.AsIs();
-  layout->top.SameAs(m_Label2, wxBottom, 3);
-  layout->height.AsIs();
-  m_Password->SetConstraints(layout);
-  
-  s_UserName = "";
-  s_Password = "";
-  
-  Layout();
-}
-//---------------------------------------------------------------------------
-UserDialog::~UserDialog()
-{
-}
-//---------------------------------------------------------------------------
-void UserDialog::OnOK(wxCommandEvent& WXUNUSED(event))
-{
-  strcpy(ConnectInf.Uid,  m_UserName->GetValue());
-  strcpy(ConnectInf.AuthStr, m_Password->GetValue());
-  EndModal(1);
-}
-//////////////////////////////////////////////////////////////////////////////////
-// BJO 20000115 : end of  new stuff
-//////////////////////////////////////////////////////////////////////////////////
+
 //---------------------------------------------------------------------------
 BrowserDB::BrowserDB()
 {
@@ -228,7 +141,7 @@ bool BrowserDB::OnStartDB(int Quite)
   delete p_Dlg;
 
   if (OK)
-    {
+    {     
       //---------------------------
       strcpy(ConnectInf.Dsn, ODBCSource);           // ODBC data source name (created with ODBC Administrator under Win95/NT)
       strcpy(ConnectInf.Uid, UserName);             // database username - must already exist in the data source
index 5b4b15b6b6e16703570d8fad97583210b4284f1f..e5b8303a7c4a3b5901e4a244b2ff2f6305206664 100644 (file)
@@ -67,26 +67,26 @@ DBTree::DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const w
   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__)
+//   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
   
   SetImageList(p_imageListNormal);
   ct_BrowserDB = NULL;
@@ -111,6 +111,7 @@ 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))
     {
@@ -189,8 +190,9 @@ int  DBTree::OnPopulate()
     }       // 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"));
+      //wxLogMessage(_("\n-E-> DBTree::OnPopulate() : A valid Pointer could not be created : Failed"));
     }
   //----------------------------------------------------------------------------------------------------------------------------
   Expand(Root);
@@ -206,6 +208,7 @@ int  DBTree::OnPopulate()
   popupMenu2->AppendSeparator();
   popupMenu2->Append(DATA_TABLE, _("Make wxTable.cpp/h "));
   //----------------------------------------------------------------------------------------------------------------------------
+  wxEndBusyCursor();  
   return 0;
 }
 //---------------------------------------------------------------------------
index f9c80f2f631834e15279dacac0e979b7f99aef00..1b55d2d0aae70fe9dd5dce3aa0d9ebd990f12bdc 100644 (file)
@@ -264,30 +264,30 @@ void PgmCtrl::OnUserPassword()
   // wxMessageBox(SaveDSN);
   int i, rc=0;
   //-------------------------------------------
-  DlgUser p_Dlg(this, "Username and Password");
+  DlgUser *p_Dlg = new DlgUser(this, "Username and Password");
   //-------------------------------------------
   for (i=0;i<pDoc->i_DSN;i++)
     {
       if (SaveDSN == (pDoc->p_DSN+i)->Dsn)
        {
-         p_Dlg.s_DSN      = (pDoc->p_DSN+i)->Dsn;
-         p_Dlg.s_User     = (pDoc->p_DSN+i)->Usr;
-         p_Dlg.s_Password = (pDoc->p_DSN+i)->Pas;
-         p_Dlg.OnInit();
-         p_Dlg.Fit();
+         p_Dlg->s_DSN      = (pDoc->p_DSN+i)->Dsn;
+         p_Dlg->s_User     = (pDoc->p_DSN+i)->Usr;
+         p_Dlg->s_Password = (pDoc->p_DSN+i)->Pas;
+         p_Dlg->OnInit();
+         p_Dlg->Fit();
          //--------------------
          // Temp0.Printf("i(%d) ; s_DSN(%s) ; s_User(%s) ; s_Password(%s)",i,p_Dlg.s_DSN,p_Dlg.s_User,p_Dlg.s_Password);
          // wxMessageBox(Temp0);
          bool OK = FALSE;
-         if (p_Dlg.ShowModal() == wxID_OK)
+         if (p_Dlg->ShowModal() == wxID_OK)
            {
-             (pDoc->p_DSN+i)->Usr = p_Dlg.s_User;
-             (pDoc->p_DSN+i)->Pas = p_Dlg.s_Password;
+             (pDoc->p_DSN+i)->Usr = p_Dlg->s_User;
+             (pDoc->p_DSN+i)->Pas = p_Dlg->s_Password;
              (pDoc->db_Br+i)->UserName  = (pDoc->p_DSN+i)->Usr;
              (pDoc->db_Br+i)->Password  = (pDoc->p_DSN+i)->Pas;
              OK = TRUE;
            }
-         p_Dlg.Destroy();
+         delete p_Dlg;
          if (!OK) return;
          //--------------------
          break; // We have what we want, leave