X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50567b69d60faa5a3575a077bb4f98530813c80d..3f93aa54a900d873977d8bdfcc9cededaaa0bee8:/docs/latex/wx/function.tex diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index e35b960e45..49affc0f53 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -11,7 +11,7 @@ The following constants are defined in wxWindows: \begin{itemize}\itemsep=0pt \item {\tt wxMAJOR\_VERSION} is the major version of wxWindows \item {\tt wxMINOR\_VERSION} is the minor version of wxWindows -\item {\tt wxRELASE\_NUMBER} is the release number +\item {\tt wxRELEASE\_NUMBER} is the release number \end{itemize} For example, the values or these constants for wxWindows 2.1.15 are 2, 1 and @@ -177,6 +177,27 @@ Returns the next file that matches the path passed to \helpref{wxFindFirstFile}{ See \helpref{wxFindFirstFile}{wxfindfirstfile} for an example. +\membersection{::wxGetDiskSpace}\label{wxgetdiskspace} + +\func{bool}{wxGetDiskSpace}{\param{const wxString\& }{path}, \param{wxLongLong }{*total = NULL}, \param{wxLongLong }{*free = NULL}} + +This function returns the total number of bytes and number of free bytes on +the disk containing the directory {\it path} (it should exist). Both +{\it total} and {\it free} parameters may be {\tt NULL} if the corresponding +information is not needed. + +\wxheading{Returns} + +{\tt TRUE} on success, {\tt FALSE} if an error occured (for example, the +directory doesn't exist). + +\wxheading{Portability} + +This function is implemented for Win16 (only for drives less than 2Gb), Win32, +Mac OS and generic Unix provided the system has {\tt statfs()} function. + +This function first appeared in wxWindows 2.3.2. + \membersection{::wxGetOSDirectory}\label{wxgetosdirectory} \func{wxString}{wxGetOSDirectory}{\void} @@ -576,6 +597,32 @@ is remembered between the 2 program runs.} +\membersection{::wxDirSelector}\label{wxdirselector} + +\func{wxString}{wxDirSelector}{\param{const wxString\& }{message = wxDirSelectorPromptStr},\\ + \param{const wxString\& }{default\_path = ""},\\ + \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition},\\ + \param{wxWindow *}{parent = NULL}} + +Pops up a directory selector dialog. The arguments have the same meaning as +those of wxDirDialog::wxDirDialog(). The message is displayed at the top, +and the default\_path, if specified, is set as the initial selection. + +The application must check for an empty return value (if the user pressed +Cancel). For example: + +\begin{verbatim} +const wxString& dir = wxDirSelector("Choose a folder"); +if ( !dir.empty() ) +{ + ... +} +\end{verbatim} + +\wxheading{Include files} + + + \membersection{::wxFileSelector}\label{wxfileselector} \func{wxString}{wxFileSelector}{\param{const wxString\& }{message}, \param{const wxString\& }{default\_path = ""},\\ @@ -1651,7 +1698,7 @@ Gets operating system version information. \begin{twocollist}\itemsep=0pt \twocolitemruled{Platform}{Return types} -\twocolitem{Macintosh}{Return value is wxMACINTOSH.} +\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.} \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.} @@ -1753,6 +1800,54 @@ normal way which usually just means that the application will be terminated. Calling wxHandleFatalExceptions() with {\it doIt} equal to FALSE will restore this default behaviour. +\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} + +\wxheading{Include files} + + + +\membersection{::wxInitialize}\label{wxinitialize} + +\func{bool}{wxInitialize}{\void} + +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 wxWindows functions. + +If the function returns {\tt FALSE} the initialization could not be performed, +in this case the library cannot be used and +\helpref{wxUninitialize}{wxuninitialize} shouldn't be called neither. + +This function may be called several times but +\helpref{wxUninitialize}{wxuninitialize} must be called for each successful +call to this function. + +\wxheading{Include files} + + + +\membersection{::wxIsBusy}\label{wxisbusy} + +\func{bool}{wxIsBusy}{\void} + +Returns TRUE if between two \helpref{wxBeginBusyCursor}{wxbeginbusycursor} and\rtfsp +\helpref{wxEndBusyCursor}{wxendbusycursor} calls. + +See also \helpref{wxBusyCursor}{wxbusycursor}. + +\wxheading{Include files} + + + \membersection{::wxKill}\label{wxkill} \func{int}{wxKill}{\param{long}{ pid}, \param{int}{ sig = wxSIGTERM}, \param{wxKillError }{*rc = NULL}} @@ -1783,7 +1878,7 @@ enum wxSignal \end{verbatim} {\tt wxSIGNONE}, {\tt wxSIGKILL} and {\tt wxSIGTERM} have the same meaning -under both Unix and Windows but all the other signals are equivalent to +under both Unix and Windows but all the other signals are equivalent to {\tt wxSIGTERM} under Windows. Returns 0 on success, -1 on failure. If {\it rc} parameter is not NULL, it will @@ -1804,31 +1899,7 @@ enum wxKillError \helpref{wxProcess::Kill}{wxprocesskill},\rtfsp \helpref{wxProcess::Exists}{wxprocessexists},\rtfsp -\helpref{Exec sample}{sampleexex} - -\wxheading{Include files} - - - -\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} - -Returns TRUE if between two \helpref{wxBeginBusyCursor}{wxbeginbusycursor} and\rtfsp -\helpref{wxEndBusyCursor}{wxendbusycursor} calls. - -See also \helpref{wxBusyCursor}{wxbusycursor}. +\helpref{Exec sample}{sampleexec} \wxheading{Include files} @@ -2040,6 +2111,17 @@ In release mode this function does nothing. +\membersection{::wxUninitialize}\label{wxuninitialize} + +\func{void}{wxUninitialize}{\void} + +This function is for use in console (wxBase) programs only. It must be called +once for each previous successful call to \helpref{wxInitialize}{wxinitialize}. + +\wxheading{Include files} + + + \membersection{::wxUsleep}\label{wxusleep} \func{void}{wxUsleep}{\param{unsigned long}{ milliseconds}} @@ -2087,22 +2169,10 @@ See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfig \func{bool}{wxYield}{\void} -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 on systems with -cooperative multitasking, such as Windows 3.1 other processes will not respond. +Calls \helpref{wxApp::Yield}{wxappyield}. -Caution should be exercised, however, since yielding may allow the -user to perform actions which are not compatible with the current task. -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 wish to flush the log -messages immediately (otherwise it will be done during the next idle loop -iteration), call \helpref{wxLog::FlushActive}{wxlogflushactive}. +This function is kept only for backwards compatibility, please use the +wxApp method instead in any new code. \wxheading{Include files} @@ -2402,7 +2472,7 @@ avoid using {\tt \#ifdef}s when creating bitmaps. \membersection{wxConstCast}\label{wxconstcast} -\func{}{wxConstCast}{ptr, classname} +\func{classname *}{wxConstCast}{ptr, classname} This macro expands into {\tt const\_cast(ptr)} if the compiler supports {\it const\_cast} or into an old, C-style cast, otherwise. @@ -2431,14 +2501,15 @@ In non-debug mode, this is defined as the normal new operator. \membersection{wxDynamicCast}\label{wxdynamiccast} -\func{}{wxDynamicCast}{ptr, classname} +\func{classname *}{wxDynamicCast}{ptr, classname} This macro returns the pointer {\it ptr} cast to the type {\it classname *} if -the pointer is of this type (the check is done during the run-time) or NULL -otherwise. Usage of this macro is preferred over obsoleted wxObject::IsKindOf() -function. +the pointer is of this type (the check is done during the run-time) or +{\tt NULL} otherwise. Usage of this macro is preferred over obsoleted +wxObject::IsKindOf() function. -The {\it ptr} argument may be NULL, in which case NULL will be returned. +The {\it ptr} argument may be {\tt NULL}, in which case {\tt NULL} will be +returned. Example: @@ -2458,9 +2529,23 @@ Example: \wxheading{See also} \helpref{RTTI overview}{runtimeclassoverview}\\ +\helpref{wxDynamicCastThis}{wxdynamiccastthis}\\ \helpref{wxConstCast}{wxconstcast}\\ \helpref{wxStatiicCast}{wxstaticcast} +\membersection{wxDynamicCastThis}\label{wxdynamiccastthis} + +\func{classname *}{wxDynamicCastThis}{classname} + +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 +this macro should be used to avoid them. + +\wxheading{See also} + +\helpref{wxDynamicCast}{wxdynamiccast} + \membersection{wxICON}\label{wxiconmacro} \func{}{wxICON}{iconName} @@ -2480,7 +2565,7 @@ avoid using {\tt \#ifdef}s when creating icons. \membersection{wxStaticCast}\label{wxstaticcast} -\func{}{wxStaticCast}{ptr, classname} +\func{classname *}{wxStaticCast}{ptr, classname} This macro checks that the cast is valid in debug mode (an assert failure will result if {\tt wxDynamicCast(ptr, classname) == NULL}) and then returns the