X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bdc72a22686ac141e9bc4559a1171d017fdcb094..fac2666314a63b763df2c8f91277e104d89f7428:/docs/latex/wx/function.tex?ds=sidebyside

diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index 26367bbf94..cba82141e0 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -4,6 +4,58 @@
 
 The functions defined in wxWindows are described here.
 
+\section{Thread functions}\label{threadfunctions}
+
+\wxheading{Include files}
+
+<wx/thread.h>
+
+\wxheading{See also}
+
+\helpref{wxThread}{wxthread}, \helpref{wxMutex}{wxmutex}, \helpref{Multithreading overview}{wxthreadoverview}
+
+\membersection{::wxMutexGuiEnter}\label{wxmutexguienter}
+
+\func{void}{wxMutexGuiEnter}{\void}
+
+This function must be called when any thread other than the main GUI thread
+wants to get access to the GUI library. This function will block the execution
+of the calling thread until the main thread (or any other thread holding the
+main GUI lock) leaves the GUI library and no other other thread will enter
+the GUI library until the calling thread calls \helpref{::wxMutexGuiLeave()}{wxmutexguileave}.
+
+Typically, these functions are used like this:
+
+\begin{verbatim}
+void MyThread::Foo(void)
+{
+    // before doing any GUI calls we must ensure that this thread is the only
+    // one doing it!
+
+    wxMutexGuiEnter();
+
+    // Call GUI here:
+    my_window->DrawSomething();
+
+    wxMutexGuiLeave();
+}
+\end{verbatim}
+
+Note that under GTK, no creation of top-level windows is allowed in any
+thread but the main one.
+
+This function is only defined on platforms which support preemptive
+threads. 
+
+\membersection{::wxMutexGuiLeave}\label{wxmutexguileave}
+
+\func{void}{wxMutexGuiLeave}{\void}
+
+See \helpref{::wxMutexGuiEnter()}{wxmutexguienter}.
+
+This function is only defined on platforms which support preemptive
+threads.
+
 \section{File functions}\label{filefunctions}
 
 \wxheading{Include files}
@@ -12,7 +64,7 @@ The functions defined in wxWindows are described here.
 
 \wxheading{See also}
 
-\helpref{wxPathList}{wxpathlist}
+\helpref{wxPathList}{wxpathlist}, \helpref{wxDir}{wxdir}, \helpref{wxFile}{wxfile}
 
 \membersection{::wxDirExists}
 
@@ -34,6 +86,12 @@ slashes.
 Returns TRUE if the file exists. It also returns TRUE if the file is
 a directory.
 
+\membersection{::wxFileModificationTime}
+
+\func{time\_t}{wxFileModificationTime}{\param{const wxString\& }{filename}}
+
+Returns time of last modification of given file.
+
 \membersection{::wxFileNameFromPath}
 
 \func{wxString}{wxFileNameFromPath}{\param{const wxString\& }{path}}
@@ -81,17 +139,6 @@ See \helpref{wxFindFirstFile}{wxfindfirstfile} for an example.
 
 Returns the Windows directory under Windows; on other platforms returns the empty string.
 
-\membersection{::wxInitAllImageHandlers}\label{wxinitallimagehandlers}
-
-\func{void}{wxInitAllImageHandlers}{\void}
-
-Adds some common image format handlers, which, depending on wxWindows
-configuration, can be handlers for BMP (loading) (always installed), GIF
-(loading), PCX (loading), PNM (loading and saving as raw
-rgb), PNG (loading and saving), JPEG (loading and saving), file formats.
-
-See also: \helpref{wxImage}{wximage} \helpref{wxImageHandler}{wximagehandler}
-
 \membersection{::wxIsAbsolutePath}
 
 \func{bool}{wxIsAbsolutePath}{\param{const wxString\& }{filename}}
@@ -212,7 +259,7 @@ Under MS Windows, the current drive is also changed if {\it dir} contains a driv
 
 \membersection{::wxSplitPath}\label{wxsplitfunction}
 
