]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/db/dbtest.cpp
include wx/dynarray.h to fix compilation with minimal set of wxUSE options
[wxWidgets.git] / samples / db / dbtest.cpp
index 15c1398beff26acad944280f9835c9e6863585ac..6db33475af98d7e81163bed294fa4bf76bd0b927 100644 (file)
  *  SYNOPSIS END
  */
 
  *  SYNOPSIS END
  */
 
-#ifdef __GNUG__
-#pragma implementation "dbtest.h"
-#endif
-
 #include  "wx/wxprec.h"
 
 #ifdef    __BORLANDC__
 #include  "wx/wxprec.h"
 
 #ifdef    __BORLANDC__
@@ -616,6 +612,22 @@ void CheckSupportForAllDataTypes(wxDb *pDb)
         wxLogMessage(nativeDataTypeName);
     }
 #endif
         wxLogMessage(nativeDataTypeName);
     }
 #endif
+#ifdef SQL_WVARCHAR
+    if (DataTypeSupported(pDb,SQL_WVARCHAR, &nativeDataTypeName))
+    {
+        nativeDataTypeName = wxT("SQL_WVARCHAR (") + nativeDataTypeName;
+        nativeDataTypeName += wxT(")\n");
+        wxLogMessage(nativeDataTypeName);
+    }
+#endif
+#ifdef SQL_WCHAR
+    if (DataTypeSupported(pDb,SQL_WCHAR, &nativeDataTypeName))
+    {
+        nativeDataTypeName = wxT("SQL_WCHAR (") + nativeDataTypeName;
+        nativeDataTypeName += wxT(")\n");
+        wxLogMessage(nativeDataTypeName);
+    }
+#endif
 
     wxLogMessage(wxT("Done\n"));
 }  // CheckSupportForAllDataTypes()
 
     wxLogMessage(wxT("Done\n"));
 }  // CheckSupportForAllDataTypes()
@@ -623,6 +635,9 @@ void CheckSupportForAllDataTypes(wxDb *pDb)
 
 bool DatabaseDemoApp::OnInit()
 {
 
 bool DatabaseDemoApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
     DbConnectInf    = NULL;
     Contact         = NULL;
 
     DbConnectInf    = NULL;
     Contact         = NULL;
 
@@ -1359,8 +1374,8 @@ void CeditorDlg::OnCommand(wxWindow& win, wxCommandEvent& WXUNUSED(event))
         // Display the query dialog box
         wxChar qryWhere[DB_MAX_WHERE_CLAUSE_LEN+1];
         wxStrcpy(qryWhere, (const wxChar*) wxGetApp().Contact->qryWhereStr);
         // Display the query dialog box
         wxChar qryWhere[DB_MAX_WHERE_CLAUSE_LEN+1];
         wxStrcpy(qryWhere, (const wxChar*) wxGetApp().Contact->qryWhereStr);
-        wxChar *tblName[] = {(wxChar *)CONTACT_TABLE_NAME.c_str(), 0};
-        new CqueryDlg(GetParent(), wxGetApp().Contact->GetDb(), tblName, qryWhere);
+        const wxChar *tblName[] = {(const wxChar *)CONTACT_TABLE_NAME.c_str(), 0};
+        new CqueryDlg(GetParent(), wxGetApp().Contact->GetDb(), (wxChar**) tblName, qryWhere);
 
         // Query the first record in the new record set and
         // display it, if the query string has changed.
 
         // Query the first record in the new record set and
         // display it, if the query string has changed.
@@ -1700,7 +1715,7 @@ bool CeditorDlg::Initialize()
 
 void CeditorDlg::OnSelectPict()
 {
 
 void CeditorDlg::OnSelectPict()
 {
-    wxFileDialog dlg(this, wxT("Choose an image file less than 60K"), wxEmptyString, wxEmptyString, wxT("JPEG files (*.jpg)|*.jpg|GIF files (*.gif)|*.gif|BMP files (*.bmp)|*.bmp|All Files (*.*)|*.*"), wxOPEN);
+    wxFileDialog dlg(this, wxT("Choose an image file less than 60K"), wxEmptyString, wxEmptyString, wxT("JPEG files (*.jpg)|*.jpg|GIF files (*.gif)|*.gif|BMP files (*.bmp)|*.bmp|All Files (*.*)|*.*"), wxFD_OPEN);
 
     if (dlg.ShowModal() == wxID_OK)
     {
 
     if (dlg.ShowModal() == wxID_OK)
     {
@@ -2907,7 +2922,7 @@ m_pImage(NULL)
 
         if(m_pImage->Ok())
         {
 
         if(m_pImage->Ok())
         {
-            m_pBmp = new wxBitmap(m_pImage);
+            m_pBmp = new wxBitmap(*m_pImage);
             m_pDisplayBmp = new wxStaticBitmap(this, IMAGE_DIALOG_STATIC_BMP, *m_pBmp, wxPoint(5,5), wxDefaultSize);
 
             SetSize(m_pBmp->GetWidth() + 10, m_pBmp->GetHeight() + 30);
             m_pDisplayBmp = new wxStaticBitmap(this, IMAGE_DIALOG_STATIC_BMP, *m_pBmp, wxPoint(5,5), wxDefaultSize);
 
             SetSize(m_pBmp->GetWidth() + 10, m_pBmp->GetHeight() + 30);