]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/function.tex
Doc fix
[wxWidgets.git] / docs / latex / wx / function.tex
index 67937a6486a24d8acc1733dd9905d50bbc055405..5d204099ebd60373264aab5786268b0ce7f7e447 100644 (file)
@@ -189,6 +189,8 @@ the corresponding topic.
 \helpref{wxNewId}{wxnewid}\\
 \helpref{wxNow}{wxnow}\\
 \helpref{wxOnAssert}{wxonassert}\\
+\helpref{wxON\_BLOCK\_EXIT}{wxonblockexit}\\
+\helpref{wxON\_BLOCK\_EXIT\_OBJ}{wxonblockexitobj}\\
 \helpref{wxOpenClipboard}{wxopenclipboard}\\
 \helpref{wxParseCommonDialogsFilter}{wxparsecommondialogsfilter}\\
 \helpref{wxDirExists}{functionwxdirexists}\\
@@ -937,6 +939,8 @@ Returns true if the file exists and is a plain file.
 
 Returns time of last modification of given file.
 
+The return value is $0$ if an error occured (e.g. file not found).
+
 
 \membersection{::wxFileNameFromPath}\label{wxfilenamefrompath}
 
@@ -1066,7 +1070,9 @@ Returns the directory part of the filename.
 
 \membersection{::wxUnix2DosFilename}\label{wxunix2dosfilename}
 
-\func{void}{wxUnix2DosFilename}{\param{const wxString\& }{s}}
+\func{void}{wxUnix2DosFilename}{\param{wxChar *}{s}}
+
+This function is deprecated, use \helpref{wxFileName}{wxfilename} instead.
 
 Converts a Unix to a DOS filename by replacing forward
 slashes with backslashes.
@@ -1324,7 +1330,8 @@ Return the (current) user's home directory.
 
 \wxheading{See also}
 
-\helpref{wxGetUserHome}{wxgetuserhome}
+\helpref{wxGetUserHome}{wxgetuserhome}\\
+\helpref{wxStandardPaths}{wxstandardpaths}
 
 \wxheading{Include files}
 
@@ -2548,7 +2555,7 @@ Empties the clipboard.
 
 \membersection{::wxEnumClipboardFormats}\label{wxenumclipboardformats}
 
-\func{int}{wxEnumClipboardFormats}{\param{int}{dataFormat}}
+\func{int}{wxEnumClipboardFormats}{\param{int}{ dataFormat}}
 
 Enumerates the formats found in a list of available formats that belong
 to the clipboard. Each call to this  function specifies a known
@@ -2569,7 +2576,7 @@ wxOpenClipboard function.
 
 \membersection{::wxGetClipboardData}\label{wxgetclipboarddata}
 
-\func{wxObject *}{wxGetClipboardData}{\param{int}{dataFormat}}
+\func{wxObject *}{wxGetClipboardData}{\param{int}{ dataFormat}}
 
 Gets data from the clipboard.
 
@@ -2585,7 +2592,7 @@ The clipboard must have previously been opened for this call to succeed.
 
 \membersection{::wxGetClipboardFormatName}\label{wxgetclipboardformatname}
 
-\func{bool}{wxGetClipboardFormatName}{\param{int}{dataFormat}, \param{const wxString\& }{formatName}, \param{int}{maxCount}}
+\func{bool}{wxGetClipboardFormatName}{\param{int}{ dataFormat}, \param{const wxString\& }{formatName}, \param{int}{ maxCount}}
 
 Gets the name of a registered clipboard format, and puts it into the buffer {\it formatName} which is of maximum
 length {\it maxCount}. {\it dataFormat} must not specify a predefined clipboard format.
@@ -2593,7 +2600,7 @@ length {\it maxCount}. {\it dataFormat} must not specify a predefined clipboard
 
 \membersection{::wxIsClipboardFormatAvailable}\label{wxisclipboardformatavailable}
 
-\func{bool}{wxIsClipboardFormatAvailable}{\param{int}{dataFormat}}
+\func{bool}{wxIsClipboardFormatAvailable}{\param{int}{ dataFormat}}
 
 Returns true if the given data format is available on the clipboard.
 
@@ -2614,7 +2621,7 @@ Registers the clipboard data format name and returns an identifier.
 
 \membersection{::wxSetClipboardData}\label{wxsetclipboarddata}
 
