]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/pgmctrl.cpp
icons fix for unix
[wxWidgets.git] / demos / dbbrowse / pgmctrl.cpp
index 638d483317dabeb5831ddb168dfd7659e1ca7615..5522bd9e8b6ccc3643402a344b4003f21d9bbee8 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Mark Johnson
 // Modified by: 19990806.mj10777
 // Created:     19991010
-// RCS-ID:
+// RCS-ID:      $Id$
 // Copyright:   (c) Mark Johnson, Berlin Germany, mj10777@gmx.net
 // Licence:     wxWindows license
 //---------------------------------------------------------------------------
@@ -64,7 +64,8 @@ BEGIN_EVENT_TABLE(PgmCtrl, wxTreeCtrl)
 PgmCtrl::PgmCtrl(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
@@ -264,32 +265,36 @@ void PgmCtrl::OnUserPassword()
   // wxMessageBox(SaveDSN);
   int i, rc=0;
   //-------------------------------------------
-  DlgUser p_Dlg(this, "Username and Password", wxPoint(100, 100), wxSize(340, 170));
+  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->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);
-         if (p_Dlg.ShowModal() == wxID_OK)
+         bool OK = FALSE;
+         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;
          //--------------------
-         goto Weiter; // We have what we want, leave
+         break; // We have what we want, leave
        }
     }
- Weiter:
   //-------------------------------------------
   SaveDSN.Empty();
 }