]> git.saurik.com Git - wxWidgets.git/blobdiff - demos/dbbrowse/pgmctrl.cpp
Added missing includes
[wxWidgets.git] / demos / dbbrowse / pgmctrl.cpp
index c7b2ec0663896fca79eaa45a6f7e5108e2182022..d146c0de9f04d7227922e73895776dd578edbfe3 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"
 //----------------------------------------------------------------------------------------
@@ -45,7 +39,7 @@
 //----------------------------------------------------------------------------------------
 static inline const wxChar *bool2String(bool b)
 {
-    return b ? _T("") : _T("not ");
+    return b ? wxEmptyString : _T("not ");
 }
 
 //----------------------------------------------------------------------------------------
@@ -72,14 +66,8 @@ PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const
 {
     const int image_size = 16;
     // Make an image list containing small icons
-    p_imageListNormal = new wxImageList(image_size, image_size, TRUE);
+    p_imageListNormal = new wxImageList(image_size, image_size, true);
     // should correspond to TreeIc_xxx enum
-#if defined(__WXMSW__) && defined(__WIN16__)
-    // This is required in 16-bit Windows mode only because we can't load a specific (16x16)
-    // icon image, so it comes out stretched
-    p_imageListNormal->Add(wxBitmap(wxBitmap("bitmap1", wxBITMAP_TYPE_BMP_RESOURCE).ConvertToImage().Rescale(image_size, image_size)));
-    p_imageListNormal->Add(wxBitmap(wxBitmap("bitmap2", wxBITMAP_TYPE_BMP_RESOURCE).ConvertToImage().Rescale(image_size, image_size)));
-#else
     p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(aLogo)).ConvertToImage().Rescale(image_size, image_size)));
     p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnClosed)).ConvertToImage().Rescale(image_size, image_size)));
     p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DsnOpen)).ConvertToImage().Rescale(image_size, image_size)));
@@ -87,7 +75,6 @@ PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const
     p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(DocOpen)).ConvertToImage().Rescale(image_size, image_size)));
     p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(FolderClosed)).ConvertToImage().Rescale(image_size, image_size)));
     p_imageListNormal->Add(wxBitmap(wxBitmap(wxICON(FolderOpen)).ConvertToImage().Rescale(image_size, image_size)));
-#endif
     SetImageList(p_imageListNormal);
 }
 
@@ -95,7 +82,7 @@ PgmCtrl::PgmCtrl(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const
 PgmCtrl::~PgmCtrl()
 {
     delete p_imageListNormal;
-    delete popupMenu1;  
+    delete popupMenu1;
 }
 
 //----------------------------------------------------------------------------------------
@@ -129,7 +116,7 @@ int  PgmCtrl::OnPopulate()
     }
     //---------------------------------------------------------------------------------------
     popupMenu1 = NULL;
-    popupMenu1 = new wxMenu(_T(""));
+    popupMenu1 = new wxMenu;
     popupMenu1->Append(PGMCTRL_ODBC_USER, _("Set Username and Password"));
     // popupMenu1->AppendSeparator();
     //---------------------------------------------------------------------------------------
@@ -144,7 +131,9 @@ void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
 {
     int i;
     Temp0.Empty();   Temp1.Empty();
+#if wxUSE_STATUSBAR
     pDoc->p_MainFrame->SetStatusText(Temp0,0);
+#endif // wxUSE_STATUSBAR
     // Get the Information that we need
     wxTreeItemId itemId = GetSelection();
     TreeData *item = (TreeData *)GetItemData(itemId);
@@ -171,9 +160,9 @@ void PgmCtrl::OnSelChanged(wxMouseEvent& WXUNUSED(event))
         if (Temp1 == _T("wxConfigBase Delete"))
         {
             if (p_ProgramCfg->DeleteAll()) // Default Diretory for wxFileSelector
-                Temp0 = _("-I-> wxConfigBase.p_ProgramCfg->DeleteAll() was succesfull.");
+                Temp0 = _("-I-> wxConfigBase.p_ProgramCfg->DeleteAll() was successful.");
             else
-                Temp0 = _("-E-> wxConfigBase.p_ProgramCfg->DeleteAll() was not succesfull !");
+                Temp0 = _("-E-> wxConfigBase.p_ProgramCfg->DeleteAll() was not successful !");
             wxBell();     // Ding_a_Ling
             Treffer++;
         }
@@ -267,7 +256,7 @@ void PgmCtrl::OnUserPassword(wxCommandEvent& WXUNUSED(event))
     // wxMessageBox(SaveDSN);
     int i;
     //--------------------------------------------
-    DlgUser *p_Dlg = new DlgUser(this,pDoc,_T(""));
+    DlgUser *p_Dlg = new DlgUser(this,pDoc,wxEmptyString);
     //-------------------------------------------
     for (i=0;i<pDoc->i_DSN;i++)
     {
@@ -283,14 +272,14 @@ void PgmCtrl::OnUserPassword(wxCommandEvent& WXUNUSED(event))
             //--------------------
             // 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;
+            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->db_Br+i)->UserName  = (pDoc->p_DSN+i)->Usr;
                 (pDoc->db_Br+i)->Password  = (pDoc->p_DSN+i)->Pas;
-                OK = TRUE;
+                OK = true;
             }
             delete p_Dlg;
             if (!OK)