-\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{const wxString *}{ path}, \param{const wxString *}{ name}, \param{const wxString *}{ ext}}
+\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}
 
 This function splits a full file name into components: the path (including possible disk/drive
 specification under Windows), the base name and the extension. Any of the output parameters
@@ -258,7 +305,9 @@ Use of this function requires the file wx\_doc.h to be included.
 Returns the FQDN (fully qualified domain host name) or an empty string on
 error.
 
-See also: \helpref{wxGetHostName}{wxgethostname}
+\wxheading{See also}
+
+\helpref{wxGetHostName}{wxgethostname}
 
 \wxheading{Include files}
 
@@ -281,6 +330,7 @@ Returns TRUE if successful, FALSE otherwise.
 \membersection{::wxGetHostName}\label{wxgethostname}
 
 \func{wxString}{wxGetHostName}{\void}
+
 \func{bool}{wxGetHostName}{\param{char * }{buf}, \param{int }{sz}}
 
 Copies the current host machine's name into the supplied buffer. Please note
@@ -295,7 +345,9 @@ The first variant of this function returns the hostname if successful or an
 empty string otherwise. The second (deprecated) function returns TRUE
 if successful, FALSE otherwise.
 
-See also: \helpref{wxGetFullHostName}{wxgetfullhostname}
+\wxheading{See also}
+
+\helpref{wxGetFullHostName}{wxgetfullhostname}
 
 \wxheading{Include files}
 
@@ -306,6 +358,7 @@ See also: \helpref{wxGetFullHostName}{wxgetfullhostname}
 \membersection{::wxGetUserId}\label{wxgetuserid}
 
 \func{wxString}{wxGetUserId}{\void}
+
 \func{bool}{wxGetUserId}{\param{char * }{buf}, \param{int }{sz}}
 
 This function returns the "user id" also known as "login name" under Unix i.e.
@@ -319,7 +372,9 @@ The first variant of this function returns the login name if successful or an
 empty string otherwise. The second (deprecated) function returns TRUE
 if successful, FALSE otherwise.
 
-See also: \helpref{wxGetUserName}{wxgetusername}
+\wxheading{See also}
+
+\helpref{wxGetUserName}{wxgetusername}
 
 \wxheading{Include files}
 
@@ -328,6 +383,7 @@ See also: \helpref{wxGetUserName}{wxgetusername}
 \membersection{::wxGetUserName}\label{wxgetusername}
 
 \func{wxString}{wxGetUserName}{\void}
+
 \func{bool}{wxGetUserName}{\param{char * }{buf}, \param{int }{sz}}
 
 This function returns the full user name (something like "Mr. John Smith").
@@ -341,7 +397,9 @@ The first variant of this function returns the user name if successful or an
 empty string otherwise. The second (deprecated) function returns TRUE
 if successful, FALSE otherwise.
 
-See also: \helpref{wxGetUserId}{wxgetuserid}
+\wxheading{See also}
+
+\helpref{wxGetUserId}{wxgetuserid}
 
 \wxheading{Include files}
 
@@ -397,7 +455,7 @@ case-sensitive comparison.
 \func{size\_t}{Strlen}{\param{const char *}{ p}}
 
 This is a safe version of standard function {\it strlen()}: it does exactly the
-same thing (i.e. returns the length of the string) except that it returns 0 if
+same thing (i.e. returns the length of the string) except that it returns 0 if 
 {\it p} is the NULL pointer.
 
 \membersection{::wxGetTranslation}\label{wxgettranslation}
@@ -406,7 +464,7 @@ same thing (i.e. returns the length of the string) except that it returns 0 if
 
 This function returns the translation of string {\it str} in the current 
 \helpref{locale}{wxlocale}. If the string is not found in any of the loaded
-message catalogs (see \helpref{i18n overview}{internationalization}), the
+message catalogs (see \helpref{internationalization overview}{internationalization}), the
 original string is returned. In debug build, an error message is logged - this
 should help to find the strings which were not yet translated. As this function
 is used very often, an alternative syntax is provided: the \_() macro is
