From a62b0bcc145d4072829ebce1f699c5704664bf3b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 29 Oct 2001 13:21:29 +0000 Subject: [PATCH] added wxBusyInfo test git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dialogs/dialogs.cpp | 25 +++++++++++++++++++++++++ samples/dialogs/dialogs.h | 4 ++++ 2 files changed, 29 insertions(+) diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 2dcbb0b92e..2fe34c932b 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -33,6 +33,7 @@ #include "wx/tipdlg.h" #include "wx/progdlg.h" #include "wx/fdrepdlg.h" +#include "wx/busyinfo.h" #define wxTEST_GENERIC_DIALOGS_IN_MSW 0 @@ -77,9 +78,15 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(DIALOGS_CHOOSE_COLOUR_GENERIC, MyFrame::ChooseColourGeneric) EVT_MENU(DIALOGS_CHOOSE_FONT_GENERIC, MyFrame::ChooseFontGeneric) #endif + #if wxUSE_PROGRESSDLG EVT_MENU(DIALOGS_PROGRESS, MyFrame::ShowProgress) #endif // wxUSE_PROGRESSDLG + +#if wxUSE_BUSYINFO + EVT_MENU(DIALOGS_BUSYINFO, MyFrame::ShowBusyInfo) +#endif // wxUSE_BUSYINFO + #if wxUSE_FINDREPLDLG EVT_MENU(DIALOGS_FIND, MyFrame::ShowFindDialog) EVT_MENU(DIALOGS_REPLACE, MyFrame::ShowReplaceDialog) @@ -154,6 +161,9 @@ bool MyApp::OnInit() #if wxUSE_PROGRESSDLG file_menu->Append(DIALOGS_PROGRESS, "Pro&gress dialog\tCtrl-G"); #endif // wxUSE_PROGRESSDLG +#if wxUSE_BUSYINFO + file_menu->Append(DIALOGS_BUSYINFO, "&Busy info dialog\tCtrl-B"); +#endif // wxUSE_BUSYINFO #if wxUSE_FINDREPLDLG file_menu->Append(DIALOGS_FIND, "&Find dialog\tCtrl-F"); file_menu->Append(DIALOGS_REPLACE, "Find and &replace dialog\tShift-Ctrl-F"); @@ -627,6 +637,21 @@ void MyFrame::ShowProgress( wxCommandEvent& WXUNUSED(event) ) #endif // wxUSE_PROGRESSDLG +#if wxUSE_BUSYINFO + +void MyFrame::ShowBusyInfo(wxCommandEvent& WXUNUSED(event)) +{ + wxBusyInfo info("Sleep^H^H^H^H^HWorkiing, please wait...\n... a bit more"); + + for ( int i = 0; i < 30; i++ ) + { + wxUsleep(100); + wxTheApp->Yield(); + } +} + +#endif // wxUSE_BUSYINFO + #if wxUSE_FINDREPLDLG void MyFrame::ShowReplaceDialog( wxCommandEvent& WXUNUSED(event) ) diff --git a/samples/dialogs/dialogs.h b/samples/dialogs/dialogs.h index ccd0c20183..5c3396b96b 100644 --- a/samples/dialogs/dialogs.h +++ b/samples/dialogs/dialogs.h @@ -78,6 +78,9 @@ public: #if wxUSE_PROGRESSDLG void ShowProgress(wxCommandEvent& event); #endif // wxUSE_PROGRESSDLG +#if wxUSE_BUSYINFO + void ShowBusyInfo(wxCommandEvent& event); +#endif // wxUSE_BUSYINFO #if wxUSE_FINDREPLDLG void ShowFindDialog(wxCommandEvent& event); void ShowReplaceDialog(wxCommandEvent& event); @@ -138,6 +141,7 @@ enum DIALOGS_MODELESS, DIALOGS_MODELESS_BTN, DIALOGS_PROGRESS, + DIALOGS_BUSYINFO, DIALOGS_FIND, DIALOGS_REPLACE }; -- 2.45.2