X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/378b05f7f86eda83452d67f182afc62a0f9b982f..fe482327a58c0b477cbe83111b17ad493e2a7eca:/docs/latex/wx/function.tex diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 783bf35bda..bfd6094c88 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} + + + +\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,13 @@ 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 +140,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 +260,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 +306,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 +331,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 +346,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 +359,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 +373,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 +384,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 +398,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} @@ -424,20 +483,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} + +\helpref{wxVsnprintf}{wxvsnprintf}, \helpref{wxString::Printf}{wxstringprintf} -\membersection{::wxVsnprintf}\label{wxsnprintf} +\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 +518,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 +534,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, 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 +569,24 @@ if (s) +\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} + + + \membersection{::wxGetNumberFromUser}\label{wxgetnumberfromuser} \func{long}{wxGetNumberFromUser}{ @@ -537,6 +614,19 @@ Dialog is centered on its {\it parent} unless an explicit position is given in +\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} + + + \membersection{::wxGetTextFromUser}\label{wxgettextfromuser} \func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\ @@ -688,7 +778,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} @@ -862,7 +952,9 @@ 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. +These clipboard functions are implemented for Windows only. The use of these functions +is deprecated and the code is no longer maintained. Use the \helpref{wxClipboard}{wxclipboard} +class instead. \wxheading{Include files} @@ -1051,7 +1143,7 @@ See also \helpref{wxDDEServer}{wxddeserver}, \helpref{wxDDEClient}{wxddeclient}, \func{void}{wxDebugMsg}{\param{const wxString\& }{fmt}, \param{...}{}} -{\bf This function is deprecated, use \helpref{wxLogDebug}{wxlogoverview} instead!} +{\bf This function is deprecated, use \helpref{wxLogDebug}{wxlogdebug} instead!} Display a debugging message; under Windows, this will appear on the debugger command window, and under Unix, it will be written to standard @@ -1182,7 +1274,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 @@ -1193,7 +1285,8 @@ 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}. +See also \helpref{wxShell}{wxshell}, \helpref{wxProcess}{wxprocess}, +\helpref{Exec sample}{sampleexec}. \wxheading{Include files} @@ -1282,24 +1375,15 @@ Under X only, returns the current display name. See also \helpref{wxSetDisplayNa -\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. -\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} @@ -1342,7 +1426,23 @@ Returns the mouse position in screen coordinates. -\membersection{::wxGetOsVersion} +\membersection{::wxGetOsDescription}\label{wxgetosdescription} + +\func{wxString}{wxGetOsDescription}{\void} + +Returns the string containing the description of the current platform in a +user-readable form. For example, this function may return strings like +{\tt Windows NT Version 4.0} or {\tt Linux 2.2.2 i386}. + +\wxheading{See also} + +\helpref{::wxGetOsVersion}{wxgetosversion} + +\wxheading{Include files} + + + +\membersection{::wxGetOsVersion}\label{wxgetosversion} \func{int}{wxGetOsVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}} @@ -1351,16 +1451,21 @@ Gets operating system version information. \begin{twocollist}\itemsep=0pt \twocolitemruled{Platform}{Return tyes} \twocolitem{Macintosh}{Return value is wxMACINTOSH.} -\twocolitem{GTK}{Return value is wxGTK, {\it major} is 1, {\it minor} is 0. (for GTK 1.0.X) } +\twocolitem{GTK}{Return value is wxGTK, For GTK 1.0, {\it major} is 1, {\it minor} is 0. } \twocolitem{Motif}{Return value is wxMOTIF\_X, {\it major} is X version, {\it minor} is X revision.} \twocolitem{OS/2}{Return value is wxOS2\_PM.} \twocolitem{Windows 3.1}{Return value is wxWINDOWS, {\it major} is 3, {\it minor} is 1.} -\twocolitem{Windows NT}{Return value is wxWINDOWS\_NT, {\it major} is 3, {\it minor} is 1.} -\twocolitem{Windows 95}{Return value is wxWIN95, {\it major} is 3, {\it minor} is 1.} +\twocolitem{Windows NT/2000}{Return value is wxWINDOWS\_NT, version is returned in {\it major} and {\it minor}} +\twocolitem{Windows 98}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 1 or greater.} +\twocolitem{Windows 95}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 0.} \twocolitem{Win32s (Windows 3.1)}{Return value is wxWIN32S, {\it major} is 3, {\it minor} is 1.} \twocolitem{Watcom C++ 386 supervisor mode (Windows 3.1)}{Return value is wxWIN386, {\it major} is 3, {\it minor} is 1.} \end{twocollist} +\wxheading{See also} + +\helpref{::wxGetOsDescription}{wxgetosdescription} + \wxheading{Include files} @@ -1411,6 +1516,18 @@ Under Windows, this returns ``user''. +\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} + + + \membersection{::wxGetUserName} \func{bool}{wxGetUserName}{\param{const wxString\& }{buf}, \param{int}{ bufSize}} @@ -1437,6 +1554,17 @@ It does not raise a signal in the receiving process. +\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} @@ -1513,7 +1641,12 @@ 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. +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). \wxheading{Include files} @@ -1556,7 +1689,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} @@ -1698,8 +1831,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. @@ -1707,10 +1840,31 @@ 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} or +\membersection{::wxWakeUpIdle}\label{wxwakeupidle} + +\func{void}{wxWakeUpIdle}{\void} + +This functions wakes up the (internal and platform dependent) idle system, i.e. it +will force the system to send an idle event even if the system currently {\it is} +idle and thus would not send any idle event until after some other event would get +sent. This is also useful for sending events between two threads and is used by +the corresponding functions \helpref{::wxPostEvent}{wxpostevent} and +\helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent}. + +\wxheading{Include files} + + + \section{Macros}\label{macros} These macros are defined in wxWindows. @@ -1977,7 +2131,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} @@ -2041,7 +2195,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} @@ -2285,7 +2439,9 @@ Another name for \helpref{wxResourceRegisterBitmapData}{registerbitmapdata}. \section{Log functions}\label{logfunctions} These functions provide a variety of logging functions: see \helpref{Log classes overview}{wxlogoverview} for -further information. +further information. The functions use (implicitly) the currently active log +target, so their descriptions here may not apply if the log target is not the +standard one (installed by wxWindows in the beginning of the program). \wxheading{Include files} @@ -2295,9 +2451,9 @@ further information. \func{void}{wxLogError}{\param{const char*}{ formatString}, \param{...}{}} -The function to use for error messages, i.e. the -messages that must be shown to the user. The default processing is to pop up a -message box to inform the user about it. +The function to use for error messages, i.e. the messages that must be shown +to the user. The default processing is to pop up a message box to inform the +user about it. \membersection{::wxLogFatalError}\label{wxlogfatalerror} @@ -2311,18 +2467,18 @@ function also terminates the program with this exit code. \func{void}{wxLogWarning}{\param{const char*}{ formatString}, \param{...}{}} -For warnings - they are also normally shown to the -user, but don't interrupt the program work. +For warnings - they are also normally shown to the user, but don't interrupt +the program work. \membersection{::wxLogMessage}\label{wxlogmessage} \func{void}{wxLogMessage}{\param{const char*}{ formatString}, \param{...}{}} -for all normal, informational messages. They also -appear in a message box by default (but it can be changed). Notice -that the standard behaviour is to not show informational messages if there are -any errors later - the logic being that the later error messages make the -informational messages preceding them meaningless. +for all normal, informational messages. They also appear in a message box by +default (but it can be changed). Notice that the standard behaviour is to not +show informational messages if there are any errors later - the logic being +that the later error messages make the informational messages preceding them +meaningless. \membersection{::wxLogVerbose}\label{wxlogverbose} @@ -2334,50 +2490,111 @@ progress (another, but possibly confusing name for the same function is {\bf wxL \membersection{::wxLogStatus}\label{wxlogstatus} +\func{void}{wxLogStatus}{\param{wxFrame *}{frame}, \param{const char*}{ formatString}, \param{...}{}} + \func{void}{wxLogStatus}{\param{const char*}{ formatString}, \param{...}{}} -For status messages - they will go into the status -bar of the active or specified (as the first argument) \helpref{wxFrame}{wxframe} if it has one. +Messages logged by this function will appear in the statusbar of the {\it +frame} or of the top level application window by default (i.e. when using +the second version of the function). + +If the target frame doesn't have a statusbar, the message will be lost. \membersection{::wxLogSysError}\label{wxlogsyserror} \func{void}{wxLogSysError}{\param{const char*}{ formatString}, \param{...}{}} -Mostly used by wxWindows itself, but might be -handy for logging errors after system call (API function) failure. It logs the -specified message text as well 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. +Mostly used by wxWindows itself, but might be handy for logging errors after +system call (API function) failure. It logs the specified message text as well +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{...}{}} -The right function for debug output. It only -does anything at all in the debug mode (when the preprocessor symbol \_\_WXDEBUG\_\_ is defined) -and expands to nothing in release mode (otherwise). +The right function for debug output. It only does anything at all in the debug +mode (when the preprocessor symbol \_\_WXDEBUG\_\_ is defined) and expands to +nothing in release mode (otherwise). \membersection{::wxLogTrace}\label{wxlogtrace} \func{void}{wxLogTrace}{\param{const char*}{ formatString}, \param{...}{}} -\func{void}{wxLogTrace}{\param{wxTraceMask}{ mask}, \param{const char*}{ formatString}, \param{...}{}} +\func{void}{wxLogTrace}{\param{const char *}{mask}, \param{const char *}{formatString}, \param{...}{}} + +\func{void}{wxLogTrace}{\param{wxTraceMask}{ mask}, \param{const char *}{formatString}, \param{...}{}} + +As {\bf wxLogDebug}, trace functions only do something in debug build and +expand to nothing in the release one. The reason for making +it a separate function from it is that usually there are a lot of trace +messages, so it might make sense to separate them from other debug messages. -As {\bf wxLogDebug}, only does something in debug -build. The reason for making it a separate function from it is that usually -there are a lot of trace messages, so it might make sense to separate them -from other debug messages which would be flooded in them. Moreover, the second -version of this function takes a trace mask as the first argument which allows -to further restrict the amount of messages generated. The value of {\it mask} can be: +The trace messages also usually can be separated into different categories and +the second and third versions of this function only log the message if the +{\it mask} which it has is currently enabled in \helpref{wxLog}{wxlog}. This +allows to selectively trace only some operations and not others by changing +the value of the trace mask (possible during the run-time). + +For the second function (taking a string mask), the message is logged only if +the mask has been previously enabled by the call to +\helpref{AddTraceMask}{wxlogaddtracemask}. The predefined string trace masks +used by wxWindows are: + +\begin{itemize}\itemsep=0pt +\item wxTRACE\_MemAlloc: trace memory allocation (new/delete) +\item wxTRACE\_Messages: trace window messages/X callbacks +\item wxTRACE\_ResAlloc: trace GDI resource allocation +\item wxTRACE\_RefCount: trace various ref counting operations +\item wxTRACE\_OleCalls: trace OLE method calls (Win32 only) +\end{itemize} + +The third version of the function only logs the message if all the bit +corresponding to the {\it mask} are set in the wxLog trace mask which can be +set by \helpref{SetTraceMask}{wxlogsettracemask}. This version is less +flexible than the previous one because it doesn't allow defining the user +trace masks easily - this is why it is deprecated in favour of using string +trace masks. \begin{itemize}\itemsep=0pt \item wxTraceMemAlloc: trace memory allocation (new/delete) \item wxTraceMessages: trace window messages/X callbacks \item wxTraceResAlloc: trace GDI resource allocation \item wxTraceRefCount: trace various ref counting operations +\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