@@ -424,20 +482,20 @@ buffer is never overflowed.
 Returns the number of characters copied to the buffer or -1 if there is not
 enough space.
 
-\wxheading{See also:}
-\helpref{wxVsnprintf}{wxvsnprintf},
-\helpref{wxString::Printf}{wxstringprintf}
+\wxheading{See also}
 
-\membersection{::wxVsnprintf}\label{wxsnprintf}
+\helpref{wxVsnprintf}{wxvsnprintf}, \helpref{wxString::Printf}{wxstringprintf}
+
+\membersection{::wxVsnprintf}\label{wxvsnprintf}
 
 \func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argptr}}
 
 The same as \helpref{wxSnprintf}{wxsnprintf} but takes a {\tt va\_list}
 argument instead of arbitrary number of parameters.
 
-\wxheading{See also:}
-\helpref{wxSnprintf}{wxsnprintf},
-\helpref{wxString::PrintfV}{wxstringprintfv}
+\wxheading{See also}
+
+\helpref{wxSnprintf}{wxsnprintf}, \helpref{wxString::PrintfV}{wxstringprintfv}
 
 \section{Dialog functions}\label{dialogfunctions}
 
@@ -459,7 +517,7 @@ used with \helpref{wxShowTip}{wxshowtip}.
 \docparam{currentTip}{The index of the first tip to show - normally this index
 is remembered between the 2 program runs.}
 
-\wxheading{See also:}
+\wxheading{See also}
 
 \helpref{Tips overview}{tipsoverview}
 
@@ -475,13 +533,13 @@ is remembered between the 2 program runs.}
  \param{int}{ x = -1}, \param{int}{ y = -1}}
 
 Pops up a file selector box. In Windows, this is the common file selector
-dialog. In X, this is a file selector box with somewhat less functionality.
+dialog. In X, this is a file selector box with the same functionality.
 The path and filename are distinct elements of a full file pathname.
 If path is empty, the current directory will be used. If filename is empty,
 no default filename will be supplied. The wildcard determines what files
 are displayed in the file selector, and file extension supplies a type
 extension for the required filename. Flags may be a combination of wxOPEN,
-wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, wxMULTIPLE or 0.
+wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, wxFILE\_MUST\_EXIST, wxMULTIPLE or 0.
 
 Both the Unix and Windows versions implement a wildcard filter. Typing a
 filename containing wildcards (*, ?) in the filename text item, and
@@ -510,6 +568,24 @@ if (s)
 
 <wx/filedlg.h>
 
+\membersection{::wxGetColourFromUser}\label{wxgetcolourfromuser}
+
+\func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}}
+
+Shows the colour selection dialog and returns the colour selected by user or
+invalid colour (use \helpref{wxColour::Ok}{wxcolourok} to test whether a colour
+is valid) if the dialog was cancelled.
+
+\wxheading{Parameters}
+
+\docparam{parent}{The parent window for the colour selection dialog}
+
+\docparam{colInit}{If given, this will be the colour initially selected in the dialog.}
+
+\wxheading{Include files}
+
+<wx/colordlg.h>
+
 \membersection{::wxGetNumberFromUser}\label{wxgetnumberfromuser}
 
 \func{long}{wxGetNumberFromUser}{
@@ -537,6 +613,19 @@ Dialog is centered on its {\it parent} unless an explicit position is given in
 
 <wx/textdlg.h>
 
+\membersection{::wxGetPasswordFromUser}\label{wxgetpasswordfromuser}
+
+\func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
+ \param{const wxString\& }{default\_value = ``"}, \param{wxWindow *}{parent = NULL}}
+
+Similar to \helpref{wxGetTextFromUser}{wxgettextfromuser} but the text entered
+in the dialog is not shown on screen but replaced with stars. This is intended
+to be used for entering passwords as the function name implies.
+
+\wxheading{Include files}
+
+<wx/textdlg.h>
+
 \membersection{::wxGetTextFromUser}\label{wxgettextfromuser}
 
 \func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
@@ -640,10 +729,10 @@ wxCANCEL.}
 wxYES\_NO or wxOK.}
 \twocolitem{wxOK}{Puts an Ok button on the message box. May be combined with wxCANCEL.}
 \twocolitem{wxCENTRE}{Centres the text.}
