X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f5d910492b0ffbccf3caf4b57eec434377a1314..32b5be3d67ad10612ccee4887e7fd79c781e3745:/docs/latex/wx/function.tex diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 48c0b6e448..90d1f7f7a9 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -37,10 +37,11 @@ the corresponding topic. \helpref{wxCHECK\_VERSION}{wxcheckversion}\\ \helpref{wxCHECK}{wxcheck}\\ \helpref{wxClientDisplayRect}{wxclientdisplayrect}\\ -\helpref{wxClipboardOpen}{wxclipboardopen}\\ +\helpref{wxClipboardOpen}{functionwxclipboardopen}\\ \helpref{wxCloseClipboard}{wxcloseclipboard}\\ \helpref{wxColourDisplay}{wxcolourdisplay}\\ \helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}\\ +\helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2}\\ \helpref{wxConcatFiles}{wxconcatfiles}\\ \helpref{wxConstCast}{wxconstcast}\\ \helpref{wxCopyFile}{wxcopyfile}\\ @@ -50,12 +51,11 @@ the corresponding topic. \helpref{wxDDEInitialize}{wxddeinitialize}\\ \helpref{wxDROP\_ICON}{wxdropicon}\\ \helpref{wxDebugMsg}{wxdebugmsg}\\ -\helpref{wxDirExists}{wxdirexists}\\ +\helpref{wxDirExists}{functionwxdirexists}\\ \helpref{wxDirSelector}{wxdirselector}\\ \helpref{wxDisplayDepth}{wxdisplaydepth}\\ -\helpref{wxDisplaySizeMM}{wxdisplaysizemm}\\ -\helpref{wxDisplaySize}{wxdisplaysize}\\ \helpref{wxDisplaySize}{wxdisplaysize}\\ +\helpref{wxDisplaySizeMM}{wxdisplaysizemm}\\ \helpref{wxDos2UnixFilename}{wxdos2unixfilename}\\ \helpref{wxDynamicCastThis}{wxdynamiccastthis}\\ \helpref{wxDynamicCast}{wxdynamiccast}\\ @@ -70,7 +70,7 @@ the corresponding topic. \helpref{wxFAIL\_MSG}{wxfailmsg}\\ \helpref{wxFAIL}{wxfail}\\ \helpref{wxFatalError}{wxfatalerror}\\ -\helpref{wxFileExists}{wxfileexists}\\ +\helpref{wxFileExists}{functionwxfileexists}\\ \helpref{wxFileModificationTime}{wxfilemodificationtime}\\ \helpref{wxFileNameFromPath}{wxfilenamefrompath}\\ \helpref{wxFileSelector}{wxfileselector}\\ @@ -120,6 +120,7 @@ the corresponding topic. \helpref{wxGetSingleChoice}{wxgetsinglechoice}\\ \helpref{wxGetTempFileName}{wxgettempfilename}\\ \helpref{wxGetTextFromUser}{wxgettextfromuser}\\ +\helpref{wxGetTopLevelParent}{wxgettoplevelparent}\\ \helpref{wxGetTranslation}{wxgettranslation}\\ \helpref{wxGetUTCTime}{wxgetutctime}\\ \helpref{wxGetUserHome}{wxgetuserhome}\\ @@ -423,14 +424,22 @@ processes. \membersection{::wxExecute}\label{wxexecute} -\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{bool }{sync = FALSE}, \param{wxProcess *}{callback = NULL}} +\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{int }{sync = wxEXEC\_ASYNC}, \param{wxProcess *}{callback = NULL}} -\func{long}{wxExecute}{\param{char **}{argv}, \param{bool }{sync = FALSE}, \param{wxProcess *}{callback = NULL}} +\func{long}{wxExecute}{\param{char **}{argv}, \param{int }{flags = wxEXEC\_ASYNC}, \param{wxProcess *}{callback = NULL}} \func{long}{wxExecute}{\param{const wxString\& }{command}, \param{wxArrayString\& }{output}} +\perlnote{In wxPerl this function only takes the {\tt command} argument, +and returns a 2-element list {\tt ( status, output )}, where {\tt output} is +an array reference.} + \func{long}{wxExecute}{\param{const wxString\& }{command}, \param{wxArrayString\& }{output}, \param{wxArrayString\& }{errors}} +\perlnote{In wxPerl this function only takes the {\tt command} argument, +and returns a 3-element list {\tt ( status, output, errors )}, where +{\tt output} and {\tt errors} are array references.} + Executes another program in Unix or Windows. The first form takes a command string, such as {\tt "emacs file.txt"}. @@ -441,8 +450,9 @@ arguments, terminated by NULL. The semantics of the third and fourth versions is different from the first two and is described in more details below. -If {\it sync} is FALSE (the default), flow of control immediately returns. -If TRUE, the current application waits until the other program has terminated. +If {\it flags} parameter contains {\tt wxEXEC\_ASYNC} flag (the default), flow +of control immediately returns. If it contains {\tt wxEXEC\_SYNC}, the current +application waits until the other program has terminated. In the case of synchronous execution, the return value is the exit code of the process (which terminates by the moment the function returns) and will be @@ -460,10 +470,21 @@ case of using DDE under Windows for command execution). In particular, in this, and only this, case the calling code will not get the notification about process termination. -If callback isn't NULL and if execution is asynchronous (note that callback -parameter can not be non-NULL for synchronous execution), +If callback isn't NULL and if execution is asynchronous, \helpref{wxProcess::OnTerminate}{wxprocessonterminate} will be called when -the process finishes. +the process finishes. Specifying this parameter also allows you to redirect the +standard input and/or output of the process being launched by calling +\helpref{Redirect}{wxprocessredirect}. If the child process IO is redirected, +under Windows the process window is not shown by default (this avoids having to +flush an unnecessary console for the processes which don't create any windows +anyhow) but a {\tt wxEXEC\_NOHIDE} flag can be used to prevent this from +happening, i.e. with this flag the child process window will be shown normally. + +Under Unix the flag {\tt wxEXEC\_MAKE\_GROUP\_LEADER} may be used to ensure +that the new process is a group leader (this will create a new session if +needed). Calling \helpref{wxKill}{wxkill} with the argument of -pid where pid +is the process ID of the new process will kill this process as well as all of +its children (except those which have started their own session). Finally, you may use the third overloaded version of this function to execute a process (always synchronously) and capture its output in the array @@ -473,6 +494,20 @@ the messages from standard error output in the {\it errors} array. See also \helpref{wxShell}{wxshell}, \helpref{wxProcess}{wxprocess}, \helpref{Exec sample}{sampleexec}. +\wxheading{Parameters} + +\docparam{command}{The command to execute and any parameters to pass to it as a +single string.} + +\docparam{argv}{The command to execute should be the first element of this +array, any additional ones are the command parameters and the array must be +terminated with a NULL pointer.} + +\docparam{flags}{Combination of bit masks {\tt wxEXEC\_ASYNC}, +{\tt wxEXEC\_SYNC} and {\tt wxEXEC\_NOHIDE}} + +\docparam{callback}{An optional pointer to \helpref{wxProcess}{wxprocess}} + \wxheading{Include files} @@ -484,7 +519,7 @@ See also \helpref{wxShell}{wxshell}, \helpref{wxProcess}{wxprocess}, Exits application after calling \helpref{wxApp::OnExit}{wxapponexit}. Should only be used in an emergency: normally the top-level frame should be deleted (after deleting all other frames) to terminate the -application. See \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow} and \helpref{wxApp}{wxapp}. +application. See \helpref{wxCloseEvent}{wxcloseevent} and \helpref{wxApp}{wxapp}. \wxheading{Include files} @@ -626,7 +661,7 @@ threads. \helpref{wxFile}{wxfile}\\ \helpref{wxFileName}{wxfilename} -\membersection{::wxDirExists}\label{wxdirexists} +\membersection{::wxDirExists}\label{functionwxdirexists} \func{bool}{wxDirExists}{\param{const wxString\& }{dirname}} @@ -639,7 +674,7 @@ Returns TRUE if the directory exists. Converts a DOS to a Unix filename by replacing backslashes with forward slashes. -\membersection{::wxFileExists}\label{wxfileexists} +\membersection{::wxFileExists}\label{functionwxfileexists} \func{bool}{wxFileExists}{\param{const wxString\& }{filename}} @@ -1925,7 +1960,7 @@ class instead. -\membersection{::wxClipboardOpen}\label{wxclipboardopen} +\membersection{::wxClipboardOpen}\label{functionwxclipboardopen} \func{bool}{wxClipboardOpen}{\void} @@ -2072,16 +2107,6 @@ See also \helpref{wxDDEServer}{wxddeserver}, \helpref{wxDDEClient}{wxddeclient}, -\membersection{::wxDisplaySize}\label{wxdisplaysize} - -\func{void}{wxDisplaySize}{\param{int *}{width}, \param{int *}{height}} - -Gets the physical size of the display in pixels. - -\wxheading{Include files} - - - \membersection{::wxEnableTopLevelWindows}\label{wxenabletoplevelwindows} \func{void}{wxEnableTopLevelWindow}{\param{bool}{ enable = TRUE}} @@ -2209,6 +2234,17 @@ See also \helpref{wxWriteResource}{wxwriteresource}, \helpref{wxConfigBase}{wxco +\membersection{::wxGetTopLevelParent}\label{wxgettoplevelparent} + +\func{wxWindow *}{wxGetTopLevelParent}{\param{wxWindow }{*win}} + +Returns the first top level parent of the given window, or in other words, the +frame or dialog containing it, or {\tt NULL}. + +\wxheading{Include files} + + + \membersection{::wxLoadUserResource}\label{wxloaduserresource} \func{wxString}{wxLoadUserResource}{\param{const wxString\& }{resourceName}, \param{const wxString\& }{resourceType=``TEXT"}} @@ -2253,21 +2289,11 @@ Now obsolete: use \helpref{wxWindow::Close}{wxwindowclose} instead. \func{void}{wxPostEvent}{\param{wxEvtHandler *}{dest}, \param{wxEvent\& }{event}} -This function posts the event to the specified {\it dest} object. The -difference between sending an event and posting it is that in the first case -the event is processed before the function returns (in wxWindows, event sending -is done with \helpref{ProcessEvent}{wxevthandlerprocessevent} function), but in -the second, the function returns immediately and the event will be processed -sometime later - usually during the next even loop iteration. - -Note that a copy of the {\it event} is made by the function, so the original -copy can be deleted as soon as function returns. This function can also be used -to send events between different threads safely. As this function makes a -copy of the event, the event needs to have a fully implemented Clone() method, -which may not be the case for all event in wxWindows. - -See also \helpref{AddPendingEvent}{wxevthandleraddpendingevent} (which this function -uses internally). +In a GUI application, this function posts {\it event} to the specified {\it dest} +object using \helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent}. +Otherwise, it dispatches {\it event} immediately using +\helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent}. +See the respective documentation for details (and caveats). \wxheading{Include files} @@ -2338,7 +2364,7 @@ See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfig -\section{Byte order macros}\label{macros} +\section{Byte order macros}\label{byteordermacros} The endian-ness issues (that is the difference between big-endian and little-endian architectures) are important for the portable programs working @@ -2396,7 +2422,7 @@ been compiled on a big-endian architecture, the value will be unchanged. Use these macros to read data from and write data to a file that stores data in big-endian format. -\section{RTTI functions}\label{macros} +\section{RTTI functions}\label{rttimacros} wxWindows uses its own RTTI ("run-time type identification") system which predates the current standard C++ RTTI and so is kept for backwards @@ -3249,14 +3275,14 @@ Returns the number of seconds since local time 00:00:00 Jan 1st 1970. \membersection{::wxGetLocalTimeMillis}\label{wxgetlocaltimemillis} -\func{wxLongLone}{wxGetLocalTimeMillis}{\void} +\func{wxLongLong}{wxGetLocalTimeMillis}{\void} Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970. \wxheading{See also} \helpref{wxDateTime::Now}{wxdatetimenow},\\ -\helpref{wxLongLone}{wxlonglong} +\helpref{wxLongLong}{wxlonglong} \wxheading{Include files} @@ -3369,7 +3395,7 @@ because it will not be executed in release mode at all. \func{}{wxASSERT\_MIN\_BITSIZE}{\param{}{type}, \param{}{size}} This macro results in a -\helpref{compile time assertion failure}{wxCOMPILE\_TIME\_ASSERT} if the size +\helpref{compile time assertion failure}{wxcompiletimeassert} if the size of the given type {\it type} is less than {\it size} bits. You may use it like this, for example: @@ -3398,7 +3424,7 @@ Assert macro with message. An error message will be generated if the condition i \func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}} Using {\tt wxCOMPILE\_TIME\_ASSERT} results in a compilation error if the -specified {\it condition| is false. The compiler error message should include +specified {\it condition} is false. The compiler error message should include the {\it msg} identifier - please note that it must be a valid C++ identifier and not a string unlike in the other cases. @@ -3406,11 +3432,26 @@ This macro is mostly useful for testing the expressions involing the {\tt sizeof} operator as they can't be tested by the preprocessor but it is sometimes desirable to test them at the compile time. +Note that this macro internally declares a struct whose name it tries to make +unique by using the {\tt \_\_LINE\_\_} in it but it may still not work if you +use it on the same line in two different source files. In this case you may +either change the line in which either of them appears on or use the +\helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2} macro. + \wxheading{See also} \helpref{wxASSERT\_MSG}{wxassertmsg},\\ \helpref{wxASSERT\_MIN\_BITSIZE}{wxassertminbitsize} +\membersection{wxCOMPILE\_TIME\_ASSERT2}\label{wxcompiletimeassert2} + +\func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}, \param{}{name}} + +This macro is identical to \helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2} +except that it allows you to specify a unique {\it name} for the struct +internally defined by this macro to avoid getting the compilation errors +described \helpref{above}{wxcompiletimeassert}. + \membersection{wxFAIL}\label{wxfail} \func{}{wxFAIL}{\void}