/////////////////////////////////////////////////////////////////////////////
// Name: typetest.cpp
-// Purpose: Types wxWindows sample
+// Purpose: Types wxWidgets sample
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
bool MyApp::OnInit()
{
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWindows Types Demo"),
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Types Demo"),
wxPoint(50, 50), wxSize(450, 340));
// Give it an icon
tmp.Printf( _T("Signed int: %d\n"), si );
textCtrl.WriteText( tmp );
text_output << si << _T("\n");
- std_file_output << si << _T("\n");
+ std_file_output << si << "\n";
unsigned int ui = 0xFFFFFFFF;
tmp.Printf( _T("Unsigned int: %u\n"), ui );
textCtrl.WriteText( tmp );
text_output << ui << _T("\n");
- std_file_output << ui << _T("\n");
+ std_file_output << ui << "\n";
double d = 2.01234567890123456789;
tmp.Printf( _T("Double: %f\n"), d );
textCtrl.WriteText( tmp );
text_output << d << _T("\n");
- std_file_output << d << _T("\n");
+ std_file_output << d << "\n";
float f = (float)0.00001;
tmp.Printf( _T("Float: %f\n"), f );
textCtrl.WriteText( tmp );
text_output << f << _T("\n");
- std_file_output << f << _T("\n");
+ std_file_output << f << "\n";
wxString str( _T("Hello!") );
tmp.Printf( _T("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
text_output << str << _T("\n");
- std_file_output << str.c_str() << _T("\n");
+ std_file_output << str.ToAscii() << "\n";
textCtrl.WriteText( _T("\nReading from ifstream:\n") );
tmp.Printf( _T("Float: %f\n"), f );
textCtrl.WriteText( tmp );
- // Why doesn't this work?
-#if 0
char std_buf[200];
std_file_input >> std_buf;
- tmp.Printf( _T("String: %s\n"), std_buf );
+ str.FromAscii(std_buf);
+ tmp.Printf( _T("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
-#endif
textCtrl.WriteText( _T("\nReading from wxFileInputStream:\n") );
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
- wxMessageDialog dialog(this, _T("Tests various wxWindows types"),
+ wxMessageDialog dialog(this, _T("Tests various wxWidgets types"),
_T("About Types"), wxYES_NO|wxCANCEL);
dialog.ShowModal();