-\twocolitem{wxICON\_EXCLAMATION}{Under Windows, displays an exclamation mark symbol.}
-\twocolitem{wxICON\_HAND}{Under Windows, displays a hand symbol.}
-\twocolitem{wxICON\_QUESTION}{Under Windows, displays a question mark symbol.}
-\twocolitem{wxICON\_INFORMATION}{Under Windows, displays an information symbol.}
+\twocolitem{wxICON\_EXCLAMATION}{Displays an exclamation mark symbol.}
+\twocolitem{wxICON\_HAND}{Displays a hand symbol.}
+\twocolitem{wxICON\_QUESTION}{Displays a question mark symbol.}
+\twocolitem{wxICON\_INFORMATION}{Displays an information symbol.}
 \end{twocollist}
 
 The return value is one of: wxYES, wxNO, wxCANCEL, wxOK.
@@ -688,7 +777,7 @@ It may be created with the \helpref{wxCreateFileTipProvider}{wxcreatefiletipprov
 otherwise. This is used as the initial value for "Show tips at startup"
 checkbox which is shown in the tips dialog.}
 
-\wxheading{See also:}
+\wxheading{See also}
 
 \helpref{Tips overview}{tipsoverview}
 
@@ -863,7 +952,7 @@ Sets the translation (from the top left corner) for PostScript output. The defau
 \section{Clipboard functions}\label{clipsboard}
 
 These clipboard functions are implemented for Windows only. The use of these functions
-is drepated and the code no longer maintained. Use the \helpref{wxClipboard}{wxclipboard}
+is deprecated and the code is no longer maintained. Use the \helpref{wxClipboard}{wxclipboard} 
 class instead.
 
 \wxheading{Include files}
@@ -1027,7 +1116,7 @@ registered with the dynamic class system using DECLARE... and IMPLEMENT... macro
 Called when wxWindows exits, to clean up the DDE system. This no longer needs to be
 called by the application.
 
-See also helpref{wxDDEInitialize}{wxddeinitialize}.
+See also \helpref{wxDDEInitialize}{wxddeinitialize}.
 
 \wxheading{Include files}
 
@@ -1088,7 +1177,7 @@ Gets the physical size of the display in pixels.
 
 \func{void}{wxEnableTopLevelWindow}{\param{bool}{ enable = TRUE}}
 
-This function enables or disables all top level windows. It is used by
+This function enables or disables all top level windows. It is used by 
 \helpref{::wxSafeYield}{wxsafeyield}.
 
 \wxheading{Include files}
@@ -1169,6 +1258,8 @@ wxWindows errors. See also \helpref{wxFatalError}{wxfatalerror}.
 
 \func{long}{wxExecute}{\param{char **}{argv}, \param{bool }{sync = FALSE}, \param{wxProcess *}{callback = NULL}}
 
+\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{wxArrayString\& }{output}}
+
 Executes another program in Unix or Windows.
 
 The first form takes a command string, such as {\tt "emacs file.txt"}.
@@ -1176,6 +1267,9 @@ The first form takes a command string, such as {\tt "emacs file.txt"}.
 The second form takes an array of values: a command, any number of
 arguments, terminated by NULL.
 
+The semantics of the third version 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.
 
@@ -1184,7 +1278,7 @@ the process (which terminates by the moment the function returns) and will be
 $-1$ if the process couldn't be started and typically 0 if the process
 terminated successfully. Also, while waiting for the process to
 terminate, wxExecute will call \helpref{wxYield}{wxyield}. The caller
