X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e7dfcb8ea41572bda21d4e1684ef0e5a1d7d408f..1661354b7768a23db967756181858ac32ca03d01:/docs/latex/wx/function.tex

diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index 5d204099eb..0c2607b303 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -1,3 +1,14 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Name:        function.tex
+%% Purpose:     Functions and macros
+%% Author:      wxWidgets Team
+%% Modified by:
+%% Created:
+%% RCS-ID:      $Id$
+%% Copyright:   (c) wxWidgets Team
+%% License:     wxWindows license
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 \chapter{Functions}\label{functions}
 \setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
 \setfooter{\thepage}{}{}{}{}{\thepage}
@@ -229,8 +240,10 @@ the corresponding topic.
 \helpref{wxStricmp}{wxstricmp}\\
 \helpref{wxStringEq}{wxstringeq}\\
 \helpref{wxStringMatch}{wxstringmatch}\\
+\helpref{wxStringTokenize}{wxstringtokenize}\\
 \helpref{wxStripMenuCodes}{wxstripmenucodes}\\
 \helpref{wxStrlen}{wxstrlen}\\
+\helpref{wxSUPPRESS\_GCC\_PRIVATE\_DTOR\_WARNING}{wxsuppress\_gcc\_private\_dtor\_warning}\\
 \helpref{wxSysErrorCode}{wxsyserrorcode}\\
 \helpref{wxSysErrorMsg}{wxsyserrormsg}\\
 \helpref{wxT}{wxt}\\
@@ -252,6 +265,7 @@ the corresponding topic.
 \helpref{wx\_const\_cast}{wxconstcastraw}\\
 \helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}\\
 \helpref{wx\_static\_cast}{wxstaticcastraw}\\
+\helpref{wx\_truncate\_cast}{wxtruncatecast}\\
 \helpref{\_}{underscore}\\
 \helpref{wxPLURAL}{wxplural}\\
 \helpref{\_T}{underscoret}
