]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/function.tex
added wxCOMPILE_TIME_ASSERT2() macro allowing to give the unique name to the struct...
[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
b0fc8832
VZ
5The functions and macros defined in wxWindows are described here: you can
6either look up a function using the alphabetical listing of them or find it in
7the corresponding topic.
8
9\section{Alphabetical functions and macros list}
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}\\
24\helpref{WXDEBUG\_NEW}{debugnew}\\
25\helpref{WXTRACELEVEL}{tracelevel}\\
26\helpref{WXTRACE}{trace}\\
8f5d9104 27\helpref{wxASSERT\_MIN\_BITSIZE}{wxassertminbitsize}\\
b0fc8832
VZ
28\helpref{wxASSERT\_MSG}{wxassertmsg}\\
29\helpref{wxASSERT}{wxassert}\\
30\helpref{wxBITMAP}{wxbitmapmacro}\\
31\helpref{wxBeginBusyCursor}{wxbeginbusycursor}\\
32\helpref{wxBell}{wxbell}\\
33\helpref{wxCHECK2\_MSG}{wxcheck2msg}\\
34\helpref{wxCHECK2}{wxcheck2}\\
35\helpref{wxCHECK\_MSG}{wxcheckmsg}\\
36\helpref{wxCHECK\_RET}{wxcheckret}\\
37\helpref{wxCHECK\_VERSION}{wxcheckversion}\\
38\helpref{wxCHECK}{wxcheck}\\
39\helpref{wxClientDisplayRect}{wxclientdisplayrect}\\
40\helpref{wxClipboardOpen}{wxclipboardopen}\\
41\helpref{wxCloseClipboard}{wxcloseclipboard}\\
42\helpref{wxColourDisplay}{wxcolourdisplay}\\
8f5d9104 43\helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}\\
b0fc8832
VZ
44\helpref{wxConcatFiles}{wxconcatfiles}\\
45\helpref{wxConstCast}{wxconstcast}\\
46\helpref{wxCopyFile}{wxcopyfile}\\
47\helpref{wxCreateDynamicObject}{wxcreatedynamicobject}\\
48\helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider}\\
49\helpref{wxDDECleanUp}{wxddecleanup}\\
50\helpref{wxDDEInitialize}{wxddeinitialize}\\
51\helpref{wxDROP\_ICON}{wxdropicon}\\
52\helpref{wxDebugMsg}{wxdebugmsg}\\
53\helpref{wxDirExists}{wxdirexists}\\
54\helpref{wxDirSelector}{wxdirselector}\\
55\helpref{wxDisplayDepth}{wxdisplaydepth}\\
56\helpref{wxDisplaySizeMM}{wxdisplaysizemm}\\
57\helpref{wxDisplaySize}{wxdisplaysize}\\
58\helpref{wxDisplaySize}{wxdisplaysize}\\
59\helpref{wxDos2UnixFilename}{wxdos2unixfilename}\\
60\helpref{wxDynamicCastThis}{wxdynamiccastthis}\\
61\helpref{wxDynamicCast}{wxdynamiccast}\\
62\helpref{wxEmptyClipboard}{wxemptyclipboard}\\
63\helpref{wxEnableTopLevelWindows}{wxenabletoplevelwindows}\\
64\helpref{wxEndBusyCursor}{wxendbusycursor}\\
65\helpref{wxEntry}{wxentry}\\
66\helpref{wxEnumClipboardFormats}{wxenumclipboardformats}\\
67\helpref{wxError}{wxerror}\\
68\helpref{wxExecute}{wxexecute}\\
69\helpref{wxExit}{wxexit}\\
70\helpref{wxFAIL\_MSG}{wxfailmsg}\\
71\helpref{wxFAIL}{wxfail}\\
72\helpref{wxFatalError}{wxfatalerror}\\
73\helpref{wxFileExists}{wxfileexists}\\
74\helpref{wxFileModificationTime}{wxfilemodificationtime}\\
75\helpref{wxFileNameFromPath}{wxfilenamefrompath}\\
76\helpref{wxFileSelector}{wxfileselector}\\
77\helpref{wxFindFirstFile}{wxfindfirstfile}\\
78\helpref{wxFindMenuItemId}{wxfindmenuitemid}\\
79\helpref{wxFindNextFile}{wxfindnextfile}\\
80\helpref{wxFindWindowAtPointer}{wxfindwindowatpointer}\\
81\helpref{wxFindWindowAtPoint}{wxfindwindowatpoint}\\
82\helpref{wxFindWindowByLabel}{wxfindwindowbylabel}\\
83\helpref{wxFindWindowByName}{wxfindwindowbyname}\\
84\helpref{wxGetActiveWindow}{wxgetactivewindow}\\
85\helpref{wxGetClipboardData}{wxgetclipboarddata}\\
86\helpref{wxGetClipboardFormatName}{wxgetclipboardformatname}\\
87\helpref{wxGetColourFromUser}{wxgetcolourfromuser}\\
88\helpref{wxGetCwd}{wxgetcwd}\\
89\helpref{wxGetDiskSpace}{wxgetdiskspace}\\
90\helpref{wxGetDisplayName}{wxgetdisplayname}\\
91\helpref{wxGetElapsedTime}{wxgetelapsedtime}\\
92\helpref{wxGetEmailAddress}{wxgetemailaddress}\\
93\helpref{wxGetEnv}{wxgetenv}\\
d741c583 94\helpref{wxGetFontFromUser}{wxgetfontfromuser}\\
b0fc8832
VZ
95\helpref{wxGetFreeMemory}{wxgetfreememory}\\
96\helpref{wxGetFullHostName}{wxgetfullhostname}\\
97\helpref{wxGetHomeDir}{wxgethomedir}\\
98\helpref{wxGetHostName}{wxgethostname}\\
99\helpref{wxGetLocalTimeMillis}{wxgetlocaltimemillis}\\
100\helpref{wxGetLocalTime}{wxgetlocaltime}\\
101\helpref{wxGetMousePosition}{wxgetmouseposition}\\
102\helpref{wxGetMultipleChoices}{wxgetmultiplechoices}\\
103\helpref{wxGetMultipleChoice}{wxgetmultiplechoice}\\
104\helpref{wxGetNumberFromUser}{wxgetnumberfromuser}\\
105\helpref{wxGetOSDirectory}{wxgetosdirectory}\\
106\helpref{wxGetOsDescription}{wxgetosdescription}\\
107\helpref{wxGetOsVersion}{wxgetosversion}\\
108\helpref{wxGetPasswordFromUser}{wxgetpasswordfromuser}\\
109\helpref{wxGetPrinterCommand}{wxgetprintercommand}\\
110\helpref{wxGetPrinterFile}{wxgetprinterfile}\\
111\helpref{wxGetPrinterMode}{wxgetprintermode}\\
112\helpref{wxGetPrinterOptions}{wxgetprinteroptions}\\
113\helpref{wxGetPrinterOrientation}{wxgetprinterorientation}\\
114\helpref{wxGetPrinterPreviewCommand}{wxgetprinterpreviewcommand}\\
115\helpref{wxGetPrinterScaling}{wxgetprinterscaling}\\
116\helpref{wxGetPrinterTranslation}{wxgetprintertranslation}\\
117\helpref{wxGetResource}{wxgetresource}\\
118\helpref{wxGetSingleChoiceData}{wxgetsinglechoicedata}\\
119\helpref{wxGetSingleChoiceIndex}{wxgetsinglechoiceindex}\\
120\helpref{wxGetSingleChoice}{wxgetsinglechoice}\\
121\helpref{wxGetTempFileName}{wxgettempfilename}\\
122\helpref{wxGetTextFromUser}{wxgettextfromuser}\\
123\helpref{wxGetTranslation}{wxgettranslation}\\
124\helpref{wxGetUTCTime}{wxgetutctime}\\
125\helpref{wxGetUserHome}{wxgetuserhome}\\
126\helpref{wxGetUserId}{wxgetuserid}\\
127\helpref{wxGetUserName}{wxgetusername}\\
128\helpref{wxGetWorkingDirectory}{wxgetworkingdirectory}\\
129\helpref{wxGetenv}{wxgetenvmacro}\\
130\helpref{wxHandleFatalExceptions}{wxhandlefatalexceptions}\\
131\helpref{wxICON}{wxiconmacro}\\
132\helpref{wxINTXX\_SWAP\_ALWAYS}{intswapalways}\\
133\helpref{wxINTXX\_SWAP\_ON\_BE}{intswaponbe}\\
134\helpref{wxINTXX\_SWAP\_ON\_LE}{intswaponle}\\
135\helpref{wxInitAllImageHandlers}{wxinitallimagehandlers}\\
136\helpref{wxInitialize}{wxinitialize}\\
137\helpref{wxIsAbsolutePath}{wxisabsolutepath}\\
138\helpref{wxIsBusy}{wxisbusy}\\
139\helpref{wxIsClipboardFormatAvailable}{wxisclipboardformatavailable}\\
140\helpref{wxIsEmpty}{wxisempty}\\
141\helpref{wxIsWild}{wxiswild}\\
142\helpref{wxKill}{wxkill}\\
143\helpref{wxLoadUserResource}{wxloaduserresource}\\
144\helpref{wxLogDebug}{wxlogdebug}\\
145\helpref{wxLogError}{wxlogerror}\\
146\helpref{wxLogFatalError}{wxlogfatalerror}\\
147\helpref{wxLogMessage}{wxlogmessage}\\
148\helpref{wxLogStatus}{wxlogstatus}\\
149\helpref{wxLogSysError}{wxlogsyserror}\\
150\helpref{wxLogTrace}{wxlogtrace}\\
151\helpref{wxLogVerbose}{wxlogverbose}\\
152\helpref{wxLogWarning}{wxlogwarning}\\
153\helpref{wxMakeMetafilePlaceable}{wxmakemetafileplaceable}\\
154\helpref{wxMatchWild}{wxmatchwild}\\
155\helpref{wxMessageBox}{wxmessagebox}\\
156\helpref{wxMkdir}{wxmkdir}\\
157\helpref{wxMutexGuiEnter}{wxmutexguienter}\\
158\helpref{wxMutexGuiLeave}{wxmutexguileave}\\
159\helpref{wxNewId}{wxnewid}\\
160\helpref{wxNow}{wxnow}\\
161\helpref{wxOnAssert}{wxonassert}\\
162\helpref{wxOpenClipboard}{wxopenclipboard}\\
163\helpref{wxPathOnly}{wxpathonly}\\
164\helpref{wxPostDelete}{wxpostdelete}\\
165\helpref{wxPostEvent}{wxpostevent}\\
166\helpref{wxRegisterClipboardFormat}{wxregisterclipboardformat}\\
167\helpref{wxRegisterId}{wxregisterid}\\
168\helpref{wxRemoveFile}{wxremovefile}\\
169\helpref{wxRenameFile}{wxrenamefile}\\
170\helpref{wxResourceAddIdentifier}{wxresourceaddidentifier}\\
171\helpref{wxResourceClear}{wxresourceclear}\\
172\helpref{wxResourceCreateBitmap}{wxresourcecreatebitmap}\\
173\helpref{wxResourceCreateIcon}{wxresourcecreateicon}\\
174\helpref{wxResourceCreateMenuBar}{wxresourcecreatemenubar}\\
175\helpref{wxResourceGetIdentifier}{wxresourcegetidentifier}\\
176\helpref{wxResourceParseData}{wxresourcedata}\\
177\helpref{wxResourceParseFile}{wxresourceparsefile}\\
178\helpref{wxResourceParseString}{wxresourceparsestring}\\
179\helpref{wxResourceRegisterBitmapData}{registerbitmapdata}\\
180\helpref{wxResourceRegisterIconData}{wxresourceregistericondata}\\
181\helpref{wxRmdir}{wxrmdir}\\
182\helpref{wxSafeYield}{wxsafeyield}\\
183\helpref{wxSetClipboardData}{wxsetclipboarddata}\\
184\helpref{wxSetCursor}{wxsetcursor}\\
185\helpref{wxSetDisplayName}{wxsetdisplayname}\\
186\helpref{wxSetEnv}{wxsetenv}\\
187\helpref{wxSetPrinterCommand}{wxsetprintercommand}\\
188\helpref{wxSetPrinterFile}{wxsetprinterfile}\\
189\helpref{wxSetPrinterMode}{wxsetprintermode}\\
190\helpref{wxSetPrinterOptions}{wxsetprinteroptions}\\
191\helpref{wxSetPrinterOrientation}{wxsetprinterorientation}\\
192\helpref{wxSetPrinterPreviewCommand}{wxsetprinterpreviewcommand}\\
193\helpref{wxSetPrinterScaling}{wxsetprinterscaling}\\
194\helpref{wxSetPrinterTranslation}{wxsetprintertranslation}\\
195\helpref{wxSetWorkingDirectory}{wxsetworkingdirectory}\\
196\helpref{wxShell}{wxshell}\\
197\helpref{wxShowTip}{wxshowtip}\\
198\helpref{wxSleep}{wxsleep}\\
199\helpref{wxSnprintf}{wxsnprintf}\\
200\helpref{wxSplitPath}{wxsplitfunction}\\
201\helpref{wxStartTimer}{wxstarttimer}\\
202\helpref{wxStaticCast}{wxstaticcast}\\
203\helpref{wxStricmp}{wxstricmp}\\
204\helpref{wxStringEq}{wxstringeq}\\
205\helpref{wxStringMatch}{wxstringmatch}\\
206\helpref{wxStripMenuCodes}{wxstripmenucodes}\\
207\helpref{wxStrlen}{wxstrlen}\\
208\helpref{wxSysErrorCode}{wxsyserrorcode}\\
209\helpref{wxSysErrorMsg}{wxsyserrormsg}\\
210\helpref{wxToLower}{wxtolower}\\
211\helpref{wxToUpper}{wxtoupper}\\
212\helpref{wxTraceLevel}{wxtracelevel}\\
213\helpref{wxTrace}{wxtrace}\\
214\helpref{wxTransferFileToStream}{wxtransferfiletostream}\\
215\helpref{wxTransferStreamToFile}{wxtransferstreamtofile}\\
216\helpref{wxTrap}{wxtrap}\\
217\helpref{wxUninitialize}{wxuninitialize}\\
218\helpref{wxUnix2DosFilename}{wxunix2dosfilename}\\
219\helpref{wxUnsetEnv}{wxunsetenv}\\
220\helpref{wxUsleep}{wxusleep}\\
221\helpref{wxVsnprintf}{wxvsnprintf}\\
222\helpref{wxWakeUpIdle}{wxwakeupidle}\\
223\helpref{wxWriteResource}{wxwriteresource}\\
224\helpref{wxYield}{wxyield}
f6bcfd97
BP
225
226\section{Version macros}\label{versionfunctions}
227
228The following constants are defined in wxWindows:
229
230\begin{itemize}\itemsep=0pt
231\item {\tt wxMAJOR\_VERSION} is the major version of wxWindows
232\item {\tt wxMINOR\_VERSION} is the minor version of wxWindows
ff8fda36 233\item {\tt wxRELEASE\_NUMBER} is the release number
f6bcfd97
BP
234\end{itemize}
235
236For example, the values or these constants for wxWindows 2.1.15 are 2, 1 and
23715.
238
239Additionally, {\tt wxVERSION\_STRING} is a user-readable string containing
240the full wxWindows version and {\tt wxVERSION\_NUMBER} is a combination of the
241three version numbers above: for 2.1.15, it is 2115 and it is 2200 for
242wxWindows 2.2.
243
244\wxheading{Include files}
245
246<wx/version.h> or <wx/defs.h>
247
248\membersection{wxCHECK\_VERSION}\label{wxcheckversion}
249
250\func{bool}{wxCHECK\_VERSION}{\param{}{major, minor, release}}
251
252This is a macro which evaluates to true if the current wxWindows version is at
253least major.minor.release.
254
255For example, to test if the program is compiled with wxWindows 2.2 or higher,
256the following can be done:
257
258\begin{verbatim}
259 wxString s;
260#if wxCHECK_VERSION(2, 2, 0)
261 if ( s.StartsWith("foo") )
262#else // replacement code for old version
263 if ( strncmp(s, "foo", 3) == 0 )
264#endif
265 {
266 ...
267 }
268\end{verbatim}
a660d684 269
b0fc8832 270\section{Application initialization and termination}\label{appinifunctions}
c88275cb 271
b0fc8832
VZ
272The functions in this section are used on application startup/shutdown and also
273to control the behaviour of the main event loop of the GUI programs.
c88275cb 274
b0fc8832 275\membersection{::wxEntry}\label{wxentry}
c88275cb 276
b0fc8832
VZ
277This initializes wxWindows in a platform-dependent way. Use this if you
278are not using the default wxWindows entry code (e.g. main or WinMain). For example,
279you can initialize wxWindows from an Microsoft Foundation Classes application using
280this function.
c88275cb 281
b0fc8832
VZ
282\func{void}{wxEntry}{\param{HANDLE}{ hInstance}, \param{HANDLE}{ hPrevInstance},
283 \param{const wxString\& }{commandLine}, \param{int}{ cmdShow}, \param{bool}{ enterLoop = TRUE}}
c88275cb 284
b0fc8832
VZ
285wxWindows initialization under Windows (non-DLL). If {\it enterLoop} is FALSE, the
286function will return immediately after calling wxApp::OnInit. Otherwise, the wxWindows
287message loop will be entered.
c88275cb 288
b0fc8832
VZ
289\func{void}{wxEntry}{\param{HANDLE}{ hInstance}, \param{HANDLE}{ hPrevInstance},
290 \param{WORD}{ wDataSegment}, \param{WORD}{ wHeapSize}, \param{const wxString\& }{ commandLine}}
c88275cb 291
b0fc8832 292wxWindows initialization under Windows (for applications constructed as a DLL).
c88275cb 293
b0fc8832 294\func{int}{wxEntry}{\param{int}{ argc}, \param{const wxString\& *}{argv}}
c88275cb 295
b0fc8832 296wxWindows initialization under Unix.
c88275cb 297
b0fc8832 298\wxheading{Remarks}
c88275cb 299
b0fc8832
VZ
300To clean up wxWindows, call wxApp::OnExit followed by the static function
301wxApp::CleanUp. For example, if exiting from an MFC application that also uses wxWindows:
4aff28fc 302
b0fc8832
VZ
303\begin{verbatim}
304int CTheApp::ExitInstance()
305{
306 // OnExit isn't called by CleanUp so must be called explicitly.
307 wxTheApp->OnExit();
308 wxApp::CleanUp();
309
310 return CWinApp::ExitInstance();
c88275cb
RR
311}
312\end{verbatim}
313
b0fc8832 314\wxheading{Include files}
c88275cb 315
b0fc8832 316<wx/app.h>
c88275cb 317
b0fc8832 318\membersection{::wxHandleFatalExceptions}\label{wxhandlefatalexceptions}
c88275cb 319
b0fc8832 320\func{bool}{wxHandleFatalExceptions}{\param{bool}{ doIt = TRUE}}
c88275cb 321
b0fc8832
VZ
322If {\it doIt} is TRUE, the fatal exceptions (also known as general protection
323faults under Windows or segmentation violations in the Unix world) will be
324caught and passed to \helpref{wxApp::OnFatalException}{wxapponfatalexception}.
325By default, i.e. before this function is called, they will be handled in the
326normal way which usually just means that the application will be terminated.
327Calling wxHandleFatalExceptions() with {\it doIt} equal to FALSE will restore
328this default behaviour.
c88275cb 329
b0fc8832 330\membersection{::wxInitAllImageHandlers}\label{wxinitallimagehandlers}
a660d684 331
b0fc8832 332\func{void}{wxInitAllImageHandlers}{\void}
954b8ae6 333
b0fc8832
VZ
334Initializes all available image handlers. For a list of available handlers,
335see \helpref{wxImage}{wximage}.
954b8ae6
JS
336
337\wxheading{See also}
338
b0fc8832 339\helpref{wxImage}{wximage}, \helpref{wxImageHandler}{wximagehandler}
a660d684 340
b0fc8832 341\wxheading{Include files}
a660d684 342
b0fc8832 343<wx/image.h>
a660d684 344
b0fc8832 345\membersection{::wxInitialize}\label{wxinitialize}
a660d684 346
b0fc8832 347\func{bool}{wxInitialize}{\void}
a660d684 348
b0fc8832
VZ
349This function is used in wxBase only and only if you don't create
350\helpref{wxApp}{wxapp} object at all. In this case you must call it from your
351{\tt main()} function before calling any other wxWindows functions.
a660d684 352
b0fc8832
VZ
353If the function returns {\tt FALSE} the initialization could not be performed,
354in this case the library cannot be used and
355\helpref{wxUninitialize}{wxuninitialize} shouldn't be called neither.
a660d684 356
b0fc8832
VZ
357This function may be called several times but
358\helpref{wxUninitialize}{wxuninitialize} must be called for each successful
359call to this function.
a660d684 360
b0fc8832 361\wxheading{Include files}
a47ce4a7 362
b0fc8832 363<wx/app.h>
a47ce4a7 364
b0fc8832 365\membersection{::wxSafeYield}\label{wxsafeyield}
a47ce4a7 366
b0fc8832 367\func{bool}{wxSafeYield}{\param{wxWindow*}{ win = NULL}}
a660d684 368
b0fc8832
VZ
369This function is similar to wxYield, except that it disables the user input to
370all program windows before calling wxYield and re-enables it again
371afterwards. If {\it win} is not NULL, this window will remain enabled,
372allowing the implementation of some limited user interaction.
a660d684 373
b0fc8832 374Returns the result of the call to \helpref{::wxYield}{wxyield}.
532372a3 375
b0fc8832 376\wxheading{Include files}
a660d684 377
b0fc8832 378<wx/utils.h>
a660d684 379
b0fc8832 380\membersection{::wxUninitialize}\label{wxuninitialize}
a660d684 381
b0fc8832 382\func{void}{wxUninitialize}{\void}
a660d684 383
b0fc8832
VZ
384This function is for use in console (wxBase) programs only. It must be called
385once for each previous successful call to \helpref{wxInitialize}{wxinitialize}.
a660d684 386
b0fc8832 387\wxheading{Include files}
a660d684 388
b0fc8832 389<wx/app.h>
a660d684 390
b0fc8832 391\membersection{::wxYield}\label{wxyield}
a660d684 392
b0fc8832 393\func{bool}{wxYield}{\void}
a660d684 394
b0fc8832 395Calls \helpref{wxApp::Yield}{wxappyield}.
a660d684 396
b0fc8832
VZ
397This function is kept only for backwards compatibility, please use
398\helpref{wxApp::Yield}{wxappyield}method instead in any new code.
a660d684 399
b0fc8832 400\wxheading{Include files}
5ab656cd 401
b0fc8832 402<wx/app.h> or <wx/utils.h>
eadd7bd2 403
b0fc8832 404\membersection{::wxWakeUpIdle}\label{wxwakeupidle}
eadd7bd2 405
b0fc8832 406\func{void}{wxWakeUpIdle}{\void}
eadd7bd2 407
b0fc8832
VZ
408This functions wakes up the (internal and platform dependent) idle system, i.e. it
409will force the system to send an idle event even if the system currently {\it is}
410 idle and thus would not send any idle event until after some other event would get
411sent. This is also useful for sending events between two threads and is used by
412the corresponding functions \helpref{::wxPostEvent}{wxpostevent} and
413\helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent}.
eadd7bd2 414
b0fc8832 415\wxheading{Include files}
eadd7bd2 416
b0fc8832 417<wx/app.h>
eadd7bd2 418
b0fc8832 419\section{Process control functions}\label{processfunctions}
eadd7bd2 420
b0fc8832
VZ
421The functions in this section are used to launch or terminate the other
422processes.
eadd7bd2 423
b0fc8832 424\membersection{::wxExecute}\label{wxexecute}
631f1bfe 425
b0fc8832 426\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{bool }{sync = FALSE}, \param{wxProcess *}{callback = NULL}}
631f1bfe 427
b0fc8832 428\func{long}{wxExecute}{\param{char **}{argv}, \param{bool }{sync = FALSE}, \param{wxProcess *}{callback = NULL}}
631f1bfe 429
b0fc8832 430\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{wxArrayString\& }{output}}
a660d684 431
b0fc8832 432\func{long}{wxExecute}{\param{const wxString\& }{command}, \param{wxArrayString\& }{output}, \param{wxArrayString\& }{errors}}
a660d684 433
b0fc8832 434Executes another program in Unix or Windows.
a660d684 435
b0fc8832 436The first form takes a command string, such as {\tt "emacs file.txt"}.
a660d684 437
b0fc8832
VZ
438The second form takes an array of values: a command, any number of
439arguments, terminated by NULL.
a660d684 440
b0fc8832
VZ
441The semantics of the third and fourth versions is different from the first two
442and is described in more details below.
a660d684 443
b0fc8832
VZ
444If {\it sync} is FALSE (the default), flow of control immediately returns.
445If TRUE, the current application waits until the other program has terminated.
a660d684 446
b0fc8832
VZ
447In the case of synchronous execution, the return value is the exit code of
448the process (which terminates by the moment the function returns) and will be
449$-1$ if the process couldn't be started and typically 0 if the process
450terminated successfully. Also, while waiting for the process to
451terminate, wxExecute will call \helpref{wxYield}{wxyield}. The caller
452should ensure that this can cause no recursion, in the simplest case by
453calling \helpref{wxEnableTopLevelWindows(FALSE)}{wxenabletoplevelwindows}.
a660d684 454
b0fc8832
VZ
455For asynchronous execution, however, the return value is the process id and
456zero value indicates that the command could not be executed. As an added
457complication, the return value of $-1$ in this case indicattes that we didn't
458launch a new process, but connected to the running one (this can only happen in
459case of using DDE under Windows for command execution). In particular, in this,
460and only this, case the calling code will not get the notification about
461process termination.
a660d684 462
b0fc8832
VZ
463If callback isn't NULL and if execution is asynchronous (note that callback
464parameter can not be non-NULL for synchronous execution),
465\helpref{wxProcess::OnTerminate}{wxprocessonterminate} will be called when
466the process finishes.
a660d684 467
b0fc8832
VZ
468Finally, you may use the third overloaded version of this function to execute
469a process (always synchronously) and capture its output in the array
470{\it output}. The fourth version adds the possibility to additionally capture
471the messages from standard error output in the {\it errors} array.
a660d684 472
b0fc8832
VZ
473See also \helpref{wxShell}{wxshell}, \helpref{wxProcess}{wxprocess},
474\helpref{Exec sample}{sampleexec}.
a660d684 475
b0fc8832 476\wxheading{Include files}
a660d684 477
b0fc8832 478<wx/utils.h>
a660d684 479
b0fc8832 480\membersection{::wxExit}\label{wxexit}
a660d684 481
b0fc8832 482\func{void}{wxExit}{\void}
7af89395 483
b0fc8832
VZ
484Exits application after calling \helpref{wxApp::OnExit}{wxapponexit}.
485Should only be used in an emergency: normally the top-level frame
486should be deleted (after deleting all other frames) to terminate the
487application. See \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow} and \helpref{wxApp}{wxapp}.
7af89395 488
b0fc8832 489\wxheading{Include files}
7af89395 490
b0fc8832 491<wx/app.h>
a660d684 492
b0fc8832 493\membersection{::wxKill}\label{wxkill}
a660d684 494
b0fc8832 495\func{int}{wxKill}{\param{long}{ pid}, \param{int}{ sig = wxSIGTERM}, \param{wxKillError }{*rc = NULL}}
7af89395 496
b0fc8832
VZ
497Equivalent to the Unix kill function: send the given signal {\it sig} to the
498process with PID {\it pid}. The valud signal values are
a660d684 499
b0fc8832
VZ
500\begin{verbatim}
501enum wxSignal
502{
503 wxSIGNONE = 0, // verify if the process exists under Unix
504 wxSIGHUP,
505 wxSIGINT,
506 wxSIGQUIT,
507 wxSIGILL,
508 wxSIGTRAP,
509 wxSIGABRT,
510 wxSIGEMT,
511 wxSIGFPE,
512 wxSIGKILL, // forcefully kill, dangerous!
513 wxSIGBUS,
514 wxSIGSEGV,
515 wxSIGSYS,
516 wxSIGPIPE,
517 wxSIGALRM,
518 wxSIGTERM // terminate the process gently
519};
520\end{verbatim}
a660d684 521
b0fc8832
VZ
522{\tt wxSIGNONE}, {\tt wxSIGKILL} and {\tt wxSIGTERM} have the same meaning
523under both Unix and Windows but all the other signals are equivalent to
524{\tt wxSIGTERM} under Windows.
a660d684 525
b0fc8832
VZ
526Returns 0 on success, -1 on failure. If {\it rc} parameter is not NULL, it will
527be filled with an element of {\tt wxKillError} enum:
a660d684 528
b0fc8832
VZ
529\begin{verbatim}
530enum wxKillError
531{
532 wxKILL_OK, // no error
533 wxKILL_BAD_SIGNAL, // no such signal
534 wxKILL_ACCESS_DENIED, // permission denied
535 wxKILL_NO_PROCESS, // no such process
536 wxKILL_ERROR // another, unspecified error
537};
538\end{verbatim}
c0ab6adf 539
b0fc8832 540\wxheading{See also}
ade35f11 541
b0fc8832
VZ
542\helpref{wxProcess::Kill}{wxprocesskill},\rtfsp
543\helpref{wxProcess::Exists}{wxprocessexists},\rtfsp
544\helpref{Exec sample}{sampleexec}
a660d684 545
b0fc8832 546\wxheading{Include files}
a660d684 547
b0fc8832 548<wx/utils.h>
a660d684 549
b0fc8832 550\membersection{::wxShell}\label{wxshell}
a660d684 551
b0fc8832 552\func{bool}{wxShell}{\param{const wxString\& }{command = NULL}}
a660d684 553
b0fc8832
VZ
554Executes a command in an interactive shell window. If no command is
555specified, then just the shell is spawned.
a660d684 556
b0fc8832 557See also \helpref{wxExecute}{wxexecute}, \helpref{Exec sample}{sampleexec}.
a660d684 558
b0fc8832 559\wxheading{Include files}
a660d684 560
b0fc8832 561<wx/utils.h>
a660d684 562
a660d684 563
b0fc8832 564\section{Thread functions}\label{threadfunctions}
1a33c3ba 565
b0fc8832 566\wxheading{Include files}
a660d684 567
b0fc8832 568<wx/thread.h>
a660d684 569
b0fc8832 570\wxheading{See also}
a660d684 571
b0fc8832 572\helpref{wxThread}{wxthread}, \helpref{wxMutex}{wxmutex}, \helpref{Multithreading overview}{wxthreadoverview}
a660d684 573
b0fc8832 574\membersection{::wxMutexGuiEnter}\label{wxmutexguienter}
a660d684 575
b0fc8832 576\func{void}{wxMutexGuiEnter}{\void}
a660d684 577
b0fc8832
VZ
578This function must be called when any thread other than the main GUI thread
579wants to get access to the GUI library. This function will block the execution
580of the calling thread until the main thread (or any other thread holding the
581main GUI lock) leaves the GUI library and no other thread will enter the GUI
582library until the calling thread calls \helpref{::wxMutexGuiLeave()}{wxmutexguileave}.
a660d684 583
b0fc8832 584Typically, these functions are used like this:
a660d684 585
b0fc8832
VZ
586\begin{verbatim}
587void MyThread::Foo(void)
588{
589 // before doing any GUI calls we must ensure that this thread is the only
590 // one doing it!
a660d684 591
b0fc8832 592 wxMutexGuiEnter();
a660d684 593
b0fc8832
VZ
594 // Call GUI here:
595 my_window->DrawSomething();
a660d684 596
b0fc8832
VZ
597 wxMutexGuiLeave();
598}
599\end{verbatim}
a660d684 600
b0fc8832
VZ
601Note that under GTK, no creation of top-level windows is allowed in any
602thread but the main one.
a660d684 603
b0fc8832
VZ
604This function is only defined on platforms which support preemptive
605threads.
d37fd2fa 606
b0fc8832 607\membersection{::wxMutexGuiLeave}\label{wxmutexguileave}
d37fd2fa 608
b0fc8832 609\func{void}{wxMutexGuiLeave}{\void}
d37fd2fa 610
b0fc8832 611See \helpref{::wxMutexGuiEnter()}{wxmutexguienter}.
d37fd2fa 612
b0fc8832
VZ
613This function is only defined on platforms which support preemptive
614threads.
d37fd2fa 615
b0fc8832 616\section{File functions}\label{filefunctions}
d37fd2fa 617
b0fc8832 618\wxheading{Include files}
ed93168b 619
b0fc8832 620<wx/utils.h>
ed93168b 621
b0fc8832 622\wxheading{See also}
ed93168b 623
b0fc8832
VZ
624\helpref{wxPathList}{wxpathlist}\\
625\helpref{wxDir}{wxdir}\\
626\helpref{wxFile}{wxfile}\\
627\helpref{wxFileName}{wxfilename}
ed93168b 628
b0fc8832 629\membersection{::wxDirExists}\label{wxdirexists}
ed93168b 630
b0fc8832 631\func{bool}{wxDirExists}{\param{const wxString\& }{dirname}}
ed93168b 632
b0fc8832 633Returns TRUE if the directory exists.
ed93168b 634
b0fc8832 635\membersection{::wxDos2UnixFilename}\label{wxdos2unixfilename}
ed93168b 636
b0fc8832 637\func{void}{wxDos2UnixFilename}{\param{wxChar *}{s}}
d524e22d 638
b0fc8832
VZ
639Converts a DOS to a Unix filename by replacing backslashes with forward
640slashes.
d524e22d 641
b0fc8832 642\membersection{::wxFileExists}\label{wxfileexists}
d524e22d 643
b0fc8832 644\func{bool}{wxFileExists}{\param{const wxString\& }{filename}}
d524e22d 645
b0fc8832
VZ
646Returns TRUE if the file exists. It also returns TRUE if the file is
647a directory.
e12be2f7 648
b0fc8832 649\membersection{::wxFileModificationTime}\label{wxfilemodificationtime}
d524e22d 650
b0fc8832 651\func{time\_t}{wxFileModificationTime}{\param{const wxString\& }{filename}}
d524e22d 652
b0fc8832 653Returns time of last modification of given file.
d524e22d 654
b0fc8832 655\membersection{::wxFileNameFromPath}\label{wxfilenamefrompath}
d524e22d 656
b0fc8832 657\func{wxString}{wxFileNameFromPath}{\param{const wxString\& }{path}}
d524e22d 658
7ac13b21 659\func{char *}{wxFileNameFromPath}{\param{char *}{path}}
d524e22d 660
b0fc8832
VZ
661Returns the filename for a full path. The second form returns a pointer to
662temporary storage that should not be deallocated.
d524e22d 663
b0fc8832 664\membersection{::wxFindFirstFile}\label{wxfindfirstfile}
d524e22d 665
7ac13b21 666\func{wxString}{wxFindFirstFile}{\param{const char *}{spec}, \param{int}{ flags = 0}}
d524e22d 667
b0fc8832
VZ
668This function does directory searching; returns the first file
669that matches the path {\it spec}, or the empty string. Use \helpref{wxFindNextFile}{wxfindnextfile} to
670get the next matching file. Neither will report the current directory "." or the
671parent directory "..".
d524e22d 672
b0fc8832 673{\it spec} may contain wildcards.
85ec2f26 674
b0fc8832 675{\it flags} may be wxDIR for restricting the query to directories, wxFILE for files or zero for either.
d524e22d 676
b0fc8832 677For example:
d524e22d 678
b0fc8832
VZ
679\begin{verbatim}
680 wxString f = wxFindFirstFile("/home/project/*.*");
681 while ( !f.IsEmpty() )
682 {
683 ...
684 f = wxFindNextFile();
685 }
686\end{verbatim}
d524e22d 687
b0fc8832 688\membersection{::wxFindNextFile}\label{wxfindnextfile}
d524e22d 689
b0fc8832 690\func{wxString}{wxFindNextFile}{\void}
e12be2f7 691
b0fc8832 692Returns the next file that matches the path passed to \helpref{wxFindFirstFile}{wxfindfirstfile}.
d524e22d 693
b0fc8832 694See \helpref{wxFindFirstFile}{wxfindfirstfile} for an example.
d524e22d 695
b0fc8832 696\membersection{::wxGetDiskSpace}\label{wxgetdiskspace}
d524e22d 697
b0fc8832 698\func{bool}{wxGetDiskSpace}{\param{const wxString\& }{path}, \param{wxLongLong }{*total = NULL}, \param{wxLongLong }{*free = NULL}}
d524e22d 699
b0fc8832
VZ
700This function returns the total number of bytes and number of free bytes on
701the disk containing the directory {\it path} (it should exist). Both
702{\it total} and {\it free} parameters may be {\tt NULL} if the corresponding
703information is not needed.
d524e22d 704
b0fc8832 705\wxheading{Returns}
85ec2f26 706
b0fc8832
VZ
707{\tt TRUE} on success, {\tt FALSE} if an error occured (for example, the
708directory doesn't exist).
d524e22d 709
b0fc8832 710\wxheading{Portability}
d524e22d 711
b0fc8832
VZ
712This function is implemented for Win16 (only for drives less than 2Gb), Win32,
713Mac OS and generic Unix provided the system has {\tt statfs()} function.
d524e22d 714
b0fc8832 715This function first appeared in wxWindows 2.3.2.
d524e22d 716
b0fc8832 717\membersection{::wxGetOSDirectory}\label{wxgetosdirectory}
e12be2f7 718
b0fc8832 719\func{wxString}{wxGetOSDirectory}{\void}
d524e22d 720
b0fc8832 721Returns the Windows directory under Windows; on other platforms returns the empty string.
d524e22d 722
b0fc8832 723\membersection{::wxIsAbsolutePath}\label{wxisabsolutepath}
d524e22d 724
b0fc8832 725\func{bool}{wxIsAbsolutePath}{\param{const wxString\& }{filename}}
d524e22d 726
b0fc8832
VZ
727Returns TRUE if the argument is an absolute filename, i.e. with a slash
728or drive name at the beginning.
85ec2f26 729
b0fc8832 730\membersection{::wxPathOnly}\label{wxpathonly}
d524e22d 731
b0fc8832 732\func{wxString}{wxPathOnly}{\param{const wxString\& }{path}}
d524e22d 733
b0fc8832 734Returns the directory part of the filename.
d524e22d 735
b0fc8832 736\membersection{::wxUnix2DosFilename}\label{wxunix2dosfilename}
d524e22d 737
b0fc8832 738\func{void}{wxUnix2DosFilename}{\param{const wxString\& }{s}}
e12be2f7 739
b0fc8832
VZ
740Converts a Unix to a DOS filename by replacing forward
741slashes with backslashes.
d524e22d 742
b0fc8832 743\membersection{::wxConcatFiles}\label{wxconcatfiles}
d524e22d 744
b0fc8832
VZ
745\func{bool}{wxConcatFiles}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2},
746\param{const wxString\& }{file3}}
d524e22d 747
b0fc8832
VZ
748Concatenates {\it file1} and {\it file2} to {\it file3}, returning
749TRUE if successful.
a660d684 750
b0fc8832 751\membersection{::wxCopyFile}\label{wxcopyfile}
a660d684 752
b0fc8832 753\func{bool}{wxCopyFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}, \param{bool }{overwrite = TRUE}}
a660d684 754
b0fc8832
VZ
755Copies {\it file1} to {\it file2}, returning TRUE if successful. If
756{\it overwrite} parameter is TRUE (default), the destination file is overwritten
757if it exists, but if {\it overwrite} is FALSE, the functions failes in this
758case.
a660d684 759
b0fc8832 760\membersection{::wxGetCwd}\label{wxgetcwd}
7ae8ee14 761
b0fc8832 762\func{wxString}{wxGetCwd}{\void}
7ae8ee14 763
b0fc8832 764Returns a string containing the current (or working) directory.
7ae8ee14 765
b0fc8832 766\membersection{::wxGetWorkingDirectory}\label{wxgetworkingdirectory}
7ae8ee14 767
7ac13b21 768\func{wxString}{wxGetWorkingDirectory}{\param{char *}{buf=NULL}, \param{int }{sz=1000}}
7ae8ee14 769
b0fc8832 770This function is obsolete: use \helpref{wxGetCwd}{wxgetcwd} instead.
7ae8ee14 771
b0fc8832
VZ
772Copies the current working directory into the buffer if supplied, or
773copies the working directory into new storage (which you must delete yourself)
774if the buffer is NULL.
7ae8ee14 775
b0fc8832 776{\it sz} is the size of the buffer if supplied.
a660d684 777
b0fc8832 778\membersection{::wxGetTempFileName}\label{wxgettempfilename}
a660d684 779
7ac13b21 780\func{char *}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{char *}{buf=NULL}}
a660d684 781
b0fc8832 782\func{bool}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{wxString\& }{buf}}
7ae8ee14 783
b0fc8832
VZ
784%% Makes a temporary filename based on {\it prefix}, opens and closes the file,
785%% and places the name in {\it buf}. If {\it buf} is NULL, new store
786%% is allocated for the temporary filename using {\it new}.
787%%
788%% Under Windows, the filename will include the drive and name of the
789%% directory allocated for temporary files (usually the contents of the
790%% TEMP variable). Under Unix, the {\tt /tmp} directory is used.
791%%
792%% It is the application's responsibility to create and delete the file.
a660d684 793
b0fc8832
VZ
794These functions are obsolete, please use\rtfsp
795\helpref{wxFileName::CreateTempFileName}{wxfilenamecreatetempfilename}\rtfsp
796instead.
a660d684 797
b0fc8832 798\membersection{::wxIsWild}\label{wxiswild}
a660d684 799
b0fc8832 800\func{bool}{wxIsWild}{\param{const wxString\& }{pattern}}
a660d684 801
b0fc8832 802Returns TRUE if the pattern contains wildcards. See \helpref{wxMatchWild}{wxmatchwild}.
a660d684 803
b0fc8832 804\membersection{::wxMatchWild}\label{wxmatchwild}
ed93168b 805
b0fc8832 806\func{bool}{wxMatchWild}{\param{const wxString\& }{pattern}, \param{const wxString\& }{text}, \param{bool}{ dot\_special}}
ed93168b 807
b0fc8832
VZ
808Returns TRUE if the {\it pattern}\/ matches the {\it text}\/; if {\it
809dot\_special}\/ is TRUE, filenames beginning with a dot are not matched
810with wildcard characters. See \helpref{wxIsWild}{wxiswild}.
ed93168b 811
b0fc8832 812\membersection{::wxMkdir}\label{wxmkdir}
ed93168b 813
b0fc8832 814\func{bool}{wxMkdir}{\param{const wxString\& }{dir}, \param{int }{perm = 0777}}
ed93168b 815
b0fc8832 816Makes the directory {\it dir}, returning TRUE if successful.
a660d684 817
b0fc8832
VZ
818{\it perm} is the access mask for the directory for the systems on which it is
819supported (Unix) and doesn't have effect for the other ones.
378b05f7 820
b0fc8832 821\membersection{::wxRemoveFile}\label{wxremovefile}
378b05f7 822
b0fc8832 823\func{bool}{wxRemoveFile}{\param{const wxString\& }{file}}
378b05f7 824
b0fc8832 825Removes {\it file}, returning TRUE if successful.
378b05f7 826
b0fc8832 827\membersection{::wxRenameFile}\label{wxrenamefile}
e12be2f7 828
b0fc8832 829\func{bool}{wxRenameFile}{\param{const wxString\& }{file1}, \param{const wxString\& }{file2}}
378b05f7 830
b0fc8832 831Renames {\it file1} to {\it file2}, returning TRUE if successful.
378b05f7 832
b0fc8832 833\membersection{::wxRmdir}\label{wxrmdir}
378b05f7 834
b0fc8832 835\func{bool}{wxRmdir}{\param{const wxString\& }{dir}, \param{int}{ flags=0}}
378b05f7 836
b0fc8832 837Removes the directory {\it dir}, returning TRUE if successful. Does not work under VMS.
e12be2f7 838
b0fc8832 839The {\it flags} parameter is reserved for future use.
378b05f7 840
b0fc8832 841\membersection{::wxSetWorkingDirectory}\label{wxsetworkingdirectory}
a660d684 842
b0fc8832 843\func{bool}{wxSetWorkingDirectory}{\param{const wxString\& }{dir}}
a660d684 844
b0fc8832
VZ
845Sets the current working directory, returning TRUE if the operation succeeded.
846Under MS Windows, the current drive is also changed if {\it dir} contains a drive specification.
c50f1fb9 847
b0fc8832 848\membersection{::wxSplitPath}\label{wxsplitfunction}
c50f1fb9 849
b0fc8832 850\func{void}{wxSplitPath}{\param{const char *}{ fullname}, \param{wxString *}{ path}, \param{wxString *}{ name}, \param{wxString *}{ ext}}
c50f1fb9 851
b0fc8832
VZ
852This function splits a full file name into components: the path (including possible disk/drive
853specification under Windows), the base name and the extension. Any of the output parameters
854({\it path}, {\it name} or {\it ext}) may be NULL if you are not interested in the value of
855a particular component.
c50f1fb9 856
b0fc8832
VZ
857wxSplitPath() will correctly handle filenames with both DOS and Unix path separators under
858Windows, however it will not consider backslashes as path separators under Unix (where backslash
859is a valid character in a filename).
c50f1fb9 860
b0fc8832 861On entry, {\it fullname} should be non-NULL (it may be empty though).
c50f1fb9 862
b0fc8832
VZ
863On return, {\it path} contains the file path (without the trailing separator), {\it name}
864contains the file name and {\it ext} contains the file extension without leading dot. All
865three of them may be empty if the corresponding component is. The old contents of the
866strings pointed to by these parameters will be overwritten in any case (if the pointers
867are not NULL).
c50f1fb9 868
b0fc8832 869\membersection{::wxTransferFileToStream}\label{wxtransferfiletostream}
c50f1fb9 870
b0fc8832 871\func{bool}{wxTransferFileToStream}{\param{const wxString\& }{filename}, \param{ostream\& }{stream}}
10eb1f1e 872
b0fc8832
VZ
873Copies the given file to {\it stream}. Useful when converting an old application to
874use streams (within the document/view framework, for example).
10eb1f1e 875
b0fc8832 876\wxheading{Include files}
10eb1f1e 877
b0fc8832 878<wx/docview.h>
10eb1f1e 879
b0fc8832
VZ
880\membersection{::wxTransferStreamToFile}\label{wxtransferstreamtofile}
881
882\func{bool}{wxTransferStreamToFile}{\param{istream\& }{stream} \param{const wxString\& }{filename}}
883
884Copies the given stream to the file {\it filename}. Useful when converting an old application to
885use streams (within the document/view framework, for example).
10eb1f1e
VZ
886
887\wxheading{Include files}
888
b0fc8832 889<wx/docview.h>
10eb1f1e 890
b0fc8832 891\section{Network, user and OS functions}\label{networkfunctions}
a660d684 892
b0fc8832
VZ
893The functions in this section are used to retrieve information about the
894current computer and/or user characteristics.
a660d684 895
b0fc8832 896\membersection{::wxGetFreeMemory}\label{wxgetfreememory}
a660d684 897
b0fc8832 898\func{long}{wxGetFreeMemory}{\void}
a660d684 899
b0fc8832
VZ
900Returns the amount of free memory in bytes under environments which
901support it, and -1 if not supported. Currently, it is supported only
902under Windows, Linux and Solaris.
a660d684 903
b0fc8832 904\wxheading{Include files}
a660d684 905
b0fc8832 906<wx/utils.h>
a660d684 907
b0fc8832 908\membersection{::wxGetFullHostName}\label{wxgetfullhostname}
a660d684 909
b0fc8832 910\func{wxString}{wxGetFullHostName}{\void}
954b8ae6 911
b0fc8832
VZ
912Returns the FQDN (fully qualified domain host name) or an empty string on
913error.
954b8ae6 914
b0fc8832 915\wxheading{See also}
c49245f8 916
b0fc8832 917\helpref{wxGetHostName}{wxgethostname}
4aff28fc 918
b0fc8832 919\wxheading{Include files}
4aff28fc 920
b0fc8832 921<wx/utils.h>
4aff28fc 922
b0fc8832 923\membersection{::wxGetEmailAddress}\label{wxgetemailaddress}
4aff28fc 924
b0fc8832
VZ
925\func{bool}{wxGetEmailAddress}{\param{const wxString\& }{buf}, \param{int }{sz}}
926
927Copies the user's email address into the supplied buffer, by
928concatenating the values returned by \helpref{wxGetFullHostName}{wxgetfullhostname}\rtfsp
929and \helpref{wxGetUserId}{wxgetuserid}.
930
931Returns TRUE if successful, FALSE otherwise.
4aff28fc
VZ
932
933\wxheading{Include files}
934
b0fc8832 935<wx/utils.h>
4aff28fc 936
b0fc8832 937\membersection{::wxGetHomeDir}\label{wxgethomedir}
d6c9c1b7 938
b0fc8832 939\func{wxString}{wxGetHomeDir}{\void}
d6c9c1b7 940
b0fc8832 941Return the (current) user's home directory.
d6c9c1b7 942
b0fc8832 943\wxheading{See also}
d6c9c1b7 944
b0fc8832 945\helpref{wxGetUserHome}{wxgetuserhome}
d6c9c1b7
VZ
946
947\wxheading{Include files}
948
b0fc8832 949<wx/utils.h>
d6c9c1b7 950
b0fc8832 951\membersection{::wxGetHostName}\label{wxgethostname}
f3539882 952
b0fc8832 953\func{wxString}{wxGetHostName}{\void}
4aff28fc 954
b0fc8832 955\func{bool}{wxGetHostName}{\param{char * }{buf}, \param{int }{sz}}
c49245f8 956
b0fc8832
VZ
957Copies the current host machine's name into the supplied buffer. Please note
958that the returned name is {\it not} fully qualified, i.e. it does not include
959the domain name.
c49245f8 960
b0fc8832
VZ
961Under Windows or NT, this function first looks in the environment
962variable SYSTEM\_NAME; if this is not found, the entry {\bf HostName}\rtfsp
963in the {\bf wxWindows} section of the WIN.INI file is tried.
c49245f8 964
b0fc8832
VZ
965The first variant of this function returns the hostname if successful or an
966empty string otherwise. The second (deprecated) function returns TRUE
967if successful, FALSE otherwise.
968
969\wxheading{See also}
970
971\helpref{wxGetFullHostName}{wxgetfullhostname}
c49245f8
VZ
972
973\wxheading{Include files}
a294c6d5 974
b0fc8832 975<wx/utils.h>
a294c6d5 976
b0fc8832 977\membersection{::wxGetUserId}\label{wxgetuserid}
a294c6d5 978
b0fc8832 979\func{wxString}{wxGetUserId}{\void}
a294c6d5 980
b0fc8832
VZ
981\func{bool}{wxGetUserId}{\param{char * }{buf}, \param{int }{sz}}
982
983This function returns the "user id" also known as "login name" under Unix i.e.
984something like "jsmith". It uniquely identifies the current user (on this system).
985
986Under Windows or NT, this function first looks in the environment
987variables USER and LOGNAME; if neither of these is found, the entry {\bf UserId}\rtfsp
988in the {\bf wxWindows} section of the WIN.INI file is tried.
989
990The first variant of this function returns the login name if successful or an
991empty string otherwise. The second (deprecated) function returns TRUE
992if successful, FALSE otherwise.
993
994\wxheading{See also}
995
996\helpref{wxGetUserName}{wxgetusername}
a294c6d5
VZ
997
998\wxheading{Include files}
c49245f8 999
b0fc8832 1000<wx/utils.h>
c49245f8 1001
b0fc8832 1002\membersection{::wxGetOsDescription}\label{wxgetosdescription}
a660d684 1003
b0fc8832 1004\func{wxString}{wxGetOsDescription}{\void}
a660d684 1005
b0fc8832
VZ
1006Returns the string containing the description of the current platform in a
1007user-readable form. For example, this function may return strings like
1008{\tt Windows NT Version 4.0} or {\tt Linux 2.2.2 i386}.
a660d684 1009
b0fc8832
VZ
1010\wxheading{See also}
1011
1012\helpref{::wxGetOsVersion}{wxgetosversion}
a660d684 1013
954b8ae6
JS
1014\wxheading{Include files}
1015
b0fc8832 1016<wx/utils.h>
954b8ae6 1017
b0fc8832 1018\membersection{::wxGetOsVersion}\label{wxgetosversion}
a660d684 1019
b0fc8832 1020\func{int}{wxGetOsVersion}{\param{int *}{major = NULL}, \param{int *}{minor = NULL}}
a660d684 1021
b0fc8832 1022Gets operating system version information.
a660d684 1023
b0fc8832
VZ
1024\begin{twocollist}\itemsep=0pt
1025\twocolitemruled{Platform}{Return types}
1026\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.}
1027\twocolitem{GTK}{Return value is wxGTK, For GTK 1.0, {\it major} is 1, {\it minor} is 0. }
1028\twocolitem{Motif}{Return value is wxMOTIF\_X, {\it major} is X version, {\it minor} is X revision.}
1029\twocolitem{OS/2}{Return value is wxOS2\_PM.}
1030\twocolitem{Windows 3.1}{Return value is wxWINDOWS, {\it major} is 3, {\it minor} is 1.}
1031\twocolitem{Windows NT/2000}{Return value is wxWINDOWS\_NT, version is returned in {\it major} and {\it minor}}
1032\twocolitem{Windows 98}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 1 or greater.}
1033\twocolitem{Windows 95}{Return value is wxWIN95, {\it major} is 4, {\it minor} is 0.}
1034\twocolitem{Win32s (Windows 3.1)}{Return value is wxWIN32S, {\it major} is 3, {\it minor} is 1.}
1035\twocolitem{Watcom C++ 386 supervisor mode (Windows 3.1)}{Return value is wxWIN386, {\it major} is 3, {\it minor} is 1.}
1036\end{twocollist}
a660d684 1037
b0fc8832 1038\wxheading{See also}
a660d684 1039
b0fc8832 1040\helpref{::wxGetOsDescription}{wxgetosdescription}
a660d684 1041
b0fc8832
VZ
1042\wxheading{Include files}
1043
1044<wx/utils.h>
1045
1046\membersection{::wxGetUserHome}\label{wxgetuserhome}
1047
1048\func{const wxChar *}{wxGetUserHome}{\param{const wxString\& }{user = ""}}
1049
1050Returns the home directory for the given user. If the username is empty
1051(default value), this function behaves like
1052\helpref{wxGetHomeDir}{wxgethomedir}.
a660d684 1053
954b8ae6
JS
1054\wxheading{Include files}
1055
b0fc8832 1056<wx/utils.h>
954b8ae6 1057
b0fc8832 1058\membersection{::wxGetUserName}\label{wxgetusername}
a660d684 1059
b0fc8832 1060\func{wxString}{wxGetUserName}{\void}
d6c9c1b7 1061
b0fc8832 1062\func{bool}{wxGetUserName}{\param{char * }{buf}, \param{int }{sz}}
d6c9c1b7 1063
b0fc8832 1064This function returns the full user name (something like "Mr. John Smith").
d6c9c1b7 1065
b0fc8832
VZ
1066Under Windows or NT, this function looks for the entry {\bf UserName}\rtfsp
1067in the {\bf wxWindows} section of the WIN.INI file. If PenWindows
1068is running, the entry {\bf Current} in the section {\bf User} of
1069the PENWIN.INI file is used.
d6c9c1b7 1070
b0fc8832
VZ
1071The first variant of this function returns the user name if successful or an
1072empty string otherwise. The second (deprecated) function returns {\tt TRUE}
1073if successful, {\tt FALSE} otherwise.
1074
1075\wxheading{See also}
1076
1077\helpref{wxGetUserId}{wxgetuserid}
a660d684 1078
954b8ae6
JS
1079\wxheading{Include files}
1080
b0fc8832 1081<wx/utils.h>
954b8ae6 1082
b0fc8832 1083\section{String functions}
f3539882 1084
b0fc8832 1085\membersection{::copystring}\label{copystring}
a660d684 1086
7ac13b21 1087\func{char *}{copystring}{\param{const char *}{s}}
a660d684 1088
b0fc8832
VZ
1089Makes a copy of the string {\it s} using the C++ new operator, so it can be
1090deleted with the {\it delete} operator.
d6c9c1b7 1091
b0fc8832 1092This function is deprecated, use \helpref{wxString}{wxstring} class instead.
a660d684 1093
b0fc8832 1094\membersection{::wxIsEmpty}\label{wxisempty}
954b8ae6 1095
b0fc8832 1096\func{bool}{wxIsEmpty}{\param{const char *}{ p}}
954b8ae6 1097
b0fc8832
VZ
1098Returns {\tt TRUE} if the pointer is either {\tt NULL} or points to an empty
1099string, {\tt FALSE} otherwise.
f3539882 1100
b0fc8832 1101\membersection{::wxStricmp}\label{wxstricmp}
a660d684 1102
b0fc8832 1103\func{int}{wxStricmp}{\param{const char *}{p1}, \param{const char *}{p2}}
d6c9c1b7 1104
b0fc8832
VZ
1105Returns a negative value, 0, or positive value if {\it p1} is less than, equal
1106to or greater than {\it p2}. The comparison is case-insensitive.
a660d684 1107
b0fc8832
VZ
1108This function complements the standard C function {\it strcmp()} which performs
1109case-sensitive comparison.
a660d684 1110
b0fc8832 1111\membersection{::wxStringMatch}\label{wxstringmatch}
954b8ae6 1112
b0fc8832
VZ
1113\func{bool}{wxStringMatch}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2},\\
1114 \param{bool}{ subString = TRUE}, \param{bool}{ exact = FALSE}}
954b8ae6 1115
b0fc8832
VZ
1116Returns {\tt TRUE} if the substring {\it s1} is found within {\it s2},
1117ignoring case if {\it exact} is FALSE. If {\it subString} is {\tt FALSE},
1118no substring matching is done.
f3539882 1119
b0fc8832 1120This function is obsolete, use \helpref{wxString::Find}{wxstringfind} instead.
a660d684 1121
b0fc8832 1122\membersection{::wxStringEq}\label{wxstringeq}
a660d684 1123
b0fc8832 1124\func{bool}{wxStringEq}{\param{const wxString\& }{s1}, \param{const wxString\& }{s2}}
a660d684 1125
b0fc8832
VZ
1126A macro defined as:
1127
1128\begin{verbatim}
1129#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
1130\end{verbatim}
1131
1132This function is obsolete, use \helpref{wxString}{wxstring} instead.
1133
1134\membersection{::wxStrlen}\label{wxstrlen}
1135
1136\func{size\_t}{wxStrlen}{\param{const char *}{ p}}
1137
1138This is a safe version of standard function {\it strlen()}: it does exactly the
1139same thing (i.e. returns the length of the string) except that it returns 0 if
1140{\it p} is the {\tt NULL} pointer.
1141
1142\membersection{::wxGetTranslation}\label{wxgettranslation}
1143
1144\func{const char *}{wxGetTranslation}{\param{const char * }{str}}
1145
1146This function returns the translation of string {\it str} in the current
1147\helpref{locale}{wxlocale}. If the string is not found in any of the loaded
1148message catalogs (see \helpref{internationalization overview}{internationalization}), the
1149original string is returned. In debug build, an error message is logged - this
1150should help to find the strings which were not yet translated. As this function
1151is used very often, an alternative syntax is provided: the \_() macro is
1152defined as wxGetTranslation().
1153
1154\membersection{::wxSnprintf}\label{wxsnprintf}
a660d684 1155
b0fc8832 1156\func{int}{wxSnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{}{...}}
a660d684 1157
b0fc8832
VZ
1158This function replaces the dangerous standard function {\tt sprintf()} and is
1159like {\tt snprintf()} available on some platforms. The only difference with
1160sprintf() is that an additional argument - buffer size - is taken and the
1161buffer is never overflowed.
a660d684 1162
b0fc8832
VZ
1163Returns the number of characters copied to the buffer or -1 if there is not
1164enough space.
a660d684 1165
b0fc8832 1166\wxheading{See also}
a660d684 1167
b0fc8832
VZ
1168\helpref{wxVsnprintf}{wxvsnprintf}, \helpref{wxString::Printf}{wxstringprintf}
1169
1170\membersection{::wxToLower}\label{wxtolower}
1171
1172\func{char}{wxToLower}{\param{char }{ch}}
1173
1174Converts the character to lower case. This is implemented as a macro for efficiency.
a660d684 1175
954b8ae6
JS
1176\wxheading{Include files}
1177
b0fc8832 1178<wx/utils.h>
954b8ae6 1179
b0fc8832 1180\membersection{::wxToUpper}\label{wxtoupper}
c50f1fb9 1181
b0fc8832 1182\func{char}{wxToUpper}{\param{char }{ch}}
c50f1fb9 1183
b0fc8832 1184Converts the character to upper case. This is implemented as a macro for efficiency.
c50f1fb9 1185
b0fc8832 1186\wxheading{Include files}
c50f1fb9 1187
b0fc8832 1188<wx/utils.h>
c50f1fb9 1189
b0fc8832
VZ
1190\membersection{::wxVsnprintf}\label{wxvsnprintf}
1191
ea44a631 1192\func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argPtr}}
b0fc8832 1193
7ac13b21 1194The same as \helpref{wxSnprintf}{wxsnprintf} but takes a {\tt va\_list }
b0fc8832 1195argument instead of arbitrary number of parameters.
c50f1fb9 1196
e12be2f7 1197\wxheading{See also}
c50f1fb9 1198
b0fc8832 1199\helpref{wxSnprintf}{wxsnprintf}, \helpref{wxString::PrintfV}{wxstringprintfv}
c50f1fb9 1200
b0fc8832 1201\section{Dialog functions}\label{dialogfunctions}
c50f1fb9 1202
b0fc8832
VZ
1203Below are a number of convenience functions for getting input from the
1204user or displaying messages. Note that in these functions the last three
1205parameters are optional. However, it is recommended to pass a parent frame
1206parameter, or (in MS Windows or Motif) the wrong window frame may be brought to
1207the front when the dialog box is popped up.
c50f1fb9 1208
b0fc8832 1209\membersection{::wxBeginBusyCursor}\label{wxbeginbusycursor}
a660d684 1210
b0fc8832
VZ
1211\func{void}{wxBeginBusyCursor}{\param{wxCursor *}{cursor = wxHOURGLASS\_CURSOR}}
1212
1213Changes the cursor to the given cursor for all windows in the application.
1214Use \helpref{wxEndBusyCursor}{wxendbusycursor} to revert the cursor back
1215to its previous state. These two calls can be nested, and a counter
1216ensures that only the outer calls take effect.
1217
1218See also \helpref{wxIsBusy}{wxisbusy}, \helpref{wxBusyCursor}{wxbusycursor}.
a660d684 1219
954b8ae6
JS
1220\wxheading{Include files}
1221
b0fc8832 1222<wx/utils.h>
954b8ae6 1223
b0fc8832 1224\membersection{::wxBell}\label{wxbell}
ec5d7799 1225
b0fc8832 1226\func{void}{wxBell}{\void}
ec5d7799 1227
b0fc8832 1228Ring the system bell.
ec5d7799 1229
b0fc8832 1230\wxheading{Include files}
ec5d7799 1231
b0fc8832 1232<wx/utils.h>
a660d684 1233
b0fc8832 1234\membersection{::wxCreateFileTipProvider}\label{wxcreatefiletipprovider}
a660d684 1235
b0fc8832
VZ
1236\func{wxTipProvider *}{wxCreateFileTipProvider}{\param{const wxString\& }{filename},
1237 \param{size\_t }{currentTip}}
a660d684 1238
b0fc8832
VZ
1239This function creates a \helpref{wxTipProvider}{wxtipprovider} which may be
1240used with \helpref{wxShowTip}{wxshowtip}.
a660d684 1241
b0fc8832
VZ
1242\docparam{filename}{The name of the file containing the tips, one per line}
1243\docparam{currentTip}{The index of the first tip to show - normally this index
1244is remembered between the 2 program runs.}
a660d684 1245
b0fc8832 1246\wxheading{See also}
a660d684 1247
b0fc8832 1248\helpref{Tips overview}{tipsoverview}
904a68b6 1249
b0fc8832 1250\wxheading{Include files}
904a68b6 1251
b0fc8832 1252<wx/tipdlg.h>
904a68b6 1253
b0fc8832 1254\membersection{::wxDirSelector}\label{wxdirselector}
904a68b6 1255
b0fc8832
VZ
1256\func{wxString}{wxDirSelector}{\param{const wxString\& }{message = wxDirSelectorPromptStr},\\
1257 \param{const wxString\& }{default\_path = ""},\\
1258 \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition},\\
1259 \param{wxWindow *}{parent = NULL}}
904a68b6 1260
b0fc8832
VZ
1261Pops up a directory selector dialog. The arguments have the same meaning as
1262those of wxDirDialog::wxDirDialog(). The message is displayed at the top,
1263and the default\_path, if specified, is set as the initial selection.
904a68b6 1264
b0fc8832
VZ
1265The application must check for an empty return value (if the user pressed
1266Cancel). For example:
904a68b6 1267
b0fc8832
VZ
1268\begin{verbatim}
1269const wxString& dir = wxDirSelector("Choose a folder");
1270if ( !dir.empty() )
1271{
1272 ...
1273}
1274\end{verbatim}
904a68b6 1275
b0fc8832 1276\wxheading{Include files}
a660d684 1277
b0fc8832 1278<wx/dirdlg.h>
a660d684 1279
b0fc8832 1280\membersection{::wxFileSelector}\label{wxfileselector}
a660d684 1281
b0fc8832
VZ
1282\func{wxString}{wxFileSelector}{\param{const wxString\& }{message}, \param{const wxString\& }{default\_path = ""},\\
1283 \param{const wxString\& }{default\_filename = ""}, \param{const wxString\& }{default\_extension = ""},\\
1284 \param{const wxString\& }{wildcard = ``*.*''}, \param{int }{flags = 0}, \param{wxWindow *}{parent = ""},\\
1285 \param{int}{ x = -1}, \param{int}{ y = -1}}
a660d684 1286
b0fc8832
VZ
1287Pops up a file selector box. In Windows, this is the common file selector
1288dialog. In X, this is a file selector box with the same functionality.
1289The path and filename are distinct elements of a full file pathname.
1290If path is empty, the current directory will be used. If filename is empty,
1291no default filename will be supplied. The wildcard determines what files
1292are displayed in the file selector, and file extension supplies a type
1293extension for the required filename. Flags may be a combination of wxOPEN,
1294wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, wxFILE\_MUST\_EXIST, wxMULTIPLE or 0.
a660d684 1295
b0fc8832
VZ
1296Both the Unix and Windows versions implement a wildcard filter. Typing a
1297filename containing wildcards (*, ?) in the filename text item, and
1298clicking on Ok, will result in only those files matching the pattern being
1299displayed.
a660d684 1300
b0fc8832
VZ
1301The wildcard may be a specification for multiple types of file
1302with a description for each, such as:
a660d684 1303
b0fc8832
VZ
1304\begin{verbatim}
1305 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
1306\end{verbatim}
a660d684 1307
b0fc8832
VZ
1308The application must check for an empty return value (the user pressed
1309Cancel). For example:
a660d684 1310
b0fc8832
VZ
1311\begin{verbatim}
1312const wxString& s = wxFileSelector("Choose a file to open");
1313if (s)
1314{
1315 ...
1316}
1317\end{verbatim}
a660d684 1318
b0fc8832 1319\wxheading{Include files}
a660d684 1320
b0fc8832 1321<wx/filedlg.h>
a660d684 1322
b0fc8832 1323\membersection{::wxEndBusyCursor}\label{wxendbusycursor}
a660d684 1324
b0fc8832 1325\func{void}{wxEndBusyCursor}{\void}
f53561f1 1326
b0fc8832
VZ
1327Changes the cursor back to the original cursor, for all windows in the application.
1328Use with \helpref{wxBeginBusyCursor}{wxbeginbusycursor}.
1329
1330See also \helpref{wxIsBusy}{wxisbusy}, \helpref{wxBusyCursor}{wxbusycursor}.
a660d684 1331
954b8ae6
JS
1332\wxheading{Include files}
1333
b0fc8832 1334<wx/utils.h>
954b8ae6 1335
b0fc8832 1336\membersection{::wxGetColourFromUser}\label{wxgetcolourfromuser}
a660d684 1337
b0fc8832 1338\func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}}
a660d684 1339
b0fc8832
VZ
1340Shows the colour selection dialog and returns the colour selected by user or
1341invalid colour (use \helpref{wxColour::Ok}{wxcolourok} to test whether a colour
1342is valid) if the dialog was cancelled.
a660d684 1343
b0fc8832 1344\wxheading{Parameters}
a660d684 1345
b0fc8832 1346\docparam{parent}{The parent window for the colour selection dialog}
a660d684 1347
b0fc8832 1348\docparam{colInit}{If given, this will be the colour initially selected in the dialog.}
a660d684 1349
b0fc8832 1350\wxheading{Include files}
a660d684 1351
b0fc8832 1352<wx/colordlg.h>
a660d684 1353
d741c583
VZ
1354\membersection{::wxGetFontFromUser}\label{wxgetfontfromuser}
1355
1356\func{wxFont}{wxGetFontFromUser}{\param{wxWindow *}{parent}, \param{const wxFont\& }{fontInit}}
1357
1358Shows the font selection dialog and returns the font selected by user or
1359invalid font (use \helpref{wxFont::Ok}{wxfontok} to test whether a font
1360is valid) if the dialog was cancelled.
1361
1362\wxheading{Parameters}
1363
65d877d2 1364\docparam{parent}{The parent window for the font selection dialog}
d741c583
VZ
1365
1366\docparam{fontInit}{If given, this will be the font initially selected in the dialog.}
1367
1368\wxheading{Include files}
1369
1370<wx/fontdlg.h>
1371
1372
b0fc8832 1373\membersection{::wxGetMultipleChoices}\label{wxgetmultiplechoices}
a660d684 1374
b0fc8832
VZ
1375\func{size\_t}{wxGetMultipleChoices}{\\
1376 \param{wxArrayInt\& }{selections},\\
1377 \param{const wxString\& }{message},\\
1378 \param{const wxString\& }{caption},\\
1379 \param{const wxArrayString\& }{aChoices},\\
1380 \param{wxWindow *}{parent = NULL},\\
1381 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1382 \param{bool}{ centre = TRUE},\\
1383 \param{int }{width=150}, \param{int }{height=200}}
a660d684 1384
b0fc8832
VZ
1385\func{size\_t}{wxGetMultipleChoices}{\\
1386 \param{wxArrayInt\& }{selections},\\
1387 \param{const wxString\& }{message},\\
1388 \param{const wxString\& }{caption},\\
1389 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1390 \param{wxWindow *}{parent = NULL},\\
1391 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1392 \param{bool}{ centre = TRUE},\\
1393 \param{int }{width=150}, \param{int }{height=200}}
a660d684 1394
b0fc8832
VZ
1395Pops up a dialog box containing a message, OK/Cancel buttons and a
1396multiple-selection listbox. The user may choose an arbitrary (including 0)
1397number of items in the listbox whose indices will be returned in
1398{\it selection} array. The initial contents of this array will be used to
1399select the items when the dialog is shown.
a660d684 1400
b0fc8832
VZ
1401You may pass the list of strings to choose from either using {\it choices}
1402which is an array of {\it n} strings for the listbox or by using a single
1403{\it aChoices} parameter of type \helpref{wxArrayString}{wxarraystring}.
a660d684 1404
b0fc8832
VZ
1405If {\it centre} is TRUE, the message text (which may include new line
1406characters) is centred; if FALSE, the message is left-justified.
a660d684 1407
b0fc8832 1408\wxheading{Include files}
a660d684 1409
b0fc8832 1410<wx/choicdlg.h>
a660d684 1411
b0fc8832
VZ
1412\perlnote{In wxPerl there is just an array reference in place of {\tt n}
1413and {\tt choices}, and no {\tt selections} parameter; the function
1414returns an array containing the user selections.}
a660d684 1415
b0fc8832 1416\membersection{::wxGetNumberFromUser}\label{wxgetnumberfromuser}
a660d684 1417
b0fc8832
VZ
1418\func{long}{wxGetNumberFromUser}{
1419 \param{const wxString\& }{message},
1420 \param{const wxString\& }{prompt},
1421 \param{const wxString\& }{caption},
1422 \param{long }{value},
1423 \param{long }{min = 0},
1424 \param{long }{max = 100},
1425 \param{wxWindow *}{parent = NULL},
1426 \param{const wxPoint\& }{pos = wxDefaultPosition}}
a660d684 1427
b0fc8832
VZ
1428Shows a dialog asking the user for numeric input. The dialogs title is set to
1429{\it caption}, it contains a (possibly) multiline {\it message} above the
1430single line {\it prompt} and the zone for entering the number.
a660d684 1431
b0fc8832
VZ
1432The number entered must be in the range {\it min}..{\it max} (both of which
1433should be positive) and {\it value} is the initial value of it. If the user
1434enters an invalid value or cancels the dialog, the function will return -1.
a660d684 1435
b0fc8832
VZ
1436Dialog is centered on its {\it parent} unless an explicit position is given in
1437{\it pos}.
a660d684 1438
b0fc8832 1439\wxheading{Include files}
a660d684 1440
b0fc8832 1441<wx/textdlg.h>
a660d684 1442
b0fc8832 1443\membersection{::wxGetPasswordFromUser}\label{wxgetpasswordfromuser}
a660d684 1444
b0fc8832
VZ
1445\func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
1446 \param{const wxString\& }{default\_value = ``"}, \param{wxWindow *}{parent = NULL}}
a660d684 1447
b0fc8832
VZ
1448Similar to \helpref{wxGetTextFromUser}{wxgettextfromuser} but the text entered
1449in the dialog is not shown on screen but replaced with stars. This is intended
1450to be used for entering passwords as the function name implies.
a660d684 1451
b0fc8832 1452\wxheading{Include files}
a660d684 1453
b0fc8832 1454<wx/textdlg.h>
a660d684 1455
b0fc8832 1456\membersection{::wxGetTextFromUser}\label{wxgettextfromuser}
a660d684 1457
b0fc8832
VZ
1458\func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
1459 \param{const wxString\& }{default\_value = ``"}, \param{wxWindow *}{parent = NULL},\\
1460 \param{int}{ x = -1}, \param{int}{ y = -1}, \param{bool}{ centre = TRUE}}
a660d684 1461
b0fc8832
VZ
1462Pop up a dialog box with title set to {\it caption}, {\it message}, and a
1463\rtfsp{\it default\_value}. The user may type in text and press OK to return this text,
1464or press Cancel to return the empty string.
a660d684 1465
b0fc8832
VZ
1466If {\it centre} is TRUE, the message text (which may include new line characters)
1467is centred; if FALSE, the message is left-justified.
a660d684 1468
b0fc8832 1469\wxheading{Include files}
a660d684 1470
b0fc8832 1471<wx/textdlg.h>
a660d684 1472
b0fc8832 1473\membersection{::wxGetMultipleChoice}\label{wxgetmultiplechoice}
a660d684 1474
b0fc8832
VZ
1475\func{int}{wxGetMultipleChoice}{\param{const wxString\& }{message}, \param{const wxString\& }{caption}, \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1476 \param{int }{nsel}, \param{int *}{selection},
1477 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
1478 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 1479
b0fc8832
VZ
1480Pops up a dialog box containing a message, OK/Cancel buttons and a multiple-selection
1481listbox. The user may choose one or more item(s) and press OK or Cancel.
a660d684 1482
b0fc8832
VZ
1483The number of initially selected choices, and array of the selected indices,
1484are passed in; this array will contain the user selections on exit, with
1485the function returning the number of selections. {\it selection} must be
1486as big as the number of choices, in case all are selected.
a660d684 1487
b0fc8832 1488If Cancel is pressed, -1 is returned.
a660d684 1489
b0fc8832 1490{\it choices} is an array of {\it n} strings for the listbox.
a660d684 1491
b0fc8832
VZ
1492If {\it centre} is TRUE, the message text (which may include new line characters)
1493is centred; if FALSE, the message is left-justified.
a660d684 1494
b0fc8832 1495\wxheading{Include files}
a660d684 1496
b0fc8832 1497<wx/choicdlg.h>
a660d684 1498
b0fc8832 1499\membersection{::wxGetSingleChoice}\label{wxgetsinglechoice}
a660d684 1500
b0fc8832
VZ
1501\func{wxString}{wxGetSingleChoice}{\param{const wxString\& }{message},\\
1502 \param{const wxString\& }{caption},\\
1503 \param{const wxArrayString\& }{aChoices},\\
1504 \param{wxWindow *}{parent = NULL},\\
1505 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1506 \param{bool}{ centre = TRUE},\\
1507 \param{int }{width=150}, \param{int }{height=200}}
a660d684 1508
b0fc8832
VZ
1509\func{wxString}{wxGetSingleChoice}{\param{const wxString\& }{message},\\
1510 \param{const wxString\& }{caption},\\
1511 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1512 \param{wxWindow *}{parent = NULL},\\
1513 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1514 \param{bool}{ centre = TRUE},\\
1515 \param{int }{width=150}, \param{int }{height=200}}
a660d684 1516
b0fc8832
VZ
1517Pops up a dialog box containing a message, OK/Cancel buttons and a
1518single-selection listbox. The user may choose an item and press OK to return a
1519string or Cancel to return the empty string. Use
1520\helpref{wxGetSingleChoiceIndex}{wxgetsinglechoiceindex} if empty string is a
1521valid choice and if you want to be able to detect pressing Cancel reliably.
a660d684 1522
b0fc8832
VZ
1523You may pass the list of strings to choose from either using {\it choices}
1524which is an array of {\it n} strings for the listbox or by using a single
1525{\it aChoices} parameter of type \helpref{wxArrayString}{wxarraystring}.
a660d684 1526
b0fc8832
VZ
1527If {\it centre} is TRUE, the message text (which may include new line
1528characters) is centred; if FALSE, the message is left-justified.
a660d684 1529
954b8ae6
JS
1530\wxheading{Include files}
1531
b0fc8832 1532<wx/choicdlg.h>
954b8ae6 1533
b0fc8832
VZ
1534\perlnote{In wxPerl there is just an array reference in place of {\tt n}
1535and {\tt choices}.}
a660d684 1536
b0fc8832 1537\membersection{::wxGetSingleChoiceIndex}\label{wxgetsinglechoiceindex}
a660d684 1538
b0fc8832
VZ
1539\func{int}{wxGetSingleChoiceIndex}{\param{const wxString\& }{message},\\
1540 \param{const wxString\& }{caption},\\
1541 \param{const wxArrayString\& }{aChoices},\\
1542 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
1543 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 1544
b0fc8832
VZ
1545\func{int}{wxGetSingleChoiceIndex}{\param{const wxString\& }{message},\\
1546 \param{const wxString\& }{caption},\\
1547 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1548 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
1549 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 1550
b0fc8832
VZ
1551As {\bf wxGetSingleChoice} but returns the index representing the selected
1552string. If the user pressed cancel, -1 is returned.
a660d684 1553
b0fc8832 1554\wxheading{Include files}
a660d684 1555
b0fc8832 1556<wx/choicdlg.h>
a660d684 1557
b0fc8832
VZ
1558\perlnote{In wxPerl there is just an array reference in place of {\tt n}
1559and {\tt choices}.}
a660d684 1560
b0fc8832 1561\membersection{::wxGetSingleChoiceData}\label{wxgetsinglechoicedata}
a660d684 1562
b0fc8832
VZ
1563\func{wxString}{wxGetSingleChoiceData}{\param{const wxString\& }{message},\\
1564 \param{const wxString\& }{caption},\\
1565 \param{const wxArrayString\& }{aChoices},\\
1566 \param{const wxString\& }{client\_data[]},\\
1567 \param{wxWindow *}{parent = NULL},\\
1568 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1569 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 1570
b0fc8832
VZ
1571\func{wxString}{wxGetSingleChoiceData}{\param{const wxString\& }{message},\\
1572 \param{const wxString\& }{caption},\\
1573 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1574 \param{const wxString\& }{client\_data[]},\\
1575 \param{wxWindow *}{parent = NULL},\\
1576 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1577 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
a660d684 1578
b0fc8832
VZ
1579As {\bf wxGetSingleChoice} but takes an array of client data pointers
1580corresponding to the strings, and returns one of these pointers or NULL if
1581Cancel was pressed. The {\it client\_data} array must have the same number of
1582elements as {\it choices} or {\it aChoices}!
a660d684 1583
b0fc8832 1584\wxheading{Include files}
a660d684 1585
b0fc8832 1586<wx/choicdlg.h>
a660d684 1587
b0fc8832
VZ
1588\perlnote{In wxPerl there is just an array reference in place of {\tt n}
1589and {\tt choices}, and the client data array must have the
1590same length as the choices array.}
a660d684 1591
b0fc8832 1592\membersection{::wxIsBusy}\label{wxisbusy}
a660d684 1593
b0fc8832 1594\func{bool}{wxIsBusy}{\void}
a660d684 1595
b0fc8832
VZ
1596Returns TRUE if between two \helpref{wxBeginBusyCursor}{wxbeginbusycursor} and\rtfsp
1597\helpref{wxEndBusyCursor}{wxendbusycursor} calls.
a660d684 1598
b0fc8832 1599See also \helpref{wxBusyCursor}{wxbusycursor}.
a660d684 1600
b0fc8832 1601\wxheading{Include files}
a660d684 1602
b0fc8832 1603<wx/utils.h>
a660d684 1604
b0fc8832 1605\membersection{::wxMessageBox}\label{wxmessagebox}
a660d684 1606
b0fc8832
VZ
1607\func{int}{wxMessageBox}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Message"}, \param{int}{ style = wxOK \pipe wxCENTRE},\\
1608 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1}}
a660d684 1609
b0fc8832
VZ
1610General purpose message dialog. {\it style} may be a bit list of the
1611following identifiers:
a660d684 1612
b0fc8832
VZ
1613\begin{twocollist}\itemsep=0pt
1614\twocolitem{wxYES\_NO}{Puts Yes and No buttons on the message box. May be combined with
1615wxCANCEL.}
1616\twocolitem{wxCANCEL}{Puts a Cancel button on the message box. May be combined with
1617wxYES\_NO or wxOK.}
1618\twocolitem{wxOK}{Puts an Ok button on the message box. May be combined with wxCANCEL.}
1619\twocolitem{wxCENTRE}{Centres the text.}
1620\twocolitem{wxICON\_EXCLAMATION}{Displays an exclamation mark symbol.}
1621\twocolitem{wxICON\_HAND}{Displays an error symbol.}
1622\twocolitem{wxICON\_ERROR}{Displays an error symbol - the same as wxICON\_HAND.}
1623\twocolitem{wxICON\_QUESTION}{Displays a question mark symbol.}
1624\twocolitem{wxICON\_INFORMATION}{Displays an information symbol.}
1625\end{twocollist}
a660d684 1626
b0fc8832 1627The return value is one of: wxYES, wxNO, wxCANCEL, wxOK.
a660d684 1628
b0fc8832 1629For example:
a660d684 1630
b0fc8832
VZ
1631\begin{verbatim}
1632 ...
1633 int answer = wxMessageBox("Quit program?", "Confirm",
1634 wxYES_NO | wxCANCEL, main_frame);
1635 if (answer == wxYES)
1636 delete main_frame;
1637 ...
1638\end{verbatim}
a660d684 1639
b0fc8832
VZ
1640{\it message} may contain newline characters, in which case the
1641message will be split into separate lines, to cater for large messages.
a660d684 1642
b0fc8832
VZ
1643Under Windows, the native MessageBox function is used unless wxCENTRE
1644is specified in the style, in which case a generic function is used.
1645This is because the native MessageBox function cannot centre text.
1646The symbols are not shown when the generic function is used.
a660d684 1647
b0fc8832 1648\wxheading{Include files}
a660d684 1649
b0fc8832 1650<wx/msgdlg.h>
a660d684 1651
b0fc8832 1652\membersection{::wxShowTip}\label{wxshowtip}
a660d684 1653
b0fc8832
VZ
1654\func{bool}{wxShowTip}{\param{wxWindow *}{parent},
1655 \param{wxTipProvider *}{tipProvider},
1656 \param{bool }{showAtStartup = TRUE}}
a660d684 1657
b0fc8832 1658This function shows a "startup tip" to the user.
a660d684 1659
b0fc8832 1660\docparam{parent}{The parent window for the modal dialog}
a660d684 1661
b0fc8832
VZ
1662\docparam{tipProvider}{An object which is used to get the text of the tips.
1663It may be created with the \helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider} function.}
a660d684 1664
b0fc8832
VZ
1665\docparam{showAtStartup}{Should be TRUE if startup tips are shown, FALSE
1666otherwise. This is used as the initial value for "Show tips at startup"
1667checkbox which is shown in the tips dialog.}
a660d684 1668
b0fc8832 1669\wxheading{See also}
a660d684 1670
b0fc8832 1671\helpref{Tips overview}{tipsoverview}
a660d684 1672
b0fc8832 1673\wxheading{Include files}
f6bcfd97 1674
b0fc8832 1675<wx/tipdlg.h>
f6bcfd97 1676
b0fc8832 1677\section{GDI functions}\label{gdifunctions}
f6bcfd97 1678
b0fc8832 1679The following are relevant to the GDI (Graphics Device Interface).
f6bcfd97
BP
1680
1681\wxheading{Include files}
1682
b0fc8832 1683<wx/gdicmn.h>
f6bcfd97 1684
b0fc8832 1685\membersection{wxBITMAP}\label{wxbitmapmacro}
a660d684 1686
b0fc8832 1687\func{}{wxBITMAP}{bitmapName}
a660d684 1688
b0fc8832
VZ
1689This macro loads a bitmap from either application resources (on the platforms
1690for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
1691avoid using {\tt \#ifdef}s when creating bitmaps.
a660d684 1692
b0fc8832 1693\wxheading{See also}
954b8ae6 1694
b0fc8832
VZ
1695\helpref{Bitmaps and icons overview}{wxbitmapoverview},
1696\helpref{wxICON}{wxiconmacro}
a660d684 1697
b0fc8832 1698\wxheading{Include files}
954b8ae6 1699
b0fc8832 1700<wx/gdicmn.h>
a660d684 1701
b0fc8832 1702\membersection{::wxClientDisplayRect}\label{wxclientdisplayrect}
a660d684 1703
b0fc8832
VZ
1704\func{void}{wxClientDisplayRect}{\param{int *}{x}, \param{int *}{y},
1705\param{int *}{width}, \param{int *}{height}}
954b8ae6 1706
b0fc8832 1707\func{wxRect}{wxGetClientDisplayRect}{\void}
954b8ae6 1708
b0fc8832
VZ
1709Returns the dimensions of the work area on the display. On Windows
1710this means the area not covered by the taskbar, etc. Other platforms
1711are currently defaulting to the whole display until a way is found to
1712provide this info for all window managers, etc.
a660d684 1713
b0fc8832 1714\membersection{::wxColourDisplay}\label{wxcolourdisplay}
a660d684 1715
b0fc8832 1716\func{bool}{wxColourDisplay}{\void}
a660d684 1717
b0fc8832 1718Returns TRUE if the display is colour, FALSE otherwise.
a660d684 1719
b0fc8832 1720\membersection{::wxDisplayDepth}\label{wxdisplaydepth}
954b8ae6 1721
b0fc8832 1722\func{int}{wxDisplayDepth}{\void}
954b8ae6 1723
b0fc8832 1724Returns the depth of the display (a value of 1 denotes a monochrome display).
a660d684 1725
b0fc8832 1726\membersection{::wxDisplaySize}\label{wxdisplaysize}
a660d684 1727
b0fc8832 1728\func{void}{wxDisplaySize}{\param{int *}{width}, \param{int *}{height}}
a660d684 1729
b0fc8832 1730\func{wxSize}{wxGetDisplaySize}{\void}
a660d684 1731
b0fc8832 1732Returns the display size in pixels.
a660d684 1733
b0fc8832 1734\membersection{::wxDisplaySizeMM}\label{wxdisplaysizemm}
a660d684 1735
b0fc8832 1736\func{void}{wxDisplaySizeMM}{\param{int *}{width}, \param{int *}{height}}
a660d684 1737
b0fc8832 1738\func{wxSize}{wxGetDisplaySizeMM}{\void}
a660d684 1739
b0fc8832 1740Returns the display size in millimeters.
e2a6f233 1741
b0fc8832 1742\membersection{::wxDROP\_ICON}\label{wxdropicon}
e2a6f233 1743
b0fc8832 1744\func{wxIconOrCursor}{wxDROP\_ICON}{\param{const char *}{name}}
e2a6f233 1745
b0fc8832
VZ
1746This macro creates either a cursor (MSW) or an icon (elsewhere) with the given
1747name. Under MSW, the cursor is loaded from the resource file and the icon is
1748loaded from XPM file under other platforms.
1749
1750This macro should be used with
1751\helpref{wxDropSource constructor}{wxdropsourcewxdropsource}.
e2a6f233 1752
954b8ae6
JS
1753\wxheading{Include files}
1754
b0fc8832 1755<wx/dnd.h>
954b8ae6 1756
b0fc8832 1757\membersection{wxICON}\label{wxiconmacro}
e2a6f233 1758
b0fc8832 1759\func{}{wxICON}{iconName}
e2a6f233 1760
b0fc8832
VZ
1761This macro loads an icon from either application resources (on the platforms
1762for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
1763avoid using {\tt \#ifdef}s when creating icons.
e2a6f233 1764
b0fc8832 1765\wxheading{See also}
e2a6f233 1766
b0fc8832
VZ
1767\helpref{Bitmaps and icons overview}{wxbitmapoverview},
1768\helpref{wxBITMAP}{wxbitmapmacro}
e2a6f233 1769
954b8ae6
JS
1770\wxheading{Include files}
1771
b0fc8832 1772<wx/gdicmn.h>
a660d684 1773
b0fc8832 1774\membersection{::wxMakeMetafilePlaceable}\label{wxmakemetafileplaceable}
de6019fb 1775
b0fc8832
VZ
1776\func{bool}{wxMakeMetafilePlaceable}{\param{const wxString\& }{filename}, \param{int }{minX}, \param{int }{minY},
1777 \param{int }{maxX}, \param{int }{maxY}, \param{float }{scale=1.0}}
a660d684 1778
b0fc8832
VZ
1779Given a filename for an existing, valid metafile (as constructed using \helpref{wxMetafileDC}{wxmetafiledc})
1780makes it into a placeable metafile by prepending a header containing the given
1781bounding box. The bounding box may be obtained from a device context after drawing
1782into it, using the functions wxDC::MinX, wxDC::MinY, wxDC::MaxX and wxDC::MaxY.
a660d684 1783
b0fc8832
VZ
1784In addition to adding the placeable metafile header, this function adds
1785the equivalent of the following code to the start of the metafile data:
a660d684 1786
b0fc8832
VZ
1787\begin{verbatim}
1788 SetMapMode(dc, MM_ANISOTROPIC);
1789 SetWindowOrg(dc, minX, minY);
1790 SetWindowExt(dc, maxX - minX, maxY - minY);
1791\end{verbatim}
6fb26ea3 1792
b0fc8832 1793This simulates the wxMM\_TEXT mapping mode, which wxWindows assumes.
954b8ae6 1794
b0fc8832
VZ
1795Placeable metafiles may be imported by many Windows applications, and can be
1796used in RTF (Rich Text Format) files.
954b8ae6 1797
b0fc8832 1798{\it scale} allows the specification of scale for the metafile.
a660d684 1799
b0fc8832 1800This function is only available under Windows.
a660d684 1801
b0fc8832 1802\membersection{::wxSetCursor}\label{wxsetcursor}
a660d684 1803
b0fc8832 1804\func{void}{wxSetCursor}{\param{wxCursor *}{cursor}}
954b8ae6 1805
b0fc8832
VZ
1806Globally sets the cursor; only has an effect in Windows and GTK.
1807See also \helpref{wxCursor}{wxcursor}, \helpref{wxWindow::SetCursor}{wxwindowsetcursor}.
954b8ae6 1808
b0fc8832 1809\section{Printer settings}\label{printersettings}
8e193f38 1810
b0fc8832 1811These routines are obsolete and should no longer be used!
8e193f38 1812
b0fc8832
VZ
1813The following functions are used to control PostScript printing. Under
1814Windows, PostScript output can only be sent to a file.
8e193f38
VZ
1815
1816\wxheading{Include files}
1817
b0fc8832 1818<wx/dcps.h>
a660d684 1819
b0fc8832 1820\membersection{::wxGetPrinterCommand}\label{wxgetprintercommand}
a660d684 1821
b0fc8832 1822\func{wxString}{wxGetPrinterCommand}{\void}
a660d684 1823
b0fc8832 1824Gets the printer command used to print a file. The default is {\tt lpr}.
a660d684 1825
b0fc8832 1826\membersection{::wxGetPrinterFile}\label{wxgetprinterfile}
a660d684 1827
b0fc8832 1828\func{wxString}{wxGetPrinterFile}{\void}
a660d684 1829
b0fc8832 1830Gets the PostScript output filename.
a660d684 1831
b0fc8832 1832\membersection{::wxGetPrinterMode}\label{wxgetprintermode}
a660d684 1833
b0fc8832 1834\func{int}{wxGetPrinterMode}{\void}
954b8ae6 1835
b0fc8832
VZ
1836Gets the printing mode controlling where output is sent (PS\_PREVIEW, PS\_FILE or PS\_PRINTER).
1837The default is PS\_PREVIEW.
954b8ae6 1838
b0fc8832 1839\membersection{::wxGetPrinterOptions}\label{wxgetprinteroptions}
954b8ae6 1840
b0fc8832 1841\func{wxString}{wxGetPrinterOptions}{\void}
954b8ae6 1842
b0fc8832 1843Gets the additional options for the print command (e.g. specific printer). The default is nothing.
954b8ae6 1844
b0fc8832 1845\membersection{::wxGetPrinterOrientation}\label{wxgetprinterorientation}
954b8ae6 1846
b0fc8832 1847\func{int}{wxGetPrinterOrientation}{\void}
a660d684 1848
b0fc8832 1849Gets the orientation (PS\_PORTRAIT or PS\_LANDSCAPE). The default is PS\_PORTRAIT.
a660d684 1850
b0fc8832 1851\membersection{::wxGetPrinterPreviewCommand}\label{wxgetprinterpreviewcommand}
8e193f38 1852
b0fc8832 1853\func{wxString}{wxGetPrinterPreviewCommand}{\void}
a660d684 1854
b0fc8832 1855Gets the command used to view a PostScript file. The default depends on the platform.
954b8ae6 1856
b0fc8832 1857\membersection{::wxGetPrinterScaling}\label{wxgetprinterscaling}
954b8ae6 1858
b0fc8832 1859\func{void}{wxGetPrinterScaling}{\param{float *}{x}, \param{float *}{y}}
a660d684 1860
b0fc8832 1861Gets the scaling factor for PostScript output. The default is 1.0, 1.0.
a660d684 1862
b0fc8832 1863\membersection{::wxGetPrinterTranslation}\label{wxgetprintertranslation}
a660d684 1864
b0fc8832 1865\func{void}{wxGetPrinterTranslation}{\param{float *}{x}, \param{float *}{y}}
954b8ae6 1866
b0fc8832 1867Gets the translation (from the top left corner) for PostScript output. The default is 0.0, 0.0.
954b8ae6 1868
b0fc8832 1869\membersection{::wxSetPrinterCommand}\label{wxsetprintercommand}
a660d684 1870
b0fc8832 1871\func{void}{wxSetPrinterCommand}{\param{const wxString\& }{command}}
a660d684 1872
b0fc8832 1873Sets the printer command used to print a file. The default is {\tt lpr}.
a660d684 1874
b0fc8832 1875\membersection{::wxSetPrinterFile}\label{wxsetprinterfile}
cd6ce4a9 1876
b0fc8832 1877\func{void}{wxSetPrinterFile}{\param{const wxString\& }{filename}}
f6bcfd97 1878
b0fc8832 1879Sets the PostScript output filename.
a660d684 1880
b0fc8832 1881\membersection{::wxSetPrinterMode}\label{wxsetprintermode}
a660d684 1882
b0fc8832 1883\func{void}{wxSetPrinterMode}{\param{int }{mode}}
a660d684 1884
b0fc8832
VZ
1885Sets the printing mode controlling where output is sent (PS\_PREVIEW, PS\_FILE or PS\_PRINTER).
1886The default is PS\_PREVIEW.
cd6ce4a9 1887
b0fc8832 1888\membersection{::wxSetPrinterOptions}\label{wxsetprinteroptions}
a660d684 1889
b0fc8832 1890\func{void}{wxSetPrinterOptions}{\param{const wxString\& }{options}}
e6045e08 1891
b0fc8832 1892Sets the additional options for the print command (e.g. specific printer). The default is nothing.
a660d684 1893
b0fc8832 1894\membersection{::wxSetPrinterOrientation}\label{wxsetprinterorientation}
eafc087e 1895
b0fc8832 1896\func{void}{wxSetPrinterOrientation}{\param{int}{ orientation}}
cd6ce4a9 1897
b0fc8832 1898Sets the orientation (PS\_PORTRAIT or PS\_LANDSCAPE). The default is PS\_PORTRAIT.
a660d684 1899
b0fc8832 1900\membersection{::wxSetPrinterPreviewCommand}\label{wxsetprinterpreviewcommand}
954b8ae6 1901
b0fc8832 1902\func{void}{wxSetPrinterPreviewCommand}{\param{const wxString\& }{command}}
954b8ae6 1903
b0fc8832 1904Sets the command used to view a PostScript file. The default depends on the platform.
a660d684 1905
b0fc8832 1906\membersection{::wxSetPrinterScaling}\label{wxsetprinterscaling}
a660d684 1907
b0fc8832 1908\func{void}{wxSetPrinterScaling}{\param{float }{x}, \param{float }{y}}
a660d684 1909
b0fc8832 1910Sets the scaling factor for PostScript output. The default is 1.0, 1.0.
954b8ae6 1911
b0fc8832 1912\membersection{::wxSetPrinterTranslation}\label{wxsetprintertranslation}
954b8ae6 1913
b0fc8832 1914\func{void}{wxSetPrinterTranslation}{\param{float }{x}, \param{float }{y}}
a660d684 1915
b0fc8832 1916Sets the translation (from the top left corner) for PostScript output. The default is 0.0, 0.0.
a660d684 1917
b0fc8832
VZ
1918\section{Clipboard functions}\label{clipsboard}
1919
1920These clipboard functions are implemented for Windows only. The use of these functions
1921is deprecated and the code is no longer maintained. Use the \helpref{wxClipboard}{wxclipboard}
1922class instead.
a660d684 1923
954b8ae6
JS
1924\wxheading{Include files}
1925
b0fc8832 1926<wx/clipbrd.h>
954b8ae6 1927
b0fc8832 1928\membersection{::wxClipboardOpen}\label{wxclipboardopen}
a660d684 1929
b0fc8832 1930\func{bool}{wxClipboardOpen}{\void}
a660d684 1931
b0fc8832 1932Returns TRUE if this application has already opened the clipboard.
a660d684 1933
b0fc8832 1934\membersection{::wxCloseClipboard}\label{wxcloseclipboard}
954b8ae6 1935
b0fc8832 1936\func{bool}{wxCloseClipboard}{\void}
954b8ae6 1937
b0fc8832 1938Closes the clipboard to allow other applications to use it.
a660d684 1939
b0fc8832 1940\membersection{::wxEmptyClipboard}\label{wxemptyclipboard}
a660d684 1941
b0fc8832 1942\func{bool}{wxEmptyClipboard}{\void}
a660d684 1943
b0fc8832 1944Empties the clipboard.
954b8ae6 1945
b0fc8832 1946\membersection{::wxEnumClipboardFormats}\label{wxenumclipboardformats}
954b8ae6 1947
b0fc8832 1948\func{int}{wxEnumClipboardFormats}{\param{int}{dataFormat}}
a660d684 1949
b0fc8832
VZ
1950Enumerates the formats found in a list of available formats that belong
1951to the clipboard. Each call to this function specifies a known
1952available format; the function returns the format that appears next in
1953the list.
a660d684 1954
b0fc8832
VZ
1955{\it dataFormat} specifies a known format. If this parameter is zero,
1956the function returns the first format in the list.
a660d684 1957
b0fc8832
VZ
1958The return value specifies the next known clipboard data format if the
1959function is successful. It is zero if the {\it dataFormat} parameter specifies
1960the last format in the list of available formats, or if the clipboard
1961is not open.
a660d684 1962
b0fc8832
VZ
1963Before it enumerates the formats function, an application must open the clipboard by using the
1964wxOpenClipboard function.
954b8ae6 1965
b0fc8832 1966\membersection{::wxGetClipboardData}\label{wxgetclipboarddata}
954b8ae6 1967
b0fc8832 1968\func{wxObject *}{wxGetClipboardData}{\param{int}{dataFormat}}
26a80c22 1969
b0fc8832 1970Gets data from the clipboard.
26a80c22 1971
b0fc8832 1972{\it dataFormat} may be one of:
26a80c22 1973
b0fc8832
VZ
1974\begin{itemize}\itemsep=0pt
1975\item wxCF\_TEXT or wxCF\_OEMTEXT: returns a pointer to new memory containing a null-terminated text string.
1976\item wxCF\_BITMAP: returns a new wxBitmap.
1977\end{itemize}
26a80c22 1978
b0fc8832 1979The clipboard must have previously been opened for this call to succeed.
26a80c22 1980
b0fc8832 1981\membersection{::wxGetClipboardFormatName}\label{wxgetclipboardformatname}
26a80c22 1982
b0fc8832 1983\func{bool}{wxGetClipboardFormatName}{\param{int}{dataFormat}, \param{const wxString\& }{formatName}, \param{int}{maxCount}}
a660d684 1984
b0fc8832
VZ
1985Gets the name of a registered clipboard format, and puts it into the buffer {\it formatName} which is of maximum
1986length {\it maxCount}. {\it dataFormat} must not specify a predefined clipboard format.
a660d684 1987
b0fc8832 1988\membersection{::wxIsClipboardFormatAvailable}\label{wxisclipboardformatavailable}
a660d684 1989
b0fc8832 1990\func{bool}{wxIsClipboardFormatAvailable}{\param{int}{dataFormat}}
954b8ae6 1991
b0fc8832 1992Returns TRUE if the given data format is available on the clipboard.
954b8ae6 1993
b0fc8832 1994\membersection{::wxOpenClipboard}\label{wxopenclipboard}
a660d684 1995
b0fc8832 1996\func{bool}{wxOpenClipboard}{\void}
a660d684 1997
b0fc8832 1998Opens the clipboard for passing data to it or getting data from it.
a660d684 1999
b0fc8832 2000\membersection{::wxRegisterClipboardFormat}\label{wxregisterclipboardformat}
954b8ae6 2001
b0fc8832 2002\func{int}{wxRegisterClipboardFormat}{\param{const wxString\& }{formatName}}
954b8ae6 2003
b0fc8832 2004Registers the clipboard data format name and returns an identifier.
a660d684 2005
b0fc8832 2006\membersection{::wxSetClipboardData}\label{wxsetclipboarddata}
a660d684 2007
b0fc8832 2008\func{bool}{wxSetClipboardData}{\param{int}{dataFormat}, \param{wxObject *}{data}, \param{int}{width}, \param{int}{height}}
c51deffc 2009
b0fc8832 2010Passes data to the clipboard.
c51deffc 2011
b0fc8832 2012{\it dataFormat} may be one of:
a660d684 2013
b0fc8832
VZ
2014\begin{itemize}\itemsep=0pt
2015\item wxCF\_TEXT or wxCF\_OEMTEXT: {\it data} is a null-terminated text string.
2016\item wxCF\_BITMAP: {\it data} is a wxBitmap.
2017\item wxCF\_DIB: {\it data} is a wxBitmap. The bitmap is converted to a DIB (device independent bitmap).
2018\item wxCF\_METAFILE: {\it data} is a wxMetafile. {\it width} and {\it height} are used to give recommended dimensions.
2019\end{itemize}
954b8ae6 2020
b0fc8832 2021The clipboard must have previously been opened for this call to succeed.
954b8ae6 2022
b0fc8832 2023\section{Miscellaneous functions}\label{miscellany}
a660d684 2024
b0fc8832 2025\membersection{::wxNewId}\label{wxnewid}
a660d684 2026
b0fc8832
VZ
2027\func{long}{wxNewId}{\void}
2028
2029Generates an integer identifier unique to this run of the program.
a660d684 2030
954b8ae6
JS
2031\wxheading{Include files}
2032
2033<wx/utils.h>
2034
b0fc8832 2035\membersection{::wxRegisterId}\label{wxregisterid}
a660d684 2036
b0fc8832 2037\func{void}{wxRegisterId}{\param{long}{ id}}
a660d684 2038
b0fc8832
VZ
2039Ensures that ids subsequently generated by {\bf NewId} do not clash with
2040the given {\bf id}.
a660d684 2041
954b8ae6
JS
2042\wxheading{Include files}
2043
2044<wx/utils.h>
2045
b0fc8832 2046\membersection{::wxDDECleanUp}\label{wxddecleanup}
bdc72a22 2047
b0fc8832 2048\func{void}{wxDDECleanUp}{\void}
bdc72a22 2049
b0fc8832
VZ
2050Called when wxWindows exits, to clean up the DDE system. This no longer needs to be
2051called by the application.
bdc72a22 2052
b0fc8832 2053See also \helpref{wxDDEInitialize}{wxddeinitialize}.
bdc72a22
VZ
2054
2055\wxheading{Include files}
2056
b0fc8832 2057<wx/dde.h>
a660d684 2058
b0fc8832 2059\membersection{::wxDDEInitialize}\label{wxddeinitialize}
a660d684 2060
b0fc8832 2061\func{void}{wxDDEInitialize}{\void}
a660d684 2062
b0fc8832 2063Initializes the DDE system. May be called multiple times without harm.
a660d684 2064
b0fc8832
VZ
2065This no longer needs to be called by the application: it will be called
2066by wxWindows if necessary.
bdc72a22 2067
b0fc8832
VZ
2068See also \helpref{wxDDEServer}{wxddeserver}, \helpref{wxDDEClient}{wxddeclient}, \helpref{wxDDEConnection}{wxddeconnection},
2069\helpref{wxDDECleanUp}{wxddecleanup}.
bdc72a22 2070
954b8ae6
JS
2071\wxheading{Include files}
2072
b0fc8832 2073<wx/dde.h>
a660d684 2074
b0fc8832 2075\membersection{::wxDisplaySize}\label{wxdisplaysize}
a660d684 2076
b0fc8832 2077\func{void}{wxDisplaySize}{\param{int *}{width}, \param{int *}{height}}
a660d684 2078
b0fc8832 2079Gets the physical size of the display in pixels.
a660d684 2080
b0fc8832 2081\wxheading{Include files}
a660d684 2082
b0fc8832 2083<wx/gdicmn.h>
a660d684 2084
b0fc8832 2085\membersection{::wxEnableTopLevelWindows}\label{wxenabletoplevelwindows}
a660d684 2086
b0fc8832 2087\func{void}{wxEnableTopLevelWindow}{\param{bool}{ enable = TRUE}}
a660d684 2088
b0fc8832
VZ
2089This function enables or disables all top level windows. It is used by
2090\helpref{::wxSafeYield}{wxsafeyield}.
a660d684 2091
954b8ae6
JS
2092\wxheading{Include files}
2093
2094<wx/utils.h>
2095
b0fc8832 2096\membersection{::wxFindMenuItemId}\label{wxfindmenuitemid}
a660d684 2097
b0fc8832 2098\func{int}{wxFindMenuItemId}{\param{wxFrame *}{frame}, \param{const wxString\& }{menuString}, \param{const wxString\& }{itemString}}
a660d684 2099
b0fc8832 2100Find a menu item identifier associated with the given frame's menu bar.
a660d684 2101
954b8ae6
JS
2102\wxheading{Include files}
2103
2104<wx/utils.h>
2105
b0fc8832 2106\membersection{::wxFindWindowByLabel}\label{wxfindwindowbylabel}
c51deffc 2107
b0fc8832 2108\func{wxWindow *}{wxFindWindowByLabel}{\param{const wxString\& }{label}, \param{wxWindow *}{parent=NULL}}
c51deffc 2109
b0fc8832
VZ
2110Find a window by its label. Depending on the type of window, the label may be a window title
2111or panel item label. If {\it parent} is NULL, the search will start from all top-level
2112frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
2113The search is recursive in both cases.
c51deffc
VZ
2114
2115\wxheading{Include files}
2116
2117<wx/utils.h>
2118
b0fc8832
VZ
2119\membersection{::wxFindWindowByName}\label{wxfindwindowbyname}
2120
2121\func{wxWindow *}{wxFindWindowByName}{\param{const wxString\& }{name}, \param{wxWindow *}{parent=NULL}}
a660d684 2122
b0fc8832
VZ
2123Find a window by its name (as given in a window constructor or {\bf Create} function call).
2124If {\it parent} is NULL, the search will start from all top-level
2125frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
2126The search is recursive in both cases.
a660d684 2127
b0fc8832 2128If no such named window is found, {\bf wxFindWindowByLabel} is called.
a660d684 2129
954b8ae6
JS
2130\wxheading{Include files}
2131
2132<wx/utils.h>
2133
b0fc8832 2134\membersection{::wxFindWindowAtPoint}\label{wxfindwindowatpoint}
6787e41e 2135
b0fc8832 2136\func{wxWindow *}{wxFindWindowAtPoint}{\param{const wxPoint\& }{pt}}
6787e41e 2137
b0fc8832
VZ
2138Find the deepest window at the given mouse position in screen coordinates,
2139returning the window if found, or NULL if not.
4d01e583 2140
b0fc8832 2141\membersection{::wxFindWindowAtPointer}\label{wxfindwindowatpointer}
4d01e583 2142
b0fc8832 2143\func{wxWindow *}{wxFindWindowAtPointer}{\param{wxPoint\& }{pt}}
4d01e583 2144
b0fc8832
VZ
2145Find the deepest window at the mouse pointer position, returning the window
2146and current pointer position in screen coordinates.
4d01e583 2147
b0fc8832 2148\membersection{::wxGetActiveWindow}\label{wxgetactivewindow}
4d01e583 2149
b0fc8832 2150\func{wxWindow *}{wxGetActiveWindow}{\void}
4d01e583 2151
b0fc8832 2152Gets the currently active window (Windows only).
4d01e583 2153
b0fc8832 2154\wxheading{Include files}
4d01e583 2155
b0fc8832 2156<wx/windows.h>
4d01e583 2157
b0fc8832 2158\membersection{::wxGetDisplayName}\label{wxgetdisplayname}
4d01e583 2159
b0fc8832 2160\func{wxString}{wxGetDisplayName}{\void}
4d01e583 2161
b0fc8832 2162Under X only, returns the current display name. See also \helpref{wxSetDisplayName}{wxsetdisplayname}.
4d01e583
VZ
2163
2164\wxheading{Include files}
2165
b0fc8832 2166<wx/utils.h>
4d01e583 2167
b0fc8832 2168\membersection{::wxGetMousePosition}\label{wxgetmouseposition}
4d01e583 2169
b0fc8832 2170\func{wxPoint}{wxGetMousePosition}{\void}
4d01e583 2171
b0fc8832 2172Returns the mouse position in screen coordinates.
4d01e583
VZ
2173
2174\wxheading{Include files}
2175
2176<wx/utils.h>
2177
b0fc8832 2178\membersection{::wxGetResource}\label{wxgetresource}
a660d684 2179
b0fc8832
VZ
2180\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2181 \param{const wxString\& *}{value}, \param{const wxString\& }{file = NULL}}
a660d684 2182
b0fc8832
VZ
2183\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2184 \param{float *}{value}, \param{const wxString\& }{file = NULL}}
a660d684 2185
b0fc8832
VZ
2186\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2187 \param{long *}{value}, \param{const wxString\& }{file = NULL}}
50567b69 2188
b0fc8832
VZ
2189\func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2190 \param{int *}{value}, \param{const wxString\& }{file = NULL}}
50567b69 2191
b0fc8832
VZ
2192Gets a resource value from the resource database (for example, WIN.INI, or
2193.Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used,
2194otherwise the specified file is used.
50567b69 2195
b0fc8832
VZ
2196Under X, if an application class (wxApp::GetClassName) has been defined,
2197it is appended to the string /usr/lib/X11/app-defaults/ to try to find
2198an applications default file when merging all resource databases.
50567b69 2199
b0fc8832
VZ
2200The reason for passing the result in an argument is that it
2201can be convenient to define a default value, which gets overridden
2202if the value exists in the resource file. It saves a separate
2203test for that resource's existence, and it also allows
2204the overloading of the function for different types.
50567b69 2205
b0fc8832 2206See also \helpref{wxWriteResource}{wxwriteresource}, \helpref{wxConfigBase}{wxconfigbase}.
a660d684 2207
954b8ae6 2208\wxheading{Include files}
a660d684 2209
954b8ae6 2210<wx/utils.h>
a660d684 2211
a660d684
KB
2212\membersection{::wxLoadUserResource}\label{wxloaduserresource}
2213
2214\func{wxString}{wxLoadUserResource}{\param{const wxString\& }{resourceName}, \param{const wxString\& }{resourceType=``TEXT"}}
2215
2216Loads a user-defined Windows resource as a string. If the resource is found, the function creates
2217a new character array and copies the data into it. A pointer to this data is returned. If unsuccessful, NULL is returned.
2218
2219The resource must be defined in the {\tt .rc} file using the following syntax:
2220
2221\begin{verbatim}
2222myResource TEXT file.ext
2223\end{verbatim}
2224
2225where {\tt file.ext} is a file that the resource compiler can find.
2226
2227One use of this is to store {\tt .wxr} files instead of including the data in the C++ file; some compilers
2228cannot cope with the long strings in a {\tt .wxr} file. The resource data can then be parsed
2229using \helpref{wxResourceParseString}{wxresourceparsestring}.
2230
2231This function is available under Windows only.
2232
954b8ae6
JS
2233\wxheading{Include files}
2234
2235<wx/utils.h>
2236
a660d684
KB
2237\membersection{::wxPostDelete}\label{wxpostdelete}
2238
2239\func{void}{wxPostDelete}{\param{wxObject *}{object}}
2240
954b8ae6 2241Tells the system to delete the specified object when
a660d684
KB
2242all other events have been processed. In some environments, it is
2243necessary to use this instead of deleting a frame directly with the
954b8ae6 2244delete operator, because some GUIs will still send events to a deleted window.
a660d684
KB
2245
2246Now obsolete: use \helpref{wxWindow::Close}{wxwindowclose} instead.
2247
954b8ae6
JS
2248\wxheading{Include files}
2249
2250<wx/utils.h>
2251
8e193f38
VZ
2252\membersection{::wxPostEvent}\label{wxpostevent}
2253
2254\func{void}{wxPostEvent}{\param{wxEvtHandler *}{dest}, \param{wxEvent\& }{event}}
2255
2256This function posts the event to the specified {\it dest} object. The
2257difference between sending an event and posting it is that in the first case
2258the event is processed before the function returns (in wxWindows, event sending
2259is done with \helpref{ProcessEvent}{wxevthandlerprocessevent} function), but in
2260the second, the function returns immediately and the event will be processed
2261sometime later - usually during the next even loop iteration.
2262
2263Note that a copy of the {\it event} is made by the function, so the original
2264copy can be deleted as soon as function returns. This function can also be used
8a293590
RR
2265to send events between different threads safely. As this function makes a
2266copy of the event, the event needs to have a fully implemented Clone() method,
2267which may not be the case for all event in wxWindows.
2268
2269See also \helpref{AddPendingEvent}{wxevthandleraddpendingevent} (which this function
2270uses internally).
8e193f38
VZ
2271
2272\wxheading{Include files}
2273
2274<wx/app.h>
2275
a660d684
KB
2276\membersection{::wxSetDisplayName}\label{wxsetdisplayname}
2277
2278\func{void}{wxSetDisplayName}{\param{const wxString\& }{displayName}}
2279
2280Under X only, sets the current display name. This is the X host and display name such
2281as ``colonsay:0.0", and the function indicates which display should be used for creating
2282windows from this point on. Setting the display within an application allows multiple
2283displays to be used.
2284
2285See also \helpref{wxGetDisplayName}{wxgetdisplayname}.
2286
954b8ae6
JS
2287\wxheading{Include files}
2288
2289<wx/utils.h>
2290
b0fc8832 2291\membersection{::wxStripMenuCodes}\label{wxstripmenucodes}
a660d684 2292
8a2c6ef8
JS
2293\func{wxString}{wxStripMenuCodes}{\param{const wxString\& }{in}}
2294
7ac13b21 2295\func{void}{wxStripMenuCodes}{\param{char *}{in}, \param{char *}{out}}
a660d684 2296
b0fc8832
VZ
2297This function is obsolete, please use
2298\helpref{wxMenuItem::GetLabelFromText}{wxmenuitemgetlabelfromtext} instead.
2299
a660d684 2300Strips any menu codes from {\it in} and places the result
8a2c6ef8
JS
2301in {\it out} (or returns the new string, in the first form).
2302
2303Menu codes include \& (mark the next character with an underline
a660d684
KB
2304as a keyboard shortkey in Windows and Motif) and $\backslash$t (tab in Windows).
2305
954b8ae6
JS
2306\wxheading{Include files}
2307
2308<wx/utils.h>
2309
a660d684
KB
2310\membersection{::wxWriteResource}\label{wxwriteresource}
2311
2312\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2313 \param{const wxString\& }{value}, \param{const wxString\& }{file = NULL}}
2314
2315\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2316 \param{float }{value}, \param{const wxString\& }{file = NULL}}
2317
2318\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2319 \param{long }{value}, \param{const wxString\& }{file = NULL}}
2320
2321\func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2322 \param{int }{value}, \param{const wxString\& }{file = NULL}}
2323
2324Writes a resource value into the resource database (for example, WIN.INI, or
2325.Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used,
2326otherwise the specified file is used.
2327
2328Under X, the resource databases are cached until the internal function
b0fc8832
VZ
2329\rtfsp{\bf wxFlushResources} is called automatically on exit, when
2330all updated resource databases are written to their files.
8a293590 2331
b0fc8832
VZ
2332Note that it is considered bad manners to write to the .Xdefaults
2333file under Unix, although the WIN.INI file is fair game under Windows.
8a293590 2334
b0fc8832 2335See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfigbase}.
8a293590
RR
2336
2337\wxheading{Include files}
2338
b0fc8832 2339<wx/utils.h>
8a293590 2340
b0fc8832 2341\section{Byte order macros}\label{macros}
a660d684 2342
b0fc8832
VZ
2343The endian-ness issues (that is the difference between big-endian and
2344little-endian architectures) are important for the portable programs working
2345with the external binary data (for example, data files or data coming from
2346network) which is usually in some fixed, platform-independent format. The
2347macros are helpful for transforming the data to the correct format.
a660d684 2348
0180dad6
RR
2349\membersection{wxINTXX\_SWAP\_ALWAYS}\label{intswapalways}
2350
2351\func{wxInt32}{wxINT32\_SWAP\_ALWAYS}{\param{wxInt32 }{value}}
2352
2353\func{wxUint32}{wxUINT32\_SWAP\_ALWAYS}{\param{wxUint32 }{value}}
2354
2355\func{wxInt16}{wxINT16\_SWAP\_ALWAYS}{\param{wxInt16 }{value}}
2356
2357\func{wxUint16}{wxUINT16\_SWAP\_ALWAYS}{\param{wxUint16 }{value}}
2358
b0fc8832
VZ
2359These macros will swap the bytes of the {\it value} variable from little
2360endian to big endian or vice versa unconditionally, i.e. independently of the
2361current platform.
0180dad6
RR
2362
2363\membersection{wxINTXX\_SWAP\_ON\_BE}\label{intswaponbe}
2364
2365\func{wxInt32}{wxINT32\_SWAP\_ON\_BE}{\param{wxInt32 }{value}}
2366
2367\func{wxUint32}{wxUINT32\_SWAP\_ON\_BE}{\param{wxUint32 }{value}}
2368
2369\func{wxInt16}{wxINT16\_SWAP\_ON\_BE}{\param{wxInt16 }{value}}
2370
2371\func{wxUint16}{wxUINT16\_SWAP\_ON\_BE}{\param{wxUint16 }{value}}
2372
2373This macro will swap the bytes of the {\it value} variable from little
2374endian to big endian or vice versa if the program is compiled on a
ec5d7799 2375big-endian architecture (such as Sun work stations). If the program has
0180dad6
RR
2376been compiled on a little-endian architecture, the value will be unchanged.
2377
ec5d7799 2378Use these macros to read data from and write data to a file that stores
b0fc8832 2379data in little-endian (for example Intel i386) format.
0180dad6
RR
2380
2381\membersection{wxINTXX\_SWAP\_ON\_LE}\label{intswaponle}
2382
2383\func{wxInt32}{wxINT32\_SWAP\_ON\_LE}{\param{wxInt32 }{value}}
2384
2385\func{wxUint32}{wxUINT32\_SWAP\_ON\_LE}{\param{wxUint32 }{value}}
2386
2387\func{wxInt16}{wxINT16\_SWAP\_ON\_LE}{\param{wxInt16 }{value}}
2388
2389\func{wxUint16}{wxUINT16\_SWAP\_ON\_LE}{\param{wxUint16 }{value}}
2390
2391This macro will swap the bytes of the {\it value} variable from little
2392endian to big endian or vice versa if the program is compiled on a
ec5d7799 2393little-endian architecture (such as Intel PCs). If the program has
0180dad6
RR
2394been compiled on a big-endian architecture, the value will be unchanged.
2395
ec5d7799 2396Use these macros to read data from and write data to a file that stores
b0fc8832
VZ
2397data in big-endian format.
2398
2399\section{RTTI functions}\label{macros}
2400
2401wxWindows uses its own RTTI ("run-time type identification") system which
2402predates the current standard C++ RTTI and so is kept for backwards
2403compatribility reasons but also because it allows some things which the
2404standard RTTI doesn't directly support (such as creating a class from its
2405name).
2406
2407The standard C++ RTTI can be used in the user code without any problems and in
2408general you shouldn't need to use the functions and the macros in this section
2409unless you are thinking of modifying or adding any wxWindows classes.
2410
2411\wxheading{See also}
2412
2413\helpref{RTTI overview}{runtimeclassoverview}
0180dad6 2414
a660d684
KB
2415\membersection{CLASSINFO}\label{classinfo}
2416
2417\func{wxClassInfo *}{CLASSINFO}{className}
2418
2419Returns a pointer to the wxClassInfo object associated with this class.
2420
954b8ae6
JS
2421\wxheading{Include files}
2422
2423<wx/object.h>
2424
b0fc8832 2425\membersection{DECLARE\_ABSTRACT\_CLASS}\label{declareabstractclass}
a660d684
KB
2426
2427\func{}{DECLARE\_ABSTRACT\_CLASS}{className}
2428
2429Used inside a class declaration to declare that the class should be
2430made known to the class hierarchy, but objects of this class cannot be created
2431dynamically. The same as DECLARE\_CLASS.
2432
2433Example:
2434
2435\begin{verbatim}
2436class wxCommand: public wxObject
2437{
2438 DECLARE_ABSTRACT_CLASS(wxCommand)
2439
2440 private:
2441 ...
2442 public:
2443 ...
2444};
2445\end{verbatim}
2446
954b8ae6
JS
2447\wxheading{Include files}
2448
2449<wx/object.h>
2450
a660d684
KB
2451\membersection{DECLARE\_APP}\label{declareapp}
2452
2453\func{}{DECLARE\_APP}{className}
2454
2455This is used in headers to create a forward declaration of the wxGetApp function implemented
2456by IMPLEMENT\_APP. It creates the declaration {\tt className\& wxGetApp(void)}.
2457
2458Example:
2459
2460\begin{verbatim}
2461 DECLARE_APP(MyApp)
2462\end{verbatim}
2463
954b8ae6
JS
2464\wxheading{Include files}
2465
2466<wx/app.h>
2467
b0fc8832 2468\membersection{DECLARE\_CLASS}\label{declareclass}
a660d684
KB
2469
2470\func{}{DECLARE\_CLASS}{className}
2471
2472Used inside a class declaration to declare that the class should be
2473made known to the class hierarchy, but objects of this class cannot be created
2474dynamically. The same as DECLARE\_ABSTRACT\_CLASS.
2475
954b8ae6
JS
2476\wxheading{Include files}
2477
2478<wx/object.h>
2479
b0fc8832 2480\membersection{DECLARE\_DYNAMIC\_CLASS}\label{declaredynamicclass}
a660d684
KB
2481
2482\func{}{DECLARE\_DYNAMIC\_CLASS}{className}
2483
2484Used inside a class declaration to declare that the objects of this class should be dynamically
f6bcfd97 2485creatable from run-time type information.
a660d684
KB
2486
2487Example:
2488
2489\begin{verbatim}
2490class wxFrame: public wxWindow
2491{
2492 DECLARE_DYNAMIC_CLASS(wxFrame)
2493
2494 private:
2495 const wxString\& frameTitle;
2496 public:
2497 ...
2498};
2499\end{verbatim}
2500
954b8ae6
JS
2501\wxheading{Include files}
2502
2503<wx/object.h>
2504
b0fc8832 2505\membersection{IMPLEMENT\_ABSTRACT\_CLASS}\label{implementabstractclass}
a660d684
KB
2506
2507\func{}{IMPLEMENT\_ABSTRACT\_CLASS}{className, baseClassName}
2508
2509Used in a C++ implementation file to complete the declaration of
2510a class that has run-time type information. The same as IMPLEMENT\_CLASS.
2511
2512Example:
2513
2514\begin{verbatim}
2515IMPLEMENT_ABSTRACT_CLASS(wxCommand, wxObject)
2516
2517wxCommand::wxCommand(void)
2518{
2519...
2520}
2521\end{verbatim}
2522
954b8ae6
JS
2523\wxheading{Include files}
2524
2525<wx/object.h>
2526
b0fc8832 2527\membersection{IMPLEMENT\_ABSTRACT\_CLASS2}\label{implementabstractclass2}
a660d684
KB
2528
2529\func{}{IMPLEMENT\_ABSTRACT\_CLASS2}{className, baseClassName1, baseClassName2}
2530
2531Used in a C++ implementation file to complete the declaration of
2532a class that has run-time type information and two base classes. The same as IMPLEMENT\_CLASS2.
2533
954b8ae6
JS
2534\wxheading{Include files}
2535
2536<wx/object.h>
2537
a660d684
KB
2538\membersection{IMPLEMENT\_APP}\label{implementapp}
2539
2540\func{}{IMPLEMENT\_APP}{className}
2541
2542This is used in the application class implementation file to make the application class known to
2543wxWindows for dynamic construction. You use this instead of
2544
2545Old form:
2546
2547\begin{verbatim}
2548 MyApp myApp;
2549\end{verbatim}
2550
2551New form:
2552
2553\begin{verbatim}
2554 IMPLEMENT_APP(MyApp)
2555\end{verbatim}
2556
2557See also \helpref{DECLARE\_APP}{declareapp}.
2558
954b8ae6
JS
2559\wxheading{Include files}
2560
2561<wx/app.h>
2562
b0fc8832 2563\membersection{IMPLEMENT\_CLASS}\label{implementclass}
a660d684
KB
2564
2565\func{}{IMPLEMENT\_CLASS}{className, baseClassName}
2566
2567Used in a C++ implementation file to complete the declaration of
2568a class that has run-time type information. The same as IMPLEMENT\_ABSTRACT\_CLASS.
2569
954b8ae6
JS
2570\wxheading{Include files}
2571
2572<wx/object.h>
2573
b0fc8832 2574\membersection{IMPLEMENT\_CLASS2}\label{implementclass2}
a660d684
KB
2575
2576\func{}{IMPLEMENT\_CLASS2}{className, baseClassName1, baseClassName2}
2577
2578Used in a C++ implementation file to complete the declaration of a
2579class that has run-time type information and two base classes. The
2580same as IMPLEMENT\_ABSTRACT\_CLASS2.
2581
954b8ae6
JS
2582\wxheading{Include files}
2583
2584<wx/object.h>
2585
b0fc8832 2586\membersection{IMPLEMENT\_DYNAMIC\_CLASS}\label{implementdynamicclass}
a660d684
KB
2587
2588\func{}{IMPLEMENT\_DYNAMIC\_CLASS}{className, baseClassName}
2589
2590Used in a C++ implementation file to complete the declaration of
2591a class that has run-time type information, and whose instances
2592can be created dynamically.
2593
2594Example:
2595
2596\begin{verbatim}
2597IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
2598
2599wxFrame::wxFrame(void)
2600{
2601...
2602}
2603\end{verbatim}
2604
954b8ae6
JS
2605\wxheading{Include files}
2606
2607<wx/object.h>
2608
b0fc8832 2609\membersection{IMPLEMENT\_DYNAMIC\_CLASS2}\label{implementdynamicclass2}
a660d684
KB
2610
2611\func{}{IMPLEMENT\_DYNAMIC\_CLASS2}{className, baseClassName1, baseClassName2}
2612
2613Used in a C++ implementation file to complete the declaration of
2614a class that has run-time type information, and whose instances
2615can be created dynamically. Use this for classes derived from two
2616base classes.
2617
954b8ae6
JS
2618\wxheading{Include files}
2619
2620<wx/object.h>
2621
f6bcfd97
BP
2622\membersection{wxConstCast}\label{wxconstcast}
2623
f7637829 2624\func{classname *}{wxConstCast}{ptr, classname}
f6bcfd97
BP
2625
2626This macro expands into {\tt const\_cast<classname *>(ptr)} if the compiler
2627supports {\it const\_cast} or into an old, C-style cast, otherwise.
2628
2629\wxheading{See also}
2630
2631\helpref{wxDynamicCast}{wxdynamiccast}\\
2632\helpref{wxStaticCast}{wxstaticcast}
2633
b0fc8832
VZ
2634\membersection{::wxCreateDynamicObject}\label{wxcreatedynamicobject}
2635
2636\func{wxObject *}{wxCreateDynamicObject}{\param{const wxString\& }{className}}
2637
2638Creates and returns an object of the given class, if the class has been
2639registered with the dynamic class system using DECLARE... and IMPLEMENT... macros.
2640
34636400
VZ
2641\membersection{WXDEBUG\_NEW}\label{debugnew}
2642
2643\func{}{WXDEBUG\_NEW}{arg}
2644
2645This is defined in debug mode to be call the redefined new operator
2646with filename and line number arguments. The definition is:
2647
2648\begin{verbatim}
2649#define WXDEBUG_NEW new(__FILE__,__LINE__)
2650\end{verbatim}
2651
2652In non-debug mode, this is defined as the normal new operator.
2653
2654\wxheading{Include files}
2655
2656<wx/object.h>
2657
2658\membersection{wxDynamicCast}\label{wxdynamiccast}
2659
f7637829 2660\func{classname *}{wxDynamicCast}{ptr, classname}
34636400
VZ
2661
2662This macro returns the pointer {\it ptr} cast to the type {\it classname *} if
8a7f3379 2663the pointer is of this type (the check is done during the run-time) or
f7637829
VZ
2664{\tt NULL} otherwise. Usage of this macro is preferred over obsoleted
2665wxObject::IsKindOf() function.
34636400 2666
f7637829
VZ
2667The {\it ptr} argument may be {\tt NULL}, in which case {\tt NULL} will be
2668returned.
34636400
VZ
2669
2670Example:
2671
2672\begin{verbatim}
2673 wxWindow *win = wxWindow::FindFocus();
2674 wxTextCtrl *text = wxDynamicCast(win, wxTextCtrl);
2675 if ( text )
2676 {
2677 // a text control has the focus...
2678 }
2679 else
2680 {
f6bcfd97 2681 // no window has the focus or it is not a text control
34636400
VZ
2682 }
2683\end{verbatim}
2684
2685\wxheading{See also}
2686
f6bcfd97 2687\helpref{RTTI overview}{runtimeclassoverview}\\
f7637829 2688\helpref{wxDynamicCastThis}{wxdynamiccastthis}\\
f6bcfd97
BP
2689\helpref{wxConstCast}{wxconstcast}\\
2690\helpref{wxStatiicCast}{wxstaticcast}
34636400 2691
f7637829
VZ
2692\membersection{wxDynamicCastThis}\label{wxdynamiccastthis}
2693
2694\func{classname *}{wxDynamicCastThis}{classname}
2695
2696This macro is equivalent to {\tt wxDynamicCast(this, classname)} but the
2697latter provokes spurious compilation warnings from some compilers (because it
2698tests whether {\tt this} pointer is non {\tt NULL} which is always true), so
2699this macro should be used to avoid them.
2700
2701\wxheading{See also}
2702
2703\helpref{wxDynamicCast}{wxdynamiccast}
2704
f6bcfd97
BP
2705\membersection{wxStaticCast}\label{wxstaticcast}
2706
f7637829 2707\func{classname *}{wxStaticCast}{ptr, classname}
f6bcfd97
BP
2708
2709This macro checks that the cast is valid in debug mode (an assert failure will
2710result if {\tt wxDynamicCast(ptr, classname) == NULL}) and then returns the
2711result of executing an equivalent of {\tt static\_cast<classname *>(ptr)}.
2712
2713\helpref{wxDynamicCast}{wxdynamiccast}\\
2714\helpref{wxConstCast}{wxconstcast}
2715
b0fc8832 2716\section{Resource functions}\label{resourcefuncs}
a660d684 2717
b0fc8832 2718\overview{Resource functions}{resourceformats}
a660d684
KB
2719
2720This section details functions for manipulating wxWindows (.WXR) resource
2721files and loading user interface elements from resources.
2722
2723\normalbox{Please note that this use of the word `resource' is different from that used when talking
2724about initialisation file resource reading and writing, using such functions
f6bcfd97 2725as wxWriteResource and wxGetResource. It is just an unfortunate clash of terminology.}
a660d684
KB
2726
2727\helponly{For an overview of the wxWindows resource mechanism, see \helpref{the wxWindows resource system}{resourceformats}.}
2728
2729See also \helpref{wxWindow::LoadFromResource}{wxwindowloadfromresource} for
2730loading from resource data.
2731
2732\membersection{::wxResourceAddIdentifier}\label{wxresourceaddidentifier}
2733
2734\func{bool}{wxResourceAddIdentifier}{\param{const wxString\& }{name}, \param{int }{value}}
2735
2736Used for associating a name with an integer identifier (equivalent to dynamically\rtfsp
6aa358ae 2737\tt{#}defining a name to an integer). Unlikely to be used by an application except
a660d684
KB
2738perhaps for implementing resource functionality for interpreted languages.
2739
b0fc8832 2740\membersection{::wxResourceClear}\label{wxresourceclear}
a660d684
KB
2741
2742\func{void}{wxResourceClear}{\void}
2743
2744Clears the wxWindows resource table.
2745
b0fc8832 2746\membersection{::wxResourceCreateBitmap}\label{wxresourcecreatebitmap}
a660d684
KB
2747
2748\func{wxBitmap *}{wxResourceCreateBitmap}{\param{const wxString\& }{resource}}
2749
2750Creates a new bitmap from a file, static data, or Windows resource, given a valid
2751wxWindows bitmap resource identifier. For example, if the .WXR file contains
2752the following:
2753
2754\begin{verbatim}
f6bcfd97
BP
2755static const wxString\& project_resource = "bitmap(name = 'project_resource',\
2756 bitmap = ['project', wxBITMAP_TYPE_BMP_RESOURCE, 'WINDOWS'],\
2757 bitmap = ['project.xpm', wxBITMAP_TYPE_XPM, 'X']).";
a660d684
KB
2758\end{verbatim}
2759
2760then this function can be called as follows:
2761
2762\begin{verbatim}
f6bcfd97 2763 wxBitmap *bitmap = wxResourceCreateBitmap("project_resource");
a660d684
KB
2764\end{verbatim}
2765
b0fc8832 2766\membersection{::wxResourceCreateIcon}\label{wxresourcecreateicon}
a660d684
KB
2767
2768\func{wxIcon *}{wxResourceCreateIcon}{\param{const wxString\& }{resource}}
2769
2770Creates a new icon from a file, static data, or Windows resource, given a valid
2771wxWindows icon resource identifier. For example, if the .WXR file contains
2772the following:
2773
2774\begin{verbatim}
f6bcfd97
BP
2775static const wxString\& project_resource = "icon(name = 'project_resource',\
2776 icon = ['project', wxBITMAP_TYPE_ICO_RESOURCE, 'WINDOWS'],\
2777 icon = ['project', wxBITMAP_TYPE_XBM_DATA, 'X']).";
a660d684
KB
2778\end{verbatim}
2779
2780then this function can be called as follows:
2781
2782\begin{verbatim}
f6bcfd97 2783 wxIcon *icon = wxResourceCreateIcon("project_resource");
a660d684
KB
2784\end{verbatim}
2785
b0fc8832 2786\membersection{::wxResourceCreateMenuBar}\label{wxresourcecreatemenubar}
a660d684
KB
2787
2788\func{wxMenuBar *}{wxResourceCreateMenuBar}{\param{const wxString\& }{resource}}
2789
2790Creates a new menu bar given a valid wxWindows menubar resource
2791identifier. For example, if the .WXR file contains the following:
2792
2793\begin{verbatim}
2794static const wxString\& menuBar11 = "menu(name = 'menuBar11',\
2795 menu = \
2796 [\
2797 ['&File', 1, '', \
2798 ['&Open File', 2, 'Open a file'],\
2799 ['&Save File', 3, 'Save a file'],\
2800 [],\
2801 ['E&xit', 4, 'Exit program']\
2802 ],\
2803 ['&Help', 5, '', \
2804 ['&About', 6, 'About this program']\
2805 ]\
2806 ]).";
2807\end{verbatim}
2808
2809then this function can be called as follows:
2810
2811\begin{verbatim}
2812 wxMenuBar *menuBar = wxResourceCreateMenuBar("menuBar11");
2813\end{verbatim}
2814
2815
b0fc8832 2816\membersection{::wxResourceGetIdentifier}\label{wxresourcegetidentifier}
a660d684
KB
2817
2818\func{int}{wxResourceGetIdentifier}{\param{const wxString\& }{name}}
2819
2820Used for retrieving the integer value associated with an identifier.
2821A zero value indicates that the identifier was not found.
2822
2823See \helpref{wxResourceAddIdentifier}{wxresourceaddidentifier}.
2824
2825\membersection{::wxResourceParseData}\label{wxresourcedata}
2826
2827\func{bool}{wxResourceParseData}{\param{const wxString\& }{resource}, \param{wxResourceTable *}{table = NULL}}
2828
2829Parses a string containing one or more wxWindows resource objects. If
2830the resource objects are global static data that are included into the
2831C++ program, then this function must be called for each variable
2832containing the resource data, to make it known to wxWindows.
2833
2834{\it resource} should contain data in the following form:
2835
2836\begin{verbatim}
2837dialog(name = 'dialog1',
2838 style = 'wxCAPTION | wxDEFAULT_DIALOG_STYLE',
2839 title = 'Test dialog box',
2840 x = 312, y = 234, width = 400, height = 300,
2841 modal = 0,
f6bcfd97 2842 control = [1000, wxStaticBox, 'Groupbox', '0', 'group6', 5, 4, 380, 262,
a660d684 2843 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],
f6bcfd97 2844 control = [1001, wxTextCtrl, '', 'wxTE_MULTILINE', 'text3',
a660d684
KB
2845 156, 126, 200, 70, 'wxWindows is a multi-platform, GUI toolkit.',
2846 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],
2847 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]]).
2848\end{verbatim}
2849
2850This function will typically be used after including a {\tt .wxr} file into
2851a C++ program as follows:
2852
2853\begin{verbatim}
2854#include "dialog1.wxr"
2855\end{verbatim}
2856
2857Each of the contained resources will declare a new C++ variable, and each
2858of these variables should be passed to wxResourceParseData.
2859
b0fc8832 2860\membersection{::wxResourceParseFile}\label{wxresourceparsefile}
a660d684
KB
2861
2862\func{bool}{wxResourceParseFile}{\param{const wxString\& }{filename}, \param{wxResourceTable *}{table = NULL}}
2863
2864Parses a file containing one or more wxWindows resource objects
2865in C++-compatible syntax. Use this function to dynamically load
2866wxWindows resource data.
2867
2868\membersection{::wxResourceParseString}\label{wxresourceparsestring}
2869
7ac13b21 2870\func{bool}{wxResourceParseString}{\param{char *}{s}, \param{wxResourceTable *}{table = NULL}}
a660d684
KB
2871
2872Parses a string containing one or more wxWindows resource objects. If
2873the resource objects are global static data that are included into the
2874C++ program, then this function must be called for each variable
2875containing the resource data, to make it known to wxWindows.
2876
2877{\it resource} should contain data with the following form:
2878
2879\begin{verbatim}
f6bcfd97
BP
2880dialog(name = 'dialog1',
2881 style = 'wxCAPTION | wxDEFAULT_DIALOG_STYLE',
2882 title = 'Test dialog box',
2883 x = 312, y = 234, width = 400, height = 300,
2884 modal = 0,
2885 control = [1000, wxStaticBox, 'Groupbox', '0', 'group6', 5, 4, 380, 262,
2886 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],
2887 control = [1001, wxTextCtrl, '', 'wxTE_MULTILINE', 'text3',
2888 156, 126, 200, 70, 'wxWindows is a multi-platform, GUI toolkit.',
2889 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],
2890 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]]).
a660d684
KB
2891\end{verbatim}
2892
2893This function will typically be used after calling \helpref{wxLoadUserResource}{wxloaduserresource} to
2894load an entire {\tt .wxr file} into a string.
2895
2896\membersection{::wxResourceRegisterBitmapData}\label{registerbitmapdata}
2897
7ac13b21 2898\func{bool}{wxResourceRegisterBitmapData}{\param{const wxString\& }{name}, \param{char *}{xbm\_data}, \param{int }{width},
a660d684
KB
2899\param{int }{height}, \param{wxResourceTable *}{table = NULL}}
2900
7ac13b21 2901\func{bool}{wxResourceRegisterBitmapData}{\param{const wxString\& }{name}, \param{char **}{xpm\_data}}
a660d684 2902
6aa358ae 2903Makes \tt{#}included XBM or XPM bitmap data known to the wxWindows resource system.
a660d684
KB
2904This is required if other resources will use the bitmap data, since otherwise there
2905is no connection between names used in resources, and the global bitmap data.
2906
b0fc8832 2907\membersection{::wxResourceRegisterIconData}\label{wxresourceregistericondata}
a660d684
KB
2908
2909Another name for \helpref{wxResourceRegisterBitmapData}{registerbitmapdata}.
2910
6fb26ea3
JS
2911\section{Log functions}\label{logfunctions}
2912
2913These functions provide a variety of logging functions: see \helpref{Log classes overview}{wxlogoverview} for
f68586e5
VZ
2914further information. The functions use (implicitly) the currently active log
2915target, so their descriptions here may not apply if the log target is not the
2916standard one (installed by wxWindows in the beginning of the program).
6fb26ea3 2917
954b8ae6
JS
2918\wxheading{Include files}
2919
2920<wx/log.h>
2921
b0fc8832
VZ
2922\membersection{::wxDebugMsg}\label{wxdebugmsg}
2923
2924\func{void}{wxDebugMsg}{\param{const wxString\& }{fmt}, \param{...}{}}
2925
2926{\bf This function is deprecated, use \helpref{wxLogDebug}{wxlogdebug} instead!}
2927
2928Display a debugging message; under Windows, this will appear on the
2929debugger command window, and under Unix, it will be written to standard
2930error.
2931
2932The syntax is identical to {\bf printf}: pass a format string and a
2933variable list of arguments.
2934
2935{\bf Tip:} under Windows, if your application crashes before the
2936message appears in the debugging window, put a wxYield call after
2937each wxDebugMsg call. wxDebugMsg seems to be broken under WIN32s
2938(at least for Watcom C++): preformat your messages and use OutputDebugString
2939instead.
2940
2941This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
2942
2943\wxheading{Include files}
2944
2945<wx/utils.h>
2946
2947\membersection{::wxError}\label{wxerror}
2948
2949\func{void}{wxError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Internal Error"}}
2950
2951This function is now obsolete, please use \helpref{wxLogError}{wxlogerror}
2952instead.
2953
2954Displays {\it msg} and continues. This writes to standard error under
2955Unix, and pops up a message box under Windows. Used for internal
2956wxWindows errors. See also \helpref{wxFatalError}{wxfatalerror}.
2957
2958\wxheading{Include files}
2959
2960<wx/utils.h>
2961
2962\membersection{::wxFatalError}\label{wxfatalerror}
2963
2964\func{void}{wxFatalError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Fatal Error"}}
2965
2966This function is now obsolete, please use
2967\helpref{wxLogFatalError}{wxlogfatalerror} instead.
2968
2969Displays {\it msg} and exits. This writes to standard error under Unix,
2970and pops up a message box under Windows. Used for fatal internal
2971wxWindows errors. See also \helpref{wxError}{wxerror}.
2972
2973\wxheading{Include files}
2974
2975<wx/utils.h>
2976
6fb26ea3
JS
2977\membersection{::wxLogError}\label{wxlogerror}
2978
7ac13b21 2979\func{void}{wxLogError}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 2980
1d63fd6b
GD
2981\func{void}{wxVLogError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
2982
ea44a631 2983The functions to use for error messages, i.e. the messages that must be shown
f68586e5
VZ
2984to the user. The default processing is to pop up a message box to inform the
2985user about it.
6fb26ea3
JS
2986
2987\membersection{::wxLogFatalError}\label{wxlogfatalerror}
2988
7ac13b21 2989\func{void}{wxLogFatalError}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 2990
1d63fd6b
GD
2991\func{void}{wxVLogFatalError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
2992
6fb26ea3
JS
2993Like \helpref{wxLogError}{wxlogerror}, but also
2994terminates the program with the exit code 3. Using {\it abort()} standard
2995function also terminates the program with this exit code.
2996
2997\membersection{::wxLogWarning}\label{wxlogwarning}
2998
7ac13b21 2999\func{void}{wxLogWarning}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3000
1d63fd6b
GD
3001\func{void}{wxVLogWarning}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3002
f68586e5
VZ
3003For warnings - they are also normally shown to the user, but don't interrupt
3004the program work.
6fb26ea3
JS
3005
3006\membersection{::wxLogMessage}\label{wxlogmessage}
3007
7ac13b21 3008\func{void}{wxLogMessage}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3009
1d63fd6b
GD
3010\func{void}{wxVLogMessage}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3011
ea44a631 3012For all normal, informational messages. They also appear in a message box by
f68586e5
VZ
3013default (but it can be changed). Notice that the standard behaviour is to not
3014show informational messages if there are any errors later - the logic being
3015that the later error messages make the informational messages preceding them
3016meaningless.
6fb26ea3
JS
3017
3018\membersection{::wxLogVerbose}\label{wxlogverbose}
3019
7ac13b21
GT
3020\func{void}{wxLogVerbose}{\param{const char *}{formatString}, \param{...}{}}
3021
1d63fd6b 3022\func{void}{wxVLogVerbose}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3023
f6bcfd97 3024For verbose output. Normally, it is suppressed, but
6fb26ea3
JS
3025might be activated if the user wishes to know more details about the program
3026progress (another, but possibly confusing name for the same function is {\bf wxLogInfo}).
3027
3028\membersection{::wxLogStatus}\label{wxlogstatus}
3029
7ac13b21 3030\func{void}{wxLogStatus}{\param{wxFrame *}{frame}, \param{const char *}{formatString}, \param{...}{}}
f68586e5 3031
1d63fd6b 3032\func{void}{wxVLogStatus}{\param{wxFrame *}{frame}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
7ac13b21
GT
3033
3034\func{void}{wxLogStatus}{\param{const char *}{formatString}, \param{...}{}}
6fb26ea3 3035
1d63fd6b
GD
3036\func{void}{wxVLogStatus}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3037
ea44a631 3038Messages logged by these functions will appear in the statusbar of the {\it
f68586e5 3039frame} or of the top level application window by default (i.e. when using
ea44a631 3040the second version of the functions).
f68586e5
VZ
3041
3042If the target frame doesn't have a statusbar, the message will be lost.
6fb26ea3
JS
3043
3044\membersection{::wxLogSysError}\label{wxlogsyserror}
3045
7ac13b21
GT
3046\func{void}{wxLogSysError}{\param{const char *}{formatString}, \param{...}{}}
3047
1d63fd6b 3048\func{void}{wxVLogSysError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3049
f68586e5
VZ
3050Mostly used by wxWindows itself, but might be handy for logging errors after
3051system call (API function) failure. It logs the specified message text as well
3052as the last system error code ({\it errno} or {\it ::GetLastError()} depending
3053on the platform) and the corresponding error message. The second form
f6bcfd97 3054of this function takes the error code explicitly as the first argument.
6fb26ea3 3055
6d516e09
VZ
3056\wxheading{See also}
3057
3058\helpref{wxSysErrorCode}{wxsyserrorcode},
3059\helpref{wxSysErrorMsg}{wxsyserrormsg}
3060
6fb26ea3
JS
3061\membersection{::wxLogDebug}\label{wxlogdebug}
3062
7ac13b21
GT
3063\func{void}{wxLogDebug}{\param{const char *}{formatString}, \param{...}{}}
3064
1d63fd6b 3065\func{void}{wxVLogDebug}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3066
ea44a631
GD
3067The right functions for debug output. They only do something in debug
3068mode (when the preprocessor symbol \_\_WXDEBUG\_\_ is defined) and expand to
f68586e5 3069nothing in release mode (otherwise).
6fb26ea3
JS
3070
3071\membersection{::wxLogTrace}\label{wxlogtrace}
3072
7ac13b21 3073\func{void}{wxLogTrace}{\param{const char *}{formatString}, \param{...}{}}
1d63fd6b
GD
3074
3075\func{void}{wxVLogTrace}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
6fb26ea3 3076
f68586e5 3077\func{void}{wxLogTrace}{\param{const char *}{mask}, \param{const char *}{formatString}, \param{...}{}}
7ac13b21 3078
1d63fd6b 3079\func{void}{wxVLogTrace}{\param{const char *}{mask}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
f68586e5
VZ
3080
3081\func{void}{wxLogTrace}{\param{wxTraceMask}{ mask}, \param{const char *}{formatString}, \param{...}{}}
7ac13b21 3082
1d63fd6b 3083\func{void}{wxVLogTrace}{\param{wxTraceMask}{ mask}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
f68586e5
VZ
3084
3085As {\bf wxLogDebug}, trace functions only do something in debug build and
3086expand to nothing in the release one. The reason for making
3087it a separate function from it is that usually there are a lot of trace
3088messages, so it might make sense to separate them from other debug messages.
3089
3090The trace messages also usually can be separated into different categories and
ec5d7799 3091the second and third versions of this function only log the message if the
f68586e5
VZ
3092{\it mask} which it has is currently enabled in \helpref{wxLog}{wxlog}. This
3093allows to selectively trace only some operations and not others by changing
3094the value of the trace mask (possible during the run-time).
3095
3096For the second function (taking a string mask), the message is logged only if
ec5d7799 3097the mask has been previously enabled by the call to
f68586e5
VZ
3098\helpref{AddTraceMask}{wxlogaddtracemask}. The predefined string trace masks
3099used by wxWindows are:
3100
3101\begin{itemize}\itemsep=0pt
3102\item wxTRACE\_MemAlloc: trace memory allocation (new/delete)
3103\item wxTRACE\_Messages: trace window messages/X callbacks
3104\item wxTRACE\_ResAlloc: trace GDI resource allocation
3105\item wxTRACE\_RefCount: trace various ref counting operations
3106\item wxTRACE\_OleCalls: trace OLE method calls (Win32 only)
3107\end{itemize}
6fb26ea3 3108
f68586e5
VZ
3109The third version of the function only logs the message if all the bit
3110corresponding to the {\it mask} are set in the wxLog trace mask which can be
3111set by \helpref{SetTraceMask}{wxlogsettracemask}. This version is less
3112flexible than the previous one because it doesn't allow defining the user
3113trace masks easily - this is why it is deprecated in favour of using string
3114trace masks.
6fb26ea3
JS
3115
3116\begin{itemize}\itemsep=0pt
3117\item wxTraceMemAlloc: trace memory allocation (new/delete)
3118\item wxTraceMessages: trace window messages/X callbacks
3119\item wxTraceResAlloc: trace GDI resource allocation
3120\item wxTraceRefCount: trace various ref counting operations
f68586e5 3121\item wxTraceOleCalls: trace OLE method calls (Win32 only)
6fb26ea3
JS
3122\end{itemize}
3123
6d516e09
VZ
3124\membersection{::wxSysErrorCode}\label{wxsyserrorcode}
3125
3126\func{unsigned long}{wxSysErrorCode}{\void}
3127
3128Returns the error code from the last system call. This function uses
3129{\tt errno} on Unix platforms and {\tt GetLastError} under Win32.
3130
3131\wxheading{See also}
3132
3133\helpref{wxSysErrorMsg}{wxsyserrormsg},
3134\helpref{wxLogSysError}{wxlogsyserror}
3135
3136\membersection{::wxSysErrorMsg}\label{wxsyserrormsg}
3137
3138\func{const wxChar *}{wxSysErrorMsg}{\param{unsigned long }{errCode = 0}}
3139
ec5d7799
RD
3140Returns the error message corresponding to the given system error code. If
3141{\it errCode} is $0$ (default), the last error code (as returned by
6d516e09
VZ
3142\helpref{wxSysErrorCode}{wxsyserrorcode}) is used.
3143
3144\wxheading{See also}
3145
3146\helpref{wxSysErrorCode}{wxsyserrorcode},
3147\helpref{wxLogSysError}{wxlogsyserror}
3148
b0fc8832
VZ
3149\membersection{WXTRACE}\label{trace}
3150
3151\wxheading{Include files}
3152
3153<wx/object.h>
3154
3155\func{}{WXTRACE}{formatString, ...}
3156
3157Calls wxTrace with printf-style variable argument syntax. Output
3158is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3159
3160This macro is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3161
3162\wxheading{Include files}
3163
3164<wx/memory.h>
3165
3166\membersection{WXTRACELEVEL}\label{tracelevel}
3167
3168\func{}{WXTRACELEVEL}{level, formatString, ...}
3169
3170Calls wxTraceLevel with printf-style variable argument syntax. Output
3171is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3172The first argument should be the level at which this information is appropriate.
3173It will only be output if the level returned by wxDebugContext::GetLevel is equal to or greater than
3174this value.
3175
3176This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3177
3178\wxheading{Include files}
3179
3180<wx/memory.h>
3181
3182\membersection{::wxTrace}\label{wxtrace}
3183
3184\func{void}{wxTrace}{\param{const wxString\& }{fmt}, \param{...}{}}
3185
3186Takes printf-style variable argument syntax. Output
3187is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3188
3189This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3190
3191\wxheading{Include files}
3192
3193<wx/memory.h>
3194
3195\membersection{::wxTraceLevel}\label{wxtracelevel}
3196
3197\func{void}{wxTraceLevel}{\param{int}{ level}, \param{const wxString\& }{fmt}, \param{...}{}}
3198
3199Takes printf-style variable argument syntax. Output
3200is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3201The first argument should be the level at which this information is appropriate.
3202It will only be output if the level returned by wxDebugContext::GetLevel is equal to or greater than
3203this value.
3204
3205This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3206
3207\wxheading{Include files}
3208
3209<wx/memory.h>
3210
f6bcfd97
BP
3211\section{Time functions}\label{timefunctions}
3212
3213The functions in this section deal with getting the current time and
3214starting/stopping the global timers. Please note that the timer functions are
ec5d7799 3215deprecated because they work with one global timer only and
f6bcfd97 3216\helpref{wxTimer}{wxtimer} and/or \helpref{wxStopWatch}{wxstopwatch} classes
ec5d7799
RD
3217should be used instead. For retrieving the current time, you may also use
3218\helpref{wxDateTime::Now}{wxdatetimenow} or
f6bcfd97
BP
3219\helpref{wxDateTime::UNow}{wxdatetimeunow} methods.
3220
3221\membersection{::wxGetElapsedTime}\label{wxgetelapsedtime}
3222
3223\func{long}{wxGetElapsedTime}{\param{bool}{ resetTimer = TRUE}}
3224
3225Gets the time in milliseconds since the last \helpref{::wxStartTimer}{wxstarttimer}.
3226
3227If {\it resetTimer} is TRUE (the default), the timer is reset to zero
3228by this call.
3229
3230See also \helpref{wxTimer}{wxtimer}.
3231
3232\wxheading{Include files}
3233
3234<wx/timer.h>
3235
3236\membersection{::wxGetLocalTime}\label{wxgetlocaltime}
3237
3238\func{long}{wxGetLocalTime}{\void}
3239
3240Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
3241
3242\wxheading{See also}
3243
3244\helpref{wxDateTime::Now}{wxdatetimenow}
3245
3246\wxheading{Include files}
3247
3248<wx/timer.h>
3249
3250\membersection{::wxGetLocalTimeMillis}\label{wxgetlocaltimemillis}
3251
3252\func{wxLongLone}{wxGetLocalTimeMillis}{\void}
3253
3254Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
3255
3256\wxheading{See also}
3257
3258\helpref{wxDateTime::Now}{wxdatetimenow},\\
3259\helpref{wxLongLone}{wxlonglong}
3260
3261\wxheading{Include files}
3262
3263<wx/timer.h>
3264
3265\membersection{::wxGetUTCTime}\label{wxgetutctime}
3266
3267\func{long}{wxGetUTCTime}{\void}
3268
3269Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
3270
3271\wxheading{See also}
3272
3273\helpref{wxDateTime::Now}{wxdatetimenow}
3274
3275\wxheading{Include files}
3276
3277<wx/timer.h>
3278
b0fc8832
VZ
3279\membersection{::wxNow}\label{wxnow}
3280
3281\func{wxString}{wxNow}{\void}
3282
3283Returns a string representing the current date and time.
3284
3285\wxheading{Include files}
3286
3287<wx/utils.h>
3288
3289\membersection{::wxSleep}\label{wxsleep}
3290
3291\func{void}{wxSleep}{\param{int}{ secs}}
3292
3293Sleeps for the specified number of seconds.
3294
3295\wxheading{Include files}
3296
3297<wx/utils.h>
3298
f6bcfd97
BP
3299\membersection{::wxStartTimer}\label{wxstarttimer}
3300
3301\func{void}{wxStartTimer}{\void}
3302
3303Starts a stopwatch; use \helpref{::wxGetElapsedTime}{wxgetelapsedtime} to get the elapsed time.
3304
3305See also \helpref{wxTimer}{wxtimer}.
3306
3307\wxheading{Include files}
3308
3309<wx/timer.h>
3310
b0fc8832
VZ
3311\membersection{::wxUsleep}\label{wxusleep}
3312
3313\func{void}{wxUsleep}{\param{unsigned long}{ milliseconds}}
3314
3315Sleeps for the specified number of milliseconds. Notice that usage of this
3316function is encouraged instead of calling usleep(3) directly because the
3317standard usleep() function is not MT safe.
3318
3319\wxheading{Include files}
3320
3321<wx/utils.h>
3322
6fb26ea3
JS
3323\section{Debugging macros and functions}\label{debugmacros}
3324
8f5d9104
VZ
3325Useful macros and functions for error checking and defensive programming.
3326wxWindows defines three families of the assert-like macros:
3327the wxASSERT and wxFAIL macros only do anything if \_\_WXDEBUG\_\_ is defined
3328(in other words, in the debug build) but disappear completely in the release
3329build. On the other hand, the wxCHECK macros stay event in release builds but a
3330check failure doesn't generate any user-visible effects then. Finally, the
3331compile time assertions don't happen during the run-time but result in the
3332compilation error messages if the condition they check fail.
6fb26ea3 3333
954b8ae6
JS
3334\wxheading{Include files}
3335
3336<wx/debug.h>
3337
6fb26ea3
JS
3338\membersection{::wxOnAssert}\label{wxonassert}
3339
7ac13b21 3340\func{void}{wxOnAssert}{\param{const char *}{fileName}, \param{int}{ lineNumber}, \param{const char *}{msg = NULL}}
6fb26ea3 3341
8f5d9104
VZ
3342This function is called whenever one of debugging macros fails (i.e. condition
3343is false in an assertion). It is only defined in the debug mode, in release
3344builds the \helpref{wxCHECK}{wxcheck} failures don't result in anything.
3345
3346To override the default behaviour in the debug builds which is to show the user
3347a dialog asking whether he wants to abort the program, continue or continue
3348ignoring any subsequent assert failures, you may override
3349\helpref{wxApp::OnAssert}{wxapponassert} which is called by this function if
3350the global application object exists.
6fb26ea3
JS
3351
3352\membersection{wxASSERT}\label{wxassert}
3353
3354\func{}{wxASSERT}{\param{}{condition}}
3355
b207457c
VZ
3356Assert macro. An error message will be generated if the condition is FALSE in
3357debug mode, but nothing will be done in the release build.
3358
3359Please note that the condition in wxASSERT() should have no side effects
3360because it will not be executed in release mode at all.
3361
8f5d9104
VZ
3362\wxheading{See also}
3363
3364\helpref{wxASSERT\_MSG}{wxassertmsg},\\
3365\helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}
3366
3367\membersection{wxASSERT\_MIN\_BITSIZE}\label{wxassertminbitsize}
3368
3369\func{}{wxASSERT\_MIN\_BITSIZE}{\param{}{type}, \param{}{size}}
3370
3371This macro results in a
3372\helpref{compile time assertion failure}{wxCOMPILE\_TIME\_ASSERT} if the size
3373of the given type {\it type} is less than {\it size} bits.
3374
3375You may use it like this, for example:
3376
3377\begin{verbatim}
3378 // we rely on the int being able to hold values up to 2^32
3379 wxASSERT_MIN_BITSIZE(int, 32);
3380
3381 // can't work with the platforms using UTF-8 for wchar_t
3382 wxASSERT_MIN_BITSIZE(wchar_t, 16);
3383\end{verbatim}
6fb26ea3
JS
3384
3385\membersection{wxASSERT\_MSG}\label{wxassertmsg}
3386
3387\func{}{wxASSERT\_MSG}{\param{}{condition}, \param{}{msg}}
3388
3389Assert macro with message. An error message will be generated if the condition is FALSE.
3390
8f5d9104
VZ
3391\wxheading{See also}
3392
3393\helpref{wxASSERT}{wxassert},\\
3394\helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}
3395
3396\membersection{wxCOMPILE\_TIME\_ASSERT}\label{wxcompiletimeassert}
3397
3398\func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}}
3399
3400Using {\tt wxCOMPILE\_TIME\_ASSERT} results in a compilation error if the
3401specified {\it condition| is false. The compiler error message should include
3402the {\it msg} identifier - please note that it must be a valid C++ identifier
3403and not a string unlike in the other cases.
3404
3405This macro is mostly useful for testing the expressions involing the
3406{\tt sizeof} operator as they can't be tested by the preprocessor but it is
3407sometimes desirable to test them at the compile time.
3408
3409\wxheading{See also}
3410
3411\helpref{wxASSERT\_MSG}{wxassertmsg},\\
3412\helpref{wxASSERT\_MIN\_BITSIZE}{wxassertminbitsize}
b207457c 3413
6fb26ea3
JS
3414\membersection{wxFAIL}\label{wxfail}
3415
b207457c 3416\func{}{wxFAIL}{\void}
6fb26ea3
JS
3417
3418Will always generate an assert error if this code is reached (in debug mode).
3419
b207457c
VZ
3420See also: \helpref{wxFAIL\_MSG}{wxfailmsg}
3421
6fb26ea3
JS
3422\membersection{wxFAIL\_MSG}\label{wxfailmsg}
3423
b207457c 3424\func{}{wxFAIL\_MSG}{\param{}{msg}}
6fb26ea3
JS
3425
3426Will always generate an assert error with specified message if this code is reached (in debug mode).
3427
b207457c
VZ
3428This macro is useful for marking unreachable" code areas, for example
3429it may be used in the "default:" branch of a switch statement if all possible
3430cases are processed above.
3431
8f5d9104
VZ
3432\wxheading{See also}
3433
3434\helpref{wxFAIL}{wxfail}
b207457c 3435
6fb26ea3
JS
3436\membersection{wxCHECK}\label{wxcheck}
3437
3438\func{}{wxCHECK}{\param{}{condition}, \param{}{retValue}}
3439
3440Checks that the condition is true, returns with the given return value if not (FAILs in debug mode).
3441This check is done even in release mode.
3442
3443\membersection{wxCHECK\_MSG}\label{wxcheckmsg}
3444
3445\func{}{wxCHECK\_MSG}{\param{}{condition}, \param{}{retValue}, \param{}{msg}}
3446
3447Checks that the condition is true, returns with the given return value if not (FAILs in debug mode).
3448This check is done even in release mode.
3449
ec5d7799 3450This macro may be only used in non void functions, see also
b207457c
VZ
3451\helpref{wxCHECK\_RET}{wxcheckret}.
3452
3453\membersection{wxCHECK\_RET}\label{wxcheckret}
3454
3455\func{}{wxCHECK\_RET}{\param{}{condition}, \param{}{msg}}
3456
3457Checks that the condition is true, and returns if not (FAILs with given error
3458message in debug mode). This check is done even in release mode.
3459
ec5d7799 3460This macro should be used in void functions instead of
b207457c
VZ
3461\helpref{wxCHECK\_MSG}{wxcheckmsg}.
3462
3463\membersection{wxCHECK2}\label{wxcheck2}
3464
3465\func{}{wxCHECK2}{\param{}{condition}, \param{}{operation}}
3466
ec5d7799
RD
3467Checks that the condition is true and \helpref{wxFAIL}{wxfail} and execute
3468{\it operation} if it is not. This is a generalisation of
b207457c
VZ
3469\helpref{wxCHECK}{wxcheck} and may be used when something else than just
3470returning from the function must be done when the {\it condition} is false.
3471
3472This check is done even in release mode.
3473
3474\membersection{wxCHECK2\_MSG}\label{wxcheck2msg}
3475
3476\func{}{wxCHECK2}{\param{}{condition}, \param{}{operation}, \param{}{msg}}
3477
ec5d7799 3478This is the same as \helpref{wxCHECK2}{wxcheck2}, but
b207457c
VZ
3479\helpref{wxFAIL\_MSG}{wxfailmsg} with the specified {\it msg} is called
3480instead of wxFAIL() if the {\it condition} is false.
3481
b0fc8832
VZ
3482\membersection{::wxTrap}\label{wxtrap}
3483
3484\func{void}{wxTrap}{\void}
3485
3486In debug mode (when {\tt \_\_WXDEBUG\_\_} is defined) this function generates a
3487debugger exception meaning that the control is passed to the debugger if one is
3488attached to the process. Otherwise the program just terminates abnormally.
3489
3490In release mode this function does nothing.
3491
3492\wxheading{Include files}
3493
3494<wx/debug.h>
3495
5807634c
VZ
3496\section{Environment access functions}\label{environfunctions}
3497
3498The functions in this section allow to access (get) or change value of
3499environment variables in a portable way. They are currently implemented under
3500Win32 and POSIX-like systems (Unix).
3501
3502% TODO add some stuff about env var inheriting but not propagating upwards (VZ)
3503
3504\wxheading{Include files}
3505
3506<wx/utils.h>
3507
308978f6 3508\membersection{wxGetenv}\label{wxgetenvmacro}
5807634c
VZ
3509
3510\func{wxChar *}{wxGetEnv}{\param{const wxString\&}{ var}}
3511
308978f6
VZ
3512This is a macro defined as {\tt getenv()} or its wide char version in Unicode
3513mode.
3514
3515Note that under Win32 it may not return correct value for the variables set
3516with \helpref{wxSetEnv}{wxsetenv}, use \helpref{wxGetEnv}{wxgetenv} function
3517instead.
3518
3519\membersection{wxGetEnv}\label{wxgetenv}
3520
3521\func{bool}{wxGetEnv}{\param{const wxString\&}{ var}, \param{wxString *}{value}}
3522
3523Returns the current value of the environment variable {\it var} in {\it value}.
3524{\it value} may be {\tt NULL} if you just want to know if the variable exists
3525and are not interested in its value.
3526
3527Returns {\tt TRUE} if the variable exists, {\tt FALSE} otherwise.
5807634c
VZ
3528
3529\membersection{wxSetEnv}\label{wxsetenv}
3530
3531\func{bool}{wxSetEnv}{\param{const wxString\&}{ var}, \param{const wxChar *}{value}}
3532
3533Sets the value of the environment variable {\it var} (adding it if necessary)
3534to {\it value}.
3535
3536Returns {\tt TRUE} on success.
3537
3538\membersection{wxUnsetEnv}\label{wxunsetenv}
3539
3540\func{bool}{wxUnsetEnv}{\param{const wxString\&}{ var}}
3541
ec5d7799 3542Removes the variable {\it var} from the environment.
5df6ed1c 3543\helpref{wxGetEnv}{wxgetenv} will return {\tt NULL} after the call to this
5807634c
VZ
3544function.
3545
3546Returns {\tt TRUE} on success.
3547