]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/exec/exec.cpp
made operator==() and \!=() const (still doesn't make them correct probably)
[wxWidgets.git] / samples / exec / exec.cpp
index 1634f47fb7bbc1243dcd36663204bad2ef59755b..d11a4ac917d7ede89eee9dda98262c092ec17f2b 100644 (file)
@@ -233,9 +233,11 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 
     EVT_MENU(Exec_OpenFile, MyFrame::OnFileExec)
 
+#ifdef __WINDOWS__
     EVT_MENU(Exec_DDEExec, MyFrame::OnDDEExec)
     EVT_MENU(Exec_DDERequest, MyFrame::OnDDERequest)
-
+#endif // __WINDOWS__
+    
     EVT_MENU(Exec_About, MyFrame::OnAbout)
 
     EVT_IDLE(MyFrame::OnIdle)
@@ -374,7 +376,8 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event))
                                    _T("Enter PID:"),
                                    _T("Exec question"),
                                    m_pidLast,
-                                   1, INT_MAX,
+                                   // we need the full unsigned int range
+                                   -INT_MAX, INT_MAX,
                                    this);
     if ( pid == -1 )
     {
@@ -473,7 +476,7 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event))
 void MyFrame::DoAsyncExec(const wxString& cmd)
 {
     wxProcess *process = new MyProcess(this, cmd);
-    m_pidLast = wxExecute(cmd, FALSE /* async */, process);
+    m_pidLast = wxExecute(cmd, wxEXEC_ASYNC, process);
     if ( !m_pidLast )
     {
         wxLogError(_T("Execution of '%s' failed."), cmd.c_str());
@@ -499,7 +502,7 @@ void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event))
 
     wxLogStatus(_T("'%s' is running please wait..."), cmd.c_str());
 
-    int code = wxExecute(cmd, TRUE /* sync */);
+    int code = wxExecute(cmd, wxEXEC_SYNC);
 
     wxLogStatus(_T("Process '%s' terminated with exit code %d."),
                 cmd.c_str(), code);
@@ -575,7 +578,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event))
     else // async exec
     {
         MyPipedProcess *process = new MyPipedProcess(this, cmd);
-        if ( !wxExecute(cmd, FALSE /* async */, process) )
+        if ( !wxExecute(cmd, wxEXEC_ASYNC, process) )
         {
             wxLogError(_T("Execution of '%s' failed."), cmd.c_str());
 
@@ -609,7 +612,7 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event))
 
     // always execute the filter asynchronously
     MyPipedProcess2 *process = new MyPipedProcess2(this, cmd, input);
-    int pid = wxExecute(cmd, FALSE /* async */, process);
+    int pid = wxExecute(cmd, wxEXEC_ASYNC, process);
     if ( pid )
     {
         wxLogStatus(_T("Process %ld (%s) launched."), pid, cmd.c_str());