From b4954d198e72e2d6831548f92bd105e2b825c7ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 21 Jun 2004 10:31:39 +0000 Subject: [PATCH] Better conditions within dialogs sample. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dialogs/dialogs.cpp | 10 ++++++++-- samples/dialogs/dialogs.h | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 22ff54978c..f9341d3584 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -480,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 @@ -501,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) ) { @@ -576,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 @@ -1137,6 +1138,8 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event) ) dc.DrawText(_T("wxWidgets common dialogs test application"), 10, 10); } +#if USE_MODAL_PRESENTATION + // ---------------------------------------------------------------------------- // MyModelessDialog // ---------------------------------------------------------------------------- @@ -1233,3 +1236,6 @@ void MyModalDialog::OnButton(wxCommandEvent& event) event.Skip(); } } + +#endif // USE_MODAL_PRESENTATION + diff --git a/samples/dialogs/dialogs.h b/samples/dialogs/dialogs.h index 91bef905f1..a33f4ea9b4 100644 --- a/samples/dialogs/dialogs.h +++ b/samples/dialogs/dialogs.h @@ -54,6 +54,8 @@ public: wxColour m_canvasTextColour; }; +#if USE_MODAL_PRESENTATION + // A custom modeless dialog class MyModelessDialog : public wxDialog { @@ -83,6 +85,8 @@ private: DECLARE_EVENT_TABLE() }; +#endif // USE_MODAL_PRESENTATION + // Define a new frame type class MyFrame: public wxFrame { -- 2.45.2