// `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;
myCanvas->Clear();
myCanvas->Refresh();
}
- dialog->Close();
+ dialog->Destroy();
}
void MyFrame::ChooseFont(wxCommandEvent& WXUNUSED(event) )
wxGetApp().m_canvasTextColour = retData.GetColour();
myCanvas->Refresh();
}
- dialog->Close();
+ dialog->Destroy();
}
#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
myCanvas->Clear();
myCanvas->Refresh();
}
- dialog->Close();
+ dialog->Destroy();
}
void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) )
wxGetApp().m_canvasTextColour = retData.GetColour();
myCanvas->Refresh();
}
- dialog->Close();
+ dialog->Destroy();
}
#endif
void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
{
- wxMessageDialog dialog(this, "This is a message box\nA long, long string to test out the message box properly",
+ 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();
+
+ ::wxMessageBox("MsgBox with a really long long string",
+ "this is the text", wxYES_NO|wxICON_EXCLAMATION);
}
void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event) )
if (dialog.ShowModal() == wxID_OK)
{
- wxMessageDialog dialog2(this, dialog.GetPath(), "Selected path");
+ wxString info;
+ 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());
+ wxMessageDialog dialog2(this, info, "Selected file");
dialog2.ShowModal();
}
}
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();
}