-should ensure that this can cause no recursion, in the simples case by 
+should ensure that this can cause no recursion, in the simplest case by 
 calling \helpref{wxEnableTopLevelWindows(FALSE)}{wxenabletoplevelwindows}.
 
 For asynchronous execution, however, the return value is the process id and
@@ -1195,7 +1289,12 @@ parameter can not be non NULL for synchronous execution),
 \helpref{wxProcess::OnTerminate}{wxprocessonterminate} will be called when
 the process finishes.
 
-See also \helpref{wxShell}{wxshell}, \helpref{wxProcess}{wxprocess}.
+Finally, you may use the third overloaded version of this function to execute
+a process (always synchronously) and capture its output in the array 
+{\it output}.
+
+See also \helpref{wxShell}{wxshell}, \helpref{wxProcess}{wxprocess}, 
+\helpref{Exec sample}{sampleexec}.
 
 \wxheading{Include files}
 
@@ -1284,24 +1383,15 @@ Under X only, returns the current display name. See also \helpref{wxSetDisplayNa
 
 <wx/utils.h>
 
-\membersection{::wxGetHomeDir}
-
-\func{wxString}{wxGetHomeDir}{\param{const wxString\& }{buf}}
+\membersection{::wxGetHomeDir}\label{wxgethomedir}
 
-Fills the buffer with a string representing the user's home directory (Unix only).
+\func{wxString}{wxGetHomeDir}{\void}
 
-\wxheading{Include files}
+Return the (current) user's home directory.
 
-<wx/utils.h>
-
-\membersection{::wxGetHostName}
-
-\func{bool}{wxGetHostName}{\param{const wxString\& }{buf}, \param{int}{ bufSize}}
+\wxheading{See also}
 
-Copies the host name of the machine the program is running on into the
-buffer {\it buf}, of maximum size {\it bufSize}, returning TRUE if
-successful. Under Unix, this will return a machine name. Under Windows,
-this returns ``windows''.
+\helpref{wxGetUserHome}{wxgetuserhome}
 
 \wxheading{Include files}
 
@@ -1434,6 +1524,18 @@ Under Windows, this returns ``user''.
 
 <wx/utils.h>
 
+\membersection{::wxGetUserHome}\label{wxgetuserhome}
+
+\func{const wxChar *}{wxGetUserHome}{\param{const wxString\& }{user = ""}}
+
+Returns the home directory for the given user. If the username is empty
+(default value), this function behaves like 
+\helpref{wxGetHomeDir}{wxgethomedir}.
+
+\wxheading{Include files}
+
+<wx/utils.h>
+
 \membersection{::wxGetUserName}
 
 \func{bool}{wxGetUserName}{\param{const wxString\& }{buf}, \param{int}{ bufSize}}
@@ -1446,6 +1548,12 @@ Under Windows, this returns ``unknown''.
 
 <wx/utils.h>
 
+\membersection{::wxHandleFatalExceptions}\label{wxhandlefatalexceptions}
+
+\func{bool}{wxHandleFatalExceptions}{\param{bool}{ doIt = TRUE}}
+
+Call this from e.g. \helpref{wxApp::OnFatalException}{wxapponfatalexception}.
+
 \membersection{::wxKill}\label{wxkill}
 
 \func{int}{wxKill}{\param{long}{ pid}, \param{int}{ sig}}
@@ -1460,6 +1568,17 @@ It does not raise a signal in the receiving process.
 
 <wx/utils.h>
 
+\membersection{::wxInitAllImageHandlers}\label{wxinitallimagehandlers}
+
+\func{void}{wxInitAllImageHandlers}{\void}
+
+Initializes all available image handlers. For a list of available handlers,
+see \helpref{wxImage}{wximage}.
+
+\wxheading{See also}
+
+\helpref{wxImage}{wximage}, \helpref{wxImageHandler}{wximagehandler}
+
 \membersection{::wxIsBusy}\label{wxisbusy}
 
 \func{bool}{wxIsBusy}{\void}
@@ -1584,7 +1703,7 @@ See also \helpref{wxGetDisplayName}{wxgetdisplayname}.
 Executes a command in an interactive shell window. If no command is
 specified, then just the shell is spawned.
 
-See also \helpref{wxExecute}{wxexecute}.
+See also \helpref{wxExecute}{wxexecute}, \helpref{Exec sample}{sampleexec}.
 
 \wxheading{Include files}
 
@@ -1726,8 +1845,8 @@ See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfig
 
 Yields control to pending messages in the windowing system. This can be useful, for example, when a
 time-consuming process writes to a text window. Without an occasional
-yield, the text window will not be updated properly, and (since Windows
-multitasking is cooperative) other processes will not respond.
+yield, the text window will not be updated properly, and on systems with
+cooperative multitasking, such as Windows 3.1 other processes will not respond.
 
 Caution should be exercised, however, since yielding may allow the
 user to perform actions which are not compatible with the current task.
@@ -1735,6 +1854,12 @@ Disabling menu items or whole menus during processing can avoid unwanted
 reentrance of code: see \helpref{::wxSafeYield}{wxsafeyield} for a better
 function.
 
+Note that wxYield will not flush the message logs. This is intentional as
+calling wxYield is usually done to quickly update the screen and popping up a
+message box dialog may be undesirable. If you do with to flush the log
+messages immediately (otherwise it will be done during the next idle loop
+iteration), call \helpref{wxLog::FlushActive}{wxlogflushactive}.
+
 \wxheading{Include files}
 
 <wx/app.h> or <wx/utils.h>
@@ -2020,7 +2145,7 @@ base classes.
 
 This macro loads a bitmap from either application resources (on the platforms
 for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
-avoid using {\tt #ifdef}s when creating bitmaps.
+avoid using {\tt \#ifdef}s when creating bitmaps.
 
 \wxheading{See also}
 
@@ -2084,7 +2209,7 @@ Example:
 
 This macro loads an icon from either application resources (on the platforms
 for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
-avoid using {\tt #ifdef}s when creating icons.
+avoid using {\tt \#ifdef}s when creating icons.
 
 \wxheading{See also}
 
@@ -2399,6 +2524,11 @@ as the last system error code ({\it errno} or {\it ::GetLastError()} depending
 on the platform) and the corresponding error message. The second form
 of this function takes the error code explitly as the first argument.
 
+\wxheading{See also}
+
+\helpref{wxSysErrorCode}{wxsyserrorcode},
+\helpref{wxSysErrorMsg}{wxsyserrormsg}
+
 \membersection{::wxLogDebug}\label{wxlogdebug}
 
 \func{void}{wxLogDebug}{\param{const char*}{ formatString}, \param{...}{}}
@@ -2454,6 +2584,31 @@ trace masks.
 \item wxTraceOleCalls: trace OLE method calls (Win32 only)
 \end{itemize}
 
+\membersection{::wxSysErrorCode}\label{wxsyserrorcode}
+
+\func{unsigned long}{wxSysErrorCode}{\void}
+
+Returns the error code from the last system call. This function uses
+{\tt errno} on Unix platforms and {\tt GetLastError} under Win32.
+
+\wxheading{See also}
+
+\helpref{wxSysErrorMsg}{wxsyserrormsg},
+\helpref{wxLogSysError}{wxlogsyserror}
+
+\membersection{::wxSysErrorMsg}\label{wxsyserrormsg}
+
+\func{const wxChar *}{wxSysErrorMsg}{\param{unsigned long }{errCode = 0}}
+
+Returns the error message corresponding to the given system error code. If 
+{\it errCode} is $0$ (default), the last error code (as returned by 
+\helpref{wxSysErrorCode}{wxsyserrorcode}) is used.
+
+\wxheading{See also}
+
+\helpref{wxSysErrorCode}{wxsyserrorcode},
+\helpref{wxLogSysError}{wxlogsyserror}
+
 \section{Debugging macros and functions}\label{debugmacros}
 
 Useful macros and functins for error checking and defensive programming. ASSERTs are only
