X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e360a085f281fca0c512c1731bdc9164484fd9e..4dc2c3bbc5bc04b6239e14a7ec4e3ddc400a00bc:/samples/dialogs/dialogs.cpp diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 360e2bf5aa..5b38a4085d 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -47,6 +47,10 @@ MyCanvas *myCanvas = (MyCanvas *) NULL; // `Main program' equivalent, creating windows and returning main app frame bool MyApp::OnInit(void) { +#if defined(__WXGTK__) && defined(wxUSE_UNICODE) + wxConvCurrent = &wxConvLocal; +#endif + m_canvasTextColour = wxColour("BLACK"); m_canvasFont = *wxNORMAL_FONT; @@ -185,12 +189,11 @@ void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) ) void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) ) { -#if 0 wxMessageDialog dialog(NULL, "This is a message box\nA long, long string to test out the message box properly", "Message box text", wxYES_NO|wxCANCEL); dialog.ShowModal(); -#endif + ::wxMessageBox("MsgBox with a really long long string", "this is the text", wxYES_NO|wxICON_EXCLAMATION); } @@ -231,9 +234,9 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) ) if (dialog.ShowModal() == wxID_OK) { wxString info; - info.Printf("Full file name: %s\n" - "Path: %s\n" - "Name: %s", + info.Printf(_T("Full file name: %s\n") + _T("Path: %s\n") + _T("Name: %s"), dialog.GetPath().c_str(), dialog.GetDirectory().c_str(), dialog.GetFilename().c_str()); @@ -250,8 +253,8 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) ) if (dialog.ShowModal() == wxID_OK) { - char buf[400]; - sprintf(buf, "%s, filter %d", (const char *)dialog.GetPath(), dialog.GetFilterIndex()); + wxChar buf[400]; + wxSprintf(buf, _T("%s, filter %d"), (const wxChar*)dialog.GetPath(), dialog.GetFilterIndex()); wxMessageDialog dialog2(this, wxString(buf), "Selected path"); dialog2.ShowModal(); }