void OnClear(wxCommandEvent& event);
+ void OnBeginBusyCursor(wxCommandEvent& event);
+ void OnEndBusyCursor(wxCommandEvent& event);
+
void OnSyncExec(wxCommandEvent& event);
void OnSyncNoEventsExec(wxCommandEvent& event);
void OnAsyncExec(wxCommandEvent& event);
Exec_Quit = 100,
Exec_Kill,
Exec_ClearLog,
+ Exec_BeginBusyCursor,
+ Exec_EndBusyCursor,
Exec_SyncExec = 200,
Exec_SyncNoEventsExec,
Exec_AsyncExec,
EVT_MENU(Exec_Quit, MyFrame::OnQuit)
EVT_MENU(Exec_Kill, MyFrame::OnKill)
EVT_MENU(Exec_ClearLog, MyFrame::OnClear)
+ EVT_MENU(Exec_BeginBusyCursor, MyFrame::OnBeginBusyCursor)
+ EVT_MENU(Exec_EndBusyCursor, MyFrame::OnEndBusyCursor)
EVT_MENU(Exec_SyncExec, MyFrame::OnSyncExec)
EVT_MENU(Exec_SyncNoEventsExec, MyFrame::OnSyncNoEventsExec)
menuFile->Append(Exec_Kill, _T("&Kill process...\tCtrl-K"),
_T("Kill a process by PID"));
menuFile->AppendSeparator();
- menuFile->Append(Exec_ClearLog, _T("&Clear log\tCtrl-C"),
+ menuFile->Append(Exec_ClearLog, _T("&Clear log\tCtrl-L"),
_T("Clear the log window"));
menuFile->AppendSeparator();
+ menuFile->Append(Exec_BeginBusyCursor, _T("Show &busy cursor\tCtrl-C"));
+ menuFile->Append(Exec_EndBusyCursor, _T("Show &normal cursor\tShift-Ctrl-C"));
+ menuFile->AppendSeparator();
menuFile->Append(Exec_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
wxMenu *execMenu = new wxMenu;
m_lbox->Clear();
}
+void MyFrame::OnBeginBusyCursor(wxCommandEvent& WXUNUSED(event))
+{
+ wxBeginBusyCursor();
+}
+
+void MyFrame::OnEndBusyCursor(wxCommandEvent& WXUNUSED(event))
+{
+ wxEndBusyCursor();
+}
+
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxMessageBox(_T("Exec wxWidgets Sample\n(c) 2000-2002 Vadim Zeitlin"),
if ( sync )
{
+ wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() );
+
wxArrayString output, errors;
int code = wxExecute(cmd, output, errors);
- wxLogStatus(_T("command '%s' terminated with exit code %d."),
+
+ wxLogStatus(_T("Command '%s' terminated with exit code %d."),
cmd.c_str(), code);
if ( code != -1 )
wxString filename;
#if wxUSE_FILEDLG
- filename = wxLoadFileSelector(_T("any file"), NULL, s_filename, this);
+ filename = wxLoadFileSelector(_T("any file"), wxEmptyString, s_filename, this);
#else // !wxUSE_FILEDLG
filename = wxGetTextFromUser(_T("Enter the file name"), _T("exec sample"),
s_filename, this);
void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event))
{
- static wxString s_filename;
+ static wxString s_filename(_T("http://www.wxwidgets.org/"));
wxString filename = wxGetTextFromUser
(