From e626d7c78771793c08f5c5652f4a2c26f6f196ed Mon Sep 17 00:00:00 2001
From: Robin Dunn <robin@alldunn.com>
Date: Fri, 12 Jul 2002 23:25:14 +0000
Subject: [PATCH] Changed wxProcess::Open to take a flags arg to pass to
 wxExecute. Fixed a few _'s without \'s in the docs

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/db.tex       | 18 +++++++++---------
 docs/latex/wx/process.tex  | 17 +++++++++--------
 docs/latex/wx/tex2rtf.ini  |  3 ++-
 docs/latex/wx/wxmgl.tex    |  6 +++---
 include/wx/process.h       |  2 +-
 src/common/process.cpp     |  4 ++--
 wxPython/src/misc2.i       |  2 +-
 wxPython/src/msw/misc2.cpp |  7 ++++---
 8 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/docs/latex/wx/db.tex b/docs/latex/wx/db.tex
index a85c7c14da..0b051394a2 100644
--- a/docs/latex/wx/db.tex
+++ b/docs/latex/wx/db.tex
@@ -623,7 +623,7 @@ entry is also logged to the defined log file.
 \docparam{aHdbc}{Handle to the ODBC connection.  Pass this in if the ODBC
 function call that erred required a hdbc or hstmt argument.}
 