-\func{bool}{wxSetClipboardData}{\param{int}{dataFormat}, \param{wxObject *}{data}, \param{int}{width}, \param{int}{height}}
+\func{bool}{wxSetClipboardData}{\param{int}{ dataFormat}, \param{wxObject*}{ data}, \param{int}{ width}, \param{int}{ height}}
 
 Passes data to the clipboard.
 
@@ -2630,8 +2637,6 @@ Passes data to the clipboard.
 The clipboard must have previously been opened for this call to succeed.
 
 
-
-
 \section{Miscellaneous functions}\label{miscellany}
 
 
@@ -2749,6 +2754,48 @@ Generates an integer identifier unique to this run of the program.
 <wx/utils.h>
 
 
+\membersection{wxON\_BLOCK\_EXIT}\label{wxonblockexit}
+
+\func{}{wxON\_BLOCK\_EXIT0}{\param{}{func}}
+\func{}{wxON\_BLOCK\_EXIT1}{\param{}{func}, \param{}{p1}}
+\func{}{wxON\_BLOCK\_EXIT2}{\param{}{func}, \param{}{p1}, \param{}{p2}}
+
+This family of macros allows to ensure that the global function \arg{func}
+with 0, 1, 2 or more parameters (up to some implementaton-defined limit) is
+executed on scope exit, whether due to a normal function return or because an
+exception has been thrown. A typical example of its usage:
+\begin{verbatim}
+    void *buf = malloc(size);
+    wxON_BLOCK_EXIT1(free, buf);
+\end{verbatim}
+
+Please see the original article by Andrei Alexandrescu and Petru Marginean
+published in December 2000 issue of \emph{C/C++ Users Journal} for more
+details.
+
+\wxheading{Include files}
+
+<wx/scopeguard.h>
+
+\wxheading{See also}
+
+\helpref{wxON\_BLOCK\_EXIT\_OBJ}{wxonblockexitobj}
+
+
+\membersection{wxON\_BLOCK\_EXIT\_OBJ}\label{wxonblockexitobj}
+
+\func{}{wxON\_BLOCK\_EXIT\_OBJ0}{\param{}{obj}, \param{}{method}}
+\func{}{wxON\_BLOCK\_EXIT\_OBJ1}{\param{}{obj}, \param{}{method}, \param{}{p1}}
+\func{}{wxON\_BLOCK\_EXIT\_OBJ2}{\param{}{obj}, \param{}{method}, \param{}{p1}, \param{}{p2}}
+
+This family of macros is similar to \helpref{wxON\_BLOCK\_EXIT}{wxonblockexit} 
+but calls a method of the given object instead of a free function.
+
+\wxheading{Include files}
+
+<wx/scopeguard.h>
+
+
 \membersection{::wxRegisterId}\label{wxregisterid}
 
 \func{void}{wxRegisterId}{\param{long}{ id}}
@@ -2794,7 +2841,7 @@ See also \helpref{wxDDEServer}{wxddeserver}, \helpref{wxDDEClient}{wxddeclient},
 
 \membersection{::wxEnableTopLevelWindows}\label{wxenabletoplevelwindows}
 
-\func{void}{wxEnableTopLevelWindow}{\param{bool}{ enable = true}}
+\func{void}{wxEnableTopLevelWindows}{\param{bool}{ enable = true}}
 
 This function enables or disables all top level windows. It is used by
 \helpref{::wxSafeYield}{wxsafeyield}.
@@ -3123,7 +3170,7 @@ allows to define unsigned 64 bit compile time constants:
 
 \membersection{wxVaCopy}\label{wxvacopy}
 
-\func{void}{wxVaCopy}{\param{va\_list }{argptrDst}, \param{va\_list}{argptrSrc}}
+\func{void}{wxVaCopy}{\param{va\_list }{argptrDst}, \param{va\_list}{ argptrSrc}}
 
 This macro is the same as the standard C99 \texttt{va\_copy} for the compilers
 which support it or its replacement for those that don't. It must be used to
@@ -3322,8 +3369,11 @@ dynamically. The same as DECLARE\_ABSTRACT\_CLASS.
 
 \func{}{DECLARE\_DYNAMIC\_CLASS}{className}
 
-Used inside a class declaration to declare that the objects of this class should be dynamically
-creatable from run-time type information.
+Used inside a class declaration to make the class known to wxWidgets RTTI
+system and also declare that the objects of this class should be dynamically
+creatable from run-time type information. Notice that this implies that the
+class should have a default constructor, if this is not the case consider using 
+\helpref{DECLARE\_CLASS}{declareclass}.
 
 Example: