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