]> git.saurik.com Git - wxWidgets.git/commitdiff
added wxBusyInfo test
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 29 Oct 2001 13:21:29 +0000 (13:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 29 Oct 2001 13:21:29 +0000 (13:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/dialogs/dialogs.cpp
samples/dialogs/dialogs.h

index 2dcbb0b92e6ff9057756484d1d5d9f88c911c9c1..2fe34c932b38fbba33f08144caf5f0dfaea3b42f 100644 (file)
@@ -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) )
index ccd0c2018331e09eca06bb653afefcbc4f69b96b..5c3396b96b2c9c15aa49e0f147b882aa0b051be6 100644 (file)
@@ -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
 };