@@ -588,7 +602,7 @@ 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} passing wxKILL\_CHILDREN will
-will kill this process as well as all of its children (except those which have
+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
@@ -1120,7 +1134,7 @@ Returns a string containing the current (or working) directory.
 
 \func{wxString}{wxGetWorkingDirectory}{\param{char *}{buf=NULL}, \param{int }{sz=1000}}
 
-{\bf NB:} This function is obsolete: use \helpref{wxGetCwd}{wxgetcwd} instead.
+{\bf NB:} This function is deprecated: use \helpref{wxGetCwd}{wxgetcwd} instead.
 
 Copies the current working directory into the buffer if supplied, or
 copies the working directory into new storage (which you {\emph must} delete
@@ -1512,24 +1526,24 @@ as wxGetTranslation.
 
 The second form is used when retrieving translation of string that has
 different singular and plural form in English or different plural forms in some
-other language. It takes two extra arguments: as above, \arg{str} 
+other language. It takes two extra arguments: as above, \arg{str}
 parameter must contain the singular form of the string to be converted and
 is used as the key for the search in the catalog. The \arg{strPlural} parameter
 is the plural form (in English). The parameter \arg{n} is used to determine the
 plural form.  If no message catalog is found \arg{str} is returned if `n == 1',
 otherwise \arg{strPlural}.
 
-See \urlref{GNU gettext manual}{http://www.gnu.org/manual/gettext/html\_chapter/gettext\_10.html\#SEC150} 
+See \urlref{GNU gettext manual}{http://www.gnu.org/manual/gettext/html\_chapter/gettext\_10.html\#SEC150}
 for additional information on plural forms handling. For a shorter alternative
 see the \helpref{wxPLURAL()}{wxplural} macro.
 
 Both versions call \helpref{wxLocale::GetString}{wxlocalegetstring}.
 
 Note that this function is not suitable for literal strings in Unicode
-builds, since the literal strings must be enclosed into 
+builds, since the literal strings must be enclosed into
 \helpref{\_T()}{underscoret} or \helpref{wxT}{wxt} macro which makes them
 unrecognised by \texttt{xgettext}, and so they are not extracted to the message
-catalog. Instead, use the \helpref{\_()}{underscore} and 
+catalog. Instead, use the \helpref{\_()}{underscore} and
 \helpref{wxPLURAL}{wxplural} macro for all literal strings.
 
 
@@ -1563,6 +1577,19 @@ This function complements the standard C function {\it strcmp()} which performs
 case-sensitive comparison.
 
 
+\membersection{::wxStringEq}\label{wxstringeq}
+
+\func{bool}{wxStringEq}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2}}
+
+{\bf NB:} This function is obsolete, use \helpref{wxString}{wxstring} instead.
+
+A macro defined as:
+
+\begin{verbatim}
+#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
+\end{verbatim}
+
+
 \membersection{::wxStringMatch}\label{wxstringmatch}
 
 \func{bool}{wxStringMatch}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2},\\
@@ -1575,17 +1602,19 @@ ignoring case if {\it exact} is false. If {\it subString} is \false,
 no substring matching is done.
 
 
-\membersection{::wxStringEq}\label{wxstringeq}
+\membersection{::wxStringTokenize}\label{wxstringtokenize}
 
-\func{bool}{wxStringEq}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2}}
+\func{wxArrayString}{wxStringTokenize}{\param{const wxString\& }{str},\\
+  \param{const wxString\& }{delims = wxDEFAULT\_DELIMITERS},\\
+  \param{wxStringTokenizerMode }{mode = wxTOKEN\_DEFAULT}}
 
-{\bf NB:} This function is obsolete, use \helpref{wxString}{wxstring} instead.
+This is a convenience function wrapping
+\helpref{wxStringTokenizer}{wxstringtokenizer} which simply returns all tokens
+found in the given \arg{str} in an array.
 
-A macro defined as:
-
-\begin{verbatim}
-#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
-\end{verbatim}
+Please see
+\helpref{wxStringTokenizer::wxStringTokenizer}{wxstringtokenizerwxstringtokenizer}
+for the description of the other parameters.
 
 
 \membersection{::wxStrlen}\label{wxstrlen}
@@ -2788,7 +2817,7 @@ details.
 \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} 
+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}
@@ -3013,7 +3042,7 @@ See also \helpref{wxWriteResource}{wxwriteresource}, \helpref{wxConfigBase}{wxco
 
 \membersection{::wxGetStockLabel}\label{wxgetstocklabel}
 
-\func{wxString}{wxGetStockLabel}{\param{wxWindowID }{id}, \param{bool }{withCodes = true}, \param{wxString }{accelerator = wxEmptyString}}
+\func{wxString}{wxGetStockLabel}{\param{wxWindowID }{id}, \param{bool }{withCodes = true}, \param{const wxString\& }{accelerator = wxEmptyString}}
 
 Returns label that should be used for given {\it id} element.
 
@@ -3047,16 +3076,19 @@ frame or dialog containing it, or {\tt NULL}.
 
 \membersection{::wxLaunchDefaultBrowser}\label{wxlaunchdefaultbrowser}
 
-\func{bool}{wxLaunchDefaultBrowser}{\param{const wxString\& }{sUrl}}
+\func{bool}{wxLaunchDefaultBrowser}{\param{const wxString\& }{url}, \param{int }{flags = $0$}}
 
-Launches the user's default browser and tells it to open the location at {\tt sUrl}.
+Open the \arg{url} in user's default browser. If \arg{flags} parameter contains
+\texttt{wxBROWSER\_NEW\_WINDOW} flag, a new window is opened for the URL
+(currently this is only supported under Windows).
 
-Returns true if the application was successfully launched.
+Returns \true if the application was successfully launched.
 
 \wxheading{Include files}
 
 <wx/utils.h>
 
+
 \membersection{::wxLoadUserResource}\label{wxloaduserresource}
 
 \func{wxString}{wxLoadUserResource}{\param{const wxString\& }{resourceName}, \param{const wxString\& }{resourceType=``TEXT"}}
@@ -3146,6 +3178,36 @@ as a keyboard shortkey in Windows and Motif) and $\backslash$t (tab in Windows).
 <wx/utils.h>
 
 
+\membersection{wxSUPPRESS\_GCC\_PRIVATE\_DTOR\_WARNING}{wxsuppress\_gcc\_private\_dtor\_warning}\\
+
+\func{}{wxSUPPRESS\_GCC\_PRIVATE\_DTOR\_WARNING}{\param{}{name}}
+
+GNU C++ compiler gives a warning for any class whose destructor is private
+unless it has a friend. This warning may sometimes be useful but it doesn't
+make sense for reference counted class which always delete themselves (hence
+destructor should be private) but don't necessarily have any friends, so this
+macro is provided to disable the warning in such case. The \arg{name} parameter
+should be the name of the class but is only used to construct a unique friend
+class name internally. Example of using the macro:
+
+\begin{verbatim}
+    class RefCounted
+    {
+    public:
+        RefCounted() { m_nRef = 1; }
+        void IncRef() { m_nRef++ ; }
+        void DecRef() { if ( !--m_nRef ) delete this; }
+
+    private:
+        ~RefCounted() { }
+
+        wxSUPPRESS_GCC_PRIVATE_DTOR(RefCounted)
+    };
+\end{verbatim}
+
+Notice that there should be no semicolon after this macro.
+
+
 \membersection{wxULL}\label{wxull}
 
 \func{wxLongLong\_t}{wxULL}{\param{}{number}}
@@ -3372,7 +3434,7 @@ dynamically. The same as DECLARE\_ABSTRACT\_CLASS.
 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 
+class should have a default constructor, if this is not the case consider using
 \helpref{DECLARE\_CLASS}{declareclass}.
 
 Example:
@@ -3663,8 +3725,20 @@ star is not appended to it.
 \wxheading{See also}
 
 \helpref{wx\_const\_cast}{wxconstcastraw},\\
-\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}
+\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw},\\
+\helpref{wx\_truncate\_cast}{wxtruncatecast}
+
+
+\membersection{wx\_truncate\_cast}\label{wxtruncatecast}
+
+\func{T}{wx\_truncate\_cast}{T, x}
 
+This case doesn't correspond to any standard cast but exists solely to make
+casts which possibly result in a truncation of an integer value more readable.
+
+\wxheading{See also}
+
+\helpref{wx\_static\_cast}{wxstaticcastraw}
 
 
 \section{Log functions}\label{logfunctions}
@@ -4440,4 +4514,3 @@ Removes the variable {\it var} from the environment.
 function.
 
 Returns \true on success.
-
