]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/typetest/typetest.cpp
don't use wxVector<wxDataFormat> from wx/clipbrd.h as wxDataFormat definition is...
[wxWidgets.git] / samples / typetest / typetest.cpp
index 983961312d6be4a778f64c6746bb768dc9055a6f..cbd16a5c030639df7a46f2a0e2eae699aa5220c0 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:       wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "typetest.h"
-#endif
-
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
@@ -76,6 +72,9 @@ wxString file_name2 = wxString(_T("test_wx2.dat"));
 
 bool MyApp::OnInit()
 {
+    if ( !wxApp::OnInit() )
+        return false;
+
     // Create the main frame window
     MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Types Demo"),
                                  wxPoint(50, 50), wxSize(450, 340));
@@ -167,6 +166,8 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
     text_output << str << _T("\n");
     std_file_output << str.ToAscii() << "\n";
 
+    std_file_output.close();
+
     textCtrl.WriteText( _T("\nReading from ifstream:\n") );
 
     wxSTD ifstream std_file_input( "test_std.dat" );
@@ -189,7 +190,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
 
     char std_buf[200];
     std_file_input >> std_buf;
-    str.FromAscii(std_buf);
+    str = wxString::FromAscii(std_buf);
     tmp.Printf( _T("String: %s\n"), str.c_str() );
     textCtrl.WriteText( tmp );
 
@@ -889,7 +890,7 @@ void MyApp::DoUnicodeDemo(wxCommandEvent& WXUNUSED(event))
     textCtrl << _T("\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:");
 
     wxString str;
-    str = _T("Robert Rรถbling\n");
+    str = _T("Robert R\366bling\n");
 
     printf( "\n\nConversion with wxConvLocal:\n" );
     wxConvCurrent = &wxConvLocal;
@@ -923,12 +924,12 @@ void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event))
                                _T("XyZ %s"),
                                _T("XyZ -p %s"),
                                _T("The one and only XYZ format file"),
-                               _T("xyz"), _T("123"), NULL),
+                               _T("xyz"), _T("123"), wxNullPtr),
                 wxFileTypeInfo(_T("text/html"),
                                _T("lynx %s"),
                                _T("lynx -dump %s | lpr"),
                                _T("HTML document (from fallback)"),
-                               _T("htm"), _T("html"), NULL),
+                               _T("htm"), _T("html"), wxNullPtr),
 
                 // must terminate the table with this!
                 wxFileTypeInfo()
@@ -955,13 +956,12 @@ void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event))
             wxFileType::MessageParameters params(filename, type);
             filetype->GetOpenCommand(&open, params);
 
-            textCtrl << _T("MIME information about extension '") << ext << _T("'\n")
-                     << _T("\tMIME type: ") << ( !type ? wxT("unknown")
-                                                   : type.c_str() ) << '\n'
-                     << _T("\tDescription: ") << ( !desc ? wxEmptyString : desc.c_str() )
-                        << '\n'
-                     << _T("\tCommand to open: ") << ( !open ? wxT("no") : open.c_str() )
-                        << '\n';
+            textCtrl << _T("MIME information about extension '") << ext << _T('\n')
+                     << _T("\tMIME type: ") << ( !type ? wxString("unknown") : type ) << _T('\n')
+                     << _T("\tDescription: ") << ( !desc ? wxString(wxEmptyString) : desc )
+                        << _T('\n')
+                     << _T("\tCommand to open: ") << ( !open ? wxString("no") : open )
+                        << _T('\n');
 
             delete filetype;
         }
@@ -1028,9 +1028,9 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) )
     wxUnusedVar(l);
     wxUnusedVar(v);
 
-    wxStringList stringList;
-    stringList.Add(_T("one")); stringList.Add(_T("two")); stringList.Add(_T("three"));
-    var1 = stringList;
+    wxArrayString stringArray;
+    stringArray.Add(_T("one")); stringArray.Add(_T("two")); stringArray.Add(_T("three"));
+    var1 = stringArray;
     textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n");
 
     var1.ClearList();