-\docparam{aHstmt}{Handle to the ODBC statement being executed against.  Pass 
+\docparam{aHstmt}{Handle to the ODBC statement being executed against.  Pass
 this in if the ODBC function call that failed required a hstmt argument.}
 
 \wxheading{Remarks}
@@ -980,10 +980,10 @@ in the result set after the current position of the cursor.
 \wxheading{Parameters}
 
 \docparam{aHenv}{A handle to the ODBC environment.}
-\docparam{aHdbc}{{\it OPTIONAL.}  A handle to the ODBC connection.  Pass this 
+\docparam{aHdbc}{{\it OPTIONAL.}  A handle to the ODBC connection.  Pass this
 in if the ODBC function call that failed required a hdbc or hstmt argument.}
-\docparam{AHstmt}{{\it OPTIONAL.}A handle to the ODBC statement being executed 
-against.  Pass this in if the ODBC function call that failed requires a 
+\docparam{AHstmt}{{\it OPTIONAL.}A handle to the ODBC statement being executed
+against.  Pass this in if the ODBC function call that failed requires a
 hstmt argument.}
 
 \wxheading{Example}
@@ -1694,9 +1694,9 @@ functions planned to be added for creating/manipulating datasource definitions.
 
 Default constructor.
 
-\func{}{wxDbConnectInf}{\param{HENV }{henv}, \param{const wxString \&}{dsn}, 
-\param{const wxString \&}{userID=""}, \param{const wxString \&}{password}, 
-\param{const wxString \&}{defaultDir=""}, \param{const wxString \&}{description=""}, 
+\func{}{wxDbConnectInf}{\param{HENV }{henv}, \param{const wxString \&}{dsn},
+\param{const wxString \&}{userID=""}, \param{const wxString \&}{password},
+\param{const wxString \&}{defaultDir=""}, \param{const wxString \&}{description=""},
 \param{const wxString \&}{fileType=""}}
 
 Constructor which allows initial settings of all the classes member variables.
@@ -2574,7 +2574,7 @@ To delete all users with a first name of "JOHN", do the following:
 
 \begin{enumerate}\itemsep=0pt
 \item Clear all "columns" using wxDbTable::ClearMemberVars().
-\item Set the FIRST_NAME column equal to "JOHN".
+\item Set the FIRST\_NAME column equal to "JOHN".
 \item Call wxDbTable::DeleteMatching().
 \end{enumerate}
 
@@ -3280,7 +3280,7 @@ example, if column 3 is defined in the wxDbTable bound column
 definitions to be a float, the SELECT statement must return a
 float for column 3 (e.g. PRICE * 1.10 to increase the price by
 10%).
-\item The ROWID can be included in your SELECT statement as the {\bf last} 
+\item The ROWID can be included in your SELECT statement as the {\bf last}
 column selected, if the datasource supports it.  Use
 wxDbTable::CanUpdByROWID() to determine if the ROWID can be
 selected from the datasource.  If it can, much better
diff --git a/docs/latex/wx/process.tex b/docs/latex/wx/process.tex
index 98e90695dc..d79ce9bcbf 100644
--- a/docs/latex/wx/process.tex
+++ b/docs/latex/wx/process.tex
@@ -1,6 +1,6 @@
 \section{\class{wxProcess}}\label{wxprocess}
 
-The objects of this class are used in conjunction with the 
+The objects of this class are used in conjunction with the
 \helpref{wxExecute}{wxexecute} function. When a wxProcess object is passed to
 wxExecute(), its \helpref{OnTerminate()}{wxprocessonterminate} virtual method
 is called when the process terminates. This allows the program to be
@@ -15,10 +15,10 @@ library users should only delete those objects whose notifications have been
 processed (and call \helpref{Detach()}{wxprocessdetach} for others).
 
 wxProcess also supports IO redirection of the child process. For this, you have
-to call its \helpref{Redirect}{wxprocessredirect} method before passing it to 
-\helpref{wxExecute}{wxexecute}. If the child process was launched successfully, 
-\helpref{GetInputStream}{wxprocessgetinputstream}, 
-\helpref{GetOutputStream}{wxprocessgetoutputstream} and 
+to call its \helpref{Redirect}{wxprocessredirect} method before passing it to
+\helpref{wxExecute}{wxexecute}. If the child process was launched successfully,
+\helpref{GetInputStream}{wxprocessgetinputstream},
+\helpref{GetOutputStream}{wxprocessgetoutputstream} and
 \helpref{GetErrorStream}{wxprocessgeterrorstream} can then be used to retrieve
 the streams corresponding to the child process standard output, input and
 error output respectively.
@@ -92,7 +92,7 @@ Normally, a wxProcess object is deleted by its parent when it receives the
 notification about the process termination. However, it might happen that the
 parent object is destroyed before the external process is terminated (e.g. a
 window from which this external process was launched is closed by the user)
-and in this case it {\bf should not delete} the wxProcess object, but 
+and in this case it {\bf should not delete} the wxProcess object, but
 {\bf should call Detach()} instead. After the wxProcess object is detached
 from its parent, no notification events will be sent to the parent and the
 object will delete itself upon reception of the process termination
@@ -150,7 +150,7 @@ enum wxSignal
 \end{verbatim}
 
 {\tt wxSIGNONE}, {\tt wxSIGKILL} and {\tt wxSIGTERM} have the same meaning
-under both Unix and Windows but all the other signals are equivalent to 
+under both Unix and Windows but all the other signals are equivalent to
 {\tt wxSIGTERM} under Windows.
 
 Returns the element of {\tt wxKillError} enum:
@@ -196,7 +196,7 @@ It raises a wxWindows event when it isn't overridden.
 
 \membersection{wxProcess::Open}\label{wxprocessopen}
 
-\func{static wxProcess *}{Open}{\param{const wxString\& }{cmd}}
+\func{static wxProcess *}{Open}{\param{const wxString\& }{cmd} \param{int }{flags = wxEXEC\_ASYNC}}
 
 This static method replaces the standard {\tt popen()} function: it launches
 the process specified by the {\it cmd} parameter and returns the wxProcess
@@ -212,6 +212,7 @@ exits to avoid memory leaks.
 \wxheading{Parameters}
 
 \docparam{cmd}{The command to execute, including optional arguments.}
+\docparam{flags}{The flags to pass to \helpref{wxExecute}{wxexecute}.}
 
 \wxheading{Return value}
 
diff --git a/docs/latex/wx/tex2rtf.ini b/docs/latex/wx/tex2rtf.ini
index e83fe220ff..4fa3c9ba16 100644
--- a/docs/latex/wx/tex2rtf.ini
+++ b/docs/latex/wx/tex2rtf.ini
@@ -46,5 +46,6 @@ htmlStylesheet = "wx.css"
 \bftt [1] {\bf{\tt{#1}}}
 \pythonnote [1] {{\bf \fcol{blue}{wxPython note:}} #1}
 %\pythonnote [1] {}
-\perlnote [1] {{\bf \fcol{blue}{wxPerl note:}} #1}
+%\perlnote [1] {{\bf \fcol{blue}{wxPerl note:}} #1}
+\perlnote [1] {}
 
diff --git a/docs/latex/wx/wxmgl.tex b/docs/latex/wx/wxmgl.tex
index 3468368bca..0d71fa8ccd 100644
--- a/docs/latex/wx/wxmgl.tex
+++ b/docs/latex/wx/wxmgl.tex
@@ -11,15 +11,15 @@ Note that currently MGL for Linux runs only on x86-based systems.
 You will need wxWindows 2.3.3 or higher and MGL 5.0 or higher.
 The latter is available from
 
-\urlref{http://www.scitechsoft.com/products/product_download.html}{http://www.scitechsoft.com/products/product_download.html}
+\urlref{http://www.scitechsoft.com/products/product\_download.html}{http://www.scitechsoft.com/products/product\_download.html}
 
-In order to configure wxWindows to compile wxMGL you will 
+In order to configure wxWindows to compile wxMGL you will
 need to type:
 
 \begin{verbatim}
   configure --with-mgl --with-universal
 \end{verbatim}
-  
+
 Under DOS, wxMGL uses a dmake based make system.
 
 For further information, please see the files in docs/mgl
diff --git a/include/wx/process.h b/include/wx/process.h
index 67ac9c258f..03993984bb 100644
--- a/include/wx/process.h
+++ b/include/wx/process.h
@@ -55,7 +55,7 @@ public:
     // on error NULL is returned, in any case the process object will be
     // deleted automatically when the process terminates and should *not* be
     // deleted by the caller
-    static wxProcess *Open(const wxString& cmd);
+    static wxProcess *Open(const wxString& cmd, int flags = wxEXEC_ASYNC);
 
 
     // ctors
diff --git a/src/common/process.cpp b/src/common/process.cpp
index d98c7178ef..ccd0cc589b 100644
--- a/src/common/process.cpp
+++ b/src/common/process.cpp
@@ -63,10 +63,10 @@ void wxProcess::Init(wxEvtHandler *parent, int id, int flags)
 }
 
 /* static */
-wxProcess *wxProcess::Open(const wxString& cmd)
+wxProcess *wxProcess::Open(const wxString& cmd, int flags)
 {
     wxProcess *process = new wxProcess(wxPROCESS_REDIRECT);
-    if ( !wxExecute(cmd, wxEXEC_ASYNC, process) )
+    if ( !wxExecute(cmd, flags, process) )
     {
         // couldn't launch the process
         delete process;
diff --git a/wxPython/src/misc2.i b/wxPython/src/misc2.i
index d36e1db326..2aa156803d 100644
--- a/wxPython/src/misc2.i
+++ b/wxPython/src/misc2.i
@@ -848,7 +848,7 @@ public:
     // on error NULL is returned, in any case the process object will be
     // deleted automatically when the process terminates and should *not* be
     // deleted by the caller
-    static wxPyProcess *Open(const wxString& cmd);
+    static wxPyProcess *Open(const wxString& cmd, int flags = wxEXEC_ASYNC);
 
 
 
diff --git a/wxPython/src/msw/misc2.cpp b/wxPython/src/msw/misc2.cpp
index 4203ed3531..51c47f1f95 100644
--- a/wxPython/src/msw/misc2.cpp
+++ b/wxPython/src/msw/misc2.cpp
@@ -6147,12 +6147,13 @@ static PyObject *_wrap_wxProcess_Open(PyObject *self, PyObject *args, PyObject *
     PyObject * _resultobj;
     wxPyProcess * _result;
     wxString * _arg0;
+    int  _arg1 = (int ) wxEXEC_ASYNC;
     PyObject * _obj0 = 0;
-    char *_kwnames[] = { "cmd", NULL };
+    char *_kwnames[] = { "cmd","flags", NULL };
     char _ptemp[128];
 
     self = self;
-    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxProcess_Open",_kwnames,&_obj0)) 
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxProcess_Open",_kwnames,&_obj0,&_arg1)) 
         return NULL;
 {
     _arg0 = wxString_in_helper(_obj0);
@@ -6161,7 +6162,7 @@ static PyObject *_wrap_wxProcess_Open(PyObject *self, PyObject *args, PyObject *
 }
 {
     PyThreadState* __tstate = wxPyBeginAllowThreads();
-    _result = (wxPyProcess *)wxPyProcess::Open(*_arg0);
+    _result = (wxPyProcess *)wxPyProcess::Open(*_arg0,_arg1);
 
     wxPyEndAllowThreads(__tstate);
     if (PyErr_Occurred()) return NULL;
-- 
2.50.0

