]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/function.tex
reimplemented wxFileModificationTime() for CE without using wxDateTime (it also shoul...
[wxWidgets.git] / docs / latex / wx / function.tex
CommitLineData
a660d684
KB
1\chapter{Functions}\label{functions}
2\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}%
3\setfooter{\thepage}{}{}{}{}{\thepage}
4
fc2171bd 5The functions and macros defined in wxWidgets are described here: you can
b0fc8832
VZ
6either look up a function using the alphabetical listing of them or find it in
7the corresponding topic.
8
569ef72a 9\section{Alphabetical functions and macros list}\label{functionsalphabetically}
b0fc8832
VZ
10
11\helpref{CLASSINFO}{classinfo}\\
8f5d9104 12\helpref{copystring}{copystring}\\
b0fc8832
VZ
13\helpref{DECLARE\_ABSTRACT\_CLASS}{declareabstractclass}\\
14\helpref{DECLARE\_APP}{declareapp}\\
15\helpref{DECLARE\_CLASS}{declareclass}\\
16\helpref{DECLARE\_DYNAMIC\_CLASS}{declaredynamicclass}\\
17\helpref{IMPLEMENT\_ABSTRACT\_CLASS2}{implementabstractclass2}\\
18\helpref{IMPLEMENT\_ABSTRACT\_CLASS}{implementabstractclass}\\
19\helpref{IMPLEMENT\_APP}{implementapp}\\
20\helpref{IMPLEMENT\_CLASS2}{implementclass2}\\
21\helpref{IMPLEMENT\_CLASS}{implementclass}\\
22\helpref{IMPLEMENT\_DYNAMIC\_CLASS2}{implementdynamicclass2}\\
23\helpref{IMPLEMENT\_DYNAMIC\_CLASS}{implementdynamicclass}\\
3c595496 24\helpref{wxCONCAT}{wxconcat}\\
b0fc8832
VZ
25\helpref{WXDEBUG\_NEW}{debugnew}\\
26\helpref{WXTRACELEVEL}{tracelevel}\\
27\helpref{WXTRACE}{trace}\\
8f5d9104 28\helpref{wxASSERT\_MIN\_BITSIZE}{wxassertminbitsize}\\
b0fc8832
VZ
29\helpref{wxASSERT\_MSG}{wxassertmsg}\\
30\helpref{wxASSERT}{wxassert}\\
31\helpref{wxBITMAP}{wxbitmapmacro}\\
32\helpref{wxBeginBusyCursor}{wxbeginbusycursor}\\
33\helpref{wxBell}{wxbell}\\
8482e4bd 34\helpref{wxCHANGE\_UMASK}{wxchangeumask}\\
a30c309a 35\helpref{wxCHECK}{wxcheck}\\
b0fc8832
VZ
36\helpref{wxCHECK2\_MSG}{wxcheck2msg}\\
37\helpref{wxCHECK2}{wxcheck2}\\
a30c309a 38\helpref{wxCHECK\_GCC\_VERSION}{wxcheckgccversion}\\
b0fc8832
VZ
39\helpref{wxCHECK\_MSG}{wxcheckmsg}\\
40\helpref{wxCHECK\_RET}{wxcheckret}\\
41\helpref{wxCHECK\_VERSION}{wxcheckversion}\\
eeade4cc 42\helpref{wxCHECK\_VERSION\_FULL}{wxcheckversionfull}\\
a30c309a 43\helpref{wxCHECK\_W32API\_VERSION}{wxcheckw32apiversion}\\
b0fc8832 44\helpref{wxClientDisplayRect}{wxclientdisplayrect}\\
f4fcc291 45\helpref{wxClipboardOpen}{functionwxclipboardopen}\\
b0fc8832
VZ
46\helpref{wxCloseClipboard}{wxcloseclipboard}\\
47\helpref{wxColourDisplay}{wxcolourdisplay}\\
8f5d9104 48\helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}\\
5b8643ea 49\helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2}\\
b0fc8832
VZ
50\helpref{wxConcatFiles}{wxconcatfiles}\\
51\helpref{wxConstCast}{wxconstcast}\\
52\helpref{wxCopyFile}{wxcopyfile}\\
53\helpref{wxCreateDynamicObject}{wxcreatedynamicobject}\\
54\helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider}\\
789bdf9b 55\helpref{wxCRIT\_SECT\_DECLARE}{wxcritsectdeclare}\\
db882c54 56\helpref{wxCRIT\_SECT\_DECLARE\_MEMBER}{wxcritsectdeclaremember}\\
789bdf9b
VZ
57\helpref{wxCRIT\_SECT\_LOCKER}{wxcritsectlocker}\\
58\helpref{wxCRITICAL\_SECTION}{wxcriticalsectionmacro}\\ % wxcs already taken!
b0fc8832
VZ
59\helpref{wxDDECleanUp}{wxddecleanup}\\
60\helpref{wxDDEInitialize}{wxddeinitialize}\\
61\helpref{wxDROP\_ICON}{wxdropicon}\\
62\helpref{wxDebugMsg}{wxdebugmsg}\\
b0fc8832
VZ
63\helpref{wxDirSelector}{wxdirselector}\\
64\helpref{wxDisplayDepth}{wxdisplaydepth}\\
b0fc8832 65\helpref{wxDisplaySize}{wxdisplaysize}\\
f4fcc291 66\helpref{wxDisplaySizeMM}{wxdisplaysizemm}\\
b0fc8832
VZ
67\helpref{wxDos2UnixFilename}{wxdos2unixfilename}\\
68\helpref{wxDynamicCastThis}{wxdynamiccastthis}\\
69\helpref{wxDynamicCast}{wxdynamiccast}\\
4104ed92 70\helpref{wxDYNLIB\_FUNCTION}{wxdynlibfunction}\\
b0fc8832
VZ
71\helpref{wxEmptyClipboard}{wxemptyclipboard}\\
72\helpref{wxEnableTopLevelWindows}{wxenabletoplevelwindows}\\
73\helpref{wxEndBusyCursor}{wxendbusycursor}\\
789bdf9b 74\helpref{wxENTER\_CRIT\_SECT}{wxentercritsect}\\
b0fc8832
VZ
75\helpref{wxEntry}{wxentry}\\
76\helpref{wxEnumClipboardFormats}{wxenumclipboardformats}\\
77\helpref{wxError}{wxerror}\\
78\helpref{wxExecute}{wxexecute}\\
79\helpref{wxExit}{wxexit}\\
986ecc86 80\helpref{wxEXPLICIT}{wxexplicit}\\
b0fc8832
VZ
81\helpref{wxFAIL\_MSG}{wxfailmsg}\\
82\helpref{wxFAIL}{wxfail}\\
83\helpref{wxFatalError}{wxfatalerror}\\
f4fcc291 84\helpref{wxFileExists}{functionwxfileexists}\\
b0fc8832
VZ
85\helpref{wxFileModificationTime}{wxfilemodificationtime}\\
86\helpref{wxFileNameFromPath}{wxfilenamefrompath}\\
87\helpref{wxFileSelector}{wxfileselector}\\
88\helpref{wxFindFirstFile}{wxfindfirstfile}\\
89\helpref{wxFindMenuItemId}{wxfindmenuitemid}\\
90\helpref{wxFindNextFile}{wxfindnextfile}\\
91\helpref{wxFindWindowAtPointer}{wxfindwindowatpointer}\\
92\helpref{wxFindWindowAtPoint}{wxfindwindowatpoint}\\
93\helpref{wxFindWindowByLabel}{wxfindwindowbylabel}\\
94\helpref{wxFindWindowByName}{wxfindwindowbyname}\\
a02afd14 95\helpref{wxFinite}{wxfinite}\\
b0fc8832 96\helpref{wxGetActiveWindow}{wxgetactivewindow}\\
749caeeb 97\helpref{wxGetApp}{wxgetapp}\\
8ea92b4d 98\helpref{wxGetBatteryState}{wxgetbatterystate}\\
b0fc8832
VZ
99\helpref{wxGetClipboardData}{wxgetclipboarddata}\\
100\helpref{wxGetClipboardFormatName}{wxgetclipboardformatname}\\
101\helpref{wxGetColourFromUser}{wxgetcolourfromuser}\\
102\helpref{wxGetCwd}{wxgetcwd}\\
103\helpref{wxGetDiskSpace}{wxgetdiskspace}\\
104\helpref{wxGetDisplayName}{wxgetdisplayname}\\
f70c0443 105\helpref{wxGetDisplaySize}{wxdisplaysize}\\
3980000c 106\helpref{wxGetDisplaySizeMM}{wxdisplaysizemm}\\
b0fc8832
VZ
107\helpref{wxGetElapsedTime}{wxgetelapsedtime}\\
108\helpref{wxGetEmailAddress}{wxgetemailaddress}\\
109\helpref{wxGetEnv}{wxgetenv}\\
0912690b 110\helpref{wxGetFileKind}{wxgetfilekind}\\
d741c583 111\helpref{wxGetFontFromUser}{wxgetfontfromuser}\\
b0fc8832
VZ
112\helpref{wxGetFreeMemory}{wxgetfreememory}\\
113\helpref{wxGetFullHostName}{wxgetfullhostname}\\
114\helpref{wxGetHomeDir}{wxgethomedir}\\
115\helpref{wxGetHostName}{wxgethostname}\\
f52d9e92 116\helpref{wxGetKeyState}{wxgetkeystate}\\
b0fc8832
VZ
117\helpref{wxGetLocalTimeMillis}{wxgetlocaltimemillis}\\
118\helpref{wxGetLocalTime}{wxgetlocaltime}\\
119\helpref{wxGetMousePosition}{wxgetmouseposition}\\
120\helpref{wxGetMultipleChoices}{wxgetmultiplechoices}\\
121\helpref{wxGetMultipleChoice}{wxgetmultiplechoice}\\
122\helpref{wxGetNumberFromUser}{wxgetnumberfromuser}\\
123\helpref{wxGetOSDirectory}{wxgetosdirectory}\\
124\helpref{wxGetOsDescription}{wxgetosdescription}\\
125\helpref{wxGetOsVersion}{wxgetosversion}\\
126\helpref{wxGetPasswordFromUser}{wxgetpasswordfromuser}\\
8ea92b4d 127\helpref{wxGetPowerType}{wxgetpowertype}\\
b0fc8832
VZ
128\helpref{wxGetPrinterCommand}{wxgetprintercommand}\\
129\helpref{wxGetPrinterFile}{wxgetprinterfile}\\
130\helpref{wxGetPrinterMode}{wxgetprintermode}\\
131\helpref{wxGetPrinterOptions}{wxgetprinteroptions}\\
132\helpref{wxGetPrinterOrientation}{wxgetprinterorientation}\\
133\helpref{wxGetPrinterPreviewCommand}{wxgetprinterpreviewcommand}\\
134\helpref{wxGetPrinterScaling}{wxgetprinterscaling}\\
135\helpref{wxGetPrinterTranslation}{wxgetprintertranslation}\\
c1cb4153 136\helpref{wxGetProcessId}{wxgetprocessid}\\
b0fc8832
VZ
137\helpref{wxGetResource}{wxgetresource}\\
138\helpref{wxGetSingleChoiceData}{wxgetsinglechoicedata}\\
139\helpref{wxGetSingleChoiceIndex}{wxgetsinglechoiceindex}\\
140\helpref{wxGetSingleChoice}{wxgetsinglechoice}\\
141\helpref{wxGetTempFileName}{wxgettempfilename}\\
142\helpref{wxGetTextFromUser}{wxgettextfromuser}\\
33b494d6 143\helpref{wxGetTopLevelParent}{wxgettoplevelparent}\\
b0fc8832
VZ
144\helpref{wxGetTranslation}{wxgettranslation}\\
145\helpref{wxGetUTCTime}{wxgetutctime}\\
146\helpref{wxGetUserHome}{wxgetuserhome}\\
147\helpref{wxGetUserId}{wxgetuserid}\\
148\helpref{wxGetUserName}{wxgetusername}\\
149\helpref{wxGetWorkingDirectory}{wxgetworkingdirectory}\\
150\helpref{wxGetenv}{wxgetenvmacro}\\
151\helpref{wxHandleFatalExceptions}{wxhandlefatalexceptions}\\
152\helpref{wxICON}{wxiconmacro}\\
153\helpref{wxINTXX\_SWAP\_ALWAYS}{intswapalways}\\
154\helpref{wxINTXX\_SWAP\_ON\_BE}{intswaponbe}\\
155\helpref{wxINTXX\_SWAP\_ON\_LE}{intswaponle}\\
156\helpref{wxInitAllImageHandlers}{wxinitallimagehandlers}\\
157\helpref{wxInitialize}{wxinitialize}\\
158\helpref{wxIsAbsolutePath}{wxisabsolutepath}\\
159\helpref{wxIsBusy}{wxisbusy}\\
160\helpref{wxIsClipboardFormatAvailable}{wxisclipboardformatavailable}\\
a434b43f 161\helpref{wxIsDebuggerRunning}{wxisdebuggerrunning}\\
b0fc8832 162\helpref{wxIsEmpty}{wxisempty}\\
789bdf9b 163\helpref{wxIsMainThread}{wxismainthread}\\
a02afd14 164\helpref{wxIsNaN}{wxisnan}\\
b0fc8832
VZ
165\helpref{wxIsWild}{wxiswild}\\
166\helpref{wxKill}{wxkill}\\
498a1eeb 167\helpref{wxLaunchDefaultBrowser}{wxlaunchdefaultbrowser}\\
789bdf9b 168\helpref{wxLEAVE\_CRIT\_SECT}{wxleavecritsect}\\
b0fc8832
VZ
169\helpref{wxLoadUserResource}{wxloaduserresource}\\
170\helpref{wxLogDebug}{wxlogdebug}\\
171\helpref{wxLogError}{wxlogerror}\\
172\helpref{wxLogFatalError}{wxlogfatalerror}\\
173\helpref{wxLogMessage}{wxlogmessage}\\
174\helpref{wxLogStatus}{wxlogstatus}\\
175\helpref{wxLogSysError}{wxlogsyserror}\\
176\helpref{wxLogTrace}{wxlogtrace}\\
177\helpref{wxLogVerbose}{wxlogverbose}\\
178\helpref{wxLogWarning}{wxlogwarning}\\
2b5f62a0
VZ
179\helpref{wxLL}{wxll}\\
180\helpref{wxLongLongFmtSpec}{wxlonglongfmtspec}\\
b0fc8832
VZ
181\helpref{wxMakeMetafilePlaceable}{wxmakemetafileplaceable}\\
182\helpref{wxMatchWild}{wxmatchwild}\\
183\helpref{wxMessageBox}{wxmessagebox}\\
08873d36
VZ
184\helpref{wxMilliSleep}{wxmillisleep}\\
185\helpref{wxMicroSleep}{wxmicrosleep}\\
b0fc8832
VZ
186\helpref{wxMkdir}{wxmkdir}\\
187\helpref{wxMutexGuiEnter}{wxmutexguienter}\\
188\helpref{wxMutexGuiLeave}{wxmutexguileave}\\
189\helpref{wxNewId}{wxnewid}\\
190\helpref{wxNow}{wxnow}\\
191\helpref{wxOnAssert}{wxonassert}\\
1a64b24d
VZ
192\helpref{wxON\_BLOCK\_EXIT}{wxonblockexit}\\
193\helpref{wxON\_BLOCK\_EXIT\_OBJ}{wxonblockexitobj}\\
b0fc8832 194\helpref{wxOpenClipboard}{wxopenclipboard}\\
daf32463 195\helpref{wxParseCommonDialogsFilter}{wxparsecommondialogsfilter}\\
da865fdd 196\helpref{wxDirExists}{functionwxdirexists}\\
b0fc8832
VZ
197\helpref{wxPathOnly}{wxpathonly}\\
198\helpref{wxPostDelete}{wxpostdelete}\\
199\helpref{wxPostEvent}{wxpostevent}\\
200\helpref{wxRegisterClipboardFormat}{wxregisterclipboardformat}\\
201\helpref{wxRegisterId}{wxregisterid}\\
202\helpref{wxRemoveFile}{wxremovefile}\\
203\helpref{wxRenameFile}{wxrenamefile}\\
b0fc8832 204\helpref{wxRmdir}{wxrmdir}\\
c11d62a6 205\helpref{wxSafeShowMessage}{wxsafeshowmessage}\\
b0fc8832
VZ
206\helpref{wxSafeYield}{wxsafeyield}\\
207\helpref{wxSetClipboardData}{wxsetclipboarddata}\\
208\helpref{wxSetCursor}{wxsetcursor}\\
209\helpref{wxSetDisplayName}{wxsetdisplayname}\\
210\helpref{wxSetEnv}{wxsetenv}\\
211\helpref{wxSetPrinterCommand}{wxsetprintercommand}\\
212\helpref{wxSetPrinterFile}{wxsetprinterfile}\\
213\helpref{wxSetPrinterMode}{wxsetprintermode}\\
214\helpref{wxSetPrinterOptions}{wxsetprinteroptions}\\
215\helpref{wxSetPrinterOrientation}{wxsetprinterorientation}\\
216\helpref{wxSetPrinterPreviewCommand}{wxsetprinterpreviewcommand}\\
217\helpref{wxSetPrinterScaling}{wxsetprinterscaling}\\
218\helpref{wxSetPrinterTranslation}{wxsetprintertranslation}\\
219\helpref{wxSetWorkingDirectory}{wxsetworkingdirectory}\\
220\helpref{wxShell}{wxshell}\\
221\helpref{wxShowTip}{wxshowtip}\\
f6ba47d9 222\helpref{wxShutdown}{wxshutdown}\\
b0fc8832
VZ
223\helpref{wxSleep}{wxsleep}\\
224\helpref{wxSnprintf}{wxsnprintf}\\
225\helpref{wxSplitPath}{wxsplitfunction}\\
226\helpref{wxStartTimer}{wxstarttimer}\\
227\helpref{wxStaticCast}{wxstaticcast}\\
2f930c85 228\helpref{wxStrcmp}{wxstrcmp}\\
b0fc8832
VZ
229\helpref{wxStricmp}{wxstricmp}\\
230\helpref{wxStringEq}{wxstringeq}\\
231\helpref{wxStringMatch}{wxstringmatch}\\
232\helpref{wxStripMenuCodes}{wxstripmenucodes}\\
233\helpref{wxStrlen}{wxstrlen}\\
234\helpref{wxSysErrorCode}{wxsyserrorcode}\\
235\helpref{wxSysErrorMsg}{wxsyserrormsg}\\
0bbe4e29 236\helpref{wxT}{wxt}\\
b0fc8832
VZ
237\helpref{wxTraceLevel}{wxtracelevel}\\
238\helpref{wxTrace}{wxtrace}\\
239\helpref{wxTransferFileToStream}{wxtransferfiletostream}\\
240\helpref{wxTransferStreamToFile}{wxtransferstreamtofile}\\
241\helpref{wxTrap}{wxtrap}\\
84ed77ef 242\helpref{wxULL}{wxull}\\
b0fc8832
VZ
243\helpref{wxUninitialize}{wxuninitialize}\\
244\helpref{wxUnix2DosFilename}{wxunix2dosfilename}\\
245\helpref{wxUnsetEnv}{wxunsetenv}\\
246\helpref{wxUsleep}{wxusleep}\\
d85cfb37 247\helpref{wxVaCopy}{wxvacopy}\\
b0fc8832
VZ
248\helpref{wxVsnprintf}{wxvsnprintf}\\
249\helpref{wxWakeUpIdle}{wxwakeupidle}\\
250\helpref{wxWriteResource}{wxwriteresource}\\
0bbe4e29 251\helpref{wxYield}{wxyield}\\
f29fe169 252\helpref{wx\_const\_cast}{wxconstcastraw}\\
8c8d66c5 253\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}\\
f29fe169 254\helpref{wx\_static\_cast}{wxstaticcastraw}\\
0bbe4e29 255\helpref{\_}{underscore}\\
15d06954 256\helpref{wxPLURAL}{wxplural}\\
0bbe4e29 257\helpref{\_T}{underscoret}
f6bcfd97 258
84ed77ef
VZ
259
260
f6bcfd97
BP
261\section{Version macros}\label{versionfunctions}
262
fc2171bd 263The following constants are defined in wxWidgets:
f6bcfd97
BP
264
265\begin{itemize}\itemsep=0pt
fc2171bd
JS
266\item {\tt wxMAJOR\_VERSION} is the major version of wxWidgets
267\item {\tt wxMINOR\_VERSION} is the minor version of wxWidgets
ff8fda36 268\item {\tt wxRELEASE\_NUMBER} is the release number
eeade4cc
VZ
269\item {\tt wxSUBRELEASE\_NUMBER} is the subrelease number which is $0$ for all
270official releases
f6bcfd97
BP
271\end{itemize}
272
fc2171bd 273For example, the values or these constants for wxWidgets 2.1.15 are 2, 1 and
f6bcfd97
BP
27415.
275
276Additionally, {\tt wxVERSION\_STRING} is a user-readable string containing
fc2171bd 277the full wxWidgets version and {\tt wxVERSION\_NUMBER} is a combination of the
f6bcfd97 278three version numbers above: for 2.1.15, it is 2115 and it is 2200 for
fc2171bd 279wxWidgets 2.2.
f6bcfd97 280
eeade4cc
VZ
281The subrelease number is only used for the sources in between official releases
282and so normally is not useful.
283
f6bcfd97
BP
284\wxheading{Include files}
285
286<wx/version.h> or <wx/defs.h>
287
84ed77ef 288
eeade4cc
VZ
289\membersection{wxCHECK\_GCC\_VERSION}\label{wxcheckgccversion}
290
291\func{bool}{wxCHECK\_GCC\_VERSION}{\param{}{major, minor, release}}
292
293Returns $1$ if the compiler being used to compile the code is GNU C++
294compiler (g++) version major.minor.release or greater. Otherwise, and also if
295the compiler is not GNU C++ at all, returns $0$.
296
297
f6bcfd97
BP
298\membersection{wxCHECK\_VERSION}\label{wxcheckversion}
299
300\func{bool}{wxCHECK\_VERSION}{\param{}{major, minor, release}}
301
fc2171bd 302This is a macro which evaluates to true if the current wxWidgets version is at
f6bcfd97
BP
303least major.minor.release.
304
fc2171bd 305For example, to test if the program is compiled with wxWidgets 2.2 or higher,
f6bcfd97
BP
306the following can be done:
307
308\begin{verbatim}
309 wxString s;
310#if wxCHECK_VERSION(2, 2, 0)
311 if ( s.StartsWith("foo") )
312#else // replacement code for old version
313 if ( strncmp(s, "foo", 3) == 0 )
314#endif
315 {
316 ...
317 }
318\end{verbatim}
a660d684 319
84ed77ef 320
eeade4cc 321\membersection{wxCHECK\_VERSION\_FULL}\label{wxcheckversionfull}
a30c309a 322
eeade4cc 323\func{bool}{wxCHECK\_VERSION\_FULL}{\param{}{major, minor, release, subrel}}
a30c309a 324
9d8aca48 325Same as \helpref{wxCHECK\_VERSION}{wxcheckversion} but also checks that
eeade4cc 326\texttt{wxSUBRELEASE\_NUMBER} is at least \arg{subrel}.
a30c309a 327
84ed77ef 328
a30c309a
VZ
329\membersection{wxCHECK\_W32API\_VERSION}\label{wxcheckw32apiversion}
330
331\func{bool}{wxCHECK\_GCC\_VERSION}{\param{}{major, minor, release}}
332
333Returns $1$ if the version of w32api headers used is major.minor.release or
334greater. Otherwise, and also if we are not compiling with mingw32/cygwin under
335Win32 at all, returns $0$.
336
84ed77ef
VZ
337
338
b0fc8832 339\section{Application initialization and termination}\label{appinifunctions}
c88275cb 340
b0fc8832
VZ
341The functions in this section are used on application startup/shutdown and also
342to control the behaviour of the main event loop of the GUI programs.
c88275cb 343
84ed77ef 344
b0fc8832 345\membersection{::wxEntry}\label{wxentry}
c88275cb 346
fc2171bd
JS
347This initializes wxWidgets in a platform-dependent way. Use this if you
348are not using the default wxWidgets entry code (e.g. main or WinMain). For example,
349you can initialize wxWidgets from an Microsoft Foundation Classes application using
b0fc8832 350this function.
c88275cb 351
b0fc8832 352\func{void}{wxEntry}{\param{HANDLE}{ hInstance}, \param{HANDLE}{ hPrevInstance},
cc81d32f 353 \param{const wxString\& }{commandLine}, \param{int}{ cmdShow}, \param{bool}{ enterLoop = true}}
c88275cb 354
fc2171bd
JS
355wxWidgets initialization under Windows (non-DLL). If {\it enterLoop} is false, the
356function will return immediately after calling wxApp::OnInit. Otherwise, the wxWidgets
b0fc8832 357message loop will be entered.
c88275cb 358
b0fc8832
VZ
359\func{void}{wxEntry}{\param{HANDLE}{ hInstance}, \param{HANDLE}{ hPrevInstance},
360 \param{WORD}{ wDataSegment}, \param{WORD}{ wHeapSize}, \param{const wxString\& }{ commandLine}}
c88275cb 361
fc2171bd 362wxWidgets initialization under Windows (for applications constructed as a DLL).
c88275cb 363
b0fc8832 364\func{int}{wxEntry}{\param{int}{ argc}, \param{const wxString\& *}{argv}}
c88275cb 365
fc2171bd 366wxWidgets initialization under Unix.
c88275cb 367
b0fc8832 368\wxheading{Remarks}
c88275cb 369
fc2171bd
JS
370To clean up wxWidgets, call wxApp::OnExit followed by the static function
371wxApp::CleanUp. For example, if exiting from an MFC application that also uses wxWidgets:
4aff28fc 372
b0fc8832
VZ
373\begin{verbatim}
374int CTheApp::ExitInstance()
375{
376 // OnExit isn't called by CleanUp so must be called explicitly.
377 wxTheApp->OnExit();
378 wxApp::CleanUp();
379
380 return CWinApp::ExitInstance();
c88275cb
RR
381}
382\end{verbatim}
383
b0fc8832 384\wxheading{Include files}
c88275cb 385
b0fc8832 386<wx/app.h>
c88275cb 387
749caeeb 388
84ed77ef 389
749caeeb
VZ
390\membersection{::wxGetApp}\label{wxgetapp}
391
392\func{wxAppDerivedClass\&}{wxGetApp}{\void}
393
fc2171bd 394This function doesn't exist in wxWidgets but it is created by using
749caeeb
VZ
395the \helpref{IMPLEMENT\_APP}{implementapp} macro. Thus, before using it
396anywhere but in the same module where this macro is used, you must make it
397available using \helpref{DECLARE\_APP}{declareapp}.
398
399The advantage of using this function compared to directly using the global
400wxTheApp pointer is that the latter is of type {\tt wxApp *} and so wouldn't
401allow you to access the functions specific to your application class but not
402present in wxApp while wxGetApp() returns the object of the right type.
403
84ed77ef 404
b0fc8832 405\membersection{::wxHandleFatalExceptions}\label{wxhandlefatalexceptions}
c88275cb 406
cc81d32f 407\func{bool}{wxHandleFatalExceptions}{\param{bool}{ doIt = true}}
c88275cb 408
cc81d32f 409If {\it doIt} is true, the fatal exceptions (also known as general protection
b0fc8832
VZ
410faults under Windows or segmentation violations in the Unix world) will be
411caught and passed to \helpref{wxApp::OnFatalException}{wxapponfatalexception}.
412By default, i.e. before this function is called, they will be handled in the
413normal way which usually just means that the application will be terminated.
cc81d32f 414Calling wxHandleFatalExceptions() with {\it doIt} equal to false will restore
b0fc8832 415this default behaviour.
c88275cb 416
84ed77ef 417
b0fc8832 418\membersection{::wxInitAllImageHandlers}\label{wxinitallimagehandlers}
a660d684 419
b0fc8832 420\func{void}{wxInitAllImageHandlers}{\void}
954b8ae6 421
b0fc8832
VZ
422Initializes all available image handlers. For a list of available handlers,
423see \helpref{wxImage}{wximage}.
954b8ae6
JS
424
425\wxheading{See also}
426
b0fc8832 427\helpref{wxImage}{wximage}, \helpref{wxImageHandler}{wximagehandler}
a660d684 428
b0fc8832 429\wxheading{Include files}
a660d684 430
b0fc8832 431<wx/image.h>
a660d684 432
84ed77ef 433
b0fc8832 434\membersection{::wxInitialize}\label{wxinitialize}
a660d684 435
b0fc8832 436\func{bool}{wxInitialize}{\void}
a660d684 437
b0fc8832
VZ
438This function is used in wxBase only and only if you don't create
439\helpref{wxApp}{wxapp} object at all. In this case you must call it from your
fc2171bd 440{\tt main()} function before calling any other wxWidgets functions.
a660d684 441
43e8916f 442If the function returns \false the initialization could not be performed,
b0fc8832
VZ
443in this case the library cannot be used and
444\helpref{wxUninitialize}{wxuninitialize} shouldn't be called neither.
a660d684 445
b0fc8832
VZ
446This function may be called several times but
447\helpref{wxUninitialize}{wxuninitialize} must be called for each successful
448call to this function.
a660d684 449
b0fc8832 450\wxheading{Include files}
a47ce4a7 451
b0fc8832 452<wx/app.h>
a47ce4a7 453
84ed77ef 454
b0fc8832 455\membersection{::wxSafeYield}\label{wxsafeyield}
a47ce4a7 456
b829bf55 457\func{bool}{wxSafeYield}{\param{wxWindow*}{ win = NULL}, \param{bool}{
cc81d32f 458 onlyIfNeeded = false}}
a660d684 459
b0fc8832
VZ
460This function is similar to wxYield, except that it disables the user input to
461all program windows before calling wxYield and re-enables it again
462afterwards. If {\it win} is not NULL, this window will remain enabled,
463allowing the implementation of some limited user interaction.
a660d684 464
b0fc8832 465Returns the result of the call to \helpref{::wxYield}{wxyield}.
532372a3 466
b0fc8832 467\wxheading{Include files}
a660d684 468
b0fc8832 469<wx/utils.h>
a660d684 470
84ed77ef 471
b0fc8832 472\membersection{::wxUninitialize}\label{wxuninitialize}
a660d684 473
b0fc8832 474\func{void}{wxUninitialize}{\void}
a660d684 475
b0fc8832
VZ
476This function is for use in console (wxBase) programs only. It must be called
477once for each previous successful call to \helpref{wxInitialize}{wxinitialize}.
a660d684 478
b0fc8832 479\wxheading{Include files}
a660d684 480
b0fc8832 481<wx/app.h>
a660d684 482
84ed77ef 483
b0fc8832 484\membersection{::wxYield}\label{wxyield}
a660d684 485
b0fc8832 486\func{bool}{wxYield}{\void}
a660d684 487
b0fc8832 488Calls \helpref{wxApp::Yield}{wxappyield}.
a660d684 489
b829bf55 490This function is kept only for backwards compatibility. Please use
2b5f62a0 491the \helpref{wxApp::Yield}{wxappyield} method instead in any new code.
a660d684 492
b0fc8832 493\wxheading{Include files}
5ab656cd 494
b0fc8832 495<wx/app.h> or <wx/utils.h>
eadd7bd2 496
84ed77ef 497
b0fc8832 498\membersection{::wxWakeUpIdle}\label{wxwakeupidle}
eadd7bd2 499
b0fc8832 500\func{void}{wxWakeUpIdle}{\void}
eadd7bd2 501
b0fc8832
VZ
502This functions wakes up the (internal and platform dependent) idle system, i.e. it
503will force the system to send an idle event even if the system currently {\it is}
504 idle and thus would not send any idle event until after some other event would get
505sent. This is also useful for sending events between two threads and is used by
506the corresponding functions \helpref{::wxPostEvent}{wxpostevent} and
507\helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent}.
eadd7bd2 508
b0fc8832 509\wxheading{Include files}
eadd7bd2 510
a434b43f 511<wx/event.h>
eadd7bd2 512
84ed77ef
VZ
513
514
b0fc8832 515\section{Process control functions}\label{processfunctions}
eadd7bd2 516
b0fc8832
VZ
517The functions in this section are used to launch or terminate the other
518processes.
eadd7bd2 519
84ed77ef 520
b0fc8832 521\membersection{::wxExecute}\label{wxexecute}
631f1bfe 522
fbf456aa 523\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{int }{sync = wxEXEC\_ASYNC}, \param{wxProcess *}{callback = NULL}}
631f1bfe 524
d6c6a323
MB
525\perlnote{In wxPerl this function is called \texttt{Wx::ExecuteCommand}}
526
fbf456aa 527\func{long}{wxExecute}{\param{char **}{argv}, \param{int }{flags = wxEXEC\_ASYNC}, \param{wxProcess *}{callback = NULL}}
631f1bfe 528
d6c6a323
MB
529\perlnote{In wxPerl this function is called \texttt{Wx::ExecuteArgs}}
530
4d172154 531\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{wxArrayString\& }{output}, \param{int }{flags = 0}}
a660d684 532
d6c6a323
MB
533\perlnote{In wxPerl this function is called \texttt{Wx::ExecuteStdout} and it
534only takes the {\tt command} argument,
9722642d
MB
535and returns a 2-element list {\tt ( status, output )}, where {\tt output} is
536an array reference.}
537
4d172154 538\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{wxArrayString\& }{output}, \param{wxArrayString\& }{errors}, \param{int }{flags = 0}}
a660d684 539
9d8aca48 540\perlnote{In wxPerl this function is called \texttt{Wx::ExecuteStdoutStderr}
d6c6a323 541and it only takes the {\tt command} argument,
9722642d
MB
542and returns a 3-element list {\tt ( status, output, errors )}, where
543{\tt output} and {\tt errors} are array references.}
544
b0fc8832 545Executes another program in Unix or Windows.
a660d684 546
b0fc8832 547The first form takes a command string, such as {\tt "emacs file.txt"}.
a660d684 548
b0fc8832
VZ
549The second form takes an array of values: a command, any number of
550arguments, terminated by NULL.
a660d684 551
b0fc8832
VZ
552The semantics of the third and fourth versions is different from the first two
553and is described in more details below.
a660d684 554
fbf456aa
VZ
555If {\it flags} parameter contains {\tt wxEXEC\_ASYNC} flag (the default), flow
556of control immediately returns. If it contains {\tt wxEXEC\_SYNC}, the current
557application waits until the other program has terminated.
a660d684 558
b0fc8832
VZ
559In the case of synchronous execution, the return value is the exit code of
560the process (which terminates by the moment the function returns) and will be
561$-1$ if the process couldn't be started and typically 0 if the process
562terminated successfully. Also, while waiting for the process to
f38f6899
VZ
563terminate, wxExecute will call \helpref{wxYield}{wxyield}. Because of this, by
564default this function disables all application windows to avoid unexpected
565reentrancies which could result from the users interaction with the program
566while the child process is running. If you are sure that it is safe to not
567disable the program windows, you may pass \texttt{wxEXEC\_NODISABLE} flag to
568prevent this automatic disabling from happening.
a660d684 569
b0fc8832
VZ
570For asynchronous execution, however, the return value is the process id and
571zero value indicates that the command could not be executed. As an added
2edb0bde 572complication, the return value of $-1$ in this case indicates that we didn't
b0fc8832
VZ
573launch a new process, but connected to the running one (this can only happen in
574case of using DDE under Windows for command execution). In particular, in this,
575and only this, case the calling code will not get the notification about
576process termination.
a660d684 577
b829bf55 578If callback isn't NULL and if execution is asynchronous,
b0fc8832 579\helpref{wxProcess::OnTerminate}{wxprocessonterminate} will be called when
fbf456aa 580the process finishes. Specifying this parameter also allows you to redirect the
b829bf55 581standard input and/or output of the process being launched by calling
fbf456aa
VZ
582\helpref{Redirect}{wxprocessredirect}. If the child process IO is redirected,
583under Windows the process window is not shown by default (this avoids having to
584flush an unnecessary console for the processes which don't create any windows
585anyhow) but a {\tt wxEXEC\_NOHIDE} flag can be used to prevent this from
586happening, i.e. with this flag the child process window will be shown normally.
a660d684 587
e1082c9f
VZ
588Under Unix the flag {\tt wxEXEC\_MAKE\_GROUP\_LEADER} may be used to ensure
589that the new process is a group leader (this will create a new session if
e0f6b731
JS
590needed). Calling \helpref{wxKill}{wxkill} passing wxKILL\_CHILDREN will
591will kill this process as well as all of its children (except those which have
592started their own session).
e1082c9f 593
b0fc8832 594Finally, you may use the third overloaded version of this function to execute
9d8aca48 595a process (always synchronously, the contents of \arg{flags} is or'd with
12f6571f 596\texttt{wxEXEC\_SYNC}) and capture its output in the array \arg{output}. The
4d172154
VZ
597fourth version adds the possibility to additionally capture the messages from
598standard error output in the \arg{errors} array.
a660d684 599
647b8e37
VZ
600{\bf NB:} Currently wxExecute() can only be used from the main thread, calling
601this function from another thread will result in an assert failure in debug
602build and won't work.
603
604\wxheading{See also}
605
606\helpref{wxShell}{wxshell}, \helpref{wxProcess}{wxprocess}, \helpref{Exec sample}{sampleexec}.
a660d684 607
fbf456aa
VZ
608\wxheading{Parameters}
609
610\docparam{command}{The command to execute and any parameters to pass to it as a
611single string.}
612
613\docparam{argv}{The command to execute should be the first element of this
614array, any additional ones are the command parameters and the array must be
615terminated with a NULL pointer.}
616
d2c2afc9 617\docparam{flags}{Combination of bit masks {\tt wxEXEC\_ASYNC},\rtfsp
fbf456aa
VZ
618{\tt wxEXEC\_SYNC} and {\tt wxEXEC\_NOHIDE}}
619
620\docparam{callback}{An optional pointer to \helpref{wxProcess}{wxprocess}}
621
b0fc8832 622\wxheading{Include files}
a660d684 623
b0fc8832 624<wx/utils.h>
a660d684 625
84ed77ef 626
b0fc8832 627\membersection{::wxExit}\label{wxexit}
a660d684 628
b0fc8832 629\func{void}{wxExit}{\void}
7af89395 630
b0fc8832
VZ
631Exits application after calling \helpref{wxApp::OnExit}{wxapponexit}.
632Should only be used in an emergency: normally the top-level frame
633should be deleted (after deleting all other frames) to terminate the
f4fcc291 634application. See \helpref{wxCloseEvent}{wxcloseevent} and \helpref{wxApp}{wxapp}.
7af89395 635
b0fc8832 636\wxheading{Include files}
7af89395 637
b0fc8832 638<wx/app.h>
a660d684 639
84ed77ef 640
b0fc8832 641\membersection{::wxKill}\label{wxkill}
a660d684 642
e0f6b731 643\func{int}{wxKill}{\param{long}{ pid}, \param{int}{ sig = wxSIGTERM}, \param{wxKillError }{*rc = NULL}, \param{int }{flags = 0}}
7af89395 644
b0fc8832 645Equivalent to the Unix kill function: send the given signal {\it sig} to the
2edb0bde 646process with PID {\it pid}. The valid signal values are
a660d684 647
b0fc8832
VZ
648\begin{verbatim}
649enum wxSignal
650{
651 wxSIGNONE = 0, // verify if the process exists under Unix
652 wxSIGHUP,
653 wxSIGINT,
654 wxSIGQUIT,
655 wxSIGILL,
656 wxSIGTRAP,
657 wxSIGABRT,
658 wxSIGEMT,
659 wxSIGFPE,
660 wxSIGKILL, // forcefully kill, dangerous!
661 wxSIGBUS,
662 wxSIGSEGV,
663 wxSIGSYS,
664 wxSIGPIPE,
665 wxSIGALRM,
666 wxSIGTERM // terminate the process gently
667};
668\end{verbatim}
a660d684 669
b0fc8832 670{\tt wxSIGNONE}, {\tt wxSIGKILL} and {\tt wxSIGTERM} have the same meaning
9d8aca48 671under both Unix and Windows but all the other signals are equivalent to
b0fc8832 672{\tt wxSIGTERM} under Windows.
a660d684 673
b0fc8832
VZ
674Returns 0 on success, -1 on failure. If {\it rc} parameter is not NULL, it will
675be filled with an element of {\tt wxKillError} enum:
a660d684 676
b0fc8832
VZ
677\begin{verbatim}
678enum wxKillError
679{
680 wxKILL_OK, // no error
681 wxKILL_BAD_SIGNAL, // no such signal
682 wxKILL_ACCESS_DENIED, // permission denied
683 wxKILL_NO_PROCESS, // no such process
684 wxKILL_ERROR // another, unspecified error
685};
686\end{verbatim}
c0ab6adf 687
e0f6b731
JS
688The {\it flags} parameter can be wxKILL\_NOCHILDREN (the default),
689or wxKILL\_CHILDREN, in which case the child processes of this
690process will be killed too. Note that under Unix, for wxKILL\_CHILDREN
bb772a8e 691to work you should have created the process by passing wxEXEC\_MAKE\_GROUP\_LEADER
e0f6b731
JS
692to wxExecute.
693
b0fc8832 694\wxheading{See also}
ade35f11 695
b0fc8832
VZ
696\helpref{wxProcess::Kill}{wxprocesskill},\rtfsp
697\helpref{wxProcess::Exists}{wxprocessexists},\rtfsp
698\helpref{Exec sample}{sampleexec}
a660d684 699
b0fc8832 700\wxheading{Include files}
a660d684 701
b0fc8832 702<wx/utils.h>
a660d684 703
84ed77ef 704
c1cb4153
VZ
705\membersection{::wxGetProcessId}\label{wxgetprocessid}
706
707\func{unsigned long}{wxGetProcessId}{\void}
708
709Returns the number uniquely identifying the current process in the system.
710
711If an error occurs, $0$ is returned.
712
713\wxheading{Include files}
714
715<wx/utils.h>
716
84ed77ef 717
b0fc8832 718\membersection{::wxShell}\label{wxshell}
a660d684 719
b0fc8832 720\func{bool}{wxShell}{\param{const wxString\& }{command = NULL}}
a660d684 721
b0fc8832
VZ
722Executes a command in an interactive shell window. If no command is
723specified, then just the shell is spawned.
a660d684 724
b0fc8832 725See also \helpref{wxExecute}{wxexecute}, \helpref{Exec sample}{sampleexec}.
a660d684 726
b0fc8832 727\wxheading{Include files}
a660d684 728
b0fc8832 729<wx/utils.h>
a660d684 730
84ed77ef 731
f6ba47d9
VZ
732\membersection{::wxShutdown}\label{wxshutdown}
733
734\func{bool}{wxShutdown}{\param{wxShutdownFlags}{flags}}
735
b829bf55 736This function shuts down or reboots the computer depending on the value of the
f6ba47d9
VZ
737{\it flags}. Please notice that doing this requires the corresponding access
738rights (superuser under Unix, {\tt SE\_SHUTDOWN} privelege under Windows NT)
739and that this function is only implemented under Unix and Win32.
740
741\wxheading{Parameters}
742
743\docparam{flags}{Either {\tt wxSHUTDOWN\_POWEROFF} or {\tt wxSHUTDOWN\_REBOOT}}
744
745\wxheading{Returns}
746
43e8916f 747\true on success, \false if an error occurred.
f6ba47d9
VZ
748
749\wxheading{Include files}
750
751<wx/utils.h>
a660d684 752
84ed77ef
VZ
753
754
b0fc8832 755\section{Thread functions}\label{threadfunctions}
1a33c3ba 756
789bdf9b
VZ
757The functions and macros here mainly exist to make it writing the code which
758may be compiled in multi thread build ({\tt wxUSE\_THREADS} $= 1$) as well as
759in single thread configuration ({\tt wxUSE\_THREADS} $= 0$).
760
761For example, a static variable must be protected against simultaneous access by
762multiple threads in the former configuration but in the latter the extra
763overhead of using the critical section is not needed. To solve this problem,
764the \helpref{wxCRITICAL\_SECTION}{wxcriticalsectionmacro} macro may be used
765to create and use the critical section only when needed.
766
b0fc8832 767\wxheading{Include files}
a660d684 768
b0fc8832 769<wx/thread.h>
a660d684 770
b0fc8832 771\wxheading{See also}
a660d684 772
b0fc8832 773\helpref{wxThread}{wxthread}, \helpref{wxMutex}{wxmutex}, \helpref{Multithreading overview}{wxthreadoverview}
a660d684 774
789bdf9b 775
84ed77ef 776
789bdf9b
VZ
777\membersection{wxCRIT\_SECT\_DECLARE}\label{wxcritsectdeclare}
778
779\func{}{wxCRIT\_SECT\_DECLARE}{\param{}{cs}}
780
9d8aca48 781This macro declares a (static) critical section object named {\it cs} if
789bdf9b
VZ
782{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.
783
784
84ed77ef 785
db882c54
VZ
786\membersection{wxCRIT\_SECT\_DECLARE\_MEMBER}\label{wxcritsectdeclaremember}
787
788\func{}{wxCRIT\_SECT\_DECLARE}{\param{}{cs}}
789
9d8aca48 790This macro declares a critical section object named {\it cs} if
db882c54 791{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$. As it doesn't
9d8aca48 792include the {\tt static} keyword (unlike
db882c54
VZ
793\helpref{wxCRIT\_SECT\_DECLARE}{wxcritsectdeclare}), it can be used to declare
794a class or struct member which explains its name.
795
796
84ed77ef 797
789bdf9b
VZ
798\membersection{wxCRIT\_SECT\_LOCKER}\label{wxcritsectlocker}
799
800\func{}{wxCRIT\_SECT\_LOCKER}{\param{}{name}, \param{}{cs}}
801
9d8aca48
WS
802This macro creates a \helpref{critical section lock}{wxcriticalsectionlocker}
803object named {\it name} and associated with the critical section {\it cs} if
789bdf9b
VZ
804{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.
805
806
84ed77ef 807
789bdf9b
VZ
808\membersection{wxCRITICAL\_SECTION}\label{wxcriticalsectionmacro}
809
810\func{}{wxCRITICAL\_SECTION}{\param{}{name}}
811
9d8aca48 812This macro combines \helpref{wxCRIT\_SECT\_DECLARE}{wxcritsectdeclare} and
789bdf9b
VZ
813\helpref{wxCRIT\_SECT\_LOCKER}{wxcritsectlocker}: it creates a static critical
814section object and also the lock object associated with it. Because of this, it
815can be only used inside a function, not at global scope. For example:
816
817\begin{verbatim}
818int IncCount()
819{
820 static int s_counter = 0;
821
822 wxCRITICAL_SECTION(counter);
823
824 return ++s_counter;
825}
826\end{verbatim}
827
828(note that we suppose that the function is called the first time from the main
829thread so that the critical section object is initialized correctly by the time
9d8aca48 830other threads start calling it, if this is not the case this approach can
789bdf9b
VZ
831{\bf not} be used and the critical section must be made a global instead).
832
833
84ed77ef 834
789bdf9b
VZ
835\membersection{wxENTER\_CRIT\_SECT}\label{wxentercritsect}
836
837\func{}{wxENTER\_CRIT\_SECT}{\param{wxCriticalSection\& }{cs}}
838
9d8aca48 839This macro is equivalent to \helpref{cs.Enter()}{wxcriticalsectionenter} if
789bdf9b
VZ
840{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.
841
842
84ed77ef 843
789bdf9b
VZ
844\membersection{::wxIsMainThread}\label{wxismainthread}
845
846\func{bool}{wxIsMainThread}{\void}
847
43e8916f 848Returns \true if this thread is the main one. Always returns \true if
789bdf9b
VZ
849{\tt wxUSE\_THREADS} is $0$.
850
851
84ed77ef 852
789bdf9b
VZ
853\membersection{wxLEAVE\_CRIT\_SECT}\label{wxleavecritsect}
854
855\func{}{wxLEAVE\_CRIT\_SECT}{\param{wxCriticalSection\& }{cs}}
856
9d8aca48 857This macro is equivalent to \helpref{cs.Leave()}{wxcriticalsectionleave} if
789bdf9b
VZ
858{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.
859
860
84ed77ef 861
b0fc8832 862\membersection{::wxMutexGuiEnter}\label{wxmutexguienter}
a660d684 863
b0fc8832 864\func{void}{wxMutexGuiEnter}{\void}
a660d684 865
b0fc8832
VZ
866This function must be called when any thread other than the main GUI thread
867wants to get access to the GUI library. This function will block the execution
868of the calling thread until the main thread (or any other thread holding the
869main GUI lock) leaves the GUI library and no other thread will enter the GUI
870library until the calling thread calls \helpref{::wxMutexGuiLeave()}{wxmutexguileave}.
a660d684 871
b0fc8832 872Typically, these functions are used like this:
a660d684 873
b0fc8832
VZ
874\begin{verbatim}
875void MyThread::Foo(void)
876{
877 // before doing any GUI calls we must ensure that this thread is the only
878 // one doing it!
a660d684 879
b0fc8832 880 wxMutexGuiEnter();
a660d684 881
b0fc8832
VZ
882 // Call GUI here:
883 my_window->DrawSomething();
a660d684 884
b0fc8832
VZ
885 wxMutexGuiLeave();
886}
887\end{verbatim}
a660d684 888
b0fc8832
VZ
889Note that under GTK, no creation of top-level windows is allowed in any
890thread but the main one.
a660d684 891
b0fc8832
VZ
892This function is only defined on platforms which support preemptive
893threads.
d37fd2fa 894
84ed77ef 895
b0fc8832 896\membersection{::wxMutexGuiLeave}\label{wxmutexguileave}
d37fd2fa 897
b0fc8832 898\func{void}{wxMutexGuiLeave}{\void}
d37fd2fa 899
b0fc8832 900See \helpref{::wxMutexGuiEnter()}{wxmutexguienter}.
d37fd2fa 901
b0fc8832
VZ
902This function is only defined on platforms which support preemptive
903threads.
d37fd2fa 904
84ed77ef
VZ
905
906
b0fc8832 907\section{File functions}\label{filefunctions}
d37fd2fa 908
b0fc8832 909\wxheading{Include files}
ed93168b 910
8482e4bd 911<wx/filefn.h>
ed93168b 912
b0fc8832 913\wxheading{See also}
ed93168b 914
b0fc8832
VZ
915\helpref{wxPathList}{wxpathlist}\\
916\helpref{wxDir}{wxdir}\\
917\helpref{wxFile}{wxfile}\\
918\helpref{wxFileName}{wxfilename}
ed93168b 919
84ed77ef 920
b0fc8832 921\membersection{::wxDos2UnixFilename}\label{wxdos2unixfilename}
ed93168b 922
b0fc8832 923\func{void}{wxDos2UnixFilename}{\param{wxChar *}{s}}
d524e22d 924
b0fc8832
VZ
925Converts a DOS to a Unix filename by replacing backslashes with forward
926slashes.
d524e22d 927
84ed77ef 928
f4fcc291 929\membersection{::wxFileExists}\label{functionwxfileexists}
d524e22d 930
b0fc8832 931\func{bool}{wxFileExists}{\param{const wxString\& }{filename}}
d524e22d 932
c3558af5 933Returns true if the file exists and is a plain file.
e12be2f7 934
84ed77ef 935
b0fc8832 936\membersection{::wxFileModificationTime}\label{wxfilemodificationtime}
d524e22d 937
b0fc8832 938\func{time\_t}{wxFileModificationTime}{\param{const wxString\& }{filename}}
d524e22d 939
b0fc8832 940Returns time of last modification of given file.
d524e22d 941
84ed77ef 942
b0fc8832 943\membersection{::wxFileNameFromPath}\label{wxfilenamefrompath}
d524e22d 944
b0fc8832 945\func{wxString}{wxFileNameFromPath}{\param{const wxString\& }{path}}
d524e22d 946
7ac13b21 947\func{char *}{wxFileNameFromPath}{\param{char *}{path}}
d524e22d 948
b829bf55 949{\bf NB:} This function is obsolete, please use
2bd25c5a
VZ
950\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
951
b0fc8832
VZ
952Returns the filename for a full path. The second form returns a pointer to
953temporary storage that should not be deallocated.
d524e22d 954
84ed77ef 955
b0fc8832 956\membersection{::wxFindFirstFile}\label{wxfindfirstfile}
d524e22d 957
7ac13b21 958\func{wxString}{wxFindFirstFile}{\param{const char *}{spec}, \param{int}{ flags = 0}}
d524e22d 959
b0fc8832
VZ
960This function does directory searching; returns the first file
961that matches the path {\it spec}, or the empty string. Use \helpref{wxFindNextFile}{wxfindnextfile} to
962get the next matching file. Neither will report the current directory "." or the
963parent directory "..".
d524e22d 964
f70c0443
WS
965\wxheading{Warning}
966
43e8916f 967As 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.
f70c0443 968
b0fc8832 969{\it spec} may contain wildcards.
85ec2f26 970
b0fc8832 971{\it flags} may be wxDIR for restricting the query to directories, wxFILE for files or zero for either.
d524e22d 972
b0fc8832 973For example:
d524e22d 974
b0fc8832
VZ
975\begin{verbatim}
976 wxString f = wxFindFirstFile("/home/project/*.*");
8ea92b4d 977 while ( !f.empty() )
b0fc8832
VZ
978 {
979 ...
980 f = wxFindNextFile();
981 }
982\end{verbatim}
d524e22d 983
84ed77ef 984
b0fc8832 985\membersection{::wxFindNextFile}\label{wxfindnextfile}
d524e22d 986
b0fc8832 987\func{wxString}{wxFindNextFile}{\void}
e12be2f7 988
b0fc8832 989Returns the next file that matches the path passed to \helpref{wxFindFirstFile}{wxfindfirstfile}.
d524e22d 990
b0fc8832 991See \helpref{wxFindFirstFile}{wxfindfirstfile} for an example.
d524e22d 992
84ed77ef 993
b0fc8832 994\membersection{::wxGetDiskSpace}\label{wxgetdiskspace}
d524e22d 995
b0fc8832 996\func{bool}{wxGetDiskSpace}{\param{const wxString\& }{path}, \param{wxLongLong }{*total = NULL}, \param{wxLongLong }{*free = NULL}}
d524e22d 997
b0fc8832
VZ
998This function returns the total number of bytes and number of free bytes on
999the disk containing the directory {\it path} (it should exist). Both
1000{\it total} and {\it free} parameters may be {\tt NULL} if the corresponding
1001information is not needed.
d524e22d 1002
b0fc8832 1003\wxheading{Returns}
85ec2f26 1004
43e8916f 1005\true on success, \false if an error occurred (for example, the
b0fc8832 1006directory doesn't exist).
d524e22d 1007
b0fc8832 1008\wxheading{Portability}
d524e22d 1009
3a5bcc4d 1010This function is implemented for Win32,
b0fc8832 1011Mac OS and generic Unix provided the system has {\tt statfs()} function.
d524e22d 1012
fc2171bd 1013This function first appeared in wxWidgets 2.3.2.
d524e22d 1014
84ed77ef 1015
0912690b 1016\membersection{::wxGetFileKind}\label{wxgetfilekind}
3c70014d 1017
0912690b 1018\func{wxFileKind}{wxGetFileKind}{\param{int }{fd}}
3c70014d 1019
0912690b 1020\func{wxFileKind}{wxGetFileKind}{\param{FILE *}{fp}}
3c70014d
MW
1021
1022Returns the type of an open file. Possible return values are:
1023
1024\begin{verbatim}
0912690b 1025enum wxFileKind
3c70014d 1026{
0912690b
MW
1027 wxFILE_KIND_UNKNOWN,
1028 wxFILE_KIND_DISK, // a file supporting seeking to arbitrary offsets
1029 wxFILE_KIND_TERMINAL, // a tty
1030 wxFILE_KIND_PIPE // a pipe
3c70014d
MW
1031};
1032
1033\end{verbatim}
1034
1035\wxheading{Include files}
1036
1037<wx/filefn.h>
1038
1039
b0fc8832 1040\membersection{::wxGetOSDirectory}\label{wxgetosdirectory}
e12be2f7 1041
b0fc8832 1042\func{wxString}{wxGetOSDirectory}{\void}
d524e22d 1043
b0fc8832 1044Returns the Windows directory under Windows; on other platforms returns the empty string.
d524e22d 1045
84ed77ef 1046
b0fc8832 1047\membersection{::wxIsAbsolutePath}\label{wxisabsolutepath}
d524e22d 1048
b0fc8832 1049\func{bool}{wxIsAbsolutePath}{\param{const wxString\& }{filename}}
d524e22d 1050
cc81d32f 1051Returns true if the argument is an absolute filename, i.e. with a slash
b0fc8832 1052or drive name at the beginning.
85ec2f26 1053
84ed77ef 1054
da865fdd 1055\membersection{::wxDirExists}\label{functionwxdirexists}
27b2dd53 1056
da865fdd 1057\func{bool}{wxDirExists}{\param{const wxString\& }{dirname}}
27b2dd53
WS
1058
1059Returns true if the path exists.
1060
1061
b0fc8832 1062\membersection{::wxPathOnly}\label{wxpathonly}
d524e22d 1063
b0fc8832 1064\func{wxString}{wxPathOnly}{\param{const wxString\& }{path}}
d524e22d 1065
b0fc8832 1066Returns the directory part of the filename.
d524e22d 1067
84ed77ef 1068
b0fc8832 1069\membersection{::wxUnix2DosFilename}\label{wxunix2dosfilename}
d524e22d 1070
b0fc8832 1071\func{void}{wxUnix2DosFilename}{\param{const wxString\& }{s}}
e12be2f7 1072
b0fc8832
VZ
1073Converts a Unix to a DOS filename by replacing forward
1074slashes with backslashes.
d524e22d 1075
84ed77ef 1076
8482e4bd
VZ
1077\membersection{wxCHANGE\_UMASK}\label{wxchangeumask}
1078
1079\func{}{wxCHANGE\_UMASK}{\param{int }{mask}}
1080
1081Under Unix this macro changes the current process umask to the given value,
1082unless it is equal to $-1$ in which case nothing is done, and restores it to
1083the original value on scope exit. It works by declaring a variable which sets
1084umask to \arg{mask} in its constructor and restores it in its destructor.
1085
1086Under other platforms this macro expands to nothing.
1087
1088
b0fc8832 1089\membersection{::wxConcatFiles}\label{wxconcatfiles}
d524e22d 1090
b0fc8832
VZ
1091\func{bool}{wxConcatFiles}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2},
1092\param{const wxString\& }{file3}}
d524e22d 1093
b0fc8832 1094Concatenates {\it file1} and {\it file2} to {\it file3}, returning
cc81d32f 1095true if successful.
a660d684 1096
84ed77ef 1097
b0fc8832 1098\membersection{::wxCopyFile}\label{wxcopyfile}
a660d684 1099
cc81d32f 1100\func{bool}{wxCopyFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}, \param{bool }{overwrite = true}}
a660d684 1101
cc81d32f
VS
1102Copies {\it file1} to {\it file2}, returning true if successful. If
1103{\it overwrite} parameter is true (default), the destination file is overwritten
1104if it exists, but if {\it overwrite} is false, the functions fails in this
b0fc8832 1105case.
a660d684 1106
84ed77ef 1107
b0fc8832 1108\membersection{::wxGetCwd}\label{wxgetcwd}
7ae8ee14 1109
b0fc8832 1110\func{wxString}{wxGetCwd}{\void}
7ae8ee14 1111
b0fc8832 1112Returns a string containing the current (or working) directory.
7ae8ee14 1113
84ed77ef 1114
b0fc8832 1115\membersection{::wxGetWorkingDirectory}\label{wxgetworkingdirectory}
7ae8ee14 1116
7ac13b21 1117\func{wxString}{wxGetWorkingDirectory}{\param{char *}{buf=NULL}, \param{int }{sz=1000}}
7ae8ee14 1118
2bd25c5a 1119{\bf NB:} This function is obsolete: use \helpref{wxGetCwd}{wxgetcwd} instead.
7ae8ee14 1120
b0fc8832 1121Copies the current working directory into the buffer if supplied, or
cc232c93
VZ
1122copies the working directory into new storage (which you {\emph must} delete
1123yourself) if the buffer is NULL.
7ae8ee14 1124
b0fc8832 1125{\it sz} is the size of the buffer if supplied.
a660d684 1126
84ed77ef 1127
b0fc8832 1128\membersection{::wxGetTempFileName}\label{wxgettempfilename}
a660d684 1129
7ac13b21 1130\func{char *}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{char *}{buf=NULL}}
a660d684 1131
b0fc8832 1132\func{bool}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{wxString\& }{buf}}
7ae8ee14 1133
b0fc8832
VZ
1134%% Makes a temporary filename based on {\it prefix}, opens and closes the file,
1135%% and places the name in {\it buf}. If {\it buf} is NULL, new store
1136%% is allocated for the temporary filename using {\it new}.
1137%%
1138%% Under Windows, the filename will include the drive and name of the
1139%% directory allocated for temporary files (usually the contents of the
1140%% TEMP variable). Under Unix, the {\tt /tmp} directory is used.
1141%%
1142%% It is the application's responsibility to create and delete the file.
a660d684 1143
2bd25c5a 1144{\bf NB:} These functions are obsolete, please use\rtfsp
b0fc8832
VZ
1145\helpref{wxFileName::CreateTempFileName}{wxfilenamecreatetempfilename}\rtfsp
1146instead.
a660d684 1147
84ed77ef 1148
b0fc8832 1149\membersection{::wxIsWild}\label{wxiswild}
a660d684 1150
b0fc8832 1151\func{bool}{wxIsWild}{\param{const wxString\& }{pattern}}
a660d684 1152
cc81d32f 1153Returns true if the pattern contains wildcards. See \helpref{wxMatchWild}{wxmatchwild}.
a660d684 1154
84ed77ef 1155
b0fc8832 1156\membersection{::wxMatchWild}\label{wxmatchwild}
ed93168b 1157
b0fc8832 1158\func{bool}{wxMatchWild}{\param{const wxString\& }{pattern}, \param{const wxString\& }{text}, \param{bool}{ dot\_special}}
ed93168b 1159
d29bf677 1160Returns true if the \arg{pattern}\/ matches the {\it text}\/; if {\it
cc81d32f 1161dot\_special}\/ is true, filenames beginning with a dot are not matched
b0fc8832 1162with wildcard characters. See \helpref{wxIsWild}{wxiswild}.
ed93168b 1163
84ed77ef 1164
b0fc8832 1165\membersection{::wxMkdir}\label{wxmkdir}
ed93168b 1166
b0fc8832 1167\func{bool}{wxMkdir}{\param{const wxString\& }{dir}, \param{int }{perm = 0777}}
ed93168b 1168
d29bf677 1169Makes the directory \arg{dir}, returning true if successful.
a660d684 1170
b0fc8832
VZ
1171{\it perm} is the access mask for the directory for the systems on which it is
1172supported (Unix) and doesn't have effect for the other ones.
378b05f7 1173
84ed77ef 1174
daf32463 1175\membersection{::wxParseCommonDialogsFilter}\label{wxparsecommondialogsfilter}
9e152a55 1176
daf32463 1177\func{int}{wxParseCommonDialogsFilter}{\param{const wxString\& }{wildCard}, \param{wxArrayString\& }{descriptions}, \param{wxArrayString\& }{filters}}
9e152a55 1178
d29bf677 1179Parses the \arg{wildCard}, returning the number of filters.
aaf65941 1180Returns 0 if none or if there's a problem.
9e152a55 1181The arrays will contain an equal number of items found before the error.
daf32463
WS
1182On platforms where native dialogs handle only one filter per entry,
1183entries in arrays are automatically adjusted.
d29bf677 1184\arg{wildCard} is in the form:
9e152a55
WS
1185\begin{verbatim}
1186 "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
1187\end{verbatim}
1188
b0fc8832 1189\membersection{::wxRemoveFile}\label{wxremovefile}
378b05f7 1190
b0fc8832 1191\func{bool}{wxRemoveFile}{\param{const wxString\& }{file}}
378b05f7 1192
d29bf677 1193Removes \arg{file}, returning true if successful.
378b05f7 1194
84ed77ef 1195
b0fc8832 1196\membersection{::wxRenameFile}\label{wxrenamefile}
e12be2f7 1197
b0fc8832 1198\func{bool}{wxRenameFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}}
378b05f7 1199
d29bf677 1200Renames \arg{file1} to \arg{file2}, returning true if successful.
378b05f7 1201
84ed77ef 1202
b0fc8832 1203\membersection{::wxRmdir}\label{wxrmdir}
378b05f7 1204
b0fc8832 1205\func{bool}{wxRmdir}{\param{const wxString\& }{dir}, \param{int}{ flags=0}}
378b05f7 1206
cc81d32f 1207Removes the directory {\it dir}, returning true if successful. Does not work under VMS.
e12be2f7 1208
b0fc8832 1209The {\it flags} parameter is reserved for future use.
378b05f7 1210
84ed77ef 1211
b0fc8832 1212\membersection{::wxSetWorkingDirectory}\label{wxsetworkingdirectory}
a660d684 1213
b0fc8832 1214\func{bool}{wxSetWorkingDirectory}{\param{const wxString\& }{dir}}
a660d684 1215
cc81d32f 1216Sets the current working directory, returning true if the operation succeeded.
b0fc8832 1217Under MS Windows, the current drive is also changed if {\it dir} contains a drive specification.
c50f1fb9 1218
84ed77ef 1219
b0fc8832 1220\membersection{::wxSplitPath}\label{wxsplitfunction}
c50f1fb9 1221
b0fc8832 1222\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}
c50f1fb9 1223
b829bf55 1224{\bf NB:} This function is obsolete, please use
2bd25c5a
VZ
1225\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.
1226
b0fc8832
VZ
1227This function splits a full file name into components: the path (including possible disk/drive
1228specification under Windows), the base name and the extension. Any of the output parameters
1229({\it path}, {\it name} or {\it ext}) may be NULL if you are not interested in the value of
1230a particular component.
c50f1fb9 1231
b0fc8832
VZ
1232wxSplitPath() will correctly handle filenames with both DOS and Unix path separators under
1233Windows, however it will not consider backslashes as path separators under Unix (where backslash
1234is a valid character in a filename).
c50f1fb9 1235
b0fc8832 1236On entry, {\it fullname} should be non-NULL (it may be empty though).
c50f1fb9 1237
b0fc8832
VZ
1238On return, {\it path} contains the file path (without the trailing separator), {\it name}
1239contains the file name and {\it ext} contains the file extension without leading dot. All
1240three of them may be empty if the corresponding component is. The old contents of the
1241strings pointed to by these parameters will be overwritten in any case (if the pointers
1242are not NULL).
c50f1fb9 1243
84ed77ef 1244
b0fc8832 1245\membersection{::wxTransferFileToStream}\label{wxtransferfiletostream}
c50f1fb9 1246
b0fc8832 1247\func{bool}{wxTransferFileToStream}{\param{const wxString\& }{filename}, \param{ostream\& }{stream}}
10eb1f1e 1248
b0fc8832
VZ
1249Copies the given file to {\it stream}. Useful when converting an old application to
1250use streams (within the document/view framework, for example).
10eb1f1e 1251
b0fc8832 1252\wxheading{Include files}
10eb1f1e 1253
b0fc8832 1254<wx/docview.h>
10eb1f1e 1255
84ed77ef 1256
b0fc8832
VZ
1257\membersection{::wxTransferStreamToFile}\label{wxtransferstreamtofile}
1258
1259\func{bool}{wxTransferStreamToFile}{\param{istream\& }{stream} \param{const wxString\& }{filename}}
1260
1261Copies the given stream to the file {\it filename}. Useful when converting an old application to
1262use streams (within the document/view framework, for example).
10eb1f1e
VZ
1263
1264\wxheading{Include files}
1265
b0fc8832 1266<wx/docview.h>
10eb1f1e 1267
84ed77ef
VZ
1268
1269
b0fc8832 1270\section{Network, user and OS functions}\label{networkfunctions}
a660d684 1271
b0fc8832
VZ
1272The functions in this section are used to retrieve information about the
1273current computer and/or user characteristics.
a660d684 1274
84ed77ef 1275
f8665629
WS
1276\membersection{::wxGetEmailAddress}\label{wxgetemailaddress}
1277
1278\func{wxString}{wxGetEmailAddress}{\void}
1279
1280\func{bool}{wxGetEmailAddress}{\param{char * }{buf}, \param{int }{sz}}
1281
1282Copies the user's email address into the supplied buffer, by
1283concatenating the values returned by \helpref{wxGetFullHostName}{wxgetfullhostname}\rtfsp
1284and \helpref{wxGetUserId}{wxgetuserid}.
1285
1286Returns true if successful, false otherwise.
1287
1288\wxheading{Include files}
1289
1290<wx/utils.h>
1291
1292
b0fc8832 1293\membersection{::wxGetFreeMemory}\label{wxgetfreememory}
a660d684 1294
9d8aca48 1295\func{wxMemorySize}{wxGetFreeMemory}{\void}
a660d684 1296
b0fc8832 1297Returns the amount of free memory in bytes under environments which
f8665629 1298support it, and -1 if not supported or failed to perform measurement.
a660d684 1299
b0fc8832 1300\wxheading{Include files}
a660d684 1301
b0fc8832 1302<wx/utils.h>
a660d684 1303
84ed77ef 1304
b0fc8832 1305\membersection{::wxGetFullHostName}\label{wxgetfullhostname}
a660d684 1306
b0fc8832 1307\func{wxString}{wxGetFullHostName}{\void}
954b8ae6 1308
b0fc8832
VZ
1309Returns the FQDN (fully qualified domain host name) or an empty string on
1310error.
954b8ae6 1311
b0fc8832 1312\wxheading{See also}
c49245f8 1313
b0fc8832 1314\helpref{wxGetHostName}{wxgethostname}
4aff28fc 1315
b0fc8832 1316\wxheading{Include files}
4aff28fc 1317
b0fc8832 1318<wx/utils.h>
4aff28fc 1319
84ed77ef 1320
b0fc8832 1321\membersection{::wxGetHomeDir}\label{wxgethomedir}
d6c9c1b7 1322
b0fc8832 1323\func{wxString}{wxGetHomeDir}{\void}
d6c9c1b7 1324
b0fc8832 1325Return the (current) user's home directory.
d6c9c1b7 1326
b0fc8832 1327\wxheading{See also}
d6c9c1b7 1328
b0fc8832 1329\helpref{wxGetUserHome}{wxgetuserhome}
d6c9c1b7
VZ
1330
1331\wxheading{Include files}
1332
b0fc8832 1333<wx/utils.h>
d6c9c1b7 1334
84ed77ef 1335
b0fc8832 1336\membersection{::wxGetHostName}\label{wxgethostname}
f3539882 1337
b0fc8832 1338\func{wxString}{wxGetHostName}{\void}
4aff28fc 1339
b0fc8832 1340\func{bool}{wxGetHostName}{\param{char * }{buf}, \param{int }{sz}}
c49245f8 1341
b0fc8832
VZ
1342Copies the current host machine's name into the supplied buffer. Please note
1343that the returned name is {\it not} fully qualified, i.e. it does not include
1344the domain name.
c49245f8 1345
b0fc8832
VZ
1346Under Windows or NT, this function first looks in the environment
1347variable SYSTEM\_NAME; if this is not found, the entry {\bf HostName}\rtfsp
fc2171bd 1348in the {\bf wxWidgets} section of the WIN.INI file is tried.
c49245f8 1349
b0fc8832 1350The first variant of this function returns the hostname if successful or an
cc81d32f
VS
1351empty string otherwise. The second (deprecated) function returns true
1352if successful, false otherwise.
b0fc8832
VZ
1353
1354\wxheading{See also}
1355
1356\helpref{wxGetFullHostName}{wxgetfullhostname}
c49245f8
VZ
1357
1358\wxheading{Include files}
a294c6d5 1359
b0fc8832 1360<wx/utils.h>
a294c6d5 1361
84ed77ef 1362
b0fc8832 1363\membersection{::wxGetOsDescription}\label{wxgetosdescription}
a660d684 1364
b0fc8832 1365\func{wxString}{wxGetOsDescription}{\void}
a660d684 1366
b0fc8832
VZ
1367Returns the string containing the description of the current platform in a
1368user-readable form. For example, this function may return strings like
1369{\tt Windows NT Version 4.0} or {\tt Linux 2.2.2 i386}.
a660d684 1370
b0fc8832
VZ
1371\wxheading{See also}
1372
1373\helpref{::wxGetOsVersion}{wxgetosversion}
a660d684 1374
954b8ae6
JS
1375\wxheading{Include files}
1376
b0fc8832 1377<wx/utils.h>
954b8ae6 1378
84ed77ef 1379
b0fc8832 1380\membersection{::wxGetOsVersion}\label{wxgetosversion}
a660d684 1381
b0fc8832 1382\func{int}{wxGetOsVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}}
a660d684 1383
b0fc8832 1384Gets operating system version information.
a660d684 1385
b0fc8832
VZ
1386\begin{twocollist}\itemsep=0pt
1387\twocolitemruled{Platform}{Return types}
9d8aca48 1388\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.
3b432890
SC
1389
1390Both {\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}. }
b0fc8832
VZ
1391\twocolitem{GTK}{Return value is wxGTK, For GTK 1.0, {\it major} is 1, {\it minor} is 0. }
1392\twocolitem{Motif}{Return value is wxMOTIF\_X, {\it major} is X version, {\it minor} is X revision.}
1393\twocolitem{OS/2}{Return value is wxOS2\_PM.}
1394\twocolitem{Windows 3.1}{Return value is wxWINDOWS, {\it major} is 3, {\it minor} is 1.}
c75d190a 1395\twocolitem{Windows NT/2000}{Return value is wxWINDOWS\_NT, version is returned in {\it major} and {\it minor}.}
b0fc8832
VZ
1396\twocolitem{Windows 98}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 1 or greater.}
1397\twocolitem{Windows 95}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 0.}
1398\twocolitem{Win32s (Windows 3.1)}{Return value is wxWIN32S, {\it major} is 3, {\it minor} is 1.}
c75d190a
JS
1399\twocolitem{Windows PocketPC}{Return value is wxWINDOWS\_POCKETPC, version is returned in {\it major} and {\it minor}.}
1400\twocolitem{Windows Smartphone}{Return value is wxWINDOWS\_SMARTPHONE, version is returned in {\it major} and {\it minor}.}
1401\twocolitem{Windows CE (non-specific)}{Return value is wxWINDOWS\_CE, version is returned in {\it major} and {\it minor}.}
b0fc8832
VZ
1402\twocolitem{Watcom C++ 386 supervisor mode (Windows 3.1)}{Return value is wxWIN386, {\it major} is 3, {\it minor} is 1.}
1403\end{twocollist}
a660d684 1404
b0fc8832 1405\wxheading{See also}
a660d684 1406
b0fc8832 1407\helpref{::wxGetOsDescription}{wxgetosdescription}
a660d684 1408
b0fc8832
VZ
1409\wxheading{Include files}
1410
1411<wx/utils.h>
1412
84ed77ef 1413
b0fc8832
VZ
1414\membersection{::wxGetUserHome}\label{wxgetuserhome}
1415
1416\func{const wxChar *}{wxGetUserHome}{\param{const wxString\& }{user = ""}}
1417
1418Returns the home directory for the given user. If the username is empty
b829bf55 1419(default value), this function behaves like
b0fc8832 1420\helpref{wxGetHomeDir}{wxgethomedir}.
a660d684 1421
954b8ae6
JS
1422\wxheading{Include files}
1423
b0fc8832 1424<wx/utils.h>
954b8ae6 1425
84ed77ef 1426
f8665629
WS
1427\membersection{::wxGetUserId}\label{wxgetuserid}
1428
1429\func{wxString}{wxGetUserId}{\void}
1430
1431\func{bool}{wxGetUserId}{\param{char * }{buf}, \param{int }{sz}}
1432
1433This function returns the "user id" also known as "login name" under Unix i.e.
1434something like "jsmith". It uniquely identifies the current user (on this system).
1435
1436Under Windows or NT, this function first looks in the environment
1437variables USER and LOGNAME; if neither of these is found, the entry {\bf UserId}\rtfsp
1438in the {\bf wxWidgets} section of the WIN.INI file is tried.
1439
1440The first variant of this function returns the login name if successful or an
1441empty string otherwise. The second (deprecated) function returns true
1442if successful, false otherwise.
1443
1444\wxheading{See also}
1445
1446\helpref{wxGetUserName}{wxgetusername}
1447
1448\wxheading{Include files}
1449
1450<wx/utils.h>
1451
1452
b0fc8832 1453\membersection{::wxGetUserName}\label{wxgetusername}
a660d684 1454
b0fc8832 1455\func{wxString}{wxGetUserName}{\void}
d6c9c1b7 1456
b0fc8832 1457\func{bool}{wxGetUserName}{\param{char * }{buf}, \param{int }{sz}}
d6c9c1b7 1458
b0fc8832 1459This function returns the full user name (something like "Mr. John Smith").
d6c9c1b7 1460
b0fc8832 1461Under Windows or NT, this function looks for the entry {\bf UserName}\rtfsp
fc2171bd 1462in the {\bf wxWidgets} section of the WIN.INI file. If PenWindows
b0fc8832
VZ
1463is running, the entry {\bf Current} in the section {\bf User} of
1464the PENWIN.INI file is used.
d6c9c1b7 1465
b0fc8832 1466The first variant of this function returns the user name if successful or an
43e8916f
MW
1467empty string otherwise. The second (deprecated) function returns \true
1468if successful, \false otherwise.
b0fc8832
VZ
1469
1470\wxheading{See also}
1471
1472\helpref{wxGetUserId}{wxgetuserid}
a660d684 1473
954b8ae6
JS
1474\wxheading{Include files}
1475
b0fc8832 1476<wx/utils.h>
954b8ae6 1477
84ed77ef
VZ
1478
1479
569ef72a 1480\section{String functions}\label{stringfunctions}
f3539882 1481
84ed77ef 1482
b0fc8832 1483\membersection{::copystring}\label{copystring}
a660d684 1484
7ac13b21 1485\func{char *}{copystring}{\param{const char *}{s}}
a660d684 1486
b0fc8832
VZ
1487Makes a copy of the string {\it s} using the C++ new operator, so it can be
1488deleted with the {\it delete} operator.
d6c9c1b7 1489
b0fc8832 1490This function is deprecated, use \helpref{wxString}{wxstring} class instead.
a660d684 1491
84ed77ef 1492
0bbe4e29
VZ
1493\membersection{::wxGetTranslation}\label{wxgettranslation}
1494
1495\func{const char *}{wxGetTranslation}{\param{const char * }{str}}
1496
6f80247a
VS
1497\func{const char *}{wxGetTranslation}{\param{const char * }{str}, \param{const char * }{strPlural}, \param{size\_t }{n}}
1498
0bbe4e29
VZ
1499This function returns the translation of string {\it str} in the current
1500\helpref{locale}{wxlocale}. If the string is not found in any of the loaded
1501message catalogs (see \helpref{internationalization overview}{internationalization}), the
1502original string is returned. In debug build, an error message is logged -- this
1503should help to find the strings which were not yet translated. As this function
1504is used very often, an alternative (and also common in Unix world) syntax is
1505provided: the \helpref{\_()}{underscore} macro is defined to do the same thing
1506as wxGetTranslation.
1507
6f80247a
VS
1508The second form is used when retrieving translation of string that has
1509different singular and plural form in English or different plural forms in some
15d06954
VZ
1510other language. It takes two extra arguments: as above, \arg{str}
1511parameter must contain the singular form of the string to be converted and
1512is used as the key for the search in the catalog. The \arg{strPlural} parameter
1513is the plural form (in English). The parameter \arg{n} is used to determine the
1514plural form. If no message catalog is found \arg{str} is returned if `n == 1',
30e5722f 1515otherwise \arg{strPlural}.
15d06954
VZ
1516
1517See \urlref{GNU gettext manual}{http://www.gnu.org/manual/gettext/html\_chapter/gettext\_10.html\#SEC150}
1518for additional information on plural forms handling. For a shorter alternative
1519see the \helpref{wxPLURAL()}{wxplural} macro.
84ed77ef 1520
30e5722f
VS
1521Both versions call \helpref{wxLocale::GetString}{wxlocalegetstring}.
1522
15d06954 1523Note that this function is not suitable for literal strings in Unicode
050a1327 1524builds, since the literal strings must be enclosed into
15d06954
VZ
1525\helpref{\_T()}{underscoret} or \helpref{wxT}{wxt} macro which makes them
1526unrecognised by \texttt{xgettext}, and so they are not extracted to the message
1527catalog. Instead, use the \helpref{\_()}{underscore} and
1528\helpref{wxPLURAL}{wxplural} macro for all literal strings.
1529
1530
b0fc8832 1531\membersection{::wxIsEmpty}\label{wxisempty}
954b8ae6 1532
b0fc8832 1533\func{bool}{wxIsEmpty}{\param{const char *}{ p}}
954b8ae6 1534
43e8916f
MW
1535Returns \true if the pointer is either {\tt NULL} or points to an empty
1536string, \false otherwise.
f3539882 1537
84ed77ef 1538
2f930c85
JS
1539\membersection{::wxStrcmp}\label{wxstrcmp}
1540
1541\func{int}{wxStrcmp}{\param{const char *}{p1}, \param{const char *}{p2}}
1542
1543Returns a negative value, 0, or positive value if {\it p1} is less than, equal
1544to or greater than {\it p2}. The comparison is case-sensitive.
1545
1546This function complements the standard C function {\it stricmp()} which performs
1547case-insensitive comparison.
1548
84ed77ef 1549
b0fc8832 1550\membersection{::wxStricmp}\label{wxstricmp}
a660d684 1551
b0fc8832 1552\func{int}{wxStricmp}{\param{const char *}{p1}, \param{const char *}{p2}}
d6c9c1b7 1553
b0fc8832
VZ
1554Returns a negative value, 0, or positive value if {\it p1} is less than, equal
1555to or greater than {\it p2}. The comparison is case-insensitive.
a660d684 1556
b0fc8832
VZ
1557This function complements the standard C function {\it strcmp()} which performs
1558case-sensitive comparison.
a660d684 1559
84ed77ef 1560
b0fc8832 1561\membersection{::wxStringMatch}\label{wxstringmatch}
954b8ae6 1562
b0fc8832 1563\func{bool}{wxStringMatch}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2},\\
cc81d32f 1564 \param{bool}{ subString = true}, \param{bool}{ exact = false}}
954b8ae6 1565
2bd25c5a
VZ
1566{\bf NB:} This function is obsolete, use \helpref{wxString::Find}{wxstringfind} instead.
1567
43e8916f
MW
1568Returns \true if the substring {\it s1} is found within {\it s2},
1569ignoring case if {\it exact} is false. If {\it subString} is \false,
b0fc8832 1570no substring matching is done.
f3539882 1571
84ed77ef 1572
b0fc8832 1573\membersection{::wxStringEq}\label{wxstringeq}
a660d684 1574
b0fc8832 1575\func{bool}{wxStringEq}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2}}
a660d684 1576
2bd25c5a
VZ
1577{\bf NB:} This function is obsolete, use \helpref{wxString}{wxstring} instead.
1578
b0fc8832
VZ
1579A macro defined as:
1580
1581\begin{verbatim}
1582#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
1583\end{verbatim}
1584
84ed77ef 1585
b0fc8832
VZ
1586\membersection{::wxStrlen}\label{wxstrlen}
1587
1588\func{size\_t}{wxStrlen}{\param{const char *}{ p}}
1589
1590This is a safe version of standard function {\it strlen()}: it does exactly the
1591same thing (i.e. returns the length of the string) except that it returns 0 if
1592{\it p} is the {\tt NULL} pointer.
1593
84ed77ef 1594
b0fc8832 1595\membersection{::wxSnprintf}\label{wxsnprintf}
a660d684 1596
b0fc8832 1597\func{int}{wxSnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{}{...}}
a660d684 1598
b0fc8832
VZ
1599This function replaces the dangerous standard function {\tt sprintf()} and is
1600like {\tt snprintf()} available on some platforms. The only difference with
1601sprintf() is that an additional argument - buffer size - is taken and the
1602buffer is never overflowed.
a660d684 1603
b0fc8832
VZ
1604Returns the number of characters copied to the buffer or -1 if there is not
1605enough space.
a660d684 1606
b0fc8832 1607\wxheading{See also}
a660d684 1608
b0fc8832
VZ
1609\helpref{wxVsnprintf}{wxvsnprintf}, \helpref{wxString::Printf}{wxstringprintf}
1610
84ed77ef 1611
0bbe4e29
VZ
1612\membersection{wxT}\label{wxt}
1613
1614\func{wxChar}{wxT}{\param{char }{ch}}
1615
1616\func{const wxChar *}{wxT}{\param{const char *}{s}}
1617
1618wxT() is a macro which can be used with character and string literals (in other
1619words, {\tt 'x'} or {\tt "foo"}) to automatically convert them to Unicode in
9d8aca48 1620Unicode build configuration. Please see the
0bbe4e29
VZ
1621\helpref{Unicode overview}{unicode} for more information.
1622
1623This macro is simply returns the value passed to it without changes in ASCII
1624build. In fact, its definition is:
1625\begin{verbatim}
1626#ifdef UNICODE
1627#define wxT(x) L ## x
1628#else // !Unicode
1629#define wxT(x) x
1630#endif
1631\end{verbatim}
1632
84ed77ef 1633
0bbe4e29
VZ
1634\membersection{wxTRANSLATE}\label{wxtranslate}
1635
1636\func{const wxChar *}{wxTRANSLATE}{\param{const char *}{s}}
1637
1638This macro doesn't do anything in the program code -- it simply expands to the
9d8aca48 1639value of its argument (except in Unicode build where it is equivalent to
0bbe4e29
VZ
1640\helpref{wxT}{wxt} which makes it unnecessary to use both wxTRANSLATE and wxT
1641with the same string which would be really unreadable).
1642
1643However it does have a purpose and it is to mark the literal strings for the
1644extraction into the message catalog created by {\tt xgettext} program. Usually
1645this is achieved using \helpref{\_()}{underscore} but that macro not only marks
9d8aca48 1646the string for extraction but also expands into a
0bbe4e29 1647\helpref{wxGetTranslation}{wxgettranslation} function call which means that it
7445e247 1648cannot be used in some situations, notably for static array
0bbe4e29
VZ
1649initialization.
1650
1651Here is an example which should make it more clear: suppose that you have a
1652static array of strings containing the weekday names and which have to be
8ea92b4d 1653translated (note that it is a bad example, really, as
0bbe4e29
VZ
1654\helpref{wxDateTime}{wxdatetime} already can be used to get the localized week
1655day names already). If you write
d2c2afc9 1656
0bbe4e29
VZ
1657\begin{verbatim}
1658static const wxChar * const weekdays[] = { _("Mon"), ..., _("Sun") };
1659...
1660// use weekdays[n] as usual
1661\end{verbatim}
d2c2afc9 1662
0bbe4e29
VZ
1663the code wouldn't compile because the function calls are forbidden in the array
1664initializer. So instead you should do
d2c2afc9 1665
0bbe4e29
VZ
1666\begin{verbatim}
1667static const wxChar * const weekdays[] = { wxTRANSLATE("Mon"), ..., wxTRANSLATE("Sun") };
1668...
1669// use wxGetTranslation(weekdays[n])
1670\end{verbatim}
d2c2afc9 1671
0bbe4e29
VZ
1672here.
1673
1674Note that although the code {\bf would} compile if you simply omit
1675wxTRANSLATE() in the above, it wouldn't work as expected because there would be
1676no translations for the weekday names in the program message catalog and
1677wxGetTranslation wouldn't find them.
1678
b0fc8832
VZ
1679\membersection{::wxVsnprintf}\label{wxvsnprintf}
1680
ea44a631 1681\func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argPtr}}
b0fc8832 1682
7ac13b21 1683The same as \helpref{wxSnprintf}{wxsnprintf} but takes a {\tt va\_list }
b0fc8832 1684argument instead of arbitrary number of parameters.
c50f1fb9 1685
e12be2f7 1686\wxheading{See also}
c50f1fb9 1687
b0fc8832 1688\helpref{wxSnprintf}{wxsnprintf}, \helpref{wxString::PrintfV}{wxstringprintfv}
c50f1fb9 1689
0bbe4e29 1690
84ed77ef 1691
0bbe4e29
VZ
1692\membersection{\_}\label{underscore}
1693
1694\func{const wxChar *}{\_}{\param{const char *}{s}}
1695
8ea92b4d 1696This macro expands into a call to \helpref{wxGetTranslation}{wxgettranslation}
0bbe4e29
VZ
1697function, so it marks the message for the extraction by {\tt xgettext} just as
1698\helpref{wxTRANSLATE}{wxtranslate} does, but also returns the translation of
1699the string for the current locale during execution.
1700
1701Don't confuse this macro with \helpref{\_T()}{underscoret}!
1702
84ed77ef 1703
15d06954
VZ
1704\membersection{wxPLURAL}\label{wxplural}
1705
1706\func{const wxChar *}{wxPLURAL}{\param{const char *}{sing}, \param{const char *}{plur}, \param{size\_t}{n}}
1707
1708This macro is identical to \helpref{\_()}{underscore} but for the plural variant
1709of \helpref{wxGetTranslation}{wxgettranslation}.
1710
1711
0bbe4e29
VZ
1712\membersection{\_T}\label{underscoret}
1713
1714\func{wxChar}{\_T}{\param{char }{ch}}
1715
1716\func{const wxChar *}{\_T}{\param{const wxChar }{ch}}
1717
1718This macro is exactly the same as \helpref{wxT}{wxt} and is defined in
fc2171bd 1719wxWidgets simply because it may be more intuitive for Windows programmers as
0bbe4e29
VZ
1720the standard Win32 headers also define it (as well as yet another name for the
1721same macro which is {\tt \_TEXT()}).
1722
1723Don't confuse this macro with \helpref{\_()}{underscore}!
1724
84ed77ef
VZ
1725
1726
b0fc8832 1727\section{Dialog functions}\label{dialogfunctions}
c50f1fb9 1728
b0fc8832
VZ
1729Below are a number of convenience functions for getting input from the
1730user or displaying messages. Note that in these functions the last three
1731parameters are optional. However, it is recommended to pass a parent frame
1732parameter, or (in MS Windows or Motif) the wrong window frame may be brought to
1733the front when the dialog box is popped up.
c50f1fb9 1734
84ed77ef 1735
b0fc8832 1736\membersection{::wxBeginBusyCursor}\label{wxbeginbusycursor}
a660d684 1737
b0fc8832
VZ
1738\func{void}{wxBeginBusyCursor}{\param{wxCursor *}{cursor = wxHOURGLASS\_CURSOR}}
1739
1740Changes the cursor to the given cursor for all windows in the application.
1741Use \helpref{wxEndBusyCursor}{wxendbusycursor} to revert the cursor back
1742to its previous state. These two calls can be nested, and a counter
1743ensures that only the outer calls take effect.
1744
1745See also \helpref{wxIsBusy}{wxisbusy}, \helpref{wxBusyCursor}{wxbusycursor}.
a660d684 1746
954b8ae6
JS
1747\wxheading{Include files}
1748
b0fc8832 1749<wx/utils.h>
954b8ae6 1750
84ed77ef 1751
b0fc8832 1752\membersection{::wxBell}\label{wxbell}
ec5d7799 1753
b0fc8832 1754\func{void}{wxBell}{\void}
ec5d7799 1755
b0fc8832 1756Ring the system bell.
ec5d7799 1757
b0fc8832 1758\wxheading{Include files}
ec5d7799 1759
b0fc8832 1760<wx/utils.h>
a660d684 1761
84ed77ef 1762
b0fc8832 1763\membersection{::wxCreateFileTipProvider}\label{wxcreatefiletipprovider}
a660d684 1764
b0fc8832
VZ
1765\func{wxTipProvider *}{wxCreateFileTipProvider}{\param{const wxString\& }{filename},
1766 \param{size\_t }{currentTip}}
a660d684 1767
b0fc8832
VZ
1768This function creates a \helpref{wxTipProvider}{wxtipprovider} which may be
1769used with \helpref{wxShowTip}{wxshowtip}.
a660d684 1770
b0fc8832
VZ
1771\docparam{filename}{The name of the file containing the tips, one per line}
1772\docparam{currentTip}{The index of the first tip to show - normally this index
1773is remembered between the 2 program runs.}
a660d684 1774
b0fc8832 1775\wxheading{See also}
a660d684 1776
b0fc8832 1777\helpref{Tips overview}{tipsoverview}
904a68b6 1778
b0fc8832 1779\wxheading{Include files}
904a68b6 1780
b0fc8832 1781<wx/tipdlg.h>
904a68b6 1782
84ed77ef 1783
b0fc8832 1784\membersection{::wxDirSelector}\label{wxdirselector}
904a68b6 1785
b0fc8832
VZ
1786\func{wxString}{wxDirSelector}{\param{const wxString\& }{message = wxDirSelectorPromptStr},\\
1787 \param{const wxString\& }{default\_path = ""},\\
1788 \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition},\\
1789 \param{wxWindow *}{parent = NULL}}
904a68b6 1790
b0fc8832
VZ
1791Pops up a directory selector dialog. The arguments have the same meaning as
1792those of wxDirDialog::wxDirDialog(). The message is displayed at the top,
1793and the default\_path, if specified, is set as the initial selection.
904a68b6 1794
b0fc8832
VZ
1795The application must check for an empty return value (if the user pressed
1796Cancel). For example:
904a68b6 1797
b0fc8832
VZ
1798\begin{verbatim}
1799const wxString& dir = wxDirSelector("Choose a folder");
1800if ( !dir.empty() )
1801{
1802 ...
1803}
1804\end{verbatim}
904a68b6 1805
b0fc8832 1806\wxheading{Include files}
a660d684 1807
b0fc8832 1808<wx/dirdlg.h>
a660d684 1809
84ed77ef 1810
b0fc8832 1811\membersection{::wxFileSelector}\label{wxfileselector}
a660d684 1812
b0fc8832
VZ
1813\func{wxString}{wxFileSelector}{\param{const wxString\& }{message}, \param{const wxString\& }{default\_path = ""},\\
1814 \param{const wxString\& }{default\_filename = ""}, \param{const wxString\& }{default\_extension = ""},\\
cf700088 1815 \param{const wxString\& }{wildcard = "*.*"}, \param{int }{flags = 0}, \param{wxWindow *}{parent = NULL},\\
b0fc8832 1816 \param{int}{ x = -1}, \param{int}{ y = -1}}
a660d684 1817
b0fc8832
VZ
1818Pops up a file selector box. In Windows, this is the common file selector
1819dialog. In X, this is a file selector box with the same functionality.
1820The path and filename are distinct elements of a full file pathname.
1821If path is empty, the current directory will be used. If filename is empty,
1822no default filename will be supplied. The wildcard determines what files
1823are displayed in the file selector, and file extension supplies a type
1824extension for the required filename. Flags may be a combination of wxOPEN,
2f1b667b 1825wxSAVE, wxOVERWRITE\_PROMPT, wxFILE\_MUST\_EXIST, wxMULTIPLE or 0.
a660d684 1826
b0fc8832
VZ
1827Both the Unix and Windows versions implement a wildcard filter. Typing a
1828filename containing wildcards (*, ?) in the filename text item, and
1829clicking on Ok, will result in only those files matching the pattern being
1830displayed.
a660d684 1831
b0fc8832
VZ
1832The wildcard may be a specification for multiple types of file
1833with a description for each, such as:
a660d684 1834
b0fc8832
VZ
1835\begin{verbatim}
1836 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
1837\end{verbatim}
a660d684 1838
b0fc8832
VZ
1839The application must check for an empty return value (the user pressed
1840Cancel). For example:
a660d684 1841
b0fc8832 1842\begin{verbatim}
f0f12073
VZ
1843wxString filename = wxFileSelector("Choose a file to open");
1844if ( !filename.empty() )
b0fc8832 1845{
f0f12073
VZ
1846 // work with the file
1847 ...
b0fc8832 1848}
f0f12073 1849//else: cancelled by user
b0fc8832 1850\end{verbatim}
a660d684 1851
b0fc8832 1852\wxheading{Include files}
a660d684 1853
b0fc8832 1854<wx/filedlg.h>
a660d684 1855
84ed77ef 1856
b0fc8832 1857\membersection{::wxEndBusyCursor}\label{wxendbusycursor}
a660d684 1858
b0fc8832 1859\func{void}{wxEndBusyCursor}{\void}
f53561f1 1860
b0fc8832
VZ
1861Changes the cursor back to the original cursor, for all windows in the application.
1862Use with \helpref{wxBeginBusyCursor}{wxbeginbusycursor}.
1863
1864See also \helpref{wxIsBusy}{wxisbusy}, \helpref{wxBusyCursor}{wxbusycursor}.
a660d684 1865
954b8ae6
JS
1866\wxheading{Include files}
1867
b0fc8832 1868<wx/utils.h>
954b8ae6 1869
84ed77ef 1870
b0fc8832 1871\membersection{::wxGetColourFromUser}\label{wxgetcolourfromuser}
a660d684 1872
b0fc8832 1873\func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}}
a660d684 1874
b0fc8832
VZ
1875Shows the colour selection dialog and returns the colour selected by user or
1876invalid colour (use \helpref{wxColour::Ok}{wxcolourok} to test whether a colour
1877is valid) if the dialog was cancelled.
a660d684 1878
b0fc8832 1879\wxheading{Parameters}
a660d684 1880
b0fc8832 1881\docparam{parent}{The parent window for the colour selection dialog}
a660d684 1882
b0fc8832 1883\docparam{colInit}{If given, this will be the colour initially selected in the dialog.}
a660d684 1884
b0fc8832 1885\wxheading{Include files}
a660d684 1886
b0fc8832 1887<wx/colordlg.h>
a660d684 1888
84ed77ef 1889
d741c583
VZ
1890\membersection{::wxGetFontFromUser}\label{wxgetfontfromuser}
1891
1892\func{wxFont}{wxGetFontFromUser}{\param{wxWindow *}{parent}, \param{const wxFont\& }{fontInit}}
1893
1894Shows the font selection dialog and returns the font selected by user or
1895invalid font (use \helpref{wxFont::Ok}{wxfontok} to test whether a font
1896is valid) if the dialog was cancelled.
1897
1898\wxheading{Parameters}
1899
65d877d2 1900\docparam{parent}{The parent window for the font selection dialog}
d741c583
VZ
1901
1902\docparam{fontInit}{If given, this will be the font initially selected in the dialog.}
1903
1904\wxheading{Include files}
1905
1906<wx/fontdlg.h>
1907
1908
84ed77ef 1909
b0fc8832 1910\membersection{::wxGetMultipleChoices}\label{wxgetmultiplechoices}
a660d684 1911
b0fc8832
VZ
1912\func{size\_t}{wxGetMultipleChoices}{\\
1913 \param{wxArrayInt\& }{selections},\\
1914 \param{const wxString\& }{message},\\
1915 \param{const wxString\& }{caption},\\
1916 \param{const wxArrayString\& }{aChoices},\\
1917 \param{wxWindow *}{parent = NULL},\\
1918 \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 1919 \param{bool}{ centre = true},\\
b0fc8832 1920 \param{int }{width=150}, \param{int }{height=200}}
a660d684 1921
b0fc8832
VZ
1922\func{size\_t}{wxGetMultipleChoices}{\\
1923 \param{wxArrayInt\& }{selections},\\
1924 \param{const wxString\& }{message},\\
1925 \param{const wxString\& }{caption},\\
1926 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1927 \param{wxWindow *}{parent = NULL},\\
1928 \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 1929 \param{bool}{ centre = true},\\
b0fc8832 1930 \param{int }{width=150}, \param{int }{height=200}}
a660d684 1931
b0fc8832
VZ
1932Pops up a dialog box containing a message, OK/Cancel buttons and a
1933multiple-selection listbox. The user may choose an arbitrary (including 0)
1934number of items in the listbox whose indices will be returned in
1935{\it selection} array. The initial contents of this array will be used to
1936select the items when the dialog is shown.
a660d684 1937
b0fc8832
VZ
1938You may pass the list of strings to choose from either using {\it choices}
1939which is an array of {\it n} strings for the listbox or by using a single
1940{\it aChoices} parameter of type \helpref{wxArrayString}{wxarraystring}.
a660d684 1941
cc81d32f
VS
1942If {\it centre} is true, the message text (which may include new line
1943characters) is centred; if false, the message is left-justified.
a660d684 1944
b0fc8832 1945\wxheading{Include files}
a660d684 1946
b0fc8832 1947<wx/choicdlg.h>
a660d684 1948
b0fc8832
VZ
1949\perlnote{In wxPerl there is just an array reference in place of {\tt n}
1950and {\tt choices}, and no {\tt selections} parameter; the function
1951returns an array containing the user selections.}
a660d684 1952
84ed77ef 1953
b0fc8832 1954\membersection{::wxGetNumberFromUser}\label{wxgetnumberfromuser}
a660d684 1955
b0fc8832
VZ
1956\func{long}{wxGetNumberFromUser}{
1957 \param{const wxString\& }{message},
1958 \param{const wxString\& }{prompt},
1959 \param{const wxString\& }{caption},
1960 \param{long }{value},
1961 \param{long }{min = 0},
1962 \param{long }{max = 100},
1963 \param{wxWindow *}{parent = NULL},
1964 \param{const wxPoint\& }{pos = wxDefaultPosition}}
a660d684 1965
b0fc8832
VZ
1966Shows a dialog asking the user for numeric input. The dialogs title is set to
1967{\it caption}, it contains a (possibly) multiline {\it message} above the
1968single line {\it prompt} and the zone for entering the number.
a660d684 1969
b0fc8832
VZ
1970The number entered must be in the range {\it min}..{\it max} (both of which
1971should be positive) and {\it value} is the initial value of it. If the user
1972enters an invalid value or cancels the dialog, the function will return -1.
a660d684 1973
b0fc8832
VZ
1974Dialog is centered on its {\it parent} unless an explicit position is given in
1975{\it pos}.
a660d684 1976
b0fc8832 1977\wxheading{Include files}
a660d684 1978
bc253a97 1979<wx/numdlg.h>
a660d684 1980
84ed77ef 1981
b0fc8832 1982\membersection{::wxGetPasswordFromUser}\label{wxgetpasswordfromuser}
a660d684 1983
57dd96a6
KH
1984\func{wxString}{wxGetPasswordFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
1985 \param{const wxString\& }{default\_value = ``"}, \param{wxWindow *}{parent = NULL},\\
1986 \param{int}{ x = wxDefaultCoord}, \param{int}{ y = wxDefaultCoord}, \param{bool}{ centre = true}}
a660d684 1987
b0fc8832
VZ
1988Similar to \helpref{wxGetTextFromUser}{wxgettextfromuser} but the text entered
1989in the dialog is not shown on screen but replaced with stars. This is intended
1990to be used for entering passwords as the function name implies.
a660d684 1991
b0fc8832 1992\wxheading{Include files}
a660d684 1993
b0fc8832 1994<wx/textdlg.h>
a660d684 1995
84ed77ef 1996
b0fc8832 1997\membersection{::wxGetTextFromUser}\label{wxgettextfromuser}
a660d684 1998
b0fc8832
VZ
1999\func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
2000 \param{const wxString\& }{default\_value = ``"}, \param{wxWindow *}{parent = NULL},\\
57dd96a6 2001 \param{int}{ x = wxDefaultCoord}, \param{int}{ y = wxDefaultCoord}, \param{bool}{ centre = true}}
a660d684 2002
b0fc8832
VZ
2003Pop up a dialog box with title set to {\it caption}, {\it message}, and a
2004\rtfsp{\it default\_value}. The user may type in text and press OK to return this text,
2005or press Cancel to return the empty string.
a660d684 2006
cc81d32f
VS
2007If {\it centre} is true, the message text (which may include new line characters)
2008is centred; if false, the message is left-justified.
a660d684 2009
b0fc8832 2010\wxheading{Include files}
a660d684 2011
b0fc8832 2012<wx/textdlg.h>
a660d684 2013
84ed77ef 2014
b0fc8832 2015\membersection{::wxGetMultipleChoice}\label{wxgetmultiplechoice}
a660d684 2016
b0fc8832
VZ
2017\func{int}{wxGetMultipleChoice}{\param{const wxString\& }{message}, \param{const wxString\& }{caption}, \param{int}{ n}, \param{const wxString\& }{choices[]},\\
2018 \param{int }{nsel}, \param{int *}{selection},
2019 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 2020 \param{bool}{ centre = true}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 2021
b0fc8832
VZ
2022Pops up a dialog box containing a message, OK/Cancel buttons and a multiple-selection
2023listbox. The user may choose one or more item(s) and press OK or Cancel.
a660d684 2024
b0fc8832
VZ
2025The number of initially selected choices, and array of the selected indices,
2026are passed in; this array will contain the user selections on exit, with
2027the function returning the number of selections. {\it selection} must be
2028as big as the number of choices, in case all are selected.
a660d684 2029
b0fc8832 2030If Cancel is pressed, -1 is returned.
a660d684 2031
b0fc8832 2032{\it choices} is an array of {\it n} strings for the listbox.
a660d684 2033
cc81d32f
VS
2034If {\it centre} is true, the message text (which may include new line characters)
2035is centred; if false, the message is left-justified.
a660d684 2036
b0fc8832 2037\wxheading{Include files}
a660d684 2038
b0fc8832 2039<wx/choicdlg.h>
a660d684 2040
84ed77ef 2041
b0fc8832 2042\membersection{::wxGetSingleChoice}\label{wxgetsinglechoice}
a660d684 2043
b0fc8832
VZ
2044\func{wxString}{wxGetSingleChoice}{\param{const wxString\& }{message},\\
2045 \param{const wxString\& }{caption},\\
2046 \param{const wxArrayString\& }{aChoices},\\
2047 \param{wxWindow *}{parent = NULL},\\
2048 \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 2049 \param{bool}{ centre = true},\\
b0fc8832 2050 \param{int }{width=150}, \param{int }{height=200}}
a660d684 2051
b0fc8832
VZ
2052\func{wxString}{wxGetSingleChoice}{\param{const wxString\& }{message},\\
2053 \param{const wxString\& }{caption},\\
2054 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
2055 \param{wxWindow *}{parent = NULL},\\
2056 \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 2057 \param{bool}{ centre = true},\\
b0fc8832 2058 \param{int }{width=150}, \param{int }{height=200}}
a660d684 2059
b0fc8832
VZ
2060Pops up a dialog box containing a message, OK/Cancel buttons and a
2061single-selection listbox. The user may choose an item and press OK to return a
2062string or Cancel to return the empty string. Use
2063\helpref{wxGetSingleChoiceIndex}{wxgetsinglechoiceindex} if empty string is a
2064valid choice and if you want to be able to detect pressing Cancel reliably.
a660d684 2065
b0fc8832
VZ
2066You may pass the list of strings to choose from either using {\it choices}
2067which is an array of {\it n} strings for the listbox or by using a single
2068{\it aChoices} parameter of type \helpref{wxArrayString}{wxarraystring}.
a660d684 2069
cc81d32f
VS
2070If {\it centre} is true, the message text (which may include new line
2071characters) is centred; if false, the message is left-justified.
a660d684 2072
954b8ae6
JS
2073\wxheading{Include files}
2074
b0fc8832 2075<wx/choicdlg.h>
954b8ae6 2076
b0fc8832
VZ
2077\perlnote{In wxPerl there is just an array reference in place of {\tt n}
2078and {\tt choices}.}
a660d684 2079
84ed77ef 2080
b0fc8832 2081\membersection{::wxGetSingleChoiceIndex}\label{wxgetsinglechoiceindex}
a660d684 2082
b0fc8832
VZ
2083\func{int}{wxGetSingleChoiceIndex}{\param{const wxString\& }{message},\\
2084 \param{const wxString\& }{caption},\\
2085 \param{const wxArrayString\& }{aChoices},\\
2086 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 2087 \param{bool}{ centre = true}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 2088
b0fc8832
VZ
2089\func{int}{wxGetSingleChoiceIndex}{\param{const wxString\& }{message},\\
2090 \param{const wxString\& }{caption},\\
2091 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
2092 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 2093 \param{bool}{ centre = true}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 2094
b0fc8832
VZ
2095As {\bf wxGetSingleChoice} but returns the index representing the selected
2096string. If the user pressed cancel, -1 is returned.
a660d684 2097
b0fc8832 2098\wxheading{Include files}
a660d684 2099
b0fc8832 2100<wx/choicdlg.h>
a660d684 2101
b0fc8832
VZ
2102\perlnote{In wxPerl there is just an array reference in place of {\tt n}
2103and {\tt choices}.}
a660d684 2104
84ed77ef 2105
b0fc8832 2106\membersection{::wxGetSingleChoiceData}\label{wxgetsinglechoicedata}
a660d684 2107
b0fc8832
VZ
2108\func{wxString}{wxGetSingleChoiceData}{\param{const wxString\& }{message},\\
2109 \param{const wxString\& }{caption},\\
2110 \param{const wxArrayString\& }{aChoices},\\
2111 \param{const wxString\& }{client\_data[]},\\
2112 \param{wxWindow *}{parent = NULL},\\
2113 \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 2114 \param{bool}{ centre = true}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 2115
b0fc8832
VZ
2116\func{wxString}{wxGetSingleChoiceData}{\param{const wxString\& }{message},\\
2117 \param{const wxString\& }{caption},\\
2118 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
2119 \param{const wxString\& }{client\_data[]},\\
2120 \param{wxWindow *}{parent = NULL},\\
2121 \param{int}{ x = -1}, \param{int}{ y = -1},\\
cc81d32f 2122 \param{bool}{ centre = true}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 2123
b0fc8832
VZ
2124As {\bf wxGetSingleChoice} but takes an array of client data pointers
2125corresponding to the strings, and returns one of these pointers or NULL if
2126Cancel was pressed. The {\it client\_data} array must have the same number of
2127elements as {\it choices} or {\it aChoices}!
a660d684 2128
b0fc8832 2129\wxheading{Include files}
a660d684 2130
b0fc8832 2131<wx/choicdlg.h>
a660d684 2132
b0fc8832
VZ
2133\perlnote{In wxPerl there is just an array reference in place of {\tt n}
2134and {\tt choices}, and the client data array must have the
2135same length as the choices array.}
a660d684 2136
84ed77ef 2137
b0fc8832 2138\membersection{::wxIsBusy}\label{wxisbusy}
a660d684 2139
b0fc8832 2140\func{bool}{wxIsBusy}{\void}
a660d684 2141
cc81d32f 2142Returns true if between two \helpref{wxBeginBusyCursor}{wxbeginbusycursor} and\rtfsp
b0fc8832 2143\helpref{wxEndBusyCursor}{wxendbusycursor} calls.
a660d684 2144
b0fc8832 2145See also \helpref{wxBusyCursor}{wxbusycursor}.
a660d684 2146
b0fc8832 2147\wxheading{Include files}
a660d684 2148
b0fc8832 2149<wx/utils.h>
a660d684 2150
84ed77ef 2151
b0fc8832 2152\membersection{::wxMessageBox}\label{wxmessagebox}
a660d684 2153
dc0cecbc 2154\func{int}{wxMessageBox}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Message"}, \param{int}{ style = wxOK},\\
b0fc8832 2155 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1}}
a660d684 2156
b0fc8832
VZ
2157General purpose message dialog. {\it style} may be a bit list of the
2158following identifiers:
a660d684 2159
b0fc8832
VZ
2160\begin{twocollist}\itemsep=0pt
2161\twocolitem{wxYES\_NO}{Puts Yes and No buttons on the message box. May be combined with
2162wxCANCEL.}
2163\twocolitem{wxCANCEL}{Puts a Cancel button on the message box. May be combined with
2164wxYES\_NO or wxOK.}
2165\twocolitem{wxOK}{Puts an Ok button on the message box. May be combined with wxCANCEL.}
b0fc8832
VZ
2166\twocolitem{wxICON\_EXCLAMATION}{Displays an exclamation mark symbol.}
2167\twocolitem{wxICON\_HAND}{Displays an error symbol.}
2168\twocolitem{wxICON\_ERROR}{Displays an error symbol - the same as wxICON\_HAND.}
2169\twocolitem{wxICON\_QUESTION}{Displays a question mark symbol.}
2170\twocolitem{wxICON\_INFORMATION}{Displays an information symbol.}
2171\end{twocollist}
a660d684 2172
b0fc8832 2173The return value is one of: wxYES, wxNO, wxCANCEL, wxOK.
a660d684 2174
b0fc8832 2175For example:
a660d684 2176
b0fc8832
VZ
2177\begin{verbatim}
2178 ...
2179 int answer = wxMessageBox("Quit program?", "Confirm",
2180 wxYES_NO | wxCANCEL, main_frame);
2181 if (answer == wxYES)
933b675e 2182 main_frame->Close();
b0fc8832
VZ
2183 ...
2184\end{verbatim}
a660d684 2185
b0fc8832
VZ
2186{\it message} may contain newline characters, in which case the
2187message will be split into separate lines, to cater for large messages.
a660d684 2188
b0fc8832 2189\wxheading{Include files}
a660d684 2190
b0fc8832 2191<wx/msgdlg.h>
a660d684 2192
84ed77ef 2193
b0fc8832 2194\membersection{::wxShowTip}\label{wxshowtip}
a660d684 2195
b0fc8832
VZ
2196\func{bool}{wxShowTip}{\param{wxWindow *}{parent},
2197 \param{wxTipProvider *}{tipProvider},
cc81d32f 2198 \param{bool }{showAtStartup = true}}
a660d684 2199
7975104d 2200This function shows a "startup tip" to the user. The return value is the
cf700088 2201state of the `Show tips at startup' checkbox.
a660d684 2202
b0fc8832 2203\docparam{parent}{The parent window for the modal dialog}
a660d684 2204
b0fc8832
VZ
2205\docparam{tipProvider}{An object which is used to get the text of the tips.
2206It may be created with the \helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider} function.}
a660d684 2207
cc81d32f 2208\docparam{showAtStartup}{Should be true if startup tips are shown, false
b0fc8832
VZ
2209otherwise. This is used as the initial value for "Show tips at startup"
2210checkbox which is shown in the tips dialog.}
a660d684 2211
b0fc8832 2212\wxheading{See also}
a660d684 2213
b0fc8832 2214\helpref{Tips overview}{tipsoverview}
a660d684 2215
b0fc8832 2216\wxheading{Include files}
f6bcfd97 2217
b0fc8832 2218<wx/tipdlg.h>
f6bcfd97 2219
a02afd14 2220
84ed77ef
VZ
2221
2222
569ef72a 2223\section{Math functions}\label{mathfunctions}
a02afd14
VZ
2224
2225\wxheading{Include files}
2226
2227<wx/math.h>
2228
84ed77ef 2229
a02afd14
VZ
2230\membersection{wxFinite}\label{wxfinite}
2231
2232\func{int}{wxFinite}{\param{double }{x}}
2233
8ea92b4d 2234Returns a non-zero value if {\it x} is neither infinite or NaN (not a number),
a02afd14
VZ
2235returns 0 otherwise.
2236
84ed77ef 2237
a02afd14
VZ
2238\membersection{wxIsNaN}\label{wxisnan}
2239
2240\func{bool}{wxIsNaN}{\param{double }{x}}
2241
2242Returns a non-zero value if {\it x} is NaN (not a number), returns 0
2243otherwise.
2244
2245
84ed77ef
VZ
2246
2247
b0fc8832 2248\section{GDI functions}\label{gdifunctions}
f6bcfd97 2249
b0fc8832 2250The following are relevant to the GDI (Graphics Device Interface).
f6bcfd97
BP
2251
2252\wxheading{Include files}
2253
b0fc8832 2254<wx/gdicmn.h>
f6bcfd97 2255
84ed77ef 2256
b0fc8832 2257\membersection{wxBITMAP}\label{wxbitmapmacro}
a660d684 2258
b0fc8832 2259\func{}{wxBITMAP}{bitmapName}
a660d684 2260
b0fc8832
VZ
2261This macro loads a bitmap from either application resources (on the platforms
2262for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
2263avoid using {\tt \#ifdef}s when creating bitmaps.
a660d684 2264
b0fc8832 2265\wxheading{See also}
954b8ae6 2266
b0fc8832
VZ
2267\helpref{Bitmaps and icons overview}{wxbitmapoverview},
2268\helpref{wxICON}{wxiconmacro}
a660d684 2269
b0fc8832 2270\wxheading{Include files}
954b8ae6 2271
b0fc8832 2272<wx/gdicmn.h>
a660d684 2273
84ed77ef 2274
b0fc8832 2275\membersection{::wxClientDisplayRect}\label{wxclientdisplayrect}
a660d684 2276
b0fc8832
VZ
2277\func{void}{wxClientDisplayRect}{\param{int *}{x}, \param{int *}{y},
2278\param{int *}{width}, \param{int *}{height}}
954b8ae6 2279
b0fc8832 2280\func{wxRect}{wxGetClientDisplayRect}{\void}
954b8ae6 2281
b0fc8832
VZ
2282Returns the dimensions of the work area on the display. On Windows
2283this means the area not covered by the taskbar, etc. Other platforms
2284are currently defaulting to the whole display until a way is found to
2285provide this info for all window managers, etc.
a660d684 2286
84ed77ef 2287
b0fc8832 2288\membersection{::wxColourDisplay}\label{wxcolourdisplay}
a660d684 2289
b0fc8832 2290\func{bool}{wxColourDisplay}{\void}
a660d684 2291
cc81d32f 2292Returns true if the display is colour, false otherwise.
a660d684 2293
84ed77ef 2294
b0fc8832 2295\membersection{::wxDisplayDepth}\label{wxdisplaydepth}
954b8ae6 2296
b0fc8832 2297\func{int}{wxDisplayDepth}{\void}
954b8ae6 2298
b0fc8832 2299Returns the depth of the display (a value of 1 denotes a monochrome display).
a660d684 2300
84ed77ef 2301
b0fc8832 2302\membersection{::wxDisplaySize}\label{wxdisplaysize}
a660d684 2303
b0fc8832 2304\func{void}{wxDisplaySize}{\param{int *}{width}, \param{int *}{height}}
a660d684 2305
b0fc8832 2306\func{wxSize}{wxGetDisplaySize}{\void}
a660d684 2307
b0fc8832 2308Returns the display size in pixels.
a660d684 2309
84ed77ef 2310
b0fc8832 2311\membersection{::wxDisplaySizeMM}\label{wxdisplaysizemm}
a660d684 2312
b0fc8832 2313\func{void}{wxDisplaySizeMM}{\param{int *}{width}, \param{int *}{height}}
a660d684 2314
b0fc8832 2315\func{wxSize}{wxGetDisplaySizeMM}{\void}
a660d684 2316
b0fc8832 2317Returns the display size in millimeters.
e2a6f233 2318
84ed77ef 2319
b0fc8832 2320\membersection{::wxDROP\_ICON}\label{wxdropicon}
e2a6f233 2321
b0fc8832 2322\func{wxIconOrCursor}{wxDROP\_ICON}{\param{const char *}{name}}
e2a6f233 2323
b0fc8832
VZ
2324This macro creates either a cursor (MSW) or an icon (elsewhere) with the given
2325name. Under MSW, the cursor is loaded from the resource file and the icon is
2326loaded from XPM file under other platforms.
2327
2328This macro should be used with
2329\helpref{wxDropSource constructor}{wxdropsourcewxdropsource}.
e2a6f233 2330
954b8ae6
JS
2331\wxheading{Include files}
2332
b0fc8832 2333<wx/dnd.h>
954b8ae6 2334
84ed77ef 2335
b0fc8832 2336\membersection{wxICON}\label{wxiconmacro}
e2a6f233 2337
b0fc8832 2338\func{}{wxICON}{iconName}
e2a6f233 2339
b0fc8832
VZ
2340This macro loads an icon from either application resources (on the platforms
2341for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
2342avoid using {\tt \#ifdef}s when creating icons.
e2a6f233 2343
b0fc8832 2344\wxheading{See also}
e2a6f233 2345
b0fc8832
VZ
2346\helpref{Bitmaps and icons overview}{wxbitmapoverview},
2347\helpref{wxBITMAP}{wxbitmapmacro}
e2a6f233 2348
954b8ae6
JS
2349\wxheading{Include files}
2350
b0fc8832 2351<wx/gdicmn.h>
a660d684 2352
84ed77ef 2353
b0fc8832 2354\membersection{::wxMakeMetafilePlaceable}\label{wxmakemetafileplaceable}
de6019fb 2355
b0fc8832
VZ
2356\func{bool}{wxMakeMetafilePlaceable}{\param{const wxString\& }{filename}, \param{int }{minX}, \param{int }{minY},
2357 \param{int }{maxX}, \param{int }{maxY}, \param{float }{scale=1.0}}
a660d684 2358
b0fc8832
VZ
2359Given a filename for an existing, valid metafile (as constructed using \helpref{wxMetafileDC}{wxmetafiledc})
2360makes it into a placeable metafile by prepending a header containing the given
2361bounding box. The bounding box may be obtained from a device context after drawing
2362into it, using the functions wxDC::MinX, wxDC::MinY, wxDC::MaxX and wxDC::MaxY.
a660d684 2363
b0fc8832
VZ
2364In addition to adding the placeable metafile header, this function adds
2365the equivalent of the following code to the start of the metafile data:
a660d684 2366
b0fc8832
VZ
2367\begin{verbatim}
2368 SetMapMode(dc, MM_ANISOTROPIC);
2369 SetWindowOrg(dc, minX, minY);
2370 SetWindowExt(dc, maxX - minX, maxY - minY);
2371\end{verbatim}
6fb26ea3 2372
fc2171bd 2373This simulates the wxMM\_TEXT mapping mode, which wxWidgets assumes.
954b8ae6 2374
b0fc8832
VZ
2375Placeable metafiles may be imported by many Windows applications, and can be
2376used in RTF (Rich Text Format) files.
954b8ae6 2377
b0fc8832 2378{\it scale} allows the specification of scale for the metafile.
a660d684 2379
b0fc8832 2380This function is only available under Windows.
a660d684 2381
84ed77ef 2382
b0fc8832 2383\membersection{::wxSetCursor}\label{wxsetcursor}
a660d684 2384
b0fc8832 2385\func{void}{wxSetCursor}{\param{wxCursor *}{cursor}}
954b8ae6 2386
b0fc8832
VZ
2387Globally sets the cursor; only has an effect in Windows and GTK.
2388See also \helpref{wxCursor}{wxcursor}, \helpref{wxWindow::SetCursor}{wxwindowsetcursor}.
954b8ae6 2389
84ed77ef
VZ
2390
2391
b0fc8832 2392\section{Printer settings}\label{printersettings}
8e193f38 2393
2bd25c5a 2394{\bf NB:} These routines are obsolete and should no longer be used!
8e193f38 2395
b0fc8832
VZ
2396The following functions are used to control PostScript printing. Under
2397Windows, PostScript output can only be sent to a file.
8e193f38
VZ
2398
2399\wxheading{Include files}
2400
b0fc8832 2401<wx/dcps.h>
a660d684 2402
84ed77ef 2403
b0fc8832 2404\membersection{::wxGetPrinterCommand}\label{wxgetprintercommand}
a660d684 2405
b0fc8832 2406\func{wxString}{wxGetPrinterCommand}{\void}
a660d684 2407
b0fc8832 2408Gets the printer command used to print a file. The default is {\tt lpr}.
a660d684 2409
84ed77ef 2410
b0fc8832 2411\membersection{::wxGetPrinterFile}\label{wxgetprinterfile}
a660d684 2412
b0fc8832 2413\func{wxString}{wxGetPrinterFile}{\void}
a660d684 2414
b0fc8832 2415Gets the PostScript output filename.
a660d684 2416
84ed77ef 2417
b0fc8832 2418\membersection{::wxGetPrinterMode}\label{wxgetprintermode}
a660d684 2419
b0fc8832 2420\func{int}{wxGetPrinterMode}{\void}
954b8ae6 2421
b0fc8832
VZ
2422Gets the printing mode controlling where output is sent (PS\_PREVIEW, PS\_FILE or PS\_PRINTER).
2423The default is PS\_PREVIEW.
954b8ae6 2424
84ed77ef 2425
b0fc8832 2426\membersection{::wxGetPrinterOptions}\label{wxgetprinteroptions}
954b8ae6 2427
b0fc8832 2428\func{wxString}{wxGetPrinterOptions}{\void}
954b8ae6 2429
b0fc8832 2430Gets the additional options for the print command (e.g. specific printer). The default is nothing.
954b8ae6 2431
84ed77ef 2432
b0fc8832 2433\membersection{::wxGetPrinterOrientation}\label{wxgetprinterorientation}
954b8ae6 2434
b0fc8832 2435\func{int}{wxGetPrinterOrientation}{\void}
a660d684 2436
b0fc8832 2437Gets the orientation (PS\_PORTRAIT or PS\_LANDSCAPE). The default is PS\_PORTRAIT.
a660d684 2438
84ed77ef 2439
b0fc8832 2440\membersection{::wxGetPrinterPreviewCommand}\label{wxgetprinterpreviewcommand}
8e193f38 2441
b0fc8832 2442\func{wxString}{wxGetPrinterPreviewCommand}{\void}
a660d684 2443
b0fc8832 2444Gets the command used to view a PostScript file. The default depends on the platform.
954b8ae6 2445
84ed77ef 2446
b0fc8832 2447\membersection{::wxGetPrinterScaling}\label{wxgetprinterscaling}
954b8ae6 2448
b0fc8832 2449\func{void}{wxGetPrinterScaling}{\param{float *}{x}, \param{float *}{y}}
a660d684 2450
b0fc8832 2451Gets the scaling factor for PostScript output. The default is 1.0, 1.0.
a660d684 2452
84ed77ef 2453
b0fc8832 2454\membersection{::wxGetPrinterTranslation}\label{wxgetprintertranslation}
a660d684 2455
b0fc8832 2456\func{void}{wxGetPrinterTranslation}{\param{float *}{x}, \param{float *}{y}}
954b8ae6 2457
b0fc8832 2458Gets the translation (from the top left corner) for PostScript output. The default is 0.0, 0.0.
954b8ae6 2459
84ed77ef 2460
b0fc8832 2461\membersection{::wxSetPrinterCommand}\label{wxsetprintercommand}
a660d684 2462
b0fc8832 2463\func{void}{wxSetPrinterCommand}{\param{const wxString\& }{command}}
a660d684 2464
b0fc8832 2465Sets the printer command used to print a file. The default is {\tt lpr}.
a660d684 2466
84ed77ef 2467
b0fc8832 2468\membersection{::wxSetPrinterFile}\label{wxsetprinterfile}
cd6ce4a9 2469
b0fc8832 2470\func{void}{wxSetPrinterFile}{\param{const wxString\& }{filename}}
f6bcfd97 2471
b0fc8832 2472Sets the PostScript output filename.
a660d684 2473
84ed77ef 2474
b0fc8832 2475\membersection{::wxSetPrinterMode}\label{wxsetprintermode}
a660d684 2476
b0fc8832 2477\func{void}{wxSetPrinterMode}{\param{int }{mode}}
a660d684 2478
b0fc8832
VZ
2479Sets the printing mode controlling where output is sent (PS\_PREVIEW, PS\_FILE or PS\_PRINTER).
2480The default is PS\_PREVIEW.
cd6ce4a9 2481
84ed77ef 2482
b0fc8832 2483\membersection{::wxSetPrinterOptions}\label{wxsetprinteroptions}
a660d684 2484
b0fc8832 2485\func{void}{wxSetPrinterOptions}{\param{const wxString\& }{options}}
e6045e08 2486
b0fc8832 2487Sets the additional options for the print command (e.g. specific printer). The default is nothing.
a660d684 2488
84ed77ef 2489
b0fc8832 2490\membersection{::wxSetPrinterOrientation}\label{wxsetprinterorientation}
eafc087e 2491
b0fc8832 2492\func{void}{wxSetPrinterOrientation}{\param{int}{ orientation}}
cd6ce4a9 2493
b0fc8832 2494Sets the orientation (PS\_PORTRAIT or PS\_LANDSCAPE). The default is PS\_PORTRAIT.
a660d684 2495
84ed77ef 2496
b0fc8832 2497\membersection{::wxSetPrinterPreviewCommand}\label{wxsetprinterpreviewcommand}
954b8ae6 2498
b0fc8832 2499\func{void}{wxSetPrinterPreviewCommand}{\param{const wxString\& }{command}}
954b8ae6 2500
b0fc8832 2501Sets the command used to view a PostScript file. The default depends on the platform.
a660d684 2502
84ed77ef 2503
b0fc8832 2504\membersection{::wxSetPrinterScaling}\label{wxsetprinterscaling}
a660d684 2505
b0fc8832 2506\func{void}{wxSetPrinterScaling}{\param{float }{x}, \param{float }{y}}
a660d684 2507
b0fc8832 2508Sets the scaling factor for PostScript output. The default is 1.0, 1.0.
954b8ae6 2509
84ed77ef 2510
b0fc8832 2511\membersection{::wxSetPrinterTranslation}\label{wxsetprintertranslation}
954b8ae6 2512
b0fc8832 2513\func{void}{wxSetPrinterTranslation}{\param{float }{x}, \param{float }{y}}
a660d684 2514
b0fc8832 2515Sets the translation (from the top left corner) for PostScript output. The default is 0.0, 0.0.
a660d684 2516
84ed77ef
VZ
2517
2518
b0fc8832
VZ
2519\section{Clipboard functions}\label{clipsboard}
2520
2521These clipboard functions are implemented for Windows only. The use of these functions
2522is deprecated and the code is no longer maintained. Use the \helpref{wxClipboard}{wxclipboard}
2523class instead.
a660d684 2524
954b8ae6
JS
2525\wxheading{Include files}
2526
b0fc8832 2527<wx/clipbrd.h>
954b8ae6 2528
84ed77ef 2529
f4fcc291 2530\membersection{::wxClipboardOpen}\label{functionwxclipboardopen}
a660d684 2531
b0fc8832 2532\func{bool}{wxClipboardOpen}{\void}
a660d684 2533
cc81d32f 2534Returns true if this application has already opened the clipboard.
a660d684 2535
84ed77ef 2536
b0fc8832 2537\membersection{::wxCloseClipboard}\label{wxcloseclipboard}
954b8ae6 2538
b0fc8832 2539\func{bool}{wxCloseClipboard}{\void}
954b8ae6 2540
b0fc8832 2541Closes the clipboard to allow other applications to use it.
a660d684 2542
84ed77ef 2543
b0fc8832 2544\membersection{::wxEmptyClipboard}\label{wxemptyclipboard}
a660d684 2545
b0fc8832 2546\func{bool}{wxEmptyClipboard}{\void}
a660d684 2547
b0fc8832 2548Empties the clipboard.
954b8ae6 2549
84ed77ef 2550
b0fc8832 2551\membersection{::wxEnumClipboardFormats}\label{wxenumclipboardformats}
954b8ae6 2552
b0fc8832 2553\func{int}{wxEnumClipboardFormats}{\param{int}{dataFormat}}
a660d684 2554
b0fc8832
VZ
2555Enumerates the formats found in a list of available formats that belong
2556to the clipboard. Each call to this function specifies a known
2557available format; the function returns the format that appears next in
2558the list.
a660d684 2559
b0fc8832
VZ
2560{\it dataFormat} specifies a known format. If this parameter is zero,
2561the function returns the first format in the list.
a660d684 2562
b0fc8832
VZ
2563The return value specifies the next known clipboard data format if the
2564function is successful. It is zero if the {\it dataFormat} parameter specifies
2565the last format in the list of available formats, or if the clipboard
2566is not open.
a660d684 2567
b0fc8832
VZ
2568Before it enumerates the formats function, an application must open the clipboard by using the
2569wxOpenClipboard function.
954b8ae6 2570
84ed77ef 2571
b0fc8832 2572\membersection{::wxGetClipboardData}\label{wxgetclipboarddata}
954b8ae6 2573
b0fc8832 2574\func{wxObject *}{wxGetClipboardData}{\param{int}{dataFormat}}
26a80c22 2575
b0fc8832 2576Gets data from the clipboard.
26a80c22 2577
b0fc8832 2578{\it dataFormat} may be one of:
26a80c22 2579
b0fc8832
VZ
2580\begin{itemize}\itemsep=0pt
2581\item wxCF\_TEXT or wxCF\_OEMTEXT: returns a pointer to new memory containing a null-terminated text string.
2582\item wxCF\_BITMAP: returns a new wxBitmap.
2583\end{itemize}
26a80c22 2584
b0fc8832 2585The clipboard must have previously been opened for this call to succeed.
26a80c22 2586
84ed77ef 2587
b0fc8832 2588\membersection{::wxGetClipboardFormatName}\label{wxgetclipboardformatname}
26a80c22 2589
b0fc8832 2590\func{bool}{wxGetClipboardFormatName}{\param{int}{dataFormat}, \param{const wxString\& }{formatName}, \param{int}{maxCount}}
a660d684 2591
b0fc8832
VZ
2592Gets the name of a registered clipboard format, and puts it into the buffer {\it formatName} which is of maximum
2593length {\it maxCount}. {\it dataFormat} must not specify a predefined clipboard format.
a660d684 2594
84ed77ef 2595
b0fc8832 2596\membersection{::wxIsClipboardFormatAvailable}\label{wxisclipboardformatavailable}
a660d684 2597
b0fc8832 2598\func{bool}{wxIsClipboardFormatAvailable}{\param{int}{dataFormat}}
954b8ae6 2599
cc81d32f 2600Returns true if the given data format is available on the clipboard.
954b8ae6 2601
84ed77ef 2602
b0fc8832 2603\membersection{::wxOpenClipboard}\label{wxopenclipboard}
a660d684 2604
b0fc8832 2605\func{bool}{wxOpenClipboard}{\void}
a660d684 2606
b0fc8832 2607Opens the clipboard for passing data to it or getting data from it.
a660d684 2608
84ed77ef 2609
b0fc8832 2610\membersection{::wxRegisterClipboardFormat}\label{wxregisterclipboardformat}
954b8ae6 2611
b0fc8832 2612\func{int}{wxRegisterClipboardFormat}{\param{const wxString\& }{formatName}}
954b8ae6 2613
b0fc8832 2614Registers the clipboard data format name and returns an identifier.
a660d684 2615
84ed77ef 2616
b0fc8832 2617\membersection{::wxSetClipboardData}\label{wxsetclipboarddata}
a660d684 2618
b0fc8832 2619\func{bool}{wxSetClipboardData}{\param{int}{dataFormat}, \param{wxObject *}{data}, \param{int}{width}, \param{int}{height}}
c51deffc 2620
b0fc8832 2621Passes data to the clipboard.
c51deffc 2622
b0fc8832 2623{\it dataFormat} may be one of:
a660d684 2624
b0fc8832
VZ
2625\begin{itemize}\itemsep=0pt
2626\item wxCF\_TEXT or wxCF\_OEMTEXT: {\it data} is a null-terminated text string.
2627\item wxCF\_BITMAP: {\it data} is a wxBitmap.
2628\item wxCF\_DIB: {\it data} is a wxBitmap. The bitmap is converted to a DIB (device independent bitmap).
2629\item wxCF\_METAFILE: {\it data} is a wxMetafile. {\it width} and {\it height} are used to give recommended dimensions.
2630\end{itemize}
954b8ae6 2631
b0fc8832 2632The clipboard must have previously been opened for this call to succeed.
954b8ae6 2633
4104ed92 2634
84ed77ef
VZ
2635
2636
b0fc8832 2637\section{Miscellaneous functions}\label{miscellany}
a660d684 2638
84ed77ef 2639
3c595496
VZ
2640\membersection{wxCONCAT}\label{wxconcat}
2641
2642\func{}{wxCONCAT}{\param{}{x}, \param{}{y}}
2643
2644This macro returns the concatenation of two tokens \arg{x} and \arg{y}.
2645
2646
4104ed92
VZ
2647\membersection{wxDYNLIB\_FUNCTION}\label{wxdynlibfunction}
2648
2649\func{}{wxDYNLIB\_FUNCTION}{\param{}{type}, \param{}{name}, \param{}{dynlib}}
2650
8ea92b4d 2651When loading a function from a DLL you always have to cast the returned
b325f27f 2652{\tt void *} pointer to the correct type and, even more annoyingly, you have to
4104ed92
VZ
2653repeat this type twice if you want to declare and define a function pointer all
2654in one line
2655
2656This macro makes this slightly less painful by allowing you to specify the
2657type only once, as the first parameter, and creating a variable of this type
2658named after the function but with {\tt pfn} prefix and initialized with the
8ea92b4d 2659function \arg{name} from the \helpref{wxDynamicLibrary}{wxdynamiclibrary}
4104ed92
VZ
2660\arg{dynlib}.
2661
2662\wxheading{Parameters}
2663
2664\docparam{type}{the type of the function}
2665
2666\docparam{name}{the name of the function to load, not a string (without quotes,
2667it is quoted automatically by the macro)}
2668
2669\docparam{dynlib}{the library to load the function from}
2670
2671
84ed77ef 2672
986ecc86
VZ
2673\membersection{wxEXPLICIT}\label{wxexplicit}
2674
2675{\tt wxEXPLICIT} is a macro which expands to the C++ {\tt explicit} keyword if
2676the compiler supports it or nothing otherwise. Thus, it can be used even in the
2677code which might have to be compiled with an old compiler without support for
2678this language feature but still take advantage of it when it is available.
2679
84ed77ef 2680
f52d9e92
VZ
2681\membersection{::wxGetKeyState}\label{wxgetkeystate}
2682
1751226c 2683\func{bool}{wxGetKeyState}{\param{wxKeyCode }{key}}
f52d9e92 2684
44353523
VZ
2685For normal keys, returns \true if the specified key is currently down.
2686
2687For togglable keys (Caps Lock, Num Lock and Scroll Lock), returns
2688\true if the key is toggled such that its LED indicator is lit. There is
2689currently no way to test whether togglable keys are up or down.
2690
2691Even though there are virtual key codes defined for mouse buttons, they
2692cannot be used with this function currently.
f52d9e92
VZ
2693
2694\wxheading{Include files}
2695
2696<wx/utils.h>
2697
2698
2b5f62a0
VZ
2699\membersection{wxLL}\label{wxll}
2700
2701\func{wxLongLong\_t}{wxLL}{\param{}{number}}
2702
2703This macro is defined for the platforms with a native 64 bit integer type and
2704allows to define 64 bit compile time constants:
2705
2706\begin{verbatim}
2707 #ifdef wxLongLong_t
2708 wxLongLong_t ll = wxLL(0x1234567890abcdef);
2709 #endif
2710\end{verbatim}
2711
2712\wxheading{Include files}
2713
2714<wx/longlong.h>
2715
84ed77ef
VZ
2716\wxheading{See also}
2717
2718\helpref{wxULL}{wxull}, \helpref{wxLongLong}{wxlonglong}
2719
2720
2b5f62a0
VZ
2721\membersection{wxLongLongFmtSpec}\label{wxlonglongfmtspec}
2722
2723This macro is defined to contain the {\tt printf()} format specifier using
2724which 64 bit integer numbers (i.e. those of type {\tt wxLongLong\_t}) can be
2725printed. Example of using it:
2726
2727\begin{verbatim}
2728 #ifdef wxLongLong_t
2729 wxLongLong_t ll = wxLL(0x1234567890abcdef);
2730 printf("Long long = %" wxLongLongFmtSpec "x\n", ll);
2731 #endif
2732\end{verbatim}
2733
2734\wxheading{See also}
2735
2736\helpref{wxLL}{wxll}
2737
2738\wxheading{Include files}
2739
2740<wx/longlong.h>
2741
84ed77ef 2742
b0fc8832 2743\membersection{::wxNewId}\label{wxnewid}
a660d684 2744
b0fc8832
VZ
2745\func{long}{wxNewId}{\void}
2746
2747Generates an integer identifier unique to this run of the program.
a660d684 2748
954b8ae6
JS
2749\wxheading{Include files}
2750
2751<wx/utils.h>
2752
84ed77ef 2753
1a64b24d
VZ
2754\membersection{wxON\_BLOCK\_EXIT}\label{wxonblockexit}
2755
2756\func{}{wxON\_BLOCK\_EXIT0}{\param{}{func}}
2757\func{}{wxON\_BLOCK\_EXIT1}{\param{}{func}, \param{}{p1}}
2758\func{}{wxON\_BLOCK\_EXIT2}{\param{}{func}, \param{}{p1}, \param{}{p2}}
2759
2760This family of macros allows to ensure that the global function \arg{func}
2761with 0, 1, 2 or more parameters (up to some implementaton-defined limit) is
2762executed on scope exit, whether due to a normal function return or because an
2763exception has been thrown. A typical example of its usage:
2764\begin{verbatim}
2765 void *buf = malloc(size);
2766 wxON_BLOCK_EXIT1(free, buf);
2767\end{verbatim}
2768
2769Please see the original article by Andrei Alexandrescu and Petru Marginean
2770published in December 2000 issue of \emph{C/C++ Users Journal} for more
2771details.
2772
2773\wxheading{Include files}
2774
2775<wx/scopeguard.h>
2776
2777\wxheading{See also}
2778
2779\helpref{wxON\_BLOCK\_EXIT\_OBJ}{wxonblockexitobj}
2780
2781
2782\membersection{wxON\_BLOCK\_EXIT\_OBJ}\label{wxonblockexitobj}
2783
2784\func{}{wxON\_BLOCK\_EXIT\_OBJ0}{\param{}{obj}, \param{}{method}}
2785\func{}{wxON\_BLOCK\_EXIT\_OBJ1}{\param{}{obj}, \param{}{method}, \param{}{p1}}
2786\func{}{wxON\_BLOCK\_EXIT\_OBJ2}{\param{}{obj}, \param{}{method}, \param{}{p1}, \param{}{p2}}
2787
2788This family of macros is similar to \helpref{wxON\_BLOCK\_EXIT}{wxonblockexit}
2789but calls a method of the given object instead of a free function.
2790
2791\wxheading{Include files}
2792
2793<wx/scopeguard.h>
2794
2795
b0fc8832 2796\membersection{::wxRegisterId}\label{wxregisterid}
a660d684 2797
b0fc8832 2798\func{void}{wxRegisterId}{\param{long}{ id}}
a660d684 2799
b0fc8832
VZ
2800Ensures that ids subsequently generated by {\bf NewId} do not clash with
2801the given {\bf id}.
a660d684 2802
954b8ae6
JS
2803\wxheading{Include files}
2804
2805<wx/utils.h>
2806
84ed77ef 2807
b0fc8832 2808\membersection{::wxDDECleanUp}\label{wxddecleanup}
bdc72a22 2809
b0fc8832 2810\func{void}{wxDDECleanUp}{\void}
bdc72a22 2811
fc2171bd 2812Called when wxWidgets exits, to clean up the DDE system. This no longer needs to be
b0fc8832 2813called by the application.
bdc72a22 2814
b0fc8832 2815See also \helpref{wxDDEInitialize}{wxddeinitialize}.
bdc72a22
VZ
2816
2817\wxheading{Include files}
2818
b0fc8832 2819<wx/dde.h>
a660d684 2820
84ed77ef 2821
b0fc8832 2822\membersection{::wxDDEInitialize}\label{wxddeinitialize}
a660d684 2823
b0fc8832 2824\func{void}{wxDDEInitialize}{\void}
a660d684 2825
b0fc8832 2826Initializes the DDE system. May be called multiple times without harm.
a660d684 2827
b0fc8832 2828This no longer needs to be called by the application: it will be called
fc2171bd 2829by wxWidgets if necessary.
bdc72a22 2830
d2c2afc9 2831See also \helpref{wxDDEServer}{wxddeserver}, \helpref{wxDDEClient}{wxddeclient}, \helpref{wxDDEConnection}{wxddeconnection},\rtfsp
b0fc8832 2832\helpref{wxDDECleanUp}{wxddecleanup}.
bdc72a22 2833
954b8ae6
JS
2834\wxheading{Include files}
2835
b0fc8832 2836<wx/dde.h>
a660d684 2837
84ed77ef 2838
b0fc8832 2839\membersection{::wxEnableTopLevelWindows}\label{wxenabletoplevelwindows}
a660d684 2840
cc81d32f 2841\func{void}{wxEnableTopLevelWindow}{\param{bool}{ enable = true}}
a660d684 2842
b0fc8832
VZ
2843This function enables or disables all top level windows. It is used by
2844\helpref{::wxSafeYield}{wxsafeyield}.
a660d684 2845
954b8ae6
JS
2846\wxheading{Include files}
2847
2848<wx/utils.h>
2849
84ed77ef 2850
b0fc8832 2851\membersection{::wxFindMenuItemId}\label{wxfindmenuitemid}
a660d684 2852
b0fc8832 2853\func{int}{wxFindMenuItemId}{\param{wxFrame *}{frame}, \param{const wxString\& }{menuString}, \param{const wxString\& }{itemString}}
a660d684 2854
b0fc8832 2855Find a menu item identifier associated with the given frame's menu bar.
a660d684 2856
954b8ae6
JS
2857\wxheading{Include files}
2858
2859<wx/utils.h>
2860
84ed77ef 2861
b0fc8832 2862\membersection{::wxFindWindowByLabel}\label{wxfindwindowbylabel}
c51deffc 2863
b0fc8832 2864\func{wxWindow *}{wxFindWindowByLabel}{\param{const wxString\& }{label}, \param{wxWindow *}{parent=NULL}}
c51deffc 2865
b829bf55 2866{\bf NB:} This function is obsolete, please use
146ba0fe
VZ
2867\helpref{wxWindow::FindWindowByLabel}{wxwindowfindwindowbylabel} instead.
2868
b0fc8832
VZ
2869Find a window by its label. Depending on the type of window, the label may be a window title
2870or panel item label. If {\it parent} is NULL, the search will start from all top-level
2871frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
2872The search is recursive in both cases.
c51deffc
VZ
2873
2874\wxheading{Include files}
2875
2876<wx/utils.h>
2877
84ed77ef 2878
b0fc8832
VZ
2879\membersection{::wxFindWindowByName}\label{wxfindwindowbyname}
2880
2881\func{wxWindow *}{wxFindWindowByName}{\param{const wxString\& }{name}, \param{wxWindow *}{parent=NULL}}
a660d684 2882
b829bf55 2883{\bf NB:} This function is obsolete, please use
146ba0fe
VZ
2884\helpref{wxWindow::FindWindowByName}{wxwindowfindwindowbyname} instead.
2885
b0fc8832
VZ
2886Find a window by its name (as given in a window constructor or {\bf Create} function call).
2887If {\it parent} is NULL, the search will start from all top-level
2888frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
2889The search is recursive in both cases.
a660d684 2890
b0fc8832 2891If no such named window is found, {\bf wxFindWindowByLabel} is called.
a660d684 2892
954b8ae6
JS
2893\wxheading{Include files}
2894
2895<wx/utils.h>
2896
84ed77ef 2897
b0fc8832 2898\membersection{::wxFindWindowAtPoint}\label{wxfindwindowatpoint}
6787e41e 2899
b0fc8832 2900\func{wxWindow *}{wxFindWindowAtPoint}{\param{const wxPoint\& }{pt}}
6787e41e 2901
b0fc8832
VZ
2902Find the deepest window at the given mouse position in screen coordinates,
2903returning the window if found, or NULL if not.
4d01e583 2904
84ed77ef 2905
b0fc8832 2906\membersection{::wxFindWindowAtPointer}\label{wxfindwindowatpointer}
4d01e583 2907
b0fc8832 2908\func{wxWindow *}{wxFindWindowAtPointer}{\param{wxPoint\& }{pt}}
4d01e583 2909
b0fc8832
VZ
2910Find the deepest window at the mouse pointer position, returning the window
2911and current pointer position in screen coordinates.
4d01e583 2912
84ed77ef 2913
b0fc8832 2914\membersection{::wxGetActiveWindow}\label{wxgetactivewindow}
4d01e583 2915
b0fc8832 2916\func{wxWindow *}{wxGetActiveWindow}{\void}
4d01e583 2917
b0fc8832 2918Gets the currently active window (Windows only).
4d01e583 2919
b0fc8832 2920\wxheading{Include files}
4d01e583 2921
b0fc8832 2922<wx/windows.h>
4d01e583 2923
84ed77ef 2924
8ea92b4d
WS
2925\membersection{::wxGetBatteryState}\label{wxgetbatterystate}
2926
2927\func{wxBatteryState}{wxGetBatteryState}{\void}
2928
bb772a8e
RN
2929Returns battery state as one of \texttt{wxBATTERY\_NORMAL\_STATE},
2930\texttt{wxBATTERY\_LOW\_STATE}, \texttt{wxBATTERY\_CRITICAL\_STATE},
2931\texttt{wxBATTERY\_SHUTDOWN\_STATE} or \texttt{wxBATTERY\_UNKNOWN\_STATE}.
2932\texttt{wxBATTERY\_UNKNOWN\_STATE} is also the default on platforms where
8ea92b4d
WS
2933this feature is not implemented.
2934
2935\wxheading{Include files}
2936
2937<wx/utils.h>
2938
2939
b0fc8832 2940\membersection{::wxGetDisplayName}\label{wxgetdisplayname}
4d01e583 2941
b0fc8832 2942\func{wxString}{wxGetDisplayName}{\void}
4d01e583 2943
b0fc8832 2944Under X only, returns the current display name. See also \helpref{wxSetDisplayName}{wxsetdisplayname}.
4d01e583
VZ
2945
2946\wxheading{Include files}
2947
b0fc8832 2948<wx/utils.h>
4d01e583 2949
84ed77ef 2950
8ea92b4d
WS
2951\membersection{::wxGetPowerType}\label{wxgetpowertype}
2952
2953\func{wxPowerType}{wxGetPowerType}{\void}
2954
bb772a8e
RN
2955Returns the type of power source as one of \texttt{wxPOWER\_SOCKET},
2956\texttt{wxPOWER\_BATTERY} or \texttt{wxPOWER\_UNKNOWN}.
2957\texttt{wxPOWER\_UNKNOWN} is also the default on platforms where this
8ea92b4d
WS
2958feature is not implemented.
2959
2960\wxheading{Include files}
2961
2962<wx/utils.h>
2963
2964
b0fc8832 2965\membersection{::wxGetMousePosition}\label{wxgetmouseposition}
4d01e583 2966
b0fc8832 2967\func{wxPoint}{wxGetMousePosition}{\void}
4d01e583 2968
b0fc8832 2969Returns the mouse position in screen coordinates.
4d01e583
VZ
2970
2971\wxheading{Include files}
2972
2973<wx/utils.h>
2974
84ed77ef 2975
b0fc8832 2976\membersection{::wxGetResource}\label{wxgetresource}
a660d684 2977
b0fc8832
VZ
2978\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2979 \param{const wxString\& *}{value}, \param{const wxString\& }{file = NULL}}
a660d684 2980
b0fc8832
VZ
2981\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2982 \param{float *}{value}, \param{const wxString\& }{file = NULL}}
a660d684 2983
b0fc8832
VZ
2984\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2985 \param{long *}{value}, \param{const wxString\& }{file = NULL}}
50567b69 2986
b0fc8832
VZ
2987\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2988 \param{int *}{value}, \param{const wxString\& }{file = NULL}}
50567b69 2989
b0fc8832
VZ
2990Gets a resource value from the resource database (for example, WIN.INI, or
2991.Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used,
2992otherwise the specified file is used.
50567b69 2993
b0fc8832
VZ
2994Under X, if an application class (wxApp::GetClassName) has been defined,
2995it is appended to the string /usr/lib/X11/app-defaults/ to try to find
2996an applications default file when merging all resource databases.
50567b69 2997
b0fc8832
VZ
2998The reason for passing the result in an argument is that it
2999can be convenient to define a default value, which gets overridden
3000if the value exists in the resource file. It saves a separate
3001test for that resource's existence, and it also allows
3002the overloading of the function for different types.
50567b69 3003
b0fc8832 3004See also \helpref{wxWriteResource}{wxwriteresource}, \helpref{wxConfigBase}{wxconfigbase}.
a660d684 3005
954b8ae6 3006\wxheading{Include files}
a660d684 3007
954b8ae6 3008<wx/utils.h>
a660d684 3009
84ed77ef 3010
634629fa
WS
3011\membersection{::wxGetStockLabel}\label{wxgetstocklabel}
3012
3013\func{wxString}{wxGetStockLabel}{\param{wxWindowID }{id}, \param{bool }{withCodes = true}, \param{wxString }{accelerator = wxEmptyString}}
3014
3015Returns label that should be used for given {\it id} element.
3016
3017\wxheading{Parameters}
3018
3019\docparam{id}{given id of the \helpref{wxMenuItem}{wxmenuitem}, \helpref{wxButton}{wxbutton}, \helpref{wxToolBar}{wxtoolbar} tool, etc.}
3020
3021\docparam{withCodes}{if false then strip accelerator code from the label;
3022usefull for getting labels without accelerator char code like for toolbar tooltip or
3023under platforms without traditional keyboard like smartphones}
3024
3025\docparam{accelerator}{optional accelerator string automatically added to label; useful
3026for building labels for \helpref{wxMenuItem}{wxmenuitem}}
3027
3028\wxheading{Include files}
3029
3030<wx/stockitem.h>
3031
3032
33b494d6
VZ
3033\membersection{::wxGetTopLevelParent}\label{wxgettoplevelparent}
3034
3035\func{wxWindow *}{wxGetTopLevelParent}{\param{wxWindow }{*win}}
3036
3037Returns the first top level parent of the given window, or in other words, the
3038frame or dialog containing it, or {\tt NULL}.
3039
3040\wxheading{Include files}
3041
3042<wx/window.h>
3043
84ed77ef 3044
498a1eeb
RN
3045\membersection{::wxLaunchDefaultBrowser}\label{wxlaunchdefaultbrowser}
3046
3047\func{bool}{wxLaunchDefaultBrowser}{\param{const wxString\& }{sUrl}}
3048
3049Launches the user's default browser and tells it to open the location at {\tt sUrl}.
3050
3051Returns true if the application was successfully launched.
3052
3053\wxheading{Include files}
3054
3055<wx/utils.h>
3056
a660d684
KB
3057\membersection{::wxLoadUserResource}\label{wxloaduserresource}
3058
3059\func{wxString}{wxLoadUserResource}{\param{const wxString\& }{resourceName}, \param{const wxString\& }{resourceType=``TEXT"}}
3060
3061Loads a user-defined Windows resource as a string. If the resource is found, the function creates
3062a new character array and copies the data into it. A pointer to this data is returned. If unsuccessful, NULL is returned.
3063
3064The resource must be defined in the {\tt .rc} file using the following syntax:
3065
3066\begin{verbatim}
3067myResource TEXT file.ext
3068\end{verbatim}
3069
3070where {\tt file.ext} is a file that the resource compiler can find.
3071
a660d684
KB
3072This function is available under Windows only.
3073
954b8ae6
JS
3074\wxheading{Include files}
3075
3076<wx/utils.h>
3077
84ed77ef 3078
a660d684
KB
3079\membersection{::wxPostDelete}\label{wxpostdelete}
3080
3081\func{void}{wxPostDelete}{\param{wxObject *}{object}}
3082
954b8ae6 3083Tells the system to delete the specified object when
a660d684
KB
3084all other events have been processed. In some environments, it is
3085necessary to use this instead of deleting a frame directly with the
954b8ae6 3086delete operator, because some GUIs will still send events to a deleted window.
a660d684
KB
3087
3088Now obsolete: use \helpref{wxWindow::Close}{wxwindowclose} instead.
3089
954b8ae6
JS
3090\wxheading{Include files}
3091
3092<wx/utils.h>
3093
84ed77ef 3094
8e193f38
VZ
3095\membersection{::wxPostEvent}\label{wxpostevent}
3096
3097\func{void}{wxPostEvent}{\param{wxEvtHandler *}{dest}, \param{wxEvent\& }{event}}
3098
9a9e73f6
RR
3099In a GUI application, this function posts {\it event} to the specified {\it dest}
3100object using \helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent}.
3101Otherwise, it dispatches {\it event} immediately using
3102\helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent}.
3103See the respective documentation for details (and caveats).
8e193f38
VZ
3104
3105\wxheading{Include files}
3106
3107<wx/app.h>
3108
84ed77ef 3109
a660d684
KB
3110\membersection{::wxSetDisplayName}\label{wxsetdisplayname}
3111
3112\func{void}{wxSetDisplayName}{\param{const wxString\& }{displayName}}
3113
3114Under X only, sets the current display name. This is the X host and display name such
3115as ``colonsay:0.0", and the function indicates which display should be used for creating
3116windows from this point on. Setting the display within an application allows multiple
3117displays to be used.
3118
3119See also \helpref{wxGetDisplayName}{wxgetdisplayname}.
3120
954b8ae6
JS
3121\wxheading{Include files}
3122
3123<wx/utils.h>
3124
84ed77ef 3125
b0fc8832 3126\membersection{::wxStripMenuCodes}\label{wxstripmenucodes}
a660d684 3127
8a2c6ef8
JS
3128\func{wxString}{wxStripMenuCodes}{\param{const wxString\& }{in}}
3129
7ac13b21 3130\func{void}{wxStripMenuCodes}{\param{char *}{in}, \param{char *}{out}}
a660d684 3131
b829bf55 3132{\bf NB:} This function is obsolete, please use
b0fc8832
VZ
3133\helpref{wxMenuItem::GetLabelFromText}{wxmenuitemgetlabelfromtext} instead.
3134
a660d684 3135Strips any menu codes from {\it in} and places the result
8a2c6ef8
JS
3136in {\it out} (or returns the new string, in the first form).
3137
3138Menu codes include \& (mark the next character with an underline
a660d684
KB
3139as a keyboard shortkey in Windows and Motif) and $\backslash$t (tab in Windows).
3140
954b8ae6
JS
3141\wxheading{Include files}
3142
3143<wx/utils.h>
3144
84ed77ef
VZ
3145
3146\membersection{wxULL}\label{wxull}
3147
3148\func{wxLongLong\_t}{wxULL}{\param{}{number}}
3149
3150This macro is defined for the platforms with a native 64 bit integer type and
3151allows to define unsigned 64 bit compile time constants:
3152
3153\begin{verbatim}
3154 #ifdef wxLongLong_t
3155 unsigned wxLongLong_t ll = wxULL(0x1234567890abcdef);
3156 #endif
3157\end{verbatim}
3158
3159\wxheading{Include files}
3160
3161<wx/longlong.h>
3162
3163\wxheading{See also}
3164
3165\helpref{wxLL}{wxll}, \helpref{wxLongLong}{wxlonglong}
3166
3167
d85cfb37
VZ
3168\membersection{wxVaCopy}\label{wxvacopy}
3169
3170\func{void}{wxVaCopy}{\param{va\_list }{argptrDst}, \param{va\_list}{argptrSrc}}
3171
3172This macro is the same as the standard C99 \texttt{va\_copy} for the compilers
3173which support it or its replacement for those that don't. It must be used to
3174preserve the value of a \texttt{va\_list} object if you need to use it after
3175passing it to another function because it can be modified by the latter.
3176
8ea92b4d 3177As with \texttt{va\_start}, each call to \texttt{wxVaCopy} must have a matching
d85cfb37
VZ
3178\texttt{va\_end}.
3179
3180
a660d684
KB
3181\membersection{::wxWriteResource}\label{wxwriteresource}
3182
3183\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
3184 \param{const wxString\& }{value}, \param{const wxString\& }{file = NULL}}
3185
3186\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
3187 \param{float }{value}, \param{const wxString\& }{file = NULL}}
3188
3189\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
3190 \param{long }{value}, \param{const wxString\& }{file = NULL}}
3191
3192\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
3193 \param{int }{value}, \param{const wxString\& }{file = NULL}}
3194
3195Writes a resource value into the resource database (for example, WIN.INI, or
3196.Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used,
3197otherwise the specified file is used.
3198
3199Under X, the resource databases are cached until the internal function
b0fc8832
VZ
3200\rtfsp{\bf wxFlushResources} is called automatically on exit, when
3201all updated resource databases are written to their files.
8a293590 3202
b0fc8832
VZ
3203Note that it is considered bad manners to write to the .Xdefaults
3204file under Unix, although the WIN.INI file is fair game under Windows.
8a293590 3205
b0fc8832 3206See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfigbase}.
8a293590
RR
3207
3208\wxheading{Include files}
3209
b0fc8832 3210<wx/utils.h>
8a293590 3211
84ed77ef
VZ
3212
3213
81c9effa 3214\section{Byte order macros}\label{byteordermacros}
a660d684 3215
b0fc8832
VZ
3216The endian-ness issues (that is the difference between big-endian and
3217little-endian architectures) are important for the portable programs working
3218with the external binary data (for example, data files or data coming from
3219network) which is usually in some fixed, platform-independent format. The
3220macros are helpful for transforming the data to the correct format.
a660d684 3221
84ed77ef 3222
0180dad6
RR
3223\membersection{wxINTXX\_SWAP\_ALWAYS}\label{intswapalways}
3224
3225\func{wxInt32}{wxINT32\_SWAP\_ALWAYS}{\param{wxInt32 }{value}}
3226
3227\func{wxUint32}{wxUINT32\_SWAP\_ALWAYS}{\param{wxUint32 }{value}}
3228
3229\func{wxInt16}{wxINT16\_SWAP\_ALWAYS}{\param{wxInt16 }{value}}
3230
3231\func{wxUint16}{wxUINT16\_SWAP\_ALWAYS}{\param{wxUint16 }{value}}
3232
b0fc8832
VZ
3233These macros will swap the bytes of the {\it value} variable from little
3234endian to big endian or vice versa unconditionally, i.e. independently of the
3235current platform.
0180dad6 3236
84ed77ef 3237
0180dad6
RR
3238\membersection{wxINTXX\_SWAP\_ON\_BE}\label{intswaponbe}
3239
3240\func{wxInt32}{wxINT32\_SWAP\_ON\_BE}{\param{wxInt32 }{value}}
3241
3242\func{wxUint32}{wxUINT32\_SWAP\_ON\_BE}{\param{wxUint32 }{value}}
3243
3244\func{wxInt16}{wxINT16\_SWAP\_ON\_BE}{\param{wxInt16 }{value}}
3245
3246\func{wxUint16}{wxUINT16\_SWAP\_ON\_BE}{\param{wxUint16 }{value}}
3247
3248This macro will swap the bytes of the {\it value} variable from little
3249endian to big endian or vice versa if the program is compiled on a
ec5d7799 3250big-endian architecture (such as Sun work stations). If the program has
0180dad6
RR
3251been compiled on a little-endian architecture, the value will be unchanged.
3252
ec5d7799 3253Use these macros to read data from and write data to a file that stores
b0fc8832 3254data in little-endian (for example Intel i386) format.
0180dad6 3255
84ed77ef 3256
0180dad6
RR
3257\membersection{wxINTXX\_SWAP\_ON\_LE}\label{intswaponle}
3258
3259\func{wxInt32}{wxINT32\_SWAP\_ON\_LE}{\param{wxInt32 }{value}}
3260
3261\func{wxUint32}{wxUINT32\_SWAP\_ON\_LE}{\param{wxUint32 }{value}}
3262
3263\func{wxInt16}{wxINT16\_SWAP\_ON\_LE}{\param{wxInt16 }{value}}
3264
3265\func{wxUint16}{wxUINT16\_SWAP\_ON\_LE}{\param{wxUint16 }{value}}
3266
3267This macro will swap the bytes of the {\it value} variable from little
3268endian to big endian or vice versa if the program is compiled on a
ec5d7799 3269little-endian architecture (such as Intel PCs). If the program has
0180dad6
RR
3270been compiled on a big-endian architecture, the value will be unchanged.
3271
ec5d7799 3272Use these macros to read data from and write data to a file that stores
b0fc8832
VZ
3273data in big-endian format.
3274
84ed77ef
VZ
3275
3276
f4fcc291 3277\section{RTTI functions}\label{rttimacros}
b0fc8832 3278
fc2171bd 3279wxWidgets uses its own RTTI ("run-time type identification") system which
b0fc8832 3280predates the current standard C++ RTTI and so is kept for backwards
2edb0bde 3281compatibility reasons but also because it allows some things which the
b0fc8832
VZ
3282standard RTTI doesn't directly support (such as creating a class from its
3283name).
3284
3285The standard C++ RTTI can be used in the user code without any problems and in
3286general you shouldn't need to use the functions and the macros in this section
fc2171bd 3287unless you are thinking of modifying or adding any wxWidgets classes.
b0fc8832
VZ
3288
3289\wxheading{See also}
3290
3291\helpref{RTTI overview}{runtimeclassoverview}
0180dad6 3292
84ed77ef 3293
a660d684
KB
3294\membersection{CLASSINFO}\label{classinfo}
3295
3296\func{wxClassInfo *}{CLASSINFO}{className}
3297
3298Returns a pointer to the wxClassInfo object associated with this class.
3299
954b8ae6
JS
3300\wxheading{Include files}
3301
3302<wx/object.h>
3303
84ed77ef 3304
b0fc8832 3305\membersection{DECLARE\_ABSTRACT\_CLASS}\label{declareabstractclass}
a660d684
KB
3306
3307\func{}{DECLARE\_ABSTRACT\_CLASS}{className}
3308
3309Used inside a class declaration to declare that the class should be
3310made known to the class hierarchy, but objects of this class cannot be created
3311dynamically. The same as DECLARE\_CLASS.
3312
3313Example:
3314
3315\begin{verbatim}
3316class wxCommand: public wxObject
3317{
3318 DECLARE_ABSTRACT_CLASS(wxCommand)
3319
3320 private:
3321 ...
3322 public:
3323 ...
3324};
3325\end{verbatim}
3326
954b8ae6
JS
3327\wxheading{Include files}
3328
3329<wx/object.h>
3330
84ed77ef 3331
a660d684
KB
3332\membersection{DECLARE\_APP}\label{declareapp}
3333
3334\func{}{DECLARE\_APP}{className}
3335
8ea92b4d
WS
3336This is used in headers to create a forward declaration of the
3337\helpref{wxGetApp}{wxgetapp} function implemented by
3338\helpref{IMPLEMENT\_APP}{implementapp}. It creates the declaration
749caeeb 3339{\tt className\& wxGetApp(void)}.
a660d684
KB
3340
3341Example:
3342
3343\begin{verbatim}
3344 DECLARE_APP(MyApp)
3345\end{verbatim}
3346
954b8ae6
JS
3347\wxheading{Include files}
3348
3349<wx/app.h>
3350
84ed77ef 3351
b0fc8832 3352\membersection{DECLARE\_CLASS}\label{declareclass}
a660d684
KB
3353
3354\func{}{DECLARE\_CLASS}{className}
3355
3356Used inside a class declaration to declare that the class should be
3357made known to the class hierarchy, but objects of this class cannot be created
3358dynamically. The same as DECLARE\_ABSTRACT\_CLASS.
3359
954b8ae6
JS
3360\wxheading{Include files}
3361
3362<wx/object.h>
3363
84ed77ef 3364
b0fc8832 3365\membersection{DECLARE\_DYNAMIC\_CLASS}\label{declaredynamicclass}
a660d684
KB
3366
3367\func{}{DECLARE\_DYNAMIC\_CLASS}{className}
3368
f3886d37
VZ
3369Used inside a class declaration to make the class known to wxWidgets RTTI
3370system and also declare that the objects of this class should be dynamically
3371creatable from run-time type information. Notice that this implies that the
3372class should have a default constructor, if this is not the case consider using
3373\helpref{DECLARE\_CLASS}{declareclass}.
a660d684
KB
3374
3375Example:
3376
3377\begin{verbatim}
3378class wxFrame: public wxWindow
3379{
3380 DECLARE_DYNAMIC_CLASS(wxFrame)
3381
3382 private:
2b5f62a0 3383 const wxString& frameTitle;
a660d684
KB
3384 public:
3385 ...
3386};
3387\end{verbatim}
3388
954b8ae6
JS
3389\wxheading{Include files}
3390
3391<wx/object.h>
3392
84ed77ef 3393
b0fc8832 3394\membersection{IMPLEMENT\_ABSTRACT\_CLASS}\label{implementabstractclass}
a660d684
KB
3395
3396\func{}{IMPLEMENT\_ABSTRACT\_CLASS}{className, baseClassName}
3397
3398Used in a C++ implementation file to complete the declaration of
3399a class that has run-time type information. The same as IMPLEMENT\_CLASS.
3400
3401Example:
3402
3403\begin{verbatim}
3404IMPLEMENT_ABSTRACT_CLASS(wxCommand, wxObject)
3405
3406wxCommand::wxCommand(void)
3407{
3408...
3409}
3410\end{verbatim}
3411
954b8ae6
JS
3412\wxheading{Include files}
3413
3414<wx/object.h>
3415
84ed77ef 3416
b0fc8832 3417\membersection{IMPLEMENT\_ABSTRACT\_CLASS2}\label{implementabstractclass2}
a660d684
KB
3418
3419\func{}{IMPLEMENT\_ABSTRACT\_CLASS2}{className, baseClassName1, baseClassName2}
3420
3421Used in a C++ implementation file to complete the declaration of
3422a class that has run-time type information and two base classes. The same as IMPLEMENT\_CLASS2.
3423
954b8ae6
JS
3424\wxheading{Include files}
3425
3426<wx/object.h>
3427
84ed77ef 3428
a660d684
KB
3429\membersection{IMPLEMENT\_APP}\label{implementapp}
3430
3431\func{}{IMPLEMENT\_APP}{className}
3432
3433This is used in the application class implementation file to make the application class known to
fc2171bd 3434wxWidgets for dynamic construction. You use this instead of
a660d684
KB
3435
3436Old form:
3437
3438\begin{verbatim}
3439 MyApp myApp;
3440\end{verbatim}
3441
3442New form:
3443
3444\begin{verbatim}
3445 IMPLEMENT_APP(MyApp)
3446\end{verbatim}
3447
3448See also \helpref{DECLARE\_APP}{declareapp}.
3449
954b8ae6
JS
3450\wxheading{Include files}
3451
3452<wx/app.h>
3453
84ed77ef 3454
b0fc8832 3455\membersection{IMPLEMENT\_CLASS}\label{implementclass}
a660d684
KB
3456
3457\func{}{IMPLEMENT\_CLASS}{className, baseClassName}
3458
3459Used in a C++ implementation file to complete the declaration of
3460a class that has run-time type information. The same as IMPLEMENT\_ABSTRACT\_CLASS.
3461
954b8ae6
JS
3462\wxheading{Include files}
3463
3464<wx/object.h>
3465
84ed77ef 3466
b0fc8832 3467\membersection{IMPLEMENT\_CLASS2}\label{implementclass2}
a660d684
KB
3468
3469\func{}{IMPLEMENT\_CLASS2}{className, baseClassName1, baseClassName2}
3470
3471Used in a C++ implementation file to complete the declaration of a
3472class that has run-time type information and two base classes. The
3473same as IMPLEMENT\_ABSTRACT\_CLASS2.
3474
954b8ae6
JS
3475\wxheading{Include files}
3476
3477<wx/object.h>
3478
84ed77ef 3479
b0fc8832 3480\membersection{IMPLEMENT\_DYNAMIC\_CLASS}\label{implementdynamicclass}
a660d684
KB
3481
3482\func{}{IMPLEMENT\_DYNAMIC\_CLASS}{className, baseClassName}
3483
3484Used in a C++ implementation file to complete the declaration of
3485a class that has run-time type information, and whose instances
3486can be created dynamically.
3487
3488Example:
3489
3490\begin{verbatim}
3491IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
3492
3493wxFrame::wxFrame(void)
3494{
3495...
3496}
3497\end{verbatim}
3498
954b8ae6
JS
3499\wxheading{Include files}
3500
3501<wx/object.h>
3502
84ed77ef 3503
b0fc8832 3504\membersection{IMPLEMENT\_DYNAMIC\_CLASS2}\label{implementdynamicclass2}
a660d684
KB
3505
3506\func{}{IMPLEMENT\_DYNAMIC\_CLASS2}{className, baseClassName1, baseClassName2}
3507
3508Used in a C++ implementation file to complete the declaration of
3509a class that has run-time type information, and whose instances
3510can be created dynamically. Use this for classes derived from two
3511base classes.
3512
954b8ae6
JS
3513\wxheading{Include files}
3514
3515<wx/object.h>
3516
84ed77ef 3517
f6bcfd97
BP
3518\membersection{wxConstCast}\label{wxconstcast}
3519
f7637829 3520\func{classname *}{wxConstCast}{ptr, classname}
f6bcfd97
BP
3521
3522This macro expands into {\tt const\_cast<classname *>(ptr)} if the compiler
3523supports {\it const\_cast} or into an old, C-style cast, otherwise.
3524
3525\wxheading{See also}
3526
f29fe169 3527\helpref{wx\_const\_cast}{wxconstcastraw}\\
f6bcfd97
BP
3528\helpref{wxDynamicCast}{wxdynamiccast}\\
3529\helpref{wxStaticCast}{wxstaticcast}
3530
84ed77ef 3531
b0fc8832
VZ
3532\membersection{::wxCreateDynamicObject}\label{wxcreatedynamicobject}
3533
3534\func{wxObject *}{wxCreateDynamicObject}{\param{const wxString\& }{className}}
3535
3536Creates and returns an object of the given class, if the class has been
3537registered with the dynamic class system using DECLARE... and IMPLEMENT... macros.
3538
84ed77ef 3539
34636400
VZ
3540\membersection{WXDEBUG\_NEW}\label{debugnew}
3541
3542\func{}{WXDEBUG\_NEW}{arg}
3543
3544This is defined in debug mode to be call the redefined new operator
3545with filename and line number arguments. The definition is:
3546
3547\begin{verbatim}
3548#define WXDEBUG_NEW new(__FILE__,__LINE__)
3549\end{verbatim}
3550
3551In non-debug mode, this is defined as the normal new operator.
3552
3553\wxheading{Include files}
3554
3555<wx/object.h>
3556
84ed77ef 3557
34636400
VZ
3558\membersection{wxDynamicCast}\label{wxdynamiccast}
3559
f7637829 3560\func{classname *}{wxDynamicCast}{ptr, classname}
34636400
VZ
3561
3562This macro returns the pointer {\it ptr} cast to the type {\it classname *} if
8a7f3379 3563the pointer is of this type (the check is done during the run-time) or
f7637829
VZ
3564{\tt NULL} otherwise. Usage of this macro is preferred over obsoleted
3565wxObject::IsKindOf() function.
34636400 3566
f7637829
VZ
3567The {\it ptr} argument may be {\tt NULL}, in which case {\tt NULL} will be
3568returned.
34636400
VZ
3569
3570Example:
3571
3572\begin{verbatim}
3573 wxWindow *win = wxWindow::FindFocus();
3574 wxTextCtrl *text = wxDynamicCast(win, wxTextCtrl);
3575 if ( text )
3576 {
3577 // a text control has the focus...
3578 }
3579 else
3580 {
f6bcfd97 3581 // no window has the focus or it is not a text control
34636400
VZ
3582 }
3583\end{verbatim}
3584
3585\wxheading{See also}
3586
f6bcfd97 3587\helpref{RTTI overview}{runtimeclassoverview}\\
f7637829 3588\helpref{wxDynamicCastThis}{wxdynamiccastthis}\\
f6bcfd97 3589\helpref{wxConstCast}{wxconstcast}\\
330be534 3590\helpref{wxStaticCast}{wxstaticcast}
34636400 3591
84ed77ef 3592
f7637829
VZ
3593\membersection{wxDynamicCastThis}\label{wxdynamiccastthis}
3594
3595\func{classname *}{wxDynamicCastThis}{classname}
3596
3597This macro is equivalent to {\tt wxDynamicCast(this, classname)} but the
3598latter provokes spurious compilation warnings from some compilers (because it
3599tests whether {\tt this} pointer is non {\tt NULL} which is always true), so
3600this macro should be used to avoid them.
3601
3602\wxheading{See also}
3603
3604\helpref{wxDynamicCast}{wxdynamiccast}
3605
84ed77ef 3606
f6bcfd97
BP
3607\membersection{wxStaticCast}\label{wxstaticcast}
3608
f7637829 3609\func{classname *}{wxStaticCast}{ptr, classname}
f6bcfd97
BP
3610
3611This macro checks that the cast is valid in debug mode (an assert failure will
3612result if {\tt wxDynamicCast(ptr, classname) == NULL}) and then returns the
3613result of executing an equivalent of {\tt static\_cast<classname *>(ptr)}.
3614
f29fe169
VZ
3615\wxheading{See also}
3616
3617\helpref{wx\_static\_cast}{wxstaticcastraw}\\
f6bcfd97
BP
3618\helpref{wxDynamicCast}{wxdynamiccast}\\
3619\helpref{wxConstCast}{wxconstcast}
3620
84ed77ef 3621
f29fe169
VZ
3622\membersection{wx\_const\_cast}\label{wxconstcastraw}
3623
3624\func{T}{wx\_const\_cast}{T, x}
3625
8ea92b4d 3626Same as \texttt{const\_cast<T>(x)} if the compiler supports const cast or
f29fe169
VZ
3627\texttt{(T)x} for old compilers. Unlike \helpref{wxConstCast}{wxconstcast},
3628the cast it to the type \arg{T} and not to \texttt{T *} and also the order of
3629arguments is the same as for the standard cast.
3630
3631\wxheading{See also}
3632
8c8d66c5
VZ
3633\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw},\\
3634\helpref{wx\_static\_cast}{wxstaticcastraw}
3635
3636
3637\membersection{wx\_reinterpret\_cast}\label{wxreinterpretcastraw}
3638
3639\func{T}{wx\_reinterpret\_cast}{T, x}
3640
8ea92b4d 3641Same as \texttt{reinterpret\_cast<T>(x)} if the compiler supports reinterpret cast or
8c8d66c5
VZ
3642\texttt{(T)x} for old compilers.
3643
3644\wxheading{See also}
3645
3646\helpref{wx\_const\_cast}{wxconstcastraw},\\
3647\helpref{wx\_static\_cast}{wxstaticcastraw}
f29fe169
VZ
3648
3649
3650\membersection{wx\_static\_cast}\label{wxstaticcastraw}
3651
3652\func{T}{wx\_static\_cast}{T, x}
3653
8ea92b4d 3654Same as \texttt{static\_cast<T>(x)} if the compiler supports static cast or
f29fe169
VZ
3655\texttt{(T)x} for old compilers. Unlike \helpref{wxStaticCast}{wxstaticcast},
3656there are no checks being done and the meaning of the macro arguments is exactly
3657the same as for the standard static cast, i.e. \arg{T} is the full type name and
3658star is not appended to it.
3659
3660\wxheading{See also}
3661
8c8d66c5
VZ
3662\helpref{wx\_const\_cast}{wxconstcastraw},\\
3663\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}
f29fe169
VZ
3664
3665
84ed77ef 3666
6fb26ea3
JS
3667\section{Log functions}\label{logfunctions}
3668
3669These functions provide a variety of logging functions: see \helpref{Log classes overview}{wxlogoverview} for
f68586e5
VZ
3670further information. The functions use (implicitly) the currently active log
3671target, so their descriptions here may not apply if the log target is not the
fc2171bd 3672standard one (installed by wxWidgets in the beginning of the program).
6fb26ea3 3673
954b8ae6
JS
3674\wxheading{Include files}
3675
3676<wx/log.h>
3677
84ed77ef 3678
b0fc8832
VZ
3679\membersection{::wxDebugMsg}\label{wxdebugmsg}
3680
3681\func{void}{wxDebugMsg}{\param{const wxString\& }{fmt}, \param{...}{}}
3682
2bd25c5a
VZ
3683{\bf NB:} This function is now obsolete, replaced by \helpref{Log
3684functions}{logfunctions} and \helpref{wxLogDebug}{wxlogdebug} in particular.
b0fc8832
VZ
3685
3686Display a debugging message; under Windows, this will appear on the
3687debugger command window, and under Unix, it will be written to standard
3688error.
3689
3690The syntax is identical to {\bf printf}: pass a format string and a
3691variable list of arguments.
3692
3693{\bf Tip:} under Windows, if your application crashes before the
3694message appears in the debugging window, put a wxYield call after
3695each wxDebugMsg call. wxDebugMsg seems to be broken under WIN32s
3696(at least for Watcom C++): preformat your messages and use OutputDebugString
3697instead.
3698
b0fc8832
VZ
3699\wxheading{Include files}
3700
3701<wx/utils.h>
3702
84ed77ef 3703
b0fc8832
VZ
3704\membersection{::wxError}\label{wxerror}
3705
fc2171bd 3706\func{void}{wxError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWidgets Internal Error"}}
b0fc8832 3707
b829bf55 3708{\bf NB:} This function is now obsolete, please use \helpref{wxLogError}{wxlogerror}
b0fc8832
VZ
3709instead.
3710
3711Displays {\it msg} and continues. This writes to standard error under
3712Unix, and pops up a message box under Windows. Used for internal
fc2171bd 3713wxWidgets errors. See also \helpref{wxFatalError}{wxfatalerror}.
b0fc8832
VZ
3714
3715\wxheading{Include files}
3716
3717<wx/utils.h>
3718
84ed77ef 3719
b0fc8832
VZ
3720\membersection{::wxFatalError}\label{wxfatalerror}
3721
fc2171bd 3722\func{void}{wxFatalError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWidgets Fatal Error"}}
b0fc8832 3723
b829bf55 3724{\bf NB:} This function is now obsolete, please use
b0fc8832
VZ
3725\helpref{wxLogFatalError}{wxlogfatalerror} instead.
3726
3727Displays {\it msg} and exits. This writes to standard error under Unix,
3728and pops up a message box under Windows. Used for fatal internal
fc2171bd 3729wxWidgets errors. See also \helpref{wxError}{wxerror}.
b0fc8832
VZ
3730
3731\wxheading{Include files}
3732
3733<wx/utils.h>
3734
84ed77ef 3735
6fb26ea3
JS
3736\membersection{::wxLogError}\label{wxlogerror}
3737
7ac13b21 3738\func{void}{wxLogError}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3739
1d63fd6b
GD
3740\func{void}{wxVLogError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3741
ea44a631 3742The functions to use for error messages, i.e. the messages that must be shown
f68586e5
VZ
3743to the user. The default processing is to pop up a message box to inform the
3744user about it.
6fb26ea3 3745
84ed77ef 3746
6fb26ea3
JS
3747\membersection{::wxLogFatalError}\label{wxlogfatalerror}
3748
7ac13b21 3749\func{void}{wxLogFatalError}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3750
1d63fd6b
GD
3751\func{void}{wxVLogFatalError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3752
6fb26ea3
JS
3753Like \helpref{wxLogError}{wxlogerror}, but also
3754terminates the program with the exit code 3. Using {\it abort()} standard
3755function also terminates the program with this exit code.
3756
84ed77ef 3757
6fb26ea3
JS
3758\membersection{::wxLogWarning}\label{wxlogwarning}
3759
7ac13b21 3760\func{void}{wxLogWarning}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3761
1d63fd6b
GD
3762\func{void}{wxVLogWarning}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3763
f68586e5
VZ
3764For warnings - they are also normally shown to the user, but don't interrupt
3765the program work.
6fb26ea3 3766
84ed77ef 3767
6fb26ea3
JS
3768\membersection{::wxLogMessage}\label{wxlogmessage}
3769
7ac13b21 3770\func{void}{wxLogMessage}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3771
1d63fd6b
GD
3772\func{void}{wxVLogMessage}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3773
ea44a631 3774For all normal, informational messages. They also appear in a message box by
8004cd7a 3775default (but it can be changed).
84ed77ef 3776
6fb26ea3
JS
3777\membersection{::wxLogVerbose}\label{wxlogverbose}
3778
7ac13b21
GT
3779\func{void}{wxLogVerbose}{\param{const char *}{formatString}, \param{...}{}}
3780
1d63fd6b 3781\func{void}{wxVLogVerbose}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3782
f6bcfd97 3783For verbose output. Normally, it is suppressed, but
6fb26ea3
JS
3784might be activated if the user wishes to know more details about the program
3785progress (another, but possibly confusing name for the same function is {\bf wxLogInfo}).
3786
84ed77ef 3787
6fb26ea3
JS
3788\membersection{::wxLogStatus}\label{wxlogstatus}
3789
7ac13b21 3790\func{void}{wxLogStatus}{\param{wxFrame *}{frame}, \param{const char *}{formatString}, \param{...}{}}
f68586e5 3791
1d63fd6b 3792\func{void}{wxVLogStatus}{\param{wxFrame *}{frame}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
7ac13b21
GT
3793
3794\func{void}{wxLogStatus}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3795
1d63fd6b
GD
3796\func{void}{wxVLogStatus}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3797
ea44a631 3798Messages logged by these functions will appear in the statusbar of the {\it
f68586e5 3799frame} or of the top level application window by default (i.e. when using
ea44a631 3800the second version of the functions).
f68586e5
VZ
3801
3802If the target frame doesn't have a statusbar, the message will be lost.
6fb26ea3 3803
84ed77ef 3804
6fb26ea3
JS
3805\membersection{::wxLogSysError}\label{wxlogsyserror}
3806
7ac13b21
GT
3807\func{void}{wxLogSysError}{\param{const char *}{formatString}, \param{...}{}}
3808
1d63fd6b 3809\func{void}{wxVLogSysError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3810
fc2171bd 3811Mostly used by wxWidgets itself, but might be handy for logging errors after
f68586e5
VZ
3812system call (API function) failure. It logs the specified message text as well
3813as the last system error code ({\it errno} or {\it ::GetLastError()} depending
3814on the platform) and the corresponding error message. The second form
f6bcfd97 3815of this function takes the error code explicitly as the first argument.
6fb26ea3 3816
6d516e09
VZ
3817\wxheading{See also}
3818
3819\helpref{wxSysErrorCode}{wxsyserrorcode},
3820\helpref{wxSysErrorMsg}{wxsyserrormsg}
3821
84ed77ef 3822
6fb26ea3
JS
3823\membersection{::wxLogDebug}\label{wxlogdebug}
3824
7ac13b21
GT
3825\func{void}{wxLogDebug}{\param{const char *}{formatString}, \param{...}{}}
3826
1d63fd6b 3827\func{void}{wxVLogDebug}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3828
ea44a631
GD
3829The right functions for debug output. They only do something in debug
3830mode (when the preprocessor symbol \_\_WXDEBUG\_\_ is defined) and expand to
f68586e5 3831nothing in release mode (otherwise).
6fb26ea3 3832
84ed77ef 3833
6fb26ea3
JS
3834\membersection{::wxLogTrace}\label{wxlogtrace}
3835
7ac13b21 3836\func{void}{wxLogTrace}{\param{const char *}{formatString}, \param{...}{}}
1d63fd6b
GD
3837
3838\func{void}{wxVLogTrace}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3839
f68586e5 3840\func{void}{wxLogTrace}{\param{const char *}{mask}, \param{const char *}{formatString}, \param{...}{}}
7ac13b21 3841
1d63fd6b 3842\func{void}{wxVLogTrace}{\param{const char *}{mask}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
f68586e5
VZ
3843
3844\func{void}{wxLogTrace}{\param{wxTraceMask}{ mask}, \param{const char *}{formatString}, \param{...}{}}
7ac13b21 3845
1d63fd6b 3846\func{void}{wxVLogTrace}{\param{wxTraceMask}{ mask}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
f68586e5
VZ
3847
3848As {\bf wxLogDebug}, trace functions only do something in debug build and
3849expand to nothing in the release one. The reason for making
3850it a separate function from it is that usually there are a lot of trace
3851messages, so it might make sense to separate them from other debug messages.
3852
3853The trace messages also usually can be separated into different categories and
ec5d7799 3854the second and third versions of this function only log the message if the
f68586e5
VZ
3855{\it mask} which it has is currently enabled in \helpref{wxLog}{wxlog}. This
3856allows to selectively trace only some operations and not others by changing
3857the value of the trace mask (possible during the run-time).
3858
3859For the second function (taking a string mask), the message is logged only if
ec5d7799 3860the mask has been previously enabled by the call to
6f97a409
VS
3861\helpref{AddTraceMask}{wxlogaddtracemask} or by setting
3862\helpref{{\tt WXTRACE} environment variable}{envvars}.
3863The predefined string trace masks
fc2171bd 3864used by wxWidgets are:
f68586e5
VZ
3865
3866\begin{itemize}\itemsep=0pt
3867\item wxTRACE\_MemAlloc: trace memory allocation (new/delete)
3868\item wxTRACE\_Messages: trace window messages/X callbacks
3869\item wxTRACE\_ResAlloc: trace GDI resource allocation
3870\item wxTRACE\_RefCount: trace various ref counting operations
3871\item wxTRACE\_OleCalls: trace OLE method calls (Win32 only)
3872\end{itemize}
6fb26ea3 3873
f70c0443
WS
3874{\bf Caveats:} since both the mask and the format string are strings,
3875this might lead to function signature confusion in some cases:
3876if you intend to call the format string only version of wxLogTrace,
3877then add a \%s format string parameter and then supply a second string parameter for that \%s, the string mask version of wxLogTrace will erroneously get called instead, since you are supplying two string parameters to the function.
3878In this case you'll unfortunately have to avoid having two leading
3980000c 3879string parameters, e.g. by adding a bogus integer (with its \%d format string).
f70c0443
WS
3880
3881The third version of the function only logs the message if all the bits
f68586e5
VZ
3882corresponding to the {\it mask} are set in the wxLog trace mask which can be
3883set by \helpref{SetTraceMask}{wxlogsettracemask}. This version is less
3884flexible than the previous one because it doesn't allow defining the user
3885trace masks easily - this is why it is deprecated in favour of using string
3886trace masks.
6fb26ea3
JS
3887
3888\begin{itemize}\itemsep=0pt
3889\item wxTraceMemAlloc: trace memory allocation (new/delete)
3890\item wxTraceMessages: trace window messages/X callbacks
3891\item wxTraceResAlloc: trace GDI resource allocation
3892\item wxTraceRefCount: trace various ref counting operations
f68586e5 3893\item wxTraceOleCalls: trace OLE method calls (Win32 only)
6fb26ea3
JS
3894\end{itemize}
3895
84ed77ef 3896
c11d62a6
VZ
3897\membersection{::wxSafeShowMessage}\label{wxsafeshowmessage}
3898
3899\func{void}{wxSafeShowMessage}{\param{const wxString\& }{title}, \param{const wxString\& }{text}}
3900
3901This function shows a message to the user in a safe way and should be safe to
3902call even before the application has been initialized or if it is currently in
3903some other strange state (for example, about to crash). Under Windows this
b829bf55 3904function shows a message box using a native dialog instead of
c11d62a6
VZ
3905\helpref{wxMessageBox}{wxmessagebox} (which might be unsafe to call), elsewhere
3906it simply prints the message to the standard output using the title as prefix.
3907
3908\wxheading{Parameters}
3909
3910\docparam{title}{The title of the message box shown to the user or the prefix
3911of the message string}
3912
3913\docparam{text}{The text to show to the user}
3914
3915\wxheading{See also}
3916
3917\helpref{wxLogFatalError}{wxlogfatalerror}
3918
3919\wxheading{Include files}
3920
3921<wx/log.h>
3922
84ed77ef 3923
6d516e09
VZ
3924\membersection{::wxSysErrorCode}\label{wxsyserrorcode}
3925
3926\func{unsigned long}{wxSysErrorCode}{\void}
3927
3928Returns the error code from the last system call. This function uses
3929{\tt errno} on Unix platforms and {\tt GetLastError} under Win32.
3930
3931\wxheading{See also}
3932
3933\helpref{wxSysErrorMsg}{wxsyserrormsg},
3934\helpref{wxLogSysError}{wxlogsyserror}
3935
84ed77ef 3936
6d516e09
VZ
3937\membersection{::wxSysErrorMsg}\label{wxsyserrormsg}
3938
3939\func{const wxChar *}{wxSysErrorMsg}{\param{unsigned long }{errCode = 0}}
3940
ec5d7799
RD
3941Returns the error message corresponding to the given system error code. If
3942{\it errCode} is $0$ (default), the last error code (as returned by
6d516e09
VZ
3943\helpref{wxSysErrorCode}{wxsyserrorcode}) is used.
3944
3945\wxheading{See also}
3946
3947\helpref{wxSysErrorCode}{wxsyserrorcode},
3948\helpref{wxLogSysError}{wxlogsyserror}
3949
84ed77ef 3950
b0fc8832
VZ
3951\membersection{WXTRACE}\label{trace}
3952
3953\wxheading{Include files}
3954
3955<wx/object.h>
3956
3957\func{}{WXTRACE}{formatString, ...}
3958
2bd25c5a
VZ
3959{\bf NB:} This macro is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3960
b0fc8832
VZ
3961Calls wxTrace with printf-style variable argument syntax. Output
3962is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3963
b0fc8832
VZ
3964\wxheading{Include files}
3965
3966<wx/memory.h>
3967
84ed77ef 3968
b0fc8832
VZ
3969\membersection{WXTRACELEVEL}\label{tracelevel}
3970
3971\func{}{WXTRACELEVEL}{level, formatString, ...}
3972
2bd25c5a
VZ
3973{\bf NB:} This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3974
b0fc8832
VZ
3975Calls wxTraceLevel with printf-style variable argument syntax. Output
3976is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3977The first argument should be the level at which this information is appropriate.
3978It will only be output if the level returned by wxDebugContext::GetLevel is equal to or greater than
3979this value.
3980
b0fc8832
VZ
3981\wxheading{Include files}
3982
3983<wx/memory.h>
3984
84ed77ef 3985
b0fc8832
VZ
3986\membersection{::wxTrace}\label{wxtrace}
3987
3988\func{void}{wxTrace}{\param{const wxString\& }{fmt}, \param{...}{}}
3989
2bd25c5a
VZ
3990{\bf NB:} This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3991
b0fc8832
VZ
3992Takes printf-style variable argument syntax. Output
3993is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3994
b0fc8832
VZ
3995\wxheading{Include files}
3996
3997<wx/memory.h>
3998
84ed77ef 3999
b0fc8832
VZ
4000\membersection{::wxTraceLevel}\label{wxtracelevel}
4001
4002\func{void}{wxTraceLevel}{\param{int}{ level}, \param{const wxString\& }{fmt}, \param{...}{}}
4003
2bd25c5a
VZ
4004{\bf NB:} This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
4005
b0fc8832
VZ
4006Takes printf-style variable argument syntax. Output
4007is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
4008The first argument should be the level at which this information is appropriate.
4009It will only be output if the level returned by wxDebugContext::GetLevel is equal to or greater than
4010this value.
4011
b0fc8832
VZ
4012\wxheading{Include files}
4013
4014<wx/memory.h>
4015
84ed77ef
VZ
4016
4017
f6bcfd97
BP
4018\section{Time functions}\label{timefunctions}
4019
4020The functions in this section deal with getting the current time and
4021starting/stopping the global timers. Please note that the timer functions are
ec5d7799 4022deprecated because they work with one global timer only and
f6bcfd97 4023\helpref{wxTimer}{wxtimer} and/or \helpref{wxStopWatch}{wxstopwatch} classes
ec5d7799
RD
4024should be used instead. For retrieving the current time, you may also use
4025\helpref{wxDateTime::Now}{wxdatetimenow} or
f6bcfd97
BP
4026\helpref{wxDateTime::UNow}{wxdatetimeunow} methods.
4027
84ed77ef 4028
f6bcfd97
BP
4029\membersection{::wxGetElapsedTime}\label{wxgetelapsedtime}
4030
cc81d32f 4031\func{long}{wxGetElapsedTime}{\param{bool}{ resetTimer = true}}
f6bcfd97
BP
4032
4033Gets the time in milliseconds since the last \helpref{::wxStartTimer}{wxstarttimer}.
4034
cc81d32f 4035If {\it resetTimer} is true (the default), the timer is reset to zero
f6bcfd97
BP
4036by this call.
4037
4038See also \helpref{wxTimer}{wxtimer}.
4039
4040\wxheading{Include files}
4041
4042<wx/timer.h>
4043
84ed77ef 4044
f6bcfd97
BP
4045\membersection{::wxGetLocalTime}\label{wxgetlocaltime}
4046
4047\func{long}{wxGetLocalTime}{\void}
4048
4049Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
4050
4051\wxheading{See also}
4052
4053\helpref{wxDateTime::Now}{wxdatetimenow}
4054
4055\wxheading{Include files}
4056
4057<wx/timer.h>
4058
84ed77ef 4059
f6bcfd97
BP
4060\membersection{::wxGetLocalTimeMillis}\label{wxgetlocaltimemillis}
4061
a9d171bd 4062\func{wxLongLong}{wxGetLocalTimeMillis}{\void}
f6bcfd97
BP
4063
4064Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
4065
4066\wxheading{See also}
4067
4068\helpref{wxDateTime::Now}{wxdatetimenow},\\
a9d171bd 4069\helpref{wxLongLong}{wxlonglong}
f6bcfd97
BP
4070
4071\wxheading{Include files}
4072
4073<wx/timer.h>
4074
84ed77ef 4075
f6bcfd97
BP
4076\membersection{::wxGetUTCTime}\label{wxgetutctime}
4077
4078\func{long}{wxGetUTCTime}{\void}
4079
4080Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
4081
4082\wxheading{See also}
4083
4084\helpref{wxDateTime::Now}{wxdatetimenow}
4085
4086\wxheading{Include files}
4087
4088<wx/timer.h>
4089
84ed77ef 4090
08873d36
VZ
4091\membersection{::wxMicroSleep}\label{wxmicrosleep}
4092
4093\func{void}{wxMicroSleep}{\param{unsigned long}{ microseconds}}
4094
4095Sleeps for the specified number of microseconds. The microsecond resolution may
4096not, in fact, be available on all platforms (currently only Unix platforms with
8ea92b4d 4097nanosleep(2) may provide it) in which case this is the same as
08873d36
VZ
4098\helpref{wxMilliSleep}{wxmillisleep}(\arg{microseconds}$/1000$).
4099
4100\wxheading{Include files}
4101
4102<wx/utils.h>
4103
4104
4105\membersection{::wxMilliSleep}\label{wxmillisleep}
4106
4107\func{void}{wxMilliSleep}{\param{unsigned long}{ milliseconds}}
4108
4109Sleeps for the specified number of milliseconds. Notice that usage of this
4110function is encouraged instead of calling usleep(3) directly because the
4111standard usleep() function is not MT safe.
4112
4113\wxheading{Include files}
4114
4115<wx/utils.h>
4116
4117
b0fc8832
VZ
4118\membersection{::wxNow}\label{wxnow}
4119
4120\func{wxString}{wxNow}{\void}
4121
4122Returns a string representing the current date and time.
4123
4124\wxheading{Include files}
4125
4126<wx/utils.h>
4127
84ed77ef 4128
b0fc8832
VZ
4129\membersection{::wxSleep}\label{wxsleep}
4130
4131\func{void}{wxSleep}{\param{int}{ secs}}
4132
4133Sleeps for the specified number of seconds.
4134
4135\wxheading{Include files}
4136
4137<wx/utils.h>
4138
84ed77ef 4139
f6bcfd97
BP
4140\membersection{::wxStartTimer}\label{wxstarttimer}
4141
4142\func{void}{wxStartTimer}{\void}
4143
4144Starts a stopwatch; use \helpref{::wxGetElapsedTime}{wxgetelapsedtime} to get the elapsed time.
4145
4146See also \helpref{wxTimer}{wxtimer}.
4147
4148\wxheading{Include files}
4149
4150<wx/timer.h>
4151
84ed77ef 4152
b0fc8832
VZ
4153\membersection{::wxUsleep}\label{wxusleep}
4154
4155\func{void}{wxUsleep}{\param{unsigned long}{ milliseconds}}
4156
08873d36 4157This function is deprecated because its name is misleading: notice that the
8ea92b4d
WS
4158argument is in milliseconds, not microseconds. Please use either
4159\helpref{wxMilliSleep}{wxmillisleep} or \helpref{wxMicroSleep}{wxmicrosleep}
08873d36 4160depending on the resolution you need.
b0fc8832 4161
84ed77ef
VZ
4162
4163
6fb26ea3
JS
4164\section{Debugging macros and functions}\label{debugmacros}
4165
8f5d9104 4166Useful macros and functions for error checking and defensive programming.
fc2171bd 4167wxWidgets defines three families of the assert-like macros:
8f5d9104
VZ
4168the wxASSERT and wxFAIL macros only do anything if \_\_WXDEBUG\_\_ is defined
4169(in other words, in the debug build) but disappear completely in the release
4170build. On the other hand, the wxCHECK macros stay event in release builds but a
4171check failure doesn't generate any user-visible effects then. Finally, the
4172compile time assertions don't happen during the run-time but result in the
4173compilation error messages if the condition they check fail.
6fb26ea3 4174
954b8ae6
JS
4175\wxheading{Include files}
4176
4177<wx/debug.h>
4178
84ed77ef 4179
6fb26ea3
JS
4180\membersection{::wxOnAssert}\label{wxonassert}
4181
aad65f13 4182\func{void}{wxOnAssert}{\param{const char *}{fileName}, \param{int}{ lineNumber}, \param{const char *}{cond}, \param{const char *}{msg = NULL}}
6fb26ea3 4183
8f5d9104
VZ
4184This function is called whenever one of debugging macros fails (i.e. condition
4185is false in an assertion). It is only defined in the debug mode, in release
4186builds the \helpref{wxCHECK}{wxcheck} failures don't result in anything.
4187
4188To override the default behaviour in the debug builds which is to show the user
4189a dialog asking whether he wants to abort the program, continue or continue
b829bf55 4190ignoring any subsequent assert failures, you may override
8f5d9104
VZ
4191\helpref{wxApp::OnAssert}{wxapponassert} which is called by this function if
4192the global application object exists.
6fb26ea3 4193
84ed77ef 4194
6fb26ea3
JS
4195\membersection{wxASSERT}\label{wxassert}
4196
4197\func{}{wxASSERT}{\param{}{condition}}
4198
cc81d32f 4199Assert macro. An error message will be generated if the condition is false in
b207457c
VZ
4200debug mode, but nothing will be done in the release build.
4201
4202Please note that the condition in wxASSERT() should have no side effects
4203because it will not be executed in release mode at all.
4204
8f5d9104
VZ
4205\wxheading{See also}
4206
4207\helpref{wxASSERT\_MSG}{wxassertmsg},\\
4208\helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}
4209
84ed77ef 4210
8f5d9104
VZ
4211\membersection{wxASSERT\_MIN\_BITSIZE}\label{wxassertminbitsize}
4212
4213\func{}{wxASSERT\_MIN\_BITSIZE}{\param{}{type}, \param{}{size}}
4214
b829bf55 4215This macro results in a
9722642d 4216\helpref{compile time assertion failure}{wxcompiletimeassert} if the size
8f5d9104
VZ
4217of the given type {\it type} is less than {\it size} bits.
4218
4219You may use it like this, for example:
4220
4221\begin{verbatim}
4222 // we rely on the int being able to hold values up to 2^32
4223 wxASSERT_MIN_BITSIZE(int, 32);
4224
4225 // can't work with the platforms using UTF-8 for wchar_t
4226 wxASSERT_MIN_BITSIZE(wchar_t, 16);
4227\end{verbatim}
6fb26ea3 4228
84ed77ef 4229
6fb26ea3
JS
4230\membersection{wxASSERT\_MSG}\label{wxassertmsg}
4231
4232\func{}{wxASSERT\_MSG}{\param{}{condition}, \param{}{msg}}
4233
cc81d32f 4234Assert macro with message. An error message will be generated if the condition is false.
6fb26ea3 4235
8f5d9104
VZ
4236\wxheading{See also}
4237
4238\helpref{wxASSERT}{wxassert},\\
4239\helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}
4240
84ed77ef 4241
8f5d9104
VZ
4242\membersection{wxCOMPILE\_TIME\_ASSERT}\label{wxcompiletimeassert}
4243
4244\func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}}
4245
4246Using {\tt wxCOMPILE\_TIME\_ASSERT} results in a compilation error if the
9722642d 4247specified {\it condition} is false. The compiler error message should include
8f5d9104
VZ
4248the {\it msg} identifier - please note that it must be a valid C++ identifier
4249and not a string unlike in the other cases.
4250
b829bf55 4251This macro is mostly useful for testing the expressions involving the
8f5d9104
VZ
4252{\tt sizeof} operator as they can't be tested by the preprocessor but it is
4253sometimes desirable to test them at the compile time.
4254
5b8643ea
VZ
4255Note that this macro internally declares a struct whose name it tries to make
4256unique by using the {\tt \_\_LINE\_\_} in it but it may still not work if you
4257use it on the same line in two different source files. In this case you may
b829bf55 4258either change the line in which either of them appears on or use the
5b8643ea
VZ
4259\helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2} macro.
4260
150018ae 4261Also note that Microsoft Visual C++ has a bug which results in compiler errors
cf700088
JS
4262if you use this macro with `Program Database For Edit And Continue'
4263(\texttt{/ZI}) option, so you shouldn't use it (`Program Database'
150018ae
VZ
4264(\texttt{/Zi}) is ok though) for the code making use of this macro.
4265
8f5d9104
VZ
4266\wxheading{See also}
4267
4268\helpref{wxASSERT\_MSG}{wxassertmsg},\\
4269\helpref{wxASSERT\_MIN\_BITSIZE}{wxassertminbitsize}
b207457c 4270
84ed77ef 4271
5b8643ea
VZ
4272\membersection{wxCOMPILE\_TIME\_ASSERT2}\label{wxcompiletimeassert2}
4273
4274\func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}, \param{}{name}}
4275
b829bf55 4276This macro is identical to \helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2}
5b8643ea
VZ
4277except that it allows you to specify a unique {\it name} for the struct
4278internally defined by this macro to avoid getting the compilation errors
4279described \helpref{above}{wxcompiletimeassert}.
4280
84ed77ef 4281
6fb26ea3
JS
4282\membersection{wxFAIL}\label{wxfail}
4283
b207457c 4284\func{}{wxFAIL}{\void}
6fb26ea3
JS
4285
4286Will always generate an assert error if this code is reached (in debug mode).
4287
b207457c
VZ
4288See also: \helpref{wxFAIL\_MSG}{wxfailmsg}
4289
84ed77ef 4290
6fb26ea3
JS
4291\membersection{wxFAIL\_MSG}\label{wxfailmsg}
4292
b207457c 4293\func{}{wxFAIL\_MSG}{\param{}{msg}}
6fb26ea3
JS
4294
4295Will always generate an assert error with specified message if this code is reached (in debug mode).
4296
b207457c
VZ
4297This macro is useful for marking unreachable" code areas, for example
4298it may be used in the "default:" branch of a switch statement if all possible
4299cases are processed above.
4300
8f5d9104
VZ
4301\wxheading{See also}
4302
4303\helpref{wxFAIL}{wxfail}
b207457c 4304
84ed77ef 4305
6fb26ea3
JS
4306\membersection{wxCHECK}\label{wxcheck}
4307
4308\func{}{wxCHECK}{\param{}{condition}, \param{}{retValue}}
4309
4310Checks that the condition is true, returns with the given return value if not (FAILs in debug mode).
4311This check is done even in release mode.
4312
84ed77ef 4313
6fb26ea3
JS
4314\membersection{wxCHECK\_MSG}\label{wxcheckmsg}
4315
4316\func{}{wxCHECK\_MSG}{\param{}{condition}, \param{}{retValue}, \param{}{msg}}
4317
4318Checks that the condition is true, returns with the given return value if not (FAILs in debug mode).
4319This check is done even in release mode.
4320
ec5d7799 4321This macro may be only used in non void functions, see also
b207457c
VZ
4322\helpref{wxCHECK\_RET}{wxcheckret}.
4323
84ed77ef 4324
b207457c
VZ
4325\membersection{wxCHECK\_RET}\label{wxcheckret}
4326
4327\func{}{wxCHECK\_RET}{\param{}{condition}, \param{}{msg}}
4328
4329Checks that the condition is true, and returns if not (FAILs with given error
4330message in debug mode). This check is done even in release mode.
4331
ec5d7799 4332This macro should be used in void functions instead of
b207457c
VZ
4333\helpref{wxCHECK\_MSG}{wxcheckmsg}.
4334
84ed77ef 4335
b207457c
VZ
4336\membersection{wxCHECK2}\label{wxcheck2}
4337
4338\func{}{wxCHECK2}{\param{}{condition}, \param{}{operation}}
4339
ec5d7799
RD
4340Checks that the condition is true and \helpref{wxFAIL}{wxfail} and execute
4341{\it operation} if it is not. This is a generalisation of
b207457c
VZ
4342\helpref{wxCHECK}{wxcheck} and may be used when something else than just
4343returning from the function must be done when the {\it condition} is false.
4344
4345This check is done even in release mode.
4346
84ed77ef 4347
b207457c
VZ
4348\membersection{wxCHECK2\_MSG}\label{wxcheck2msg}
4349
4350\func{}{wxCHECK2}{\param{}{condition}, \param{}{operation}, \param{}{msg}}
4351
ec5d7799 4352This is the same as \helpref{wxCHECK2}{wxcheck2}, but
b207457c
VZ
4353\helpref{wxFAIL\_MSG}{wxfailmsg} with the specified {\it msg} is called
4354instead of wxFAIL() if the {\it condition} is false.
4355
84ed77ef 4356
b0fc8832
VZ
4357\membersection{::wxTrap}\label{wxtrap}
4358
4359\func{void}{wxTrap}{\void}
4360
4361In debug mode (when {\tt \_\_WXDEBUG\_\_} is defined) this function generates a
4362debugger exception meaning that the control is passed to the debugger if one is
4363attached to the process. Otherwise the program just terminates abnormally.
4364
4365In release mode this function does nothing.
4366
4367\wxheading{Include files}
4368
4369<wx/debug.h>
4370
a434b43f 4371
84ed77ef 4372
a434b43f
VZ
4373\membersection{::wxIsDebuggerRunning}\label{wxisdebuggerrunning}
4374
4375\func{bool}{wxIsDebuggerRunning}{\void}
4376
c50a4038 4377Returns \true if the program is running under debugger, \false otherwise.
a434b43f 4378
c50a4038
VZ
4379Please note that this function is currently only implemented for Win32 and Mac
4380builds using CodeWarrior and always returns \false elsewhere.
a434b43f
VZ
4381
4382
84ed77ef
VZ
4383
4384
5807634c
VZ
4385\section{Environment access functions}\label{environfunctions}
4386
4387The functions in this section allow to access (get) or change value of
4388environment variables in a portable way. They are currently implemented under
4389Win32 and POSIX-like systems (Unix).
4390
4391% TODO add some stuff about env var inheriting but not propagating upwards (VZ)
4392
4393\wxheading{Include files}
4394
4395<wx/utils.h>
4396
84ed77ef 4397
308978f6 4398\membersection{wxGetenv}\label{wxgetenvmacro}
5807634c
VZ
4399
4400\func{wxChar *}{wxGetEnv}{\param{const wxString\&}{ var}}
4401
308978f6
VZ
4402This is a macro defined as {\tt getenv()} or its wide char version in Unicode
4403mode.
4404
4405Note that under Win32 it may not return correct value for the variables set
4406with \helpref{wxSetEnv}{wxsetenv}, use \helpref{wxGetEnv}{wxgetenv} function
4407instead.
4408
84ed77ef 4409
308978f6
VZ
4410\membersection{wxGetEnv}\label{wxgetenv}
4411
4412\func{bool}{wxGetEnv}{\param{const wxString\&}{ var}, \param{wxString *}{value}}
4413
4414Returns the current value of the environment variable {\it var} in {\it value}.
4415{\it value} may be {\tt NULL} if you just want to know if the variable exists
4416and are not interested in its value.
4417
43e8916f 4418Returns \true if the variable exists, \false otherwise.
5807634c 4419
84ed77ef 4420
5807634c
VZ
4421\membersection{wxSetEnv}\label{wxsetenv}
4422
4423\func{bool}{wxSetEnv}{\param{const wxString\&}{ var}, \param{const wxChar *}{value}}
4424
4425Sets the value of the environment variable {\it var} (adding it if necessary)
4426to {\it value}.
4427
43e8916f 4428Returns \true on success.
5807634c 4429
84ed77ef 4430
5807634c
VZ
4431\membersection{wxUnsetEnv}\label{wxunsetenv}
4432
4433\func{bool}{wxUnsetEnv}{\param{const wxString\&}{ var}}
4434
ec5d7799 4435Removes the variable {\it var} from the environment.
5df6ed1c 4436\helpref{wxGetEnv}{wxgetenv} will return {\tt NULL} after the call to this
5807634c
VZ
4437function.
4438
43e8916f 4439Returns \true on success.
5807634c 4440