X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c75d190a0ac1671b1d2af75ba8928716d77bf823..d479632a8f5846d33a4ea13a9ceae158b78f57eb:/docs/latex/wx/function.tex diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 1cc593dd6b..96b383f984 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} @@ -21,16 +32,13 @@ the corresponding topic. \helpref{IMPLEMENT\_CLASS}{implementclass}\\ \helpref{IMPLEMENT\_DYNAMIC\_CLASS2}{implementdynamicclass2}\\ \helpref{IMPLEMENT\_DYNAMIC\_CLASS}{implementdynamicclass}\\ -\helpref{wxCONCAT}{wxconcat}\\ -\helpref{WXDEBUG\_NEW}{debugnew}\\ -\helpref{WXTRACELEVEL}{tracelevel}\\ -\helpref{WXTRACE}{trace}\\ +\helpref{wxAboutBox}{wxaboutbox}\\ +\helpref{wxASSERT}{wxassert}\\ \helpref{wxASSERT\_MIN\_BITSIZE}{wxassertminbitsize}\\ \helpref{wxASSERT\_MSG}{wxassertmsg}\\ -\helpref{wxASSERT}{wxassert}\\ -\helpref{wxBITMAP}{wxbitmapmacro}\\ \helpref{wxBeginBusyCursor}{wxbeginbusycursor}\\ \helpref{wxBell}{wxbell}\\ +\helpref{wxBITMAP}{wxbitmapmacro}\\ \helpref{wxCHANGE\_UMASK}{wxchangeumask}\\ \helpref{wxCHECK}{wxcheck}\\ \helpref{wxCHECK2\_MSG}{wxcheck2msg}\\ @@ -47,6 +55,7 @@ the corresponding topic. \helpref{wxColourDisplay}{wxcolourdisplay}\\ \helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}\\ \helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2}\\ +\helpref{wxCONCAT}{wxconcat}\\ \helpref{wxConcatFiles}{wxconcatfiles}\\ \helpref{wxConstCast}{wxconstcast}\\ \helpref{wxCopyFile}{wxcopyfile}\\ @@ -60,6 +69,7 @@ the corresponding topic. \helpref{wxDDEInitialize}{wxddeinitialize}\\ \helpref{wxDROP\_ICON}{wxdropicon}\\ \helpref{wxDebugMsg}{wxdebugmsg}\\ +\helpref{WXDEBUG\_NEW}{debugnew}\\ \helpref{wxDirExists}{functionwxdirexists}\\ \helpref{wxDirSelector}{wxdirselector}\\ \helpref{wxDisplayDepth}{wxdisplaydepth}\\ @@ -74,6 +84,8 @@ the corresponding topic. \helpref{wxEndBusyCursor}{wxendbusycursor}\\ \helpref{wxENTER\_CRIT\_SECT}{wxentercritsect}\\ \helpref{wxEntry}{wxentry}\\ +\helpref{wxEntryStart}{wxentrystart}\\ +\helpref{wxEntryCleanup}{wxentrycleanup}\\ \helpref{wxEnumClipboardFormats}{wxenumclipboardformats}\\ \helpref{wxError}{wxerror}\\ \helpref{wxExecute}{wxexecute}\\ @@ -94,6 +106,7 @@ the corresponding topic. \helpref{wxFindWindowByLabel}{wxfindwindowbylabel}\\ \helpref{wxFindWindowByName}{wxfindwindowbyname}\\ \helpref{wxFinite}{wxfinite}\\ +\helpref{wxGenericAboutBox}{wxgenericaboutbox}\\ \helpref{wxGetActiveWindow}{wxgetactivewindow}\\ \helpref{wxGetApp}{wxgetapp}\\ \helpref{wxGetBatteryState}{wxgetbatterystate}\\ @@ -118,6 +131,7 @@ the corresponding topic. \helpref{wxGetLocalTimeMillis}{wxgetlocaltimemillis}\\ \helpref{wxGetLocalTime}{wxgetlocaltime}\\ \helpref{wxGetMousePosition}{wxgetmouseposition}\\ +\helpref{wxGetMouseState}{wxgetmousestate}\\ \helpref{wxGetMultipleChoices}{wxgetmultiplechoices}\\ \helpref{wxGetMultipleChoice}{wxgetmultiplechoice}\\ \helpref{wxGetNumberFromUser}{wxgetnumberfromuser}\\ @@ -163,8 +177,11 @@ the corresponding topic. \helpref{wxIsEmpty}{wxisempty}\\ \helpref{wxIsMainThread}{wxismainthread}\\ \helpref{wxIsNaN}{wxisnan}\\ +\helpref{wxIsPlatformLittleEndian}{wxisplatformlittleendian}\\ +\helpref{wxIsPlatform64Bit}{wxisplatform64bit}\\ \helpref{wxIsWild}{wxiswild}\\ \helpref{wxKill}{wxkill}\\ +\helpref{wxLaunchDefaultBrowser}{wxlaunchdefaultbrowser}\\ \helpref{wxLEAVE\_CRIT\_SECT}{wxleavecritsect}\\ \helpref{wxLoadUserResource}{wxloaduserresource}\\ \helpref{wxLogDebug}{wxlogdebug}\\ @@ -189,9 +206,12 @@ 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{wxPathOnly}{wxpathonly}\\ +\helpref{wxPLURAL}{wxplural}\\ \helpref{wxPostDelete}{wxpostdelete}\\ \helpref{wxPostEvent}{wxpostevent}\\ \helpref{wxRegisterClipboardFormat}{wxregisterclipboardformat}\\ @@ -226,13 +246,19 @@ the corresponding topic. \helpref{wxStricmp}{wxstricmp}\\ \helpref{wxStringEq}{wxstringeq}\\ \helpref{wxStringMatch}{wxstringmatch}\\ +\helpref{wxStringTokenize}{wxstringtokenize}\\ \helpref{wxStripMenuCodes}{wxstripmenucodes}\\ \helpref{wxStrlen}{wxstrlen}\\ +\helpref{wxSTRINGIZE}{wxstringize}\\ +\helpref{wxSTRINGIZE\_T}{wxstringizet}\\ +\helpref{wxSUPPRESS\_GCC\_PRIVATE\_DTOR\_WARNING}{wxsuppressgccprivatedtorwarning}\\ \helpref{wxSysErrorCode}{wxsyserrorcode}\\ \helpref{wxSysErrorMsg}{wxsyserrormsg}\\ \helpref{wxT}{wxt}\\ -\helpref{wxTraceLevel}{wxtracelevel}\\ \helpref{wxTrace}{wxtrace}\\ +\helpref{WXTRACE}{trace}\\ +\helpref{wxTraceLevel}{wxtracelevel}\\ +\helpref{WXTRACELEVEL}{tracelevel}\\ \helpref{wxTransferFileToStream}{wxtransferfiletostream}\\ \helpref{wxTransferStreamToFile}{wxtransferstreamtofile}\\ \helpref{wxTrap}{wxtrap}\\ @@ -249,8 +275,10 @@ 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{\_T}{underscoret} +\helpref{\_\_WXFUNCTION\_\_}{wxfunction} @@ -340,26 +368,27 @@ to control the behaviour of the main event loop of the GUI programs. \membersection{::wxEntry}\label{wxentry} -This initializes wxWidgets in a platform-dependent way. Use this if you -are not using the default wxWidgets entry code (e.g. main or WinMain). For example, -you can initialize wxWidgets from an Microsoft Foundation Classes application using +This initializes wxWidgets in a platform-dependent way. Use this if you are not +using the default wxWidgets entry code (e.g. main or WinMain). For example, you +can initialize wxWidgets from an Microsoft Foundation Classes application using this function. -\func{void}{wxEntry}{\param{HANDLE}{ hInstance}, \param{HANDLE}{ hPrevInstance}, - \param{const wxString\& }{commandLine}, \param{int}{ cmdShow}, \param{bool}{ enterLoop = true}} +The following overload of wxEntry is available under all platforms: + +\func{int}{wxEntry}{\param{int\&}{ argc}, \param{wxChar **}{argv}} -wxWidgets initialization under Windows (non-DLL). If {\it enterLoop} is false, the -function will return immediately after calling wxApp::OnInit. Otherwise, the wxWidgets -message loop will be entered. +Under MS Windows, an additional overload suitable for calling from +\texttt{WinMain} is available: -\func{void}{wxEntry}{\param{HANDLE}{ hInstance}, \param{HANDLE}{ hPrevInstance}, - \param{WORD}{ wDataSegment}, \param{WORD}{ wHeapSize}, \param{const wxString\& }{ commandLine}} +\func{int}{wxEntry}{\param{HINSTANCE }{hInstance}, \param{HINSTANCE }{hPrevInstance = \NULL}, \param{char *}{pCmdLine = \NULL}, \param{int }{nCmdShow = \texttt{SW\_SHOWNORMAL}}} -wxWidgets initialization under Windows (for applications constructed as a DLL). +(notice that under Windows CE platform, and only there, the type of +\arg{pCmdLine} is \texttt{wchar\_t *}, otherwise it is \texttt{char *}, even in +Unicode build). -\func{int}{wxEntry}{\param{int}{ argc}, \param{const wxString\& *}{argv}} +\wxheading{See also} -wxWidgets initialization under Unix. +\helpref{wxEntryStart}{wxentrystart} \wxheading{Remarks} @@ -383,6 +412,38 @@ int CTheApp::ExitInstance() +\membersection{::wxEntryCleanup}\label{wxentrycleanup} + +\func{void}{wxEntryCleanup}{\void} + +Free resources allocated by a successful call to \helpref{wxEntryStart}{wxentrystart}. + +\wxheading{Include files} + + + + +\membersection{::wxEntryStart}\label{wxentrystart} + +\func{bool}{wxEntryStart}{\param{int\&}{ argc}, \param{wxChar **}{argv}} + +This function can be used to perform the initialization of wxWidgets if you +can't use the default initialization code for any reason. + +If the function returns \true, the initialization was successful and the global +\helpref{wxApp}{wxapp} object \texttt{wxTheApp} has been created. Moreover, +\helpref{wxEntryCleanup}{wxentrycleanup} must be called afterwards. If the +function returns \false, a catastrophic initialization error occured and (at +least the GUI part of) the library can't be used at all. + +Notice that parameters \arg{argc} and \arg{argv} may be modified by this +function. + +\wxheading{Include files} + + + + \membersection{::wxGetApp}\label{wxgetapp} \func{wxAppDerivedClass\&}{wxGetApp}{\void} @@ -435,7 +496,7 @@ This function is used in wxBase only and only if you don't create \helpref{wxApp}{wxapp} object at all. In this case you must call it from your {\tt main()} function before calling any other wxWidgets functions. -If the function returns {\tt false} the initialization could not be performed, +If the function returns \false the initialization could not be performed, in this case the library cannot be used and \helpref{wxUninitialize}{wxuninitialize} shouldn't be called neither. @@ -504,7 +565,7 @@ the corresponding functions \helpref{::wxPostEvent}{wxpostevent} and \wxheading{Include files} - + @@ -584,7 +645,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 @@ -731,7 +792,7 @@ See also \helpref{wxExecute}{wxexecute}, \helpref{Exec sample}{sampleexec}. This function shuts down or reboots the computer depending on the value of the {\it flags}. Please notice that doing this requires the corresponding access -rights (superuser under Unix, {\tt SE\_SHUTDOWN} privelege under Windows NT) +rights (superuser under Unix, {\tt SE\_SHUTDOWN} privilege under Windows NT) and that this function is only implemented under Unix and Win32. \wxheading{Parameters} @@ -740,7 +801,7 @@ and that this function is only implemented under Unix and Win32. \wxheading{Returns} -{\tt true} on success, {\tt false} if an error occured. +\true on success, \false if an error occurred. \wxheading{Include files} @@ -841,7 +902,7 @@ This macro is equivalent to \helpref{cs.Enter()}{wxcriticalsectionenter} if \func{bool}{wxIsMainThread}{\void} -Returns {\tt true} if this thread is the main one. Always returns {\tt true} if +Returns \true if this thread is the main one. Always returns \true if {\tt wxUSE\_THREADS} is $0$. @@ -914,13 +975,6 @@ threads. \helpref{wxFileName}{wxfilename} -\membersection{::wxDirExists}\label{functionwxdirexists} - -\func{bool}{wxDirExists}{\param{const wxString\& }{dirname}} - -Returns true if the directory exists. - - \membersection{::wxDos2UnixFilename}\label{wxdos2unixfilename} \func{void}{wxDos2UnixFilename}{\param{wxChar *}{s}} @@ -942,6 +996,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} @@ -967,7 +1023,7 @@ parent directory "..". \wxheading{Warning} -As of wx 2.5.2, these functions are not thread-safe! (use static variables) +As of wx 2.5.2, these functions are not thread-safe! (they use static variables). You probably want to use \helpref{wxDir::GetFirst}{wxdirgetfirst} or \helpref{wxDirTraverser}{wxdirtraverser} instead. {\it spec} may contain wildcards. @@ -1005,7 +1061,7 @@ information is not needed. \wxheading{Returns} -{\tt true} on success, {\tt false} if an error occured (for example, the +\true on success, \false if an error occurred (for example, the directory doesn't exist). \wxheading{Portability} @@ -1055,6 +1111,13 @@ Returns true if the argument is an absolute filename, i.e. with a slash or drive name at the beginning. +\membersection{::wxDirExists}\label{functionwxdirexists} + +\func{bool}{wxDirExists}{\param{const wxChar *}{dirname}} + +Returns true if \arg{dirname} exists and is a directory. + + \membersection{::wxPathOnly}\label{wxpathonly} \func{wxString}{wxPathOnly}{\param{const wxString\& }{path}} @@ -1064,7 +1127,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. @@ -1112,7 +1177,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 @@ -1165,7 +1230,7 @@ with wildcard characters. See \helpref{wxIsWild}{wxiswild}. Makes the directory \arg{dir}, returning true if successful. {\it perm} is the access mask for the directory for the systems on which it is -supported (Unix) and doesn't have effect for the other ones. +supported (Unix) and doesn't have any effect on the other ones. \membersection{::wxParseCommonDialogsFilter}\label{wxparsecommondialogsfilter} @@ -1191,10 +1256,14 @@ Removes \arg{file}, returning true if successful. \membersection{::wxRenameFile}\label{wxrenamefile} -\func{bool}{wxRenameFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}} +\func{bool}{wxRenameFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}, \param{bool }{overwrite = true}} Renames \arg{file1} to \arg{file2}, returning true if successful. +If \arg{overwrite} parameter is true (default), the destination file is +overwritten if it exists, but if \arg{overwrite} is false, the functions fails +in this case. + \membersection{::wxRmdir}\label{wxrmdir} @@ -1322,7 +1391,8 @@ Return the (current) user's home directory. \wxheading{See also} -\helpref{wxGetUserHome}{wxgetuserhome} +\helpref{wxGetUserHome}{wxgetuserhome}\\ +\helpref{wxStandardPaths}{wxstandardpaths} \wxheading{Include files} @@ -1375,32 +1445,49 @@ user-readable form. For example, this function may return strings like \membersection{::wxGetOsVersion}\label{wxgetosversion} -\func{int}{wxGetOsVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}} +\func{wxOperatingSystemId}{wxGetOsVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}} -Gets operating system version information. +Gets the version and the operating system ID for currently running OS. +See \helpref{wxPlatformInfo}{wxplatforminfo} for more details about wxOperatingSystemId. -\begin{twocollist}\itemsep=0pt -\twocolitemruled{Platform}{Return types} -\twocolitem{Mac OS}{Return value is wxMAC when compiled with CodeWarrior under Mac OS 8.x/9.x and Mac OS X, wxMAC\_DARWIN when compiled with the Apple Developer Tools under Mac OS X. - -Both {\it major} and {\it minor} have to be looked at as hexadecimal numbers. So System 10.2.4 returns 0x10, resp 16 for {\it major} and 0x24, resp 36 for {\it minor}. } -\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/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{Windows PocketPC}{Return value is wxWINDOWS\_POCKETPC, version is returned in {\it major} and {\it minor}.} -\twocolitem{Windows Smartphone}{Return value is wxWINDOWS\_SMARTPHONE, version is returned in {\it major} and {\it minor}.} -\twocolitem{Windows CE (non-specific)}{Return value is wxWINDOWS\_CE, version is returned in {\it major} and {\it minor}.} -\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}, +\helpref{wxPlatformInfo}{wxplatforminfo} + +\wxheading{Include files} + + + + +\membersection{::wxIsPlatformLittleEndian}\label{wxisplatformlittleendian} + +\func{bool}{wxIsPlatformLittleEndian}{\void} + +Returns \true if the current platform is little endian (instead of big endian). +The check is performed at run-time. \wxheading{See also} -\helpref{::wxGetOsDescription}{wxgetosdescription} +\helpref{Byte order macros}{byteordermacros} + +\wxheading{Include files} + + + + +\membersection{::wxIsPlatform64Bit}\label{wxisplatform64bit} + +\func{bool}{wxIsPlatform64Bit}{\void} + +Returns \true if the operating system the program is running under is 64 bit. +The check is performed at run-time and may differ from the value available at +compile-time (at compile-time you can just check if {\tt sizeof(void*)==8}) +since the program could be running in emulation mode or in a mixed 32/64 bit system +(bi-architecture operating system). + +Very important: this function is not 100\% reliable on some systems given the fact +that there isn't always a standard way to do a reliable check on the OS architecture. \wxheading{Include files} @@ -1460,8 +1547,8 @@ is running, the entry {\bf Current} in the section {\bf User} of the PENWIN.INI file is used. The first variant of this function returns the user name if successful or an -empty string otherwise. The second (deprecated) function returns {\tt true} -if successful, {\tt false} otherwise. +empty string otherwise. The second (deprecated) function returns \true +if successful, \false otherwise. \wxheading{See also} @@ -1488,38 +1575,52 @@ This function is deprecated, use \helpref{wxString}{wxstring} class instead. \membersection{::wxGetTranslation}\label{wxgettranslation} -\func{const char *}{wxGetTranslation}{\param{const char * }{str}} +\func{const wxChar *}{wxGetTranslation}{\param{const wxChar* }{str}, + \param{const wxChar* }{domain = NULL}} -\func{const char *}{wxGetTranslation}{\param{const char * }{str}, \param{const char * }{strPlural}, \param{size\_t }{n}} +\func{const wxChar *}{wxGetTranslation}{\param{const wxChar* }{str}, \param{const wxChar* }{strPlural}, \param{size\_t }{n}, + \param{const wxChar* }{domain = NULL}} 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{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 +should help to find the strings which were not yet translated. If +{\it domain} is specified then only that domain/catalog is searched +for a matching string. As this function is used very often, an alternative (and also common in Unix world) syntax is provided: the \helpref{\_()}{underscore} macro is defined to do the same thing 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: \arg{str} -parameter must contain the singular form of the string to be converted. -It is also 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', +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} for additional information on plural forms handling. + +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 +\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 +\helpref{wxPLURAL}{wxplural} macro for all literal strings. + + \membersection{::wxIsEmpty}\label{wxisempty} \func{bool}{wxIsEmpty}{\param{const char *}{ p}} -Returns {\tt true} if the pointer is either {\tt NULL} or points to an empty -string, {\tt false} otherwise. +Returns \true if the pointer is either {\tt NULL} or points to an empty +string, \false otherwise. \membersection{::wxStrcmp}\label{wxstrcmp} @@ -1544,6 +1645,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},\\ @@ -1551,22 +1665,24 @@ case-sensitive comparison. {\bf NB:} This function is obsolete, use \helpref{wxString::Find}{wxstringfind} instead. -Returns {\tt true} if the substring {\it s1} is found within {\it s2}, -ignoring case if {\it exact} is false. If {\it subString} is {\tt false}, +Returns \true if the substring {\it s1} is found within {\it s2}, +ignoring case if {\it exact} is false. If {\it subString} is \false, no substring matching is done. -\membersection{::wxStringEq}\label{wxstringeq} - -\func{bool}{wxStringEq}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2}} +\membersection{::wxStringTokenize}\label{wxstringtokenize} -{\bf NB:} This function is obsolete, use \helpref{wxString}{wxstring} instead. +\func{wxArrayString}{wxStringTokenize}{\param{const wxString\& }{str},\\ + \param{const wxString\& }{delims = wxDEFAULT\_DELIMITERS},\\ + \param{wxStringTokenizerMode }{mode = wxTOKEN\_DEFAULT}} -A macro defined as: +This is a convenience function wrapping +\helpref{wxStringTokenizer}{wxstringtokenizer} which simply returns all tokens +found in the given \arg{str} in an array. -\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} @@ -1669,6 +1785,12 @@ wxGetTranslation wouldn't find them. The same as \helpref{wxSnprintf}{wxsnprintf} but takes a {\tt va\_list } argument instead of arbitrary number of parameters. +Note that if \texttt{wxUSE\_PRINTF\_POS\_PARAMS} is set to 1, then this function supports +positional arguments (see \helpref{wxString::Printf}{wxstringprintf} for more information). +However other functions of the same family (wxPrintf, wxSprintf, wxFprintf, wxVfprintf, +wxVfprintf, wxVprintf, wxVsprintf) currently do not to support positional parameters +even when \texttt{wxUSE\_PRINTF\_POS\_PARAMS} is 1. + \wxheading{See also} \helpref{wxSnprintf}{wxsnprintf}, \helpref{wxString::PrintfV}{wxstringprintfv} @@ -1687,6 +1809,14 @@ the string for the current locale during execution. Don't confuse this macro with \helpref{\_T()}{underscoret}! +\membersection{wxPLURAL}\label{wxplural} + +\func{const wxChar *}{wxPLURAL}{\param{const char *}{sing}, \param{const char *}{plur}, \param{size\_t}{n}} + +This macro is identical to \helpref{\_()}{underscore} but for the plural variant +of \helpref{wxGetTranslation}{wxgettranslation}. + + \membersection{\_T}\label{underscoret} \func{wxChar}{\_T}{\param{char }{ch}} @@ -1711,6 +1841,39 @@ parameter, or (in MS Windows or Motif) the wrong window frame may be brought to the front when the dialog box is popped up. +\membersection{::wxAboutBox}\label{wxaboutbox} + +\func{void}{wxAboutBox}{\param{const wxAboutDialogInfo\& }{info}} + +This function shows the standard about dialog containing the information +specified in \arg{info}. If the current platform has a native about dialog +which is capable of showing all the fields in \arg{info}, the native dialog is +used, otherwise the function falls back to the generic wxWidgets version of the +dialog, i.e. does the same thing as \helpref{wxGenericAboutBox()}{wxgenericaboutbox}. + +Here is an example of how this function may be used: +\begin{verbatim} +void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event)) +{ + wxAboutDialogInfo info; + info.SetName(_("My Program")); + info.SetVersion(_("1.2.3 Beta")); + info.SetDescription(_("This program does something great.")); + info.SetCopyright(_T("(C) 2007 Me ")); + + wxAboutBox(info); +} +\end{verbatim} + +Please see the \helpref{dialogs sample}{sampledialogs} for more examples of +using this function and \helpref{wxAboutDialogInfo}{wxaboutdialoginfo} for the +description of the information which can be shown in the about dialog. + +\wxheading{Include files} + + + + \membersection{::wxBeginBusyCursor}\label{wxbeginbusycursor} \func{void}{wxBeginBusyCursor}{\param{wxCursor *}{cursor = wxHOURGLASS\_CURSOR}} @@ -1800,7 +1963,9 @@ 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, wxFILE\_MUST\_EXIST, wxMULTIPLE or 0. +wxSAVE, wxOVERWRITE\_PROMPT or wxFILE\_MUST\_EXIST. Note that wxMULTIPLE +can only be used with \helpref{wxFileDialog}{wxfiledialog} and not here as this +function only returns a single file name. Both the Unix and Windows versions implement a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and @@ -1846,12 +2011,35 @@ See also \helpref{wxIsBusy}{wxisbusy}, \helpref{wxBusyCursor}{wxbusycursor}. +\membersection{::wxGenericAboutBox}\label{wxgenericaboutbox} + +\func{void}{wxGenericAboutBox}{\param{const wxAboutDialogInfo\& }{info}} + +This function does the same thing as \helpref{wxAboutBox}{wxaboutbox} except +that it always uses the generic wxWidgets version of the dialog instead of the +native one. This is mainly useful if you need to customize the dialog by e.g. +adding custom controls to it (customizing the native dialog is not currently +supported). + +See the \helpref{dialogs sample}{sampledialogs} for an example of about dialog +customization. + +\wxheading{See also} + +\helpref{wxAboutDialogInfo}{wxaboutdialoginfo} + +\wxheading{Include files} + +\\ + + + \membersection{::wxGetColourFromUser}\label{wxgetcolourfromuser} -\func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}} +\func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}, \param{const wxString\& }{caption = wxEmptyString}} 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 +invalid colour (use \helpref{wxColour:IsOk}{wxcolourisok} to test whether a colour is valid) if the dialog was cancelled. \wxheading{Parameters} @@ -1860,6 +2048,8 @@ is valid) if the dialog was cancelled. \docparam{colInit}{If given, this will be the colour initially selected in the dialog.} +\docparam{caption}{If given, this will be used for the dialog caption.} + \wxheading{Include files} @@ -1867,10 +2057,10 @@ is valid) if the dialog was cancelled. \membersection{::wxGetFontFromUser}\label{wxgetfontfromuser} -\func{wxFont}{wxGetFontFromUser}{\param{wxWindow *}{parent}, \param{const wxFont\& }{fontInit}} +\func{wxFont}{wxGetFontFromUser}{\param{wxWindow *}{parent}, \param{const wxFont\& }{fontInit}, \param{const wxString\& }{caption = wxEmptyString}} Shows the font selection dialog and returns the font selected by user or -invalid font (use \helpref{wxFont::Ok}{wxfontok} to test whether a font +invalid font (use \helpref{wxFont:IsOk}{wxfontisok} to test whether a font is valid) if the dialog was cancelled. \wxheading{Parameters} @@ -1879,6 +2069,8 @@ is valid) if the dialog was cancelled. \docparam{fontInit}{If given, this will be the font initially selected in the dialog.} +\docparam{caption}{If given, this will be used for the dialog caption.} + \wxheading{Include files} @@ -2138,7 +2330,7 @@ following identifiers: \begin{twocollist}\itemsep=0pt \twocolitem{wxYES\_NO}{Puts Yes and No buttons on the message box. May be combined with wxCANCEL.} -\twocolitem{wxCANCEL}{Puts a Cancel button on the message box. May be combined with +\twocolitem{wxCANCEL}{Puts a Cancel button on the message box. May only be combined with wxYES\_NO or wxOK.} \twocolitem{wxOK}{Puts an Ok button on the message box. May be combined with wxCANCEL.} \twocolitem{wxICON\_EXCLAMATION}{Displays an exclamation mark symbol.} @@ -2528,7 +2720,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 @@ -2549,7 +2741,7 @@ wxOpenClipboard function. \membersection{::wxGetClipboardData}\label{wxgetclipboarddata} -\func{wxObject *}{wxGetClipboardData}{\param{int}{dataFormat}} +\func{wxObject *}{wxGetClipboardData}{\param{int}{ dataFormat}} Gets data from the clipboard. @@ -2565,7 +2757,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. @@ -2573,7 +2765,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. @@ -2594,7 +2786,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. @@ -2610,8 +2802,6 @@ Passes data to the clipboard. The clipboard must have previously been opened for this call to succeed. - - \section{Miscellaneous functions}\label{miscellany} @@ -2660,9 +2850,14 @@ this language feature but still take advantage of it when it is available. \func{bool}{wxGetKeyState}{\param{wxKeyCode }{key}} -Returns \true if the key parameter is currently pressed on the keyboard, or -with modifier keys, (caps lock, etc) if the key is active (the led light is -on). +For normal keys, returns \true if the specified key is currently down. + +For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns +\true if the key is toggled such that its LED indicator is lit. There is +currently no way to test whether togglable keys are up or down. + +Even though there are virtual key codes defined for mouse buttons, they +cannot be used with this function currently. \wxheading{Include files} @@ -2724,6 +2919,48 @@ Generates an integer identifier unique to this run of the program. +\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} + + + +\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} + + + + \membersection{::wxRegisterId}\label{wxregisterid} \func{void}{wxRegisterId}{\param{long}{ id}} @@ -2769,7 +3006,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}. @@ -2846,7 +3083,8 @@ and current pointer position in screen coordinates. \func{wxWindow *}{wxGetActiveWindow}{\void} -Gets the currently active window (Windows only). +Gets the currently active window (implemented for MSW and GTK only currently, +always returns \NULL in the other ports). \wxheading{Include files} @@ -2861,7 +3099,7 @@ Returns battery state as one of \texttt{wxBATTERY\_NORMAL\_STATE}, \texttt{wxBATTERY\_LOW\_STATE}, \texttt{wxBATTERY\_CRITICAL\_STATE}, \texttt{wxBATTERY\_SHUTDOWN\_STATE} or \texttt{wxBATTERY\_UNKNOWN\_STATE}. \texttt{wxBATTERY\_UNKNOWN\_STATE} is also the default on platforms where -this feature is not implemented. +this feature is not implemented (currently everywhere but MS Windows). \wxheading{Include files} @@ -2886,7 +3124,7 @@ Under X only, returns the current display name. See also \helpref{wxSetDisplayNa Returns the type of power source as one of \texttt{wxPOWER\_SOCKET}, \texttt{wxPOWER\_BATTERY} or \texttt{wxPOWER\_UNKNOWN}. \texttt{wxPOWER\_UNKNOWN} is also the default on platforms where this -feature is not implemented. +feature is not implemented (currently everywhere but MS Windows). \wxheading{Include files} @@ -2904,6 +3142,55 @@ Returns the mouse position in screen coordinates. +\membersection{::wxGetMouseState}\label{wxgetmousestate} + +\func{wxMouseState}{wxGetMouseState}{\void} + +Returns the current state of the mouse. Returns a wxMouseState +instance that contains the current position of the mouse pointer in +screen coordinants, as well as boolean values indicating the up/down +status of the mouse buttons and the modifier keys. + +\wxheading{Include files} + + + +wxMouseState has the following interface: + +\begin{verbatim} +class wxMouseState +{ +public: + wxMouseState(); + + wxCoord GetX(); + wxCoord GetY(); + + bool LeftDown(); + bool MiddleDown(); + bool RightDown(); + + bool ControlDown(); + bool ShiftDown(); + bool AltDown(); + bool MetaDown(); + bool CmdDown(); + + void SetX(wxCoord x); + void SetY(wxCoord y); + + void SetLeftDown(bool down); + void SetMiddleDown(bool down); + void SetRightDown(bool down); + + void SetControlDown(bool down); + void SetShiftDown(bool down); + void SetAltDown(bool down); + void SetMetaDown(bool down); +}; +\end{verbatim} + + \membersection{::wxGetResource}\label{wxgetresource} \func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry}, @@ -2941,7 +3228,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. @@ -2973,6 +3260,21 @@ frame or dialog containing it, or {\tt NULL}. +\membersection{::wxLaunchDefaultBrowser}\label{wxlaunchdefaultbrowser} + +\func{bool}{wxLaunchDefaultBrowser}{\param{const wxString\& }{url}, \param{int }{flags = $0$}} + +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. + +\wxheading{Include files} + + + + \membersection{::wxLoadUserResource}\label{wxloaduserresource} \func{wxString}{wxLoadUserResource}{\param{const wxString\& }{resourceName}, \param{const wxString\& }{resourceType=``TEXT"}} @@ -3044,24 +3346,81 @@ See also \helpref{wxGetDisplayName}{wxgetdisplayname}. \membersection{::wxStripMenuCodes}\label{wxstripmenucodes} -\func{wxString}{wxStripMenuCodes}{\param{const wxString\& }{in}} +\func{wxString}{wxStripMenuCodes}{\param{const wxString\& }{str}, \param{int }{flags = wxStrip\_All}} -\func{void}{wxStripMenuCodes}{\param{char *}{in}, \param{char *}{out}} - -{\bf NB:} This function is obsolete, please use -\helpref{wxMenuItem::GetLabelFromText}{wxmenuitemgetlabelfromtext} instead. +Strips any menu codes from \arg{str} and returns the result. -Strips any menu codes from {\it in} and places the result -in {\it out} (or returns the new string, in the first form). +By default, the functions strips both the mnemonics character (\texttt{'\&'}) +which is used to indicate a keyboard shortkey, and the accelerators, which are +used only in the menu items and are separated from the main text by the +\texttt{$\backslash$t} (TAB) character. By using \arg{flags} of +\texttt{wxStrip\_Mnemonics} or \texttt{wxStrip\_Accel} to strip only the former +or the latter part, respectively. -Menu codes include \& (mark the next character with an underline -as a keyboard shortkey in Windows and Motif) and $\backslash$t (tab in Windows). +Notice that in most cases +\helpref{wxMenuItem::GetLabelFromText}{wxmenuitemgetlabelfromtext} or +\helpref{wxControl::GetLabelText}{wxcontrolgetlabeltext} can be used instead. \wxheading{Include files} +\membersection{wxSTRINGIZE}\label{wxstringize} + +\func{}{wxSTRINGIZE}{\param{}{x}} + +Returns the string representation of the given symbol which can be either a +literal or a macro (hence the advantage of using this macro instead of the +standard preprocessor \texttt{\#} operator which doesn't work with macros). + +Notice that this macro always produces a \texttt{char} string, use +\helpref{wxSTRINGIZE\_T}{wxstringizet} to build a wide string Unicode build. + +\wxheading{See also} + +\helpref{wxCONCAT}{wxconcat} + + +\membersection{wxSTRINGIZE\_T}\label{wxstringizet} + +\func{}{wxSTRINGIZE\_T}{\param{}{x}} + +Returns the string representation of the given symbol as either an ASCII or +Unicode string, depending on the current build. This is the Unicode-friendly +equivalent of \helpref{wxSTRINGIZE}{wxstringize}. + + +\membersection{wxSUPPRESS\_GCC\_PRIVATE\_DTOR\_WARNING}\label{wxsuppressgccprivatedtorwarning} + +\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}} @@ -3086,7 +3445,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 @@ -3129,6 +3488,15 @@ See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfig +\membersection{\_\_WXFUNCTION\_\_}\label{wxfunction} + +\func{}{\_\_WXFUNCTION\_\_}{\void} + +This macro expands to the name of the current function if the compiler supports +any of \texttt{\_\_FUNCTION\_\_}, \texttt{\_\_func\_\_} or equivalent variables +or macros or to \NULL if none of them is available. + + \section{Byte order macros}\label{byteordermacros} @@ -3285,8 +3653,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: @@ -3512,7 +3883,7 @@ Example: This macro is equivalent to {\tt wxDynamicCast(this, classname)} but the latter provokes spurious compilation warnings from some compilers (because it -tests whether {\tt this} pointer is non {\tt NULL} which is always true), so +tests whether {\tt this} pointer is non-{\tt NULL} which is always true), so this macro should be used to avoid them. \wxheading{See also} @@ -3576,8 +3947,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} @@ -4095,7 +4478,7 @@ compilation error messages if the condition they check fail. \membersection{::wxOnAssert}\label{wxonassert} -\func{void}{wxOnAssert}{\param{const char *}{fileName}, \param{int}{ lineNumber}, \param{const char *}{cond}, \param{const char *}{msg = NULL}} +\func{void}{wxOnAssert}{\param{const char *}{fileName}, \param{int}{ lineNumber}, \param{const char *}{func}, \param{const char *}{cond}, \param{const char *}{msg = NULL}} This function is called whenever one of debugging macros fails (i.e. condition is false in an assertion). It is only defined in the debug mode, in release @@ -4104,7 +4487,7 @@ builds the \helpref{wxCHECK}{wxcheck} failures don't result in anything. To override the default behaviour in the debug builds which is to show the user a dialog asking whether he wants to abort the program, continue or continue ignoring any subsequent assert failures, you may override -\helpref{wxApp::OnAssert}{wxapponassert} which is called by this function if +\helpref{wxApp::OnAssertFailure}{wxapponassertfailure} which is called by this function if the global application object exists. @@ -4234,7 +4617,7 @@ This check is done even in release mode. Checks that the condition is true, returns with the given return value if not (FAILs in debug mode). This check is done even in release mode. -This macro may be only used in non void functions, see also +This macro may be only used in non-void functions, see also \helpref{wxCHECK\_RET}{wxcheckret}. @@ -4331,7 +4714,7 @@ Returns the current value of the environment variable {\it var} in {\it value}. {\it value} may be {\tt NULL} if you just want to know if the variable exists and are not interested in its value. -Returns {\tt true} if the variable exists, {\tt false} otherwise. +Returns \true if the variable exists, \false otherwise. \membersection{wxSetEnv}\label{wxsetenv} @@ -4341,7 +4724,7 @@ Returns {\tt true} if the variable exists, {\tt false} otherwise. Sets the value of the environment variable {\it var} (adding it if necessary) to {\it value}. -Returns {\tt true} on success. +Returns \true on success. \membersection{wxUnsetEnv}\label{wxunsetenv} @@ -4352,5 +4735,4 @@ Removes the variable {\it var} from the environment. \helpref{wxGetEnv}{wxgetenv} will return {\tt NULL} after the call to this function. -Returns {\tt true} on success. - +Returns \true on success.