X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/695fe764bd0ebfdc01d854033c26adb9ff248560..4d01e350fe2d8cb15c068d579c4022345f3ff0c0:/samples/dialogs/dialogs.cpp diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 07192e6846..598fe7f515 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -350,13 +350,9 @@ bool MyApp::OnInit() file_menu->AppendSeparator(); file_menu->Append(wxID_EXIT, _T("E&xit\tAlt-X")); -#if !defined( __SMARTPHONE__ ) wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _T("&File")); frame->SetMenuBar(menu_bar); -#else - frame->SetRightMenu(wxID_ANY, _T("Menu"), file_menu); -#endif // __SMARTPHONE__ myCanvas = new MyCanvas(frame); myCanvas->SetBackgroundColour(*wxWHITE); @@ -484,6 +480,7 @@ void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) ) } #endif // USE_FONTDLG_GENERIC +#if wxUSE_LOG_DIALOG void MyFrame::LogDialog(wxCommandEvent& WXUNUSED(event)) { // calling wxYield() (as ~wxBusyCursor does) shouldn't result in messages @@ -505,6 +502,7 @@ void MyFrame::LogDialog(wxCommandEvent& WXUNUSED(event)) wxLogMessage(wxT("And this is the same dialog but with only one message.")); } +#endif // wxUSE_LOG_DIALOG void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) ) { @@ -580,8 +578,7 @@ void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event)) if (dialog.ShowModal() == wxID_OK) { - wxMessageDialog dialog2(this, dialog.GetValue(), _T("Got string")); - dialog2.ShowModal(); + wxMessageBox(dialog.GetValue(), _T("Got string"), wxOK | wxICON_INFORMATION, this); } } #endif // wxUSE_TEXTDLG @@ -650,7 +647,7 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) ) #ifdef __WXMOTIF__ _T("C++ files (*.cpp)|*.cpp") #else - _T("C++ files (*.h;*.cpp)|*.h;*.cpp") + _T("C++ files (*.cpp;*.h)|*.cpp;*.h") #endif ); @@ -701,7 +698,7 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) #ifdef __WXMOTIF__ _T("C++ files (*.cpp)|*.cpp"); #else - _T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp"); + _T("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h"); #endif wxFileDialog dialog(this, _T("Testing open multiple file dialog"), wxEmptyString, wxEmptyString, wildcards, @@ -759,7 +756,7 @@ void MyFrame::FileOpenGeneric(wxCommandEvent& WXUNUSED(event) ) _T("Testing open file dialog"), wxEmptyString, wxEmptyString, - _T("C++ files (*.h;*.cpp)|*.h;*.cpp") + _T("C++ files (*.cpp;*.h)|*.cpp;*.h") ); dialog.SetDirectory(wxGetHomeDir()); @@ -780,7 +777,7 @@ void MyFrame::FileOpenGeneric(wxCommandEvent& WXUNUSED(event) ) void MyFrame::FilesOpenGeneric(wxCommandEvent& WXUNUSED(event) ) { - wxString wildcards = _T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp"); + wxString wildcards = _T("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h"); wxGenericFileDialog dialog(this, _T("Testing open multiple file dialog"), wxEmptyString, wxEmptyString, wildcards, wxMULTIPLE); @@ -1138,9 +1135,16 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event) ) dc.SetFont(wxGetApp().m_canvasFont); dc.SetTextForeground(wxGetApp().m_canvasTextColour); dc.SetBackgroundMode(wxTRANSPARENT); - dc.DrawText(_T("wxWidgets common dialogs test application"), 10, 10); + dc.DrawText( + _T("wxWidgets common dialogs") +#if !defined(__SMARTPHONE__) + _T(" test application") +#endif + , 10, 10); } +#if USE_MODAL_PRESENTATION + // ---------------------------------------------------------------------------- // MyModelessDialog // ---------------------------------------------------------------------------- @@ -1237,3 +1241,6 @@ void MyModalDialog::OnButton(wxCommandEvent& event) event.Skip(); } } + +#endif // USE_MODAL_PRESENTATION +