1 \chapter{Functions
}\label{functions
}
2 \setheader{{\it CHAPTER
\thechapter}}{}{}{}{}{{\it CHAPTER
\thechapter}}%
3 \setfooter{\thepage}{}{}{}{}{\thepage}
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.
9 \section{Alphabetical functions and macros list
}
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{wxCHECK
}{wxcheck
}\\
34 \helpref{wxCHECK2
\_MSG}{wxcheck2msg
}\\
35 \helpref{wxCHECK2
}{wxcheck2
}\\
36 \helpref{wxCHECK
\_GCC\_VERSION}{wxcheckgccversion
}\\
37 \helpref{wxCHECK
\_MSG}{wxcheckmsg
}\\
38 \helpref{wxCHECK
\_RET}{wxcheckret
}\\
39 \helpref{wxCHECK
\_VERSION}{wxcheckversion
}\\
40 \helpref{wxCHECK
\_W32API\_VERSION}{wxcheckw32apiversion
}\\
41 \helpref{wxClientDisplayRect
}{wxclientdisplayrect
}\\
42 \helpref{wxClipboardOpen
}{functionwxclipboardopen
}\\
43 \helpref{wxCloseClipboard
}{wxcloseclipboard
}\\
44 \helpref{wxColourDisplay
}{wxcolourdisplay
}\\
45 \helpref{wxCOMPILE
\_TIME\_ASSERT}{wxcompiletimeassert
}\\
46 \helpref{wxCOMPILE
\_TIME\_ASSERT2}{wxcompiletimeassert2
}\\
47 \helpref{wxConcatFiles
}{wxconcatfiles
}\\
48 \helpref{wxConstCast
}{wxconstcast
}\\
49 \helpref{wxCopyFile
}{wxcopyfile
}\\
50 \helpref{wxCreateDynamicObject
}{wxcreatedynamicobject
}\\
51 \helpref{wxCreateFileTipProvider
}{wxcreatefiletipprovider
}\\
52 \helpref{wxDDECleanUp
}{wxddecleanup
}\\
53 \helpref{wxDDEInitialize
}{wxddeinitialize
}\\
54 \helpref{wxDROP
\_ICON}{wxdropicon
}\\
55 \helpref{wxDebugMsg
}{wxdebugmsg
}\\
56 \helpref{wxDirExists
}{functionwxdirexists
}\\
57 \helpref{wxDirSelector
}{wxdirselector
}\\
58 \helpref{wxDisplayDepth
}{wxdisplaydepth
}\\
59 \helpref{wxDisplaySize
}{wxdisplaysize
}\\
60 \helpref{wxDisplaySizeMM
}{wxdisplaysizemm
}\\
61 \helpref{wxDos2UnixFilename
}{wxdos2unixfilename
}\\
62 \helpref{wxDynamicCastThis
}{wxdynamiccastthis
}\\
63 \helpref{wxDynamicCast
}{wxdynamiccast
}\\
64 \helpref{wxEmptyClipboard
}{wxemptyclipboard
}\\
65 \helpref{wxEnableTopLevelWindows
}{wxenabletoplevelwindows
}\\
66 \helpref{wxEndBusyCursor
}{wxendbusycursor
}\\
67 \helpref{wxEntry
}{wxentry
}\\
68 \helpref{wxEnumClipboardFormats
}{wxenumclipboardformats
}\\
69 \helpref{wxError
}{wxerror
}\\
70 \helpref{wxExecute
}{wxexecute
}\\
71 \helpref{wxExit
}{wxexit
}\\
72 \helpref{wxEXPLICIT
}{wxexplicit
}\\
73 \helpref{wxFAIL
\_MSG}{wxfailmsg
}\\
74 \helpref{wxFAIL
}{wxfail
}\\
75 \helpref{wxFatalError
}{wxfatalerror
}\\
76 \helpref{wxFileExists
}{functionwxfileexists
}\\
77 \helpref{wxFileModificationTime
}{wxfilemodificationtime
}\\
78 \helpref{wxFileNameFromPath
}{wxfilenamefrompath
}\\
79 \helpref{wxFileSelector
}{wxfileselector
}\\
80 \helpref{wxFindFirstFile
}{wxfindfirstfile
}\\
81 \helpref{wxFindMenuItemId
}{wxfindmenuitemid
}\\
82 \helpref{wxFindNextFile
}{wxfindnextfile
}\\
83 \helpref{wxFindWindowAtPointer
}{wxfindwindowatpointer
}\\
84 \helpref{wxFindWindowAtPoint
}{wxfindwindowatpoint
}\\
85 \helpref{wxFindWindowByLabel
}{wxfindwindowbylabel
}\\
86 \helpref{wxFindWindowByName
}{wxfindwindowbyname
}\\
87 \helpref{wxGetActiveWindow
}{wxgetactivewindow
}\\
88 \helpref{wxGetClipboardData
}{wxgetclipboarddata
}\\
89 \helpref{wxGetClipboardFormatName
}{wxgetclipboardformatname
}\\
90 \helpref{wxGetColourFromUser
}{wxgetcolourfromuser
}\\
91 \helpref{wxGetCwd
}{wxgetcwd
}\\
92 \helpref{wxGetDiskSpace
}{wxgetdiskspace
}\\
93 \helpref{wxGetDisplayName
}{wxgetdisplayname
}\\
94 \helpref{wxGetElapsedTime
}{wxgetelapsedtime
}\\
95 \helpref{wxGetEmailAddress
}{wxgetemailaddress
}\\
96 \helpref{wxGetEnv
}{wxgetenv
}\\
97 \helpref{wxGetFontFromUser
}{wxgetfontfromuser
}\\
98 \helpref{wxGetFreeMemory
}{wxgetfreememory
}\\
99 \helpref{wxGetFullHostName
}{wxgetfullhostname
}\\
100 \helpref{wxGetHomeDir
}{wxgethomedir
}\\
101 \helpref{wxGetHostName
}{wxgethostname
}\\
102 \helpref{wxGetLocalTimeMillis
}{wxgetlocaltimemillis
}\\
103 \helpref{wxGetLocalTime
}{wxgetlocaltime
}\\
104 \helpref{wxGetMousePosition
}{wxgetmouseposition
}\\
105 \helpref{wxGetMultipleChoices
}{wxgetmultiplechoices
}\\
106 \helpref{wxGetMultipleChoice
}{wxgetmultiplechoice
}\\
107 \helpref{wxGetNumberFromUser
}{wxgetnumberfromuser
}\\
108 \helpref{wxGetOSDirectory
}{wxgetosdirectory
}\\
109 \helpref{wxGetOsDescription
}{wxgetosdescription
}\\
110 \helpref{wxGetOsVersion
}{wxgetosversion
}\\
111 \helpref{wxGetPasswordFromUser
}{wxgetpasswordfromuser
}\\
112 \helpref{wxGetPrinterCommand
}{wxgetprintercommand
}\\
113 \helpref{wxGetPrinterFile
}{wxgetprinterfile
}\\
114 \helpref{wxGetPrinterMode
}{wxgetprintermode
}\\
115 \helpref{wxGetPrinterOptions
}{wxgetprinteroptions
}\\
116 \helpref{wxGetPrinterOrientation
}{wxgetprinterorientation
}\\
117 \helpref{wxGetPrinterPreviewCommand
}{wxgetprinterpreviewcommand
}\\
118 \helpref{wxGetPrinterScaling
}{wxgetprinterscaling
}\\
119 \helpref{wxGetPrinterTranslation
}{wxgetprintertranslation
}\\
120 \helpref{wxGetProcessId
}{wxgetprocessid
}\\
121 \helpref{wxGetResource
}{wxgetresource
}\\
122 \helpref{wxGetSingleChoiceData
}{wxgetsinglechoicedata
}\\
123 \helpref{wxGetSingleChoiceIndex
}{wxgetsinglechoiceindex
}\\
124 \helpref{wxGetSingleChoice
}{wxgetsinglechoice
}\\
125 \helpref{wxGetTempFileName
}{wxgettempfilename
}\\
126 \helpref{wxGetTextFromUser
}{wxgettextfromuser
}\\
127 \helpref{wxGetTopLevelParent
}{wxgettoplevelparent
}\\
128 \helpref{wxGetTranslation
}{wxgettranslation
}\\
129 \helpref{wxGetUTCTime
}{wxgetutctime
}\\
130 \helpref{wxGetUserHome
}{wxgetuserhome
}\\
131 \helpref{wxGetUserId
}{wxgetuserid
}\\
132 \helpref{wxGetUserName
}{wxgetusername
}\\
133 \helpref{wxGetWorkingDirectory
}{wxgetworkingdirectory
}\\
134 \helpref{wxGetenv
}{wxgetenvmacro
}\\
135 \helpref{wxHandleFatalExceptions
}{wxhandlefatalexceptions
}\\
136 \helpref{wxICON
}{wxiconmacro
}\\
137 \helpref{wxINTXX
\_SWAP\_ALWAYS}{intswapalways
}\\
138 \helpref{wxINTXX
\_SWAP\_ON\_BE}{intswaponbe
}\\
139 \helpref{wxINTXX
\_SWAP\_ON\_LE}{intswaponle
}\\
140 \helpref{wxInitAllImageHandlers
}{wxinitallimagehandlers
}\\
141 \helpref{wxInitialize
}{wxinitialize
}\\
142 \helpref{wxIsAbsolutePath
}{wxisabsolutepath
}\\
143 \helpref{wxIsBusy
}{wxisbusy
}\\
144 \helpref{wxIsClipboardFormatAvailable
}{wxisclipboardformatavailable
}\\
145 \helpref{wxIsEmpty
}{wxisempty
}\\
146 \helpref{wxIsWild
}{wxiswild
}\\
147 \helpref{wxKill
}{wxkill
}\\
148 \helpref{wxLoadUserResource
}{wxloaduserresource
}\\
149 \helpref{wxLogDebug
}{wxlogdebug
}\\
150 \helpref{wxLogError
}{wxlogerror
}\\
151 \helpref{wxLogFatalError
}{wxlogfatalerror
}\\
152 \helpref{wxLogMessage
}{wxlogmessage
}\\
153 \helpref{wxLogStatus
}{wxlogstatus
}\\
154 \helpref{wxLogSysError
}{wxlogsyserror
}\\
155 \helpref{wxLogTrace
}{wxlogtrace
}\\
156 \helpref{wxLogVerbose
}{wxlogverbose
}\\
157 \helpref{wxLogWarning
}{wxlogwarning
}\\
158 \helpref{wxLL
}{wxll
}\\
159 \helpref{wxLongLongFmtSpec
}{wxlonglongfmtspec
}\\
160 \helpref{wxMakeMetafilePlaceable
}{wxmakemetafileplaceable
}\\
161 \helpref{wxMatchWild
}{wxmatchwild
}\\
162 \helpref{wxMessageBox
}{wxmessagebox
}\\
163 \helpref{wxMkdir
}{wxmkdir
}\\
164 \helpref{wxMutexGuiEnter
}{wxmutexguienter
}\\
165 \helpref{wxMutexGuiLeave
}{wxmutexguileave
}\\
166 \helpref{wxNewId
}{wxnewid
}\\
167 \helpref{wxNow
}{wxnow
}\\
168 \helpref{wxOnAssert
}{wxonassert
}\\
169 \helpref{wxOpenClipboard
}{wxopenclipboard
}\\
170 \helpref{wxPathOnly
}{wxpathonly
}\\
171 \helpref{wxPostDelete
}{wxpostdelete
}\\
172 \helpref{wxPostEvent
}{wxpostevent
}\\
173 \helpref{wxRegisterClipboardFormat
}{wxregisterclipboardformat
}\\
174 \helpref{wxRegisterId
}{wxregisterid
}\\
175 \helpref{wxRemoveFile
}{wxremovefile
}\\
176 \helpref{wxRenameFile
}{wxrenamefile
}\\
177 \helpref{wxResourceAddIdentifier
}{wxresourceaddidentifier
}\\
178 \helpref{wxResourceClear
}{wxresourceclear
}\\
179 \helpref{wxResourceCreateBitmap
}{wxresourcecreatebitmap
}\\
180 \helpref{wxResourceCreateIcon
}{wxresourcecreateicon
}\\
181 \helpref{wxResourceCreateMenuBar
}{wxresourcecreatemenubar
}\\
182 \helpref{wxResourceGetIdentifier
}{wxresourcegetidentifier
}\\
183 \helpref{wxResourceParseData
}{wxresourcedata
}\\
184 \helpref{wxResourceParseFile
}{wxresourceparsefile
}\\
185 \helpref{wxResourceParseString
}{wxresourceparsestring
}\\
186 \helpref{wxResourceRegisterBitmapData
}{registerbitmapdata
}\\
187 \helpref{wxResourceRegisterIconData
}{wxresourceregistericondata
}\\
188 \helpref{wxRmdir
}{wxrmdir
}\\
189 \helpref{wxSafeShowMessage
}{wxsafeshowmessage
}\\
190 \helpref{wxSafeYield
}{wxsafeyield
}\\
191 \helpref{wxSetClipboardData
}{wxsetclipboarddata
}\\
192 \helpref{wxSetCursor
}{wxsetcursor
}\\
193 \helpref{wxSetDisplayName
}{wxsetdisplayname
}\\
194 \helpref{wxSetEnv
}{wxsetenv
}\\
195 \helpref{wxSetPrinterCommand
}{wxsetprintercommand
}\\
196 \helpref{wxSetPrinterFile
}{wxsetprinterfile
}\\
197 \helpref{wxSetPrinterMode
}{wxsetprintermode
}\\
198 \helpref{wxSetPrinterOptions
}{wxsetprinteroptions
}\\
199 \helpref{wxSetPrinterOrientation
}{wxsetprinterorientation
}\\
200 \helpref{wxSetPrinterPreviewCommand
}{wxsetprinterpreviewcommand
}\\
201 \helpref{wxSetPrinterScaling
}{wxsetprinterscaling
}\\
202 \helpref{wxSetPrinterTranslation
}{wxsetprintertranslation
}\\
203 \helpref{wxSetWorkingDirectory
}{wxsetworkingdirectory
}\\
204 \helpref{wxShell
}{wxshell
}\\
205 \helpref{wxShowTip
}{wxshowtip
}\\
206 \helpref{wxShutdown
}{wxshutdown
}\\
207 \helpref{wxSleep
}{wxsleep
}\\
208 \helpref{wxSnprintf
}{wxsnprintf
}\\
209 \helpref{wxSplitPath
}{wxsplitfunction
}\\
210 \helpref{wxStartTimer
}{wxstarttimer
}\\
211 \helpref{wxStaticCast
}{wxstaticcast
}\\
212 \helpref{wxStricmp
}{wxstricmp
}\\
213 \helpref{wxStringEq
}{wxstringeq
}\\
214 \helpref{wxStringMatch
}{wxstringmatch
}\\
215 \helpref{wxStripMenuCodes
}{wxstripmenucodes
}\\
216 \helpref{wxStrlen
}{wxstrlen
}\\
217 \helpref{wxSysErrorCode
}{wxsyserrorcode
}\\
218 \helpref{wxSysErrorMsg
}{wxsyserrormsg
}\\
219 \helpref{wxToLower
}{wxtolower
}\\
220 \helpref{wxToUpper
}{wxtoupper
}\\
221 \helpref{wxTraceLevel
}{wxtracelevel
}\\
222 \helpref{wxTrace
}{wxtrace
}\\
223 \helpref{wxTransferFileToStream
}{wxtransferfiletostream
}\\
224 \helpref{wxTransferStreamToFile
}{wxtransferstreamtofile
}\\
225 \helpref{wxTrap
}{wxtrap
}\\
226 \helpref{wxUninitialize
}{wxuninitialize
}\\
227 \helpref{wxUnix2DosFilename
}{wxunix2dosfilename
}\\
228 \helpref{wxUnsetEnv
}{wxunsetenv
}\\
229 \helpref{wxUsleep
}{wxusleep
}\\
230 \helpref{wxVsnprintf
}{wxvsnprintf
}\\
231 \helpref{wxWakeUpIdle
}{wxwakeupidle
}\\
232 \helpref{wxWriteResource
}{wxwriteresource
}\\
233 \helpref{wxYield
}{wxyield
}
235 \section{Version macros
}\label{versionfunctions
}
237 The following constants are defined in wxWindows:
239 \begin{itemize
}\itemsep=
0pt
240 \item {\tt wxMAJOR
\_VERSION} is the major version of wxWindows
241 \item {\tt wxMINOR
\_VERSION} is the minor version of wxWindows
242 \item {\tt wxRELEASE
\_NUMBER} is the release number
245 For example, the values or these constants for wxWindows
2.1.15 are
2,
1 and
248 Additionally,
{\tt wxVERSION
\_STRING} is a user-readable string containing
249 the full wxWindows version and
{\tt wxVERSION
\_NUMBER} is a combination of the
250 three version numbers above: for
2.1.15, it is
2115 and it is
2200 for
253 \wxheading{Include files
}
255 <wx/version.h> or <wx/defs.h>
257 \membersection{wxCHECK
\_VERSION}\label{wxcheckversion
}
259 \func{bool
}{wxCHECK
\_VERSION}{\param{}{major, minor, release
}}
261 This is a macro which evaluates to true if the current wxWindows version is at
262 least major.minor.release.
264 For example, to test if the program is compiled with wxWindows
2.2 or higher,
265 the following can be done:
269 #if wxCHECK_VERSION(
2,
2,
0)
270 if ( s.StartsWith("foo") )
271 #else // replacement code for old version
272 if ( strncmp(s, "foo",
3) ==
0 )
279 \membersection{wxCHECK
\_GCC\_VERSION}\label{wxcheckgccversion
}
281 \func{bool
}{wxCHECK
\_GCC\_VERSION}{\param{}{major, minor, release
}}
283 Returns $
1$ if the compiler being used to compile the code is GNU C++
284 compiler (g++) version major.minor.release or greater. Otherwise, and also if
285 the compiler is not GNU C++ at all, returns $
0$.
287 \membersection{wxCHECK
\_W32API\_VERSION}\label{wxcheckw32apiversion
}
289 \func{bool
}{wxCHECK
\_GCC\_VERSION}{\param{}{major, minor, release
}}
291 Returns $
1$ if the version of w32api headers used is major.minor.release or
292 greater. Otherwise, and also if we are not compiling with mingw32/cygwin under
293 Win32 at all, returns $
0$.
295 \section{Application initialization and termination
}\label{appinifunctions
}
297 The functions in this section are used on application startup/shutdown and also
298 to control the behaviour of the main event loop of the GUI programs.
300 \membersection{::wxEntry
}\label{wxentry
}
302 This initializes wxWindows in a platform-dependent way. Use this if you
303 are not using the default wxWindows entry code (e.g. main or WinMain). For example,
304 you can initialize wxWindows from an Microsoft Foundation Classes application using
307 \func{void
}{wxEntry
}{\param{HANDLE
}{ hInstance
},
\param{HANDLE
}{ hPrevInstance
},
308 \param{const wxString\&
}{commandLine
},
\param{int
}{ cmdShow
},
\param{bool
}{ enterLoop = TRUE
}}
310 wxWindows initialization under Windows (non-DLL). If
{\it enterLoop
} is FALSE, the
311 function will return immediately after calling wxApp::OnInit. Otherwise, the wxWindows
312 message loop will be entered.
314 \func{void
}{wxEntry
}{\param{HANDLE
}{ hInstance
},
\param{HANDLE
}{ hPrevInstance
},
315 \param{WORD
}{ wDataSegment
},
\param{WORD
}{ wHeapSize
},
\param{const wxString\&
}{ commandLine
}}
317 wxWindows initialization under Windows (for applications constructed as a DLL).
319 \func{int
}{wxEntry
}{\param{int
}{ argc
},
\param{const wxString\& *
}{argv
}}
321 wxWindows initialization under Unix.
325 To clean up wxWindows, call wxApp::OnExit followed by the static function
326 wxApp::CleanUp. For example, if exiting from an MFC application that also uses wxWindows:
329 int CTheApp::ExitInstance()
331 // OnExit isn't called by CleanUp so must be called explicitly.
335 return CWinApp::ExitInstance();
339 \wxheading{Include files
}
343 \membersection{::wxHandleFatalExceptions
}\label{wxhandlefatalexceptions
}
345 \func{bool
}{wxHandleFatalExceptions
}{\param{bool
}{ doIt = TRUE
}}
347 If
{\it doIt
} is TRUE, the fatal exceptions (also known as general protection
348 faults under Windows or segmentation violations in the Unix world) will be
349 caught and passed to
\helpref{wxApp::OnFatalException
}{wxapponfatalexception
}.
350 By default, i.e. before this function is called, they will be handled in the
351 normal way which usually just means that the application will be terminated.
352 Calling wxHandleFatalExceptions() with
{\it doIt
} equal to FALSE will restore
353 this default behaviour.
355 \membersection{::wxInitAllImageHandlers
}\label{wxinitallimagehandlers
}
357 \func{void
}{wxInitAllImageHandlers
}{\void}
359 Initializes all available image handlers. For a list of available handlers,
360 see
\helpref{wxImage
}{wximage
}.
364 \helpref{wxImage
}{wximage
},
\helpref{wxImageHandler
}{wximagehandler
}
366 \wxheading{Include files
}
370 \membersection{::wxInitialize
}\label{wxinitialize
}
372 \func{bool
}{wxInitialize
}{\void}
374 This function is used in wxBase only and only if you don't create
375 \helpref{wxApp
}{wxapp
} object at all. In this case you must call it from your
376 {\tt main()
} function before calling any other wxWindows functions.
378 If the function returns
{\tt FALSE
} the initialization could not be performed,
379 in this case the library cannot be used and
380 \helpref{wxUninitialize
}{wxuninitialize
} shouldn't be called neither.
382 This function may be called several times but
383 \helpref{wxUninitialize
}{wxuninitialize
} must be called for each successful
384 call to this function.
386 \wxheading{Include files
}
390 \membersection{::wxSafeYield
}\label{wxsafeyield
}
392 \func{bool
}{wxSafeYield
}{\param{wxWindow*
}{ win = NULL
},
\param{bool
}{
393 onlyIfNeeded = FALSE
}}
395 This function is similar to wxYield, except that it disables the user input to
396 all program windows before calling wxYield and re-enables it again
397 afterwards. If
{\it win
} is not NULL, this window will remain enabled,
398 allowing the implementation of some limited user interaction.
400 Returns the result of the call to
\helpref{::wxYield
}{wxyield
}.
402 \wxheading{Include files
}
406 \membersection{::wxUninitialize
}\label{wxuninitialize
}
408 \func{void
}{wxUninitialize
}{\void}
410 This function is for use in console (wxBase) programs only. It must be called
411 once for each previous successful call to
\helpref{wxInitialize
}{wxinitialize
}.
413 \wxheading{Include files
}
417 \membersection{::wxYield
}\label{wxyield
}
419 \func{bool
}{wxYield
}{\void}
421 Calls
\helpref{wxApp::Yield
}{wxappyield
}.
423 This function is kept only for backwards compatibility. Please use
424 the
\helpref{wxApp::Yield
}{wxappyield
} method instead in any new code.
426 \wxheading{Include files
}
428 <wx/app.h> or <wx/utils.h>
430 \membersection{::wxWakeUpIdle
}\label{wxwakeupidle
}
432 \func{void
}{wxWakeUpIdle
}{\void}
434 This functions wakes up the (internal and platform dependent) idle system, i.e. it
435 will force the system to send an idle event even if the system currently
{\it is
}
436 idle and thus would not send any idle event until after some other event would get
437 sent. This is also useful for sending events between two threads and is used by
438 the corresponding functions
\helpref{::wxPostEvent
}{wxpostevent
} and
439 \helpref{wxEvtHandler::AddPendingEvent
}{wxevthandleraddpendingevent
}.
441 \wxheading{Include files
}
445 \section{Process control functions
}\label{processfunctions
}
447 The functions in this section are used to launch or terminate the other
450 \membersection{::wxExecute
}\label{wxexecute
}
452 \func{long
}{wxExecute
}{\param{const wxString\&
}{command
},
\param{int
}{sync = wxEXEC
\_ASYNC},
\param{wxProcess *
}{callback = NULL
}}
454 \func{long
}{wxExecute
}{\param{char **
}{argv
},
\param{int
}{flags = wxEXEC
\_ASYNC},
\param{wxProcess *
}{callback = NULL
}}
456 \func{long
}{wxExecute
}{\param{const wxString\&
}{command
},
\param{wxArrayString\&
}{output
}}
458 \perlnote{In wxPerl this function only takes the
{\tt command
} argument,
459 and returns a
2-element list
{\tt ( status, output )
}, where
{\tt output
} is
462 \func{long
}{wxExecute
}{\param{const wxString\&
}{command
},
\param{wxArrayString\&
}{output
},
\param{wxArrayString\&
}{errors
}}
464 \perlnote{In wxPerl this function only takes the
{\tt command
} argument,
465 and returns a
3-element list
{\tt ( status, output, errors )
}, where
466 {\tt output
} and
{\tt errors
} are array references.
}
468 Executes another program in Unix or Windows.
470 The first form takes a command string, such as
{\tt "emacs file.txt"
}.
472 The second form takes an array of values: a command, any number of
473 arguments, terminated by NULL.
475 The semantics of the third and fourth versions is different from the first two
476 and is described in more details below.
478 If
{\it flags
} parameter contains
{\tt wxEXEC
\_ASYNC} flag (the default), flow
479 of control immediately returns. If it contains
{\tt wxEXEC
\_SYNC}, the current
480 application waits until the other program has terminated.
482 In the case of synchronous execution, the return value is the exit code of
483 the process (which terminates by the moment the function returns) and will be
484 $-
1$ if the process couldn't be started and typically
0 if the process
485 terminated successfully. Also, while waiting for the process to
486 terminate, wxExecute will call
\helpref{wxYield
}{wxyield
}. The caller
487 should ensure that this can cause no recursion, in the simplest case by
488 calling
\helpref{wxEnableTopLevelWindows(FALSE)
}{wxenabletoplevelwindows
}.
490 For asynchronous execution, however, the return value is the process id and
491 zero value indicates that the command could not be executed. As an added
492 complication, the return value of $-
1$ in this case indicates that we didn't
493 launch a new process, but connected to the running one (this can only happen in
494 case of using DDE under Windows for command execution). In particular, in this,
495 and only this, case the calling code will not get the notification about
498 If callback isn't NULL and if execution is asynchronous,
499 \helpref{wxProcess::OnTerminate
}{wxprocessonterminate
} will be called when
500 the process finishes. Specifying this parameter also allows you to redirect the
501 standard input and/or output of the process being launched by calling
502 \helpref{Redirect
}{wxprocessredirect
}. If the child process IO is redirected,
503 under Windows the process window is not shown by default (this avoids having to
504 flush an unnecessary console for the processes which don't create any windows
505 anyhow) but a
{\tt wxEXEC
\_NOHIDE} flag can be used to prevent this from
506 happening, i.e. with this flag the child process window will be shown normally.
508 Under Unix the flag
{\tt wxEXEC
\_MAKE\_GROUP\_LEADER} may be used to ensure
509 that the new process is a group leader (this will create a new session if
510 needed). Calling
\helpref{wxKill
}{wxkill
} with the argument of -pid where pid
511 is the process ID of the new process will kill this process as well as all of
512 its children (except those which have started their own session).
514 Finally, you may use the third overloaded version of this function to execute
515 a process (always synchronously) and capture its output in the array
516 {\it output
}. The fourth version adds the possibility to additionally capture
517 the messages from standard error output in the
{\it errors
} array.
519 See also
\helpref{wxShell
}{wxshell
},
\helpref{wxProcess
}{wxprocess
},
520 \helpref{Exec sample
}{sampleexec
}.
522 \wxheading{Parameters
}
524 \docparam{command
}{The command to execute and any parameters to pass to it as a
527 \docparam{argv
}{The command to execute should be the first element of this
528 array, any additional ones are the command parameters and the array must be
529 terminated with a NULL pointer.
}
531 \docparam{flags
}{Combination of bit masks
{\tt wxEXEC
\_ASYNC},
532 {\tt wxEXEC
\_SYNC} and
{\tt wxEXEC
\_NOHIDE}}
534 \docparam{callback
}{An optional pointer to
\helpref{wxProcess
}{wxprocess
}}
536 \wxheading{Include files
}
540 \membersection{::wxExit
}\label{wxexit
}
542 \func{void
}{wxExit
}{\void}
544 Exits application after calling
\helpref{wxApp::OnExit
}{wxapponexit
}.
545 Should only be used in an emergency: normally the top-level frame
546 should be deleted (after deleting all other frames) to terminate the
547 application. See
\helpref{wxCloseEvent
}{wxcloseevent
} and
\helpref{wxApp
}{wxapp
}.
549 \wxheading{Include files
}
553 \membersection{::wxKill
}\label{wxkill
}
555 \func{int
}{wxKill
}{\param{long
}{ pid
},
\param{int
}{ sig = wxSIGTERM
},
\param{wxKillError
}{*rc = NULL
}}
557 Equivalent to the Unix kill function: send the given signal
{\it sig
} to the
558 process with PID
{\it pid
}. The valid signal values are
563 wxSIGNONE =
0, // verify if the process exists under Unix
572 wxSIGKILL, // forcefully kill, dangerous!
578 wxSIGTERM // terminate the process gently
582 {\tt wxSIGNONE
},
{\tt wxSIGKILL
} and
{\tt wxSIGTERM
} have the same meaning
583 under both Unix and Windows but all the other signals are equivalent to
584 {\tt wxSIGTERM
} under Windows.
586 Returns
0 on success, -
1 on failure. If
{\it rc
} parameter is not NULL, it will
587 be filled with an element of
{\tt wxKillError
} enum:
592 wxKILL_OK, // no error
593 wxKILL_BAD_SIGNAL, // no such signal
594 wxKILL_ACCESS_DENIED, // permission denied
595 wxKILL_NO_PROCESS, // no such process
596 wxKILL_ERROR // another, unspecified error
602 \helpref{wxProcess::Kill
}{wxprocesskill
},
\rtfsp
603 \helpref{wxProcess::Exists
}{wxprocessexists
},
\rtfsp
604 \helpref{Exec sample
}{sampleexec
}
606 \wxheading{Include files
}
610 \membersection{::wxGetProcessId
}\label{wxgetprocessid
}
612 \func{unsigned long
}{wxGetProcessId
}{\void}
614 Returns the number uniquely identifying the current process in the system.
616 If an error occurs, $
0$ is returned.
618 \wxheading{Include files
}
622 \membersection{::wxShell
}\label{wxshell
}
624 \func{bool
}{wxShell
}{\param{const wxString\&
}{command = NULL
}}
626 Executes a command in an interactive shell window. If no command is
627 specified, then just the shell is spawned.
629 See also
\helpref{wxExecute
}{wxexecute
},
\helpref{Exec sample
}{sampleexec
}.
631 \wxheading{Include files
}
635 \membersection{::wxShutdown
}\label{wxshutdown
}
637 \func{bool
}{wxShutdown
}{\param{wxShutdownFlags
}{flags
}}
639 This function shuts down or reboots the computer depending on the value of the
640 {\it flags
}. Please notice that doing this requires the corresponding access
641 rights (superuser under Unix,
{\tt SE
\_SHUTDOWN} privelege under Windows NT)
642 and that this function is only implemented under Unix and Win32.
644 \wxheading{Parameters
}
646 \docparam{flags
}{Either
{\tt wxSHUTDOWN
\_POWEROFF} or
{\tt wxSHUTDOWN
\_REBOOT}}
650 {\tt TRUE
} on success,
{\tt FALSE
} if an error occured.
652 \wxheading{Include files
}
656 \section{Thread functions
}\label{threadfunctions
}
658 \wxheading{Include files
}
664 \helpref{wxThread
}{wxthread
},
\helpref{wxMutex
}{wxmutex
},
\helpref{Multithreading overview
}{wxthreadoverview
}
666 \membersection{::wxMutexGuiEnter
}\label{wxmutexguienter
}
668 \func{void
}{wxMutexGuiEnter
}{\void}
670 This function must be called when any thread other than the main GUI thread
671 wants to get access to the GUI library. This function will block the execution
672 of the calling thread until the main thread (or any other thread holding the
673 main GUI lock) leaves the GUI library and no other thread will enter the GUI
674 library until the calling thread calls
\helpref{::wxMutexGuiLeave()
}{wxmutexguileave
}.
676 Typically, these functions are used like this:
679 void MyThread::Foo(void)
681 // before doing any GUI calls we must ensure that this thread is the only
687 my_window->DrawSomething();
693 Note that under GTK, no creation of top-level windows is allowed in any
694 thread but the main one.
696 This function is only defined on platforms which support preemptive
699 \membersection{::wxMutexGuiLeave
}\label{wxmutexguileave
}
701 \func{void
}{wxMutexGuiLeave
}{\void}
703 See
\helpref{::wxMutexGuiEnter()
}{wxmutexguienter
}.
705 This function is only defined on platforms which support preemptive
708 \section{File functions
}\label{filefunctions
}
710 \wxheading{Include files
}
716 \helpref{wxPathList
}{wxpathlist
}\\
717 \helpref{wxDir
}{wxdir
}\\
718 \helpref{wxFile
}{wxfile
}\\
719 \helpref{wxFileName
}{wxfilename
}
721 \membersection{::wxDirExists
}\label{functionwxdirexists
}
723 \func{bool
}{wxDirExists
}{\param{const wxString\&
}{dirname
}}
725 Returns TRUE if the directory exists.
727 \membersection{::wxDos2UnixFilename
}\label{wxdos2unixfilename
}
729 \func{void
}{wxDos2UnixFilename
}{\param{wxChar *
}{s
}}
731 Converts a DOS to a Unix filename by replacing backslashes with forward
734 \membersection{::wxFileExists
}\label{functionwxfileexists
}
736 \func{bool
}{wxFileExists
}{\param{const wxString\&
}{filename
}}
738 Returns TRUE if the file exists. It also returns TRUE if the file is
741 \membersection{::wxFileModificationTime
}\label{wxfilemodificationtime
}
743 \func{time
\_t}{wxFileModificationTime
}{\param{const wxString\&
}{filename
}}
745 Returns time of last modification of given file.
747 \membersection{::wxFileNameFromPath
}\label{wxfilenamefrompath
}
749 \func{wxString
}{wxFileNameFromPath
}{\param{const wxString\&
}{path
}}
751 \func{char *
}{wxFileNameFromPath
}{\param{char *
}{path
}}
753 {\bf NB:
} This function is obsolete, please use
754 \helpref{wxFileName::SplitPath
}{wxfilenamesplitpath
} instead.
756 Returns the filename for a full path. The second form returns a pointer to
757 temporary storage that should not be deallocated.
759 \membersection{::wxFindFirstFile
}\label{wxfindfirstfile
}
761 \func{wxString
}{wxFindFirstFile
}{\param{const char *
}{spec
},
\param{int
}{ flags =
0}}
763 This function does directory searching; returns the first file
764 that matches the path
{\it spec
}, or the empty string. Use
\helpref{wxFindNextFile
}{wxfindnextfile
} to
765 get the next matching file. Neither will
report the current directory "." or the
766 parent directory "..".
768 {\it spec
} may contain wildcards.
770 {\it flags
} may be wxDIR for restricting the query to directories, wxFILE for files or zero for either.
775 wxString f = wxFindFirstFile("/home/project/*.*");
776 while ( !f.IsEmpty() )
779 f = wxFindNextFile();
783 \membersection{::wxFindNextFile
}\label{wxfindnextfile
}
785 \func{wxString
}{wxFindNextFile
}{\void}
787 Returns the next file that matches the path passed to
\helpref{wxFindFirstFile
}{wxfindfirstfile
}.
789 See
\helpref{wxFindFirstFile
}{wxfindfirstfile
} for an example.
791 \membersection{::wxGetDiskSpace
}\label{wxgetdiskspace
}
793 \func{bool
}{wxGetDiskSpace
}{\param{const wxString\&
}{path
},
\param{wxLongLong
}{*total = NULL
},
\param{wxLongLong
}{*free = NULL
}}
795 This function returns the total number of bytes and number of free bytes on
796 the disk containing the directory
{\it path
} (it should exist). Both
797 {\it total
} and
{\it free
} parameters may be
{\tt NULL
} if the corresponding
798 information is not needed.
802 {\tt TRUE
} on success,
{\tt FALSE
} if an error occured (for example, the
803 directory doesn't exist).
805 \wxheading{Portability
}
807 This function is implemented for Win16 (only for drives less than
2Gb), Win32,
808 Mac OS and generic Unix provided the system has
{\tt statfs()
} function.
810 This function first appeared in wxWindows
2.3.2.
812 \membersection{::wxGetOSDirectory
}\label{wxgetosdirectory
}
814 \func{wxString
}{wxGetOSDirectory
}{\void}
816 Returns the Windows directory under Windows; on other platforms returns the empty string.
818 \membersection{::wxIsAbsolutePath
}\label{wxisabsolutepath
}
820 \func{bool
}{wxIsAbsolutePath
}{\param{const wxString\&
}{filename
}}
822 Returns TRUE if the argument is an absolute filename, i.e. with a slash
823 or drive name at the beginning.
825 \membersection{::wxPathOnly
}\label{wxpathonly
}
827 \func{wxString
}{wxPathOnly
}{\param{const wxString\&
}{path
}}
829 Returns the directory part of the filename.
831 \membersection{::wxUnix2DosFilename
}\label{wxunix2dosfilename
}
833 \func{void
}{wxUnix2DosFilename
}{\param{const wxString\&
}{s
}}
835 Converts a Unix to a DOS filename by replacing forward
836 slashes with backslashes.
838 \membersection{::wxConcatFiles
}\label{wxconcatfiles
}
840 \func{bool
}{wxConcatFiles
}{\param{const wxString\&
}{file1
},
\param{const wxString\&
}{file2
},
841 \param{const wxString\&
}{file3
}}
843 Concatenates
{\it file1
} and
{\it file2
} to
{\it file3
}, returning
846 \membersection{::wxCopyFile
}\label{wxcopyfile
}
848 \func{bool
}{wxCopyFile
}{\param{const wxString\&
}{file1
},
\param{const wxString\&
}{file2
},
\param{bool
}{overwrite = TRUE
}}
850 Copies
{\it file1
} to
{\it file2
}, returning TRUE if successful. If
851 {\it overwrite
} parameter is TRUE (default), the destination file is overwritten
852 if it exists, but if
{\it overwrite
} is FALSE, the functions fails in this
855 \membersection{::wxGetCwd
}\label{wxgetcwd
}
857 \func{wxString
}{wxGetCwd
}{\void}
859 Returns a string containing the current (or working) directory.
861 \membersection{::wxGetWorkingDirectory
}\label{wxgetworkingdirectory
}
863 \func{wxString
}{wxGetWorkingDirectory
}{\param{char *
}{buf=NULL
},
\param{int
}{sz=
1000}}
865 {\bf NB:
} This function is obsolete: use
\helpref{wxGetCwd
}{wxgetcwd
} instead.
867 Copies the current working directory into the buffer if supplied, or
868 copies the working directory into new storage (which you must delete yourself)
869 if the buffer is NULL.
871 {\it sz
} is the size of the buffer if supplied.
873 \membersection{::wxGetTempFileName
}\label{wxgettempfilename
}
875 \func{char *
}{wxGetTempFileName
}{\param{const wxString\&
}{prefix
},
\param{char *
}{buf=NULL
}}
877 \func{bool
}{wxGetTempFileName
}{\param{const wxString\&
}{prefix
},
\param{wxString\&
}{buf
}}
879 %% Makes a temporary filename based on {\it prefix}, opens and closes the file,
880 %% and places the name in {\it buf}. If {\it buf} is NULL, new store
881 %% is allocated for the temporary filename using {\it new}.
883 %% Under Windows, the filename will include the drive and name of the
884 %% directory allocated for temporary files (usually the contents of the
885 %% TEMP variable). Under Unix, the {\tt /tmp} directory is used.
887 %% It is the application's responsibility to create and delete the file.
889 {\bf NB:
} These functions are obsolete, please use
\rtfsp
890 \helpref{wxFileName::CreateTempFileName
}{wxfilenamecreatetempfilename
}\rtfsp
893 \membersection{::wxIsWild
}\label{wxiswild
}
895 \func{bool
}{wxIsWild
}{\param{const wxString\&
}{pattern
}}
897 Returns TRUE if the pattern contains wildcards. See
\helpref{wxMatchWild
}{wxmatchwild
}.
899 \membersection{::wxMatchWild
}\label{wxmatchwild
}
901 \func{bool
}{wxMatchWild
}{\param{const wxString\&
}{pattern
},
\param{const wxString\&
}{text
},
\param{bool
}{ dot
\_special}}
903 Returns TRUE if the
{\it pattern
}\/ matches the
{\it text
}\/; if
{\it
904 dot
\_special}\/ is TRUE, filenames beginning with a dot are not matched
905 with wildcard characters. See
\helpref{wxIsWild
}{wxiswild
}.
907 \membersection{::wxMkdir
}\label{wxmkdir
}
909 \func{bool
}{wxMkdir
}{\param{const wxString\&
}{dir
},
\param{int
}{perm =
0777}}
911 Makes the directory
{\it dir
}, returning TRUE if successful.
913 {\it perm
} is the access mask for the directory for the systems on which it is
914 supported (Unix) and doesn't have effect for the other ones.
916 \membersection{::wxRemoveFile
}\label{wxremovefile
}
918 \func{bool
}{wxRemoveFile
}{\param{const wxString\&
}{file
}}
920 Removes
{\it file
}, returning TRUE if successful.
922 \membersection{::wxRenameFile
}\label{wxrenamefile
}
924 \func{bool
}{wxRenameFile
}{\param{const wxString\&
}{file1
},
\param{const wxString\&
}{file2
}}
926 Renames
{\it file1
} to
{\it file2
}, returning TRUE if successful.
928 \membersection{::wxRmdir
}\label{wxrmdir
}
930 \func{bool
}{wxRmdir
}{\param{const wxString\&
}{dir
},
\param{int
}{ flags=
0}}
932 Removes the directory
{\it dir
}, returning TRUE if successful. Does not work under VMS.
934 The
{\it flags
} parameter is reserved for future use.
936 \membersection{::wxSetWorkingDirectory
}\label{wxsetworkingdirectory
}
938 \func{bool
}{wxSetWorkingDirectory
}{\param{const wxString\&
}{dir
}}
940 Sets the current working directory, returning TRUE if the operation succeeded.
941 Under MS Windows, the current drive is also changed if
{\it dir
} contains a drive specification.
943 \membersection{::wxSplitPath
}\label{wxsplitfunction
}
945 \func{void
}{wxSplitPath
}{\param{const char *
}{ fullname
},
\param{wxString *
}{ path
},
\param{wxString *
}{ name
},
\param{wxString *
}{ ext
}}
947 {\bf NB:
} This function is obsolete, please use
948 \helpref{wxFileName::SplitPath
}{wxfilenamesplitpath
} instead.
950 This function splits a full file name into components: the path (including possible disk/drive
951 specification under Windows), the base name and the extension. Any of the output parameters
952 (
{\it path
},
{\it name
} or
{\it ext
}) may be NULL if you are not interested in the value of
953 a particular component.
955 wxSplitPath() will correctly handle filenames with both DOS and Unix path separators under
956 Windows, however it will not consider backslashes as path separators under Unix (where backslash
957 is a valid character in a filename).
959 On entry,
{\it fullname
} should be non-NULL (it may be empty though).
961 On return,
{\it path
} contains the file path (without the trailing separator),
{\it name
}
962 contains the file name and
{\it ext
} contains the file extension without leading dot. All
963 three of them may be empty if the corresponding component is. The old contents of the
964 strings pointed to by these parameters will be overwritten in any case (if the pointers
967 \membersection{::wxTransferFileToStream
}\label{wxtransferfiletostream
}
969 \func{bool
}{wxTransferFileToStream
}{\param{const wxString\&
}{filename
},
\param{ostream\&
}{stream
}}
971 Copies the given file to
{\it stream
}. Useful when converting an old application to
972 use streams (within the
document/view framework, for example).
974 \wxheading{Include files
}
978 \membersection{::wxTransferStreamToFile
}\label{wxtransferstreamtofile
}
980 \func{bool
}{wxTransferStreamToFile
}{\param{istream\&
}{stream
} \param{const wxString\&
}{filename
}}
982 Copies the given stream to the file
{\it filename
}. Useful when converting an old application to
983 use streams (within the
document/view framework, for example).
985 \wxheading{Include files
}
989 \section{Network, user and OS functions
}\label{networkfunctions
}
991 The functions in this section are used to retrieve information about the
992 current computer and/or user characteristics.
994 \membersection{::wxGetFreeMemory
}\label{wxgetfreememory
}
996 \func{long
}{wxGetFreeMemory
}{\void}
998 Returns the amount of free memory in bytes under environments which
999 support it, and -
1 if not supported. Currently, it is supported only
1000 under Windows, Linux and Solaris.
1002 \wxheading{Include files
}
1006 \membersection{::wxGetFullHostName
}\label{wxgetfullhostname
}
1008 \func{wxString
}{wxGetFullHostName
}{\void}
1010 Returns the FQDN (fully qualified domain host name) or an empty string on
1013 \wxheading{See also
}
1015 \helpref{wxGetHostName
}{wxgethostname
}
1017 \wxheading{Include files
}
1021 \membersection{::wxGetEmailAddress
}\label{wxgetemailaddress
}
1023 \func{bool
}{wxGetEmailAddress
}{\param{const wxString\&
}{buf
},
\param{int
}{sz
}}
1025 Copies the user's email address into the supplied buffer, by
1026 concatenating the values returned by
\helpref{wxGetFullHostName
}{wxgetfullhostname
}\rtfsp
1027 and
\helpref{wxGetUserId
}{wxgetuserid
}.
1029 Returns TRUE if successful, FALSE otherwise.
1031 \wxheading{Include files
}
1035 \membersection{::wxGetHomeDir
}\label{wxgethomedir
}
1037 \func{wxString
}{wxGetHomeDir
}{\void}
1039 Return the (current) user's home directory.
1041 \wxheading{See also
}
1043 \helpref{wxGetUserHome
}{wxgetuserhome
}
1045 \wxheading{Include files
}
1049 \membersection{::wxGetHostName
}\label{wxgethostname
}
1051 \func{wxString
}{wxGetHostName
}{\void}
1053 \func{bool
}{wxGetHostName
}{\param{char *
}{buf
},
\param{int
}{sz
}}
1055 Copies the current host machine's name into the supplied buffer. Please note
1056 that the returned name is
{\it not
} fully qualified, i.e. it does not include
1059 Under Windows or NT, this function first looks in the environment
1060 variable SYSTEM
\_NAME; if this is not found, the entry
{\bf HostName
}\rtfsp
1061 in the
{\bf wxWindows
} section of the WIN.INI file is tried.
1063 The first variant of this function returns the hostname if successful or an
1064 empty string otherwise. The second (deprecated) function returns TRUE
1065 if successful, FALSE otherwise.
1067 \wxheading{See also
}
1069 \helpref{wxGetFullHostName
}{wxgetfullhostname
}
1071 \wxheading{Include files
}
1075 \membersection{::wxGetUserId
}\label{wxgetuserid
}
1077 \func{wxString
}{wxGetUserId
}{\void}
1079 \func{bool
}{wxGetUserId
}{\param{char *
}{buf
},
\param{int
}{sz
}}
1081 This function returns the "user id" also known as "login name" under Unix i.e.
1082 something like "jsmith". It uniquely identifies the current user (on this system).
1084 Under Windows or NT, this function first looks in the environment
1085 variables USER and LOGNAME; if neither of these is found, the entry
{\bf UserId
}\rtfsp
1086 in the
{\bf wxWindows
} section of the WIN.INI file is tried.
1088 The first variant of this function returns the login name if successful or an
1089 empty string otherwise. The second (deprecated) function returns TRUE
1090 if successful, FALSE otherwise.
1092 \wxheading{See also
}
1094 \helpref{wxGetUserName
}{wxgetusername
}
1096 \wxheading{Include files
}
1100 \membersection{::wxGetOsDescription
}\label{wxgetosdescription
}
1102 \func{wxString
}{wxGetOsDescription
}{\void}
1104 Returns the string containing the description of the current platform in a
1105 user-readable form. For example, this function may return strings like
1106 {\tt Windows NT Version
4.0} or
{\tt Linux
2.2.2 i386
}.
1108 \wxheading{See also
}
1110 \helpref{::wxGetOsVersion
}{wxgetosversion
}
1112 \wxheading{Include files
}
1116 \membersection{::wxGetOsVersion
}\label{wxgetosversion
}
1118 \func{int
}{wxGetOsVersion
}{\param{int *
}{major = NULL
},
\param{int *
}{minor = NULL
}}
1120 Gets operating system version information.
1122 \begin{twocollist
}\itemsep=
0pt
1123 \twocolitemruled{Platform
}{Return types
}
1124 \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.
}
1125 \twocolitem{GTK
}{Return value is wxGTK, For GTK
1.0,
{\it major
} is
1,
{\it minor
} is
0.
}
1126 \twocolitem{Motif
}{Return value is wxMOTIF
\_X,
{\it major
} is X version,
{\it minor
} is X revision.
}
1127 \twocolitem{OS/
2}{Return value is wxOS2
\_PM.
}
1128 \twocolitem{Windows
3.1}{Return value is wxWINDOWS,
{\it major
} is
3,
{\it minor
} is
1.
}
1129 \twocolitem{Windows NT/
2000}{Return value is wxWINDOWS
\_NT, version is returned in
{\it major
} and
{\it minor
}}
1130 \twocolitem{Windows
98}{Return value is wxWIN95,
{\it major
} is
4,
{\it minor
} is
1 or greater.
}
1131 \twocolitem{Windows
95}{Return value is wxWIN95,
{\it major
} is
4,
{\it minor
} is
0.
}
1132 \twocolitem{Win32s (Windows
3.1)
}{Return value is wxWIN32S,
{\it major
} is
3,
{\it minor
} is
1.
}
1133 \twocolitem{Watcom C++
386 supervisor mode (Windows
3.1)
}{Return value is wxWIN386,
{\it major
} is
3,
{\it minor
} is
1.
}
1136 \wxheading{See also
}
1138 \helpref{::wxGetOsDescription
}{wxgetosdescription
}
1140 \wxheading{Include files
}
1144 \membersection{::wxGetUserHome
}\label{wxgetuserhome
}
1146 \func{const wxChar *
}{wxGetUserHome
}{\param{const wxString\&
}{user = ""
}}
1148 Returns the home directory for the given user. If the username is empty
1149 (default value), this function behaves like
1150 \helpref{wxGetHomeDir
}{wxgethomedir
}.
1152 \wxheading{Include files
}
1156 \membersection{::wxGetUserName
}\label{wxgetusername
}
1158 \func{wxString
}{wxGetUserName
}{\void}
1160 \func{bool
}{wxGetUserName
}{\param{char *
}{buf
},
\param{int
}{sz
}}
1162 This function returns the full user name (something like "Mr. John Smith").
1164 Under Windows or NT, this function looks for the entry
{\bf UserName
}\rtfsp
1165 in the
{\bf wxWindows
} section of the WIN.INI file. If PenWindows
1166 is running, the entry
{\bf Current
} in the section
{\bf User
} of
1167 the PENWIN.INI file is used.
1169 The first variant of this function returns the user name if successful or an
1170 empty string otherwise. The second (deprecated) function returns
{\tt TRUE
}
1171 if successful,
{\tt FALSE
} otherwise.
1173 \wxheading{See also
}
1175 \helpref{wxGetUserId
}{wxgetuserid
}
1177 \wxheading{Include files
}
1181 \section{String functions
}
1183 \membersection{::copystring
}\label{copystring
}
1185 \func{char *
}{copystring
}{\param{const char *
}{s
}}
1187 Makes a copy of the string
{\it s
} using the C++ new operator, so it can be
1188 deleted with the
{\it delete
} operator.
1190 This function is deprecated, use
\helpref{wxString
}{wxstring
} class instead.
1192 \membersection{::wxIsEmpty
}\label{wxisempty
}
1194 \func{bool
}{wxIsEmpty
}{\param{const char *
}{ p
}}
1196 Returns
{\tt TRUE
} if the pointer is either
{\tt NULL
} or points to an empty
1197 string,
{\tt FALSE
} otherwise.
1199 \membersection{::wxStricmp
}\label{wxstricmp
}
1201 \func{int
}{wxStricmp
}{\param{const char *
}{p1
},
\param{const char *
}{p2
}}
1203 Returns a negative value,
0, or positive value if
{\it p1
} is less than, equal
1204 to or greater than
{\it p2
}. The comparison is case-insensitive.
1206 This function complements the standard C function
{\it strcmp()
} which performs
1207 case-sensitive comparison.
1209 \membersection{::wxStringMatch
}\label{wxstringmatch
}
1211 \func{bool
}{wxStringMatch
}{\param{const wxString\&
}{s1
},
\param{const wxString\&
}{s2
},\\
1212 \param{bool
}{ subString = TRUE
},
\param{bool
}{ exact = FALSE
}}
1214 {\bf NB:
} This function is obsolete, use
\helpref{wxString::Find
}{wxstringfind
} instead.
1216 Returns
{\tt TRUE
} if the substring
{\it s1
} is found within
{\it s2
},
1217 ignoring case if
{\it exact
} is FALSE. If
{\it subString
} is
{\tt FALSE
},
1218 no substring matching is done.
1220 \membersection{::wxStringEq
}\label{wxstringeq
}
1222 \func{bool
}{wxStringEq
}{\param{const wxString\&
}{s1
},
\param{const wxString\&
}{s2
}}
1224 {\bf NB:
} This function is obsolete, use
\helpref{wxString
}{wxstring
} instead.
1229 #define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) ==
0))
1232 \membersection{::wxStrlen
}\label{wxstrlen
}
1234 \func{size
\_t}{wxStrlen
}{\param{const char *
}{ p
}}
1236 This is a safe version of standard function
{\it strlen()
}: it does exactly the
1237 same thing (i.e. returns the length of the string) except that it returns
0 if
1238 {\it p
} is the
{\tt NULL
} pointer.
1240 \membersection{::wxGetTranslation
}\label{wxgettranslation
}
1242 \func{const char *
}{wxGetTranslation
}{\param{const char *
}{str
}}
1244 This function returns the translation of string
{\it str
} in the current
1245 \helpref{locale
}{wxlocale
}. If the string is not found in any of the loaded
1246 message catalogs (see
\helpref{internationalization overview
}{internationalization
}), the
1247 original string is returned. In debug build, an error message is logged - this
1248 should help to find the strings which were not yet translated. As this function
1249 is used very often, an alternative syntax is provided: the
\_() macro is
1250 defined as wxGetTranslation().
1252 \membersection{::wxSnprintf
}\label{wxsnprintf
}
1254 \func{int
}{wxSnprintf
}{\param{wxChar *
}{buf
},
\param{size
\_t }{len
},
\param{const wxChar *
}{format
},
\param{}{...
}}
1256 This function replaces the dangerous standard function
{\tt sprintf()
} and is
1257 like
{\tt snprintf()
} available on some platforms. The only difference with
1258 sprintf() is that an additional argument - buffer size - is taken and the
1259 buffer is never overflowed.
1261 Returns the number of characters copied to the buffer or -
1 if there is not
1264 \wxheading{See also
}
1266 \helpref{wxVsnprintf
}{wxvsnprintf
},
\helpref{wxString::Printf
}{wxstringprintf
}
1268 \membersection{::wxToLower
}\label{wxtolower
}
1270 \func{char
}{wxToLower
}{\param{char
}{ch
}}
1272 Converts the character to lower case. This is implemented as a macro for efficiency.
1274 \wxheading{Include files
}
1278 \membersection{::wxToUpper
}\label{wxtoupper
}
1280 \func{char
}{wxToUpper
}{\param{char
}{ch
}}
1282 Converts the character to upper case. This is implemented as a macro for efficiency.
1284 \wxheading{Include files
}
1288 \membersection{::wxVsnprintf
}\label{wxvsnprintf
}
1290 \func{int
}{wxVsnprintf
}{\param{wxChar *
}{buf
},
\param{size
\_t }{len
},
\param{const wxChar *
}{format
},
\param{va
\_list }{argPtr
}}
1292 The same as
\helpref{wxSnprintf
}{wxsnprintf
} but takes a
{\tt va
\_list }
1293 argument instead of arbitrary number of parameters.
1295 \wxheading{See also
}
1297 \helpref{wxSnprintf
}{wxsnprintf
},
\helpref{wxString::PrintfV
}{wxstringprintfv
}
1299 \section{Dialog functions
}\label{dialogfunctions
}
1301 Below are a number of convenience functions for getting input from the
1302 user or displaying messages. Note that in these functions the last three
1303 parameters are optional. However, it is recommended to pass a parent frame
1304 parameter, or (in MS Windows or Motif) the wrong window frame may be brought to
1305 the front when the dialog box is popped up.
1307 \membersection{::wxBeginBusyCursor
}\label{wxbeginbusycursor
}
1309 \func{void
}{wxBeginBusyCursor
}{\param{wxCursor *
}{cursor = wxHOURGLASS
\_CURSOR}}
1311 Changes the cursor to the given cursor for all windows in the application.
1312 Use
\helpref{wxEndBusyCursor
}{wxendbusycursor
} to revert the cursor back
1313 to its previous state. These two calls can be nested, and a counter
1314 ensures that only the outer calls take effect.
1316 See also
\helpref{wxIsBusy
}{wxisbusy
},
\helpref{wxBusyCursor
}{wxbusycursor
}.
1318 \wxheading{Include files
}
1322 \membersection{::wxBell
}\label{wxbell
}
1324 \func{void
}{wxBell
}{\void}
1326 Ring the system bell.
1328 \wxheading{Include files
}
1332 \membersection{::wxCreateFileTipProvider
}\label{wxcreatefiletipprovider
}
1334 \func{wxTipProvider *
}{wxCreateFileTipProvider
}{\param{const wxString\&
}{filename
},
1335 \param{size
\_t }{currentTip
}}
1337 This function creates a
\helpref{wxTipProvider
}{wxtipprovider
} which may be
1338 used with
\helpref{wxShowTip
}{wxshowtip
}.
1340 \docparam{filename
}{The name of the file containing the tips, one per line
}
1341 \docparam{currentTip
}{The index of the first tip to show - normally this index
1342 is remembered between the
2 program runs.
}
1344 \wxheading{See also
}
1346 \helpref{Tips overview
}{tipsoverview
}
1348 \wxheading{Include files
}
1352 \membersection{::wxDirSelector
}\label{wxdirselector
}
1354 \func{wxString
}{wxDirSelector
}{\param{const wxString\&
}{message = wxDirSelectorPromptStr
},\\
1355 \param{const wxString\&
}{default
\_path = ""
},\\
1356 \param{long
}{style =
0},
\param{const wxPoint\&
}{pos = wxDefaultPosition
},\\
1357 \param{wxWindow *
}{parent = NULL
}}
1359 Pops up a directory selector dialog. The arguments have the same meaning as
1360 those of wxDirDialog::wxDirDialog(). The message is displayed at the top,
1361 and the default
\_path, if specified, is set as the initial selection.
1363 The application must check for an empty return value (if the user pressed
1364 Cancel). For example:
1367 const wxString& dir = wxDirSelector("Choose a folder");
1374 \wxheading{Include files
}
1378 \membersection{::wxFileSelector
}\label{wxfileselector
}
1380 \func{wxString
}{wxFileSelector
}{\param{const wxString\&
}{message
},
\param{const wxString\&
}{default
\_path = ""
},\\
1381 \param{const wxString\&
}{default
\_filename = ""
},
\param{const wxString\&
}{default
\_extension = ""
},\\
1382 \param{const wxString\&
}{wildcard = ``*.*''
},
\param{int
}{flags =
0},
\param{wxWindow *
}{parent = ""
},\\
1383 \param{int
}{ x = -
1},
\param{int
}{ y = -
1}}
1385 Pops up a file selector box. In Windows, this is the common file selector
1386 dialog. In X, this is a file selector box with the same functionality.
1387 The path and filename are distinct elements of a full file pathname.
1388 If path is empty, the current directory will be used. If filename is empty,
1389 no default filename will be supplied. The wildcard determines what files
1390 are displayed in the file selector, and file extension supplies a type
1391 extension for the required filename. Flags may be a combination of wxOPEN,
1392 wxSAVE, wxOVERWRITE
\_PROMPT, wxHIDE
\_READONLY, wxFILE
\_MUST\_EXIST, wxMULTIPLE or
0.
1394 Both the Unix and Windows versions implement a wildcard filter. Typing a
1395 filename containing wildcards
(*, ?) in the filename text item, and
1396 clicking on Ok, will result in only those files matching the pattern being
1399 The wildcard may be a specification for multiple types of file
1400 with a description for each, such as:
1403 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
1406 The application must check for an empty return value (the user pressed
1407 Cancel). For example:
1410 wxString filename = wxFileSelector("Choose a file to open");
1411 if ( !filename.empty() )
1413 // work with the file
1416 //else: cancelled by user
1419 \wxheading{Include files}
1423 \membersection{::wxEndBusyCursor}\label{wxendbusycursor}
1425 \func{void}{wxEndBusyCursor}{\void}
1427 Changes the cursor back to the original cursor, for all windows in the application.
1428 Use with \helpref{wxBeginBusyCursor}{wxbeginbusycursor}.
1430 See also \helpref{wxIsBusy}{wxisbusy}, \helpref{wxBusyCursor}{wxbusycursor}.
1432 \wxheading{Include files}
1436 \membersection{::wxGetColourFromUser}\label{wxgetcolourfromuser}
1438 \func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}}
1440 Shows the colour selection dialog and returns the colour selected by user or
1441 invalid colour (use \helpref{wxColour::Ok}{wxcolourok} to test whether a colour
1442 is valid) if the dialog was cancelled.
1444 \wxheading{Parameters}
1446 \docparam{parent}{The parent window for the colour selection dialog}
1448 \docparam{colInit}{If given, this will be the colour initially selected in the dialog.}
1450 \wxheading{Include files}
1454 \membersection{::wxGetFontFromUser}\label{wxgetfontfromuser}
1456 \func{wxFont}{wxGetFontFromUser}{\param{wxWindow *}{parent}, \param{const wxFont\& }{fontInit}}
1458 Shows the font selection dialog and returns the font selected by user or
1459 invalid font (use \helpref{wxFont::Ok}{wxfontok} to test whether a font
1460 is valid) if the dialog was cancelled.
1462 \wxheading{Parameters}
1464 \docparam{parent}{The parent window for the font selection dialog}
1466 \docparam{fontInit}{If given, this will be the font initially selected in the dialog.}
1468 \wxheading{Include files}
1473 \membersection{::wxGetMultipleChoices}\label{wxgetmultiplechoices}
1475 \func{size\_t}{wxGetMultipleChoices}{\\
1476 \param{wxArrayInt\& }{selections},\\
1477 \param{const wxString\& }{message},\\
1478 \param{const wxString\& }{caption},\\
1479 \param{const wxArrayString\& }{aChoices},\\
1480 \param{wxWindow *}{parent = NULL},\\
1481 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1482 \param{bool}{ centre = TRUE},\\
1483 \param{int }{width=150}, \param{int }{height=200}}
1485 \func{size\_t}{wxGetMultipleChoices}{\\
1486 \param{wxArrayInt\& }{selections},\\
1487 \param{const wxString\& }{message},\\
1488 \param{const wxString\& }{caption},\\
1489 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1490 \param{wxWindow *}{parent = NULL},\\
1491 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1492 \param{bool}{ centre = TRUE},\\
1493 \param{int }{width=150}, \param{int }{height=200}}
1495 Pops up a dialog box containing a message, OK/Cancel buttons and a
1496 multiple-selection listbox. The user may choose an arbitrary (including 0)
1497 number of items in the listbox whose indices will be returned in
1498 {\it selection} array. The initial contents of this array will be used to
1499 select the items when the dialog is shown.
1501 You may pass the list of strings to choose from either using {\it choices}
1502 which is an array of {\it n} strings for the listbox or by using a single
1503 {\it aChoices} parameter of type \helpref{wxArrayString}{wxarraystring}.
1505 If {\it centre} is TRUE, the message text (which may include new line
1506 characters) is centred; if FALSE, the message is left-justified.
1508 \wxheading{Include files}
1512 \perlnote{In wxPerl there is just an array reference in place of {\tt n}
1513 and {\tt choices}, and no {\tt selections} parameter; the function
1514 returns an array containing the user selections.}
1516 \membersection{::wxGetNumberFromUser}\label{wxgetnumberfromuser}
1518 \func{long}{wxGetNumberFromUser}{
1519 \param{const wxString\& }{message},
1520 \param{const wxString\& }{prompt},
1521 \param{const wxString\& }{caption},
1522 \param{long }{value},
1523 \param{long }{min = 0},
1524 \param{long }{max = 100},
1525 \param{wxWindow *}{parent = NULL},
1526 \param{const wxPoint\& }{pos = wxDefaultPosition}}
1528 Shows a dialog asking the user for numeric input. The dialogs title is set to
1529 {\it caption}, it contains a (possibly) multiline {\it message} above the
1530 single line {\it prompt} and the zone for entering the number.
1532 The number entered must be in the range {\it min}..{\it max} (both of which
1533 should be positive) and {\it value} is the initial value of it. If the user
1534 enters an invalid value or cancels the dialog, the function will return -1.
1536 Dialog is centered on its {\it parent} unless an explicit position is given in
1539 \wxheading{Include files}
1543 \membersection{::wxGetPasswordFromUser}\label{wxgetpasswordfromuser}
1545 \func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
1546 \param{const wxString\& }{default\_value = ``"}, \param{wxWindow *}{parent = NULL}}
1548 Similar to \helpref{wxGetTextFromUser}{wxgettextfromuser} but the text entered
1549 in the dialog is not shown on screen but replaced with stars. This is intended
1550 to be used for entering passwords as the function name implies.
1552 \wxheading{Include files}
1556 \membersection{::wxGetTextFromUser}\label{wxgettextfromuser}
1558 \func{wxString}{wxGetTextFromUser}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Input text"},\\
1559 \param{const wxString\& }{default\_value = ``"}, \param{wxWindow *}{parent = NULL},\\
1560 \param{int}{ x = -1}, \param{int}{ y = -1}, \param{bool}{ centre = TRUE}}
1562 Pop up a dialog box with title set to {\it caption}, {\it message}, and a
1563 \rtfsp{\it default\_value}. The user may type in text and press OK to return this text,
1564 or press Cancel to return the empty string.
1566 If {\it centre} is TRUE, the message text (which may include new line characters)
1567 is centred; if FALSE, the message is left-justified.
1569 \wxheading{Include files}
1573 \membersection{::wxGetMultipleChoice}\label{wxgetmultiplechoice}
1575 \func{int}{wxGetMultipleChoice}{\param{const wxString\& }{message}, \param{const wxString\& }{caption}, \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1576 \param{int }{nsel}, \param{int *}{selection},
1577 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
1578 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
1580 Pops up a dialog box containing a message, OK/Cancel buttons and a multiple-selection
1581 listbox. The user may choose one or more item(s) and press OK or Cancel.
1583 The number of initially selected choices, and array of the selected indices,
1584 are passed in; this array will contain the user selections on exit, with
1585 the function returning the number of selections. {\it selection} must be
1586 as big as the number of choices, in case all are selected.
1588 If Cancel is pressed, -1 is returned.
1590 {\it choices} is an array of {\it n} strings for the listbox.
1592 If {\it centre} is TRUE, the message text (which may include new line characters)
1593 is centred; if FALSE, the message is left-justified.
1595 \wxheading{Include files}
1599 \membersection{::wxGetSingleChoice}\label{wxgetsinglechoice}
1601 \func{wxString}{wxGetSingleChoice}{\param{const wxString\& }{message},\\
1602 \param{const wxString\& }{caption},\\
1603 \param{const wxArrayString\& }{aChoices},\\
1604 \param{wxWindow *}{parent = NULL},\\
1605 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1606 \param{bool}{ centre = TRUE},\\
1607 \param{int }{width=150}, \param{int }{height=200}}
1609 \func{wxString}{wxGetSingleChoice}{\param{const wxString\& }{message},\\
1610 \param{const wxString\& }{caption},\\
1611 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1612 \param{wxWindow *}{parent = NULL},\\
1613 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1614 \param{bool}{ centre = TRUE},\\
1615 \param{int }{width=150}, \param{int }{height=200}}
1617 Pops up a dialog box containing a message, OK/Cancel buttons and a
1618 single-selection listbox. The user may choose an item and press OK to return a
1619 string or Cancel to return the empty string. Use
1620 \helpref{wxGetSingleChoiceIndex}{wxgetsinglechoiceindex} if empty string is a
1621 valid choice and if you want to be able to detect pressing Cancel reliably.
1623 You may pass the list of strings to choose from either using {\it choices}
1624 which is an array of {\it n} strings for the listbox or by using a single
1625 {\it aChoices} parameter of type \helpref{wxArrayString}{wxarraystring}.
1627 If {\it centre} is TRUE, the message text (which may include new line
1628 characters) is centred; if FALSE, the message is left-justified.
1630 \wxheading{Include files}
1634 \perlnote{In wxPerl there is just an array reference in place of {\tt n}
1637 \membersection{::wxGetSingleChoiceIndex}\label{wxgetsinglechoiceindex}
1639 \func{int}{wxGetSingleChoiceIndex}{\param{const wxString\& }{message},\\
1640 \param{const wxString\& }{caption},\\
1641 \param{const wxArrayString\& }{aChoices},\\
1642 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
1643 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
1645 \func{int}{wxGetSingleChoiceIndex}{\param{const wxString\& }{message},\\
1646 \param{const wxString\& }{caption},\\
1647 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1648 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1},\\
1649 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
1651 As {\bf wxGetSingleChoice} but returns the index representing the selected
1652 string. If the user pressed cancel, -1 is returned.
1654 \wxheading{Include files}
1658 \perlnote{In wxPerl there is just an array reference in place of {\tt n}
1661 \membersection{::wxGetSingleChoiceData}\label{wxgetsinglechoicedata}
1663 \func{wxString}{wxGetSingleChoiceData}{\param{const wxString\& }{message},\\
1664 \param{const wxString\& }{caption},\\
1665 \param{const wxArrayString\& }{aChoices},\\
1666 \param{const wxString\& }{client\_data[]},\\
1667 \param{wxWindow *}{parent = NULL},\\
1668 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1669 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
1671 \func{wxString}{wxGetSingleChoiceData}{\param{const wxString\& }{message},\\
1672 \param{const wxString\& }{caption},\\
1673 \param{int}{ n}, \param{const wxString\& }{choices[]},\\
1674 \param{const wxString\& }{client\_data[]},\\
1675 \param{wxWindow *}{parent = NULL},\\
1676 \param{int}{ x = -1}, \param{int}{ y = -1},\\
1677 \param{bool}{ centre = TRUE}, \param{int }{width=150}, \param{int }{height=200}}
1679 As {\bf wxGetSingleChoice} but takes an array of client data pointers
1680 corresponding to the strings, and returns one of these pointers or NULL if
1681 Cancel was pressed. The {\it client\_data} array must have the same number of
1682 elements as {\it choices} or {\it aChoices}!
1684 \wxheading{Include files}
1688 \perlnote{In wxPerl there is just an array reference in place of {\tt n}
1689 and {\tt choices}, and the client data array must have the
1690 same length as the choices array.}
1692 \membersection{::wxIsBusy}\label{wxisbusy}
1694 \func{bool}{wxIsBusy}{\void}
1696 Returns TRUE if between two \helpref{wxBeginBusyCursor}{wxbeginbusycursor} and\rtfsp
1697 \helpref{wxEndBusyCursor}{wxendbusycursor} calls.
1699 See also \helpref{wxBusyCursor}{wxbusycursor}.
1701 \wxheading{Include files}
1705 \membersection{::wxMessageBox}\label{wxmessagebox}
1707 \func{int}{wxMessageBox}{\param{const wxString\& }{message}, \param{const wxString\& }{caption = ``Message"}, \param{int}{ style = wxOK \pipe wxCENTRE},\\
1708 \param{wxWindow *}{parent = NULL}, \param{int}{ x = -1}, \param{int}{ y = -1}}
1710 General purpose message dialog. {\it style} may be a bit list of the
1711 following identifiers:
1713 \begin{twocollist}\itemsep=0pt
1714 \twocolitem{wxYES\_NO}{Puts Yes and No buttons on the message box. May be combined with
1716 \twocolitem{wxCANCEL}{Puts a Cancel button on the message box. May be combined with
1718 \twocolitem{wxOK}{Puts an Ok button on the message box. May be combined with wxCANCEL.}
1719 \twocolitem{wxCENTRE}{Centres the text.}
1720 \twocolitem{wxICON\_EXCLAMATION}{Displays an exclamation mark symbol.}
1721 \twocolitem{wxICON\_HAND}{Displays an error symbol.}
1722 \twocolitem{wxICON\_ERROR}{Displays an error symbol - the same as wxICON\_HAND.}
1723 \twocolitem{wxICON\_QUESTION}{Displays a question mark symbol.}
1724 \twocolitem{wxICON\_INFORMATION}{Displays an information symbol.}
1727 The return value is one of: wxYES, wxNO, wxCANCEL, wxOK.
1733 int answer = wxMessageBox("Quit program?", "Confirm",
1734 wxYES_NO | wxCANCEL, main_frame);
1735 if (answer == wxYES)
1740 {\it message} may contain newline characters, in which case the
1741 message will be split into separate lines, to cater for large messages.
1743 Under Windows, the native MessageBox function is used unless wxCENTRE
1744 is specified in the style, in which case a generic function is used.
1745 This is because the native MessageBox function cannot centre text.
1746 The symbols are not shown when the generic function is used.
1748 \wxheading{Include files}
1752 \membersection{::wxShowTip}\label{wxshowtip}
1754 \func{bool}{wxShowTip}{\param{wxWindow *}{parent},
1755 \param{wxTipProvider *}{tipProvider},
1756 \param{bool }{showAtStartup = TRUE}}
1758 This function shows a "startup tip" to the user. The return value is the
1759 state of the ``Show tips at startup'' checkbox.
1761 \docparam{parent}{The parent window for the modal dialog}
1763 \docparam{tipProvider}{An object which is used to get the text of the tips.
1764 It may be created with the \helpref{wxCreateFileTipProvider}{wxcreatefiletipprovider} function.}
1766 \docparam{showAtStartup}{Should be TRUE if startup tips are shown, FALSE
1767 otherwise. This is used as the initial value for "Show tips at startup"
1768 checkbox which is shown in the tips dialog.}
1770 \wxheading{See also}
1772 \helpref{Tips overview}{tipsoverview}
1774 \wxheading{Include files}
1778 \section{GDI functions}\label{gdifunctions}
1780 The following are relevant to the GDI (Graphics Device Interface).
1782 \wxheading{Include files}
1786 \membersection{wxBITMAP}\label{wxbitmapmacro}
1788 \func{}{wxBITMAP}{bitmapName}
1790 This macro loads a bitmap from either application resources (on the platforms
1791 for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
1792 avoid using {\tt \#ifdef}s when creating bitmaps.
1794 \wxheading{See also}
1796 \helpref{Bitmaps and icons overview}{wxbitmapoverview},
1797 \helpref{wxICON}{wxiconmacro}
1799 \wxheading{Include files}
1803 \membersection{::wxClientDisplayRect}\label{wxclientdisplayrect}
1805 \func{void}{wxClientDisplayRect}{\param{int *}{x}, \param{int *}{y},
1806 \param{int *}{width}, \param{int *}{height}}
1808 \func{wxRect}{wxGetClientDisplayRect}{\void}
1810 Returns the dimensions of the work area on the display. On Windows
1811 this means the area not covered by the taskbar, etc. Other platforms
1812 are currently defaulting to the whole display until a way is found to
1813 provide this info for all window managers, etc.
1815 \membersection{::wxColourDisplay}\label{wxcolourdisplay}
1817 \func{bool}{wxColourDisplay}{\void}
1819 Returns TRUE if the display is colour, FALSE otherwise.
1821 \membersection{::wxDisplayDepth}\label{wxdisplaydepth}
1823 \func{int}{wxDisplayDepth}{\void}
1825 Returns the depth of the display (a value of 1 denotes a monochrome display).
1827 \membersection{::wxDisplaySize}\label{wxdisplaysize}
1829 \func{void}{wxDisplaySize}{\param{int *}{width}, \param{int *}{height}}
1831 \func{wxSize}{wxGetDisplaySize}{\void}
1833 Returns the display size in pixels.
1835 \membersection{::wxDisplaySizeMM}\label{wxdisplaysizemm}
1837 \func{void}{wxDisplaySizeMM}{\param{int *}{width}, \param{int *}{height}}
1839 \func{wxSize}{wxGetDisplaySizeMM}{\void}
1841 Returns the display size in millimeters.
1843 \membersection{::wxDROP\_ICON}\label{wxdropicon}
1845 \func{wxIconOrCursor}{wxDROP\_ICON}{\param{const char *}{name}}
1847 This macro creates either a cursor (MSW) or an icon (elsewhere) with the given
1848 name. Under MSW, the cursor is loaded from the resource file and the icon is
1849 loaded from XPM file under other platforms.
1851 This macro should be used with
1852 \helpref{wxDropSource constructor}{wxdropsourcewxdropsource}.
1854 \wxheading{Include files}
1858 \membersection{wxICON}\label{wxiconmacro}
1860 \func{}{wxICON}{iconName}
1862 This macro loads an icon from either application resources (on the platforms
1863 for which they exist, i.e. Windows and OS2) or from an XPM file. It allows to
1864 avoid using {\tt \#ifdef}s when creating icons.
1866 \wxheading{See also}
1868 \helpref{Bitmaps and icons overview}{wxbitmapoverview},
1869 \helpref{wxBITMAP}{wxbitmapmacro}
1871 \wxheading{Include files}
1875 \membersection{::wxMakeMetafilePlaceable}\label{wxmakemetafileplaceable}
1877 \func{bool}{wxMakeMetafilePlaceable}{\param{const wxString\& }{filename}, \param{int }{minX}, \param{int }{minY},
1878 \param{int }{maxX}, \param{int }{maxY}, \param{float }{scale=1.0}}
1880 Given a filename for an existing, valid metafile (as constructed using \helpref{wxMetafileDC}{wxmetafiledc})
1881 makes it into a placeable metafile by prepending a header containing the given
1882 bounding box. The bounding box may be obtained from a device context after drawing
1883 into it, using the functions wxDC::MinX, wxDC::MinY, wxDC::MaxX and wxDC::MaxY.
1885 In addition to adding the placeable metafile header, this function adds
1886 the equivalent of the following code to the start of the metafile data:
1889 SetMapMode(dc, MM_ANISOTROPIC);
1890 SetWindowOrg(dc, minX, minY);
1891 SetWindowExt(dc, maxX - minX, maxY - minY);
1894 This simulates the wxMM\_TEXT mapping mode, which wxWindows assumes.
1896 Placeable metafiles may be imported by many Windows applications, and can be
1897 used in RTF (Rich Text Format) files.
1899 {\it scale} allows the specification of scale for the metafile.
1901 This function is only available under Windows.
1903 \membersection{::wxSetCursor}\label{wxsetcursor}
1905 \func{void}{wxSetCursor}{\param{wxCursor *}{cursor}}
1907 Globally sets the cursor; only has an effect in Windows and GTK.
1908 See also \helpref{wxCursor}{wxcursor}, \helpref{wxWindow::SetCursor}{wxwindowsetcursor}.
1910 \section{Printer settings}\label{printersettings}
1912 {\bf NB:} These routines are obsolete and should no longer be used!
1914 The following functions are used to control PostScript printing. Under
1915 Windows, PostScript output can only be sent to a file.
1917 \wxheading{Include files}
1921 \membersection{::wxGetPrinterCommand}\label{wxgetprintercommand}
1923 \func{wxString}{wxGetPrinterCommand}{\void}
1925 Gets the printer command used to print a file. The default is {\tt lpr}.
1927 \membersection{::wxGetPrinterFile}\label{wxgetprinterfile}
1929 \func{wxString}{wxGetPrinterFile}{\void}
1931 Gets the PostScript output filename.
1933 \membersection{::wxGetPrinterMode}\label{wxgetprintermode}
1935 \func{int}{wxGetPrinterMode}{\void}
1937 Gets the printing mode controlling where output is sent (PS\_PREVIEW, PS\_FILE or PS\_PRINTER).
1938 The default is PS\_PREVIEW.
1940 \membersection{::wxGetPrinterOptions}\label{wxgetprinteroptions}
1942 \func{wxString}{wxGetPrinterOptions}{\void}
1944 Gets the additional options for the print command (e.g. specific printer). The default is nothing.
1946 \membersection{::wxGetPrinterOrientation}\label{wxgetprinterorientation}
1948 \func{int}{wxGetPrinterOrientation}{\void}
1950 Gets the orientation (PS\_PORTRAIT or PS\_LANDSCAPE). The default is PS\_PORTRAIT.
1952 \membersection{::wxGetPrinterPreviewCommand}\label{wxgetprinterpreviewcommand}
1954 \func{wxString}{wxGetPrinterPreviewCommand}{\void}
1956 Gets the command used to view a PostScript file. The default depends on the platform.
1958 \membersection{::wxGetPrinterScaling}\label{wxgetprinterscaling}
1960 \func{void}{wxGetPrinterScaling}{\param{float *}{x}, \param{float *}{y}}
1962 Gets the scaling factor for PostScript output. The default is 1.0, 1.0.
1964 \membersection{::wxGetPrinterTranslation}\label{wxgetprintertranslation}
1966 \func{void}{wxGetPrinterTranslation}{\param{float *}{x}, \param{float *}{y}}
1968 Gets the translation (from the top left corner) for PostScript output. The default is 0.0, 0.0.
1970 \membersection{::wxSetPrinterCommand}\label{wxsetprintercommand}
1972 \func{void}{wxSetPrinterCommand}{\param{const wxString\& }{command}}
1974 Sets the printer command used to print a file. The default is {\tt lpr}.
1976 \membersection{::wxSetPrinterFile}\label{wxsetprinterfile}
1978 \func{void}{wxSetPrinterFile}{\param{const wxString\& }{filename}}
1980 Sets the PostScript output filename.
1982 \membersection{::wxSetPrinterMode}\label{wxsetprintermode}
1984 \func{void}{wxSetPrinterMode}{\param{int }{mode}}
1986 Sets the printing mode controlling where output is sent (PS\_PREVIEW, PS\_FILE or PS\_PRINTER).
1987 The default is PS\_PREVIEW.
1989 \membersection{::wxSetPrinterOptions}\label{wxsetprinteroptions}
1991 \func{void}{wxSetPrinterOptions}{\param{const wxString\& }{options}}
1993 Sets the additional options for the print command (e.g. specific printer). The default is nothing.
1995 \membersection{::wxSetPrinterOrientation}\label{wxsetprinterorientation}
1997 \func{void}{wxSetPrinterOrientation}{\param{int}{ orientation}}
1999 Sets the orientation (PS\_PORTRAIT or PS\_LANDSCAPE). The default is PS\_PORTRAIT.
2001 \membersection{::wxSetPrinterPreviewCommand}\label{wxsetprinterpreviewcommand}
2003 \func{void}{wxSetPrinterPreviewCommand}{\param{const wxString\& }{command}}
2005 Sets the command used to view a PostScript file. The default depends on the platform.
2007 \membersection{::wxSetPrinterScaling}\label{wxsetprinterscaling}
2009 \func{void}{wxSetPrinterScaling}{\param{float }{x}, \param{float }{y}}
2011 Sets the scaling factor for PostScript output. The default is 1.0, 1.0.
2013 \membersection{::wxSetPrinterTranslation}\label{wxsetprintertranslation}
2015 \func{void}{wxSetPrinterTranslation}{\param{float }{x}, \param{float }{y}}
2017 Sets the translation (from the top left corner) for PostScript output. The default is 0.0, 0.0.
2019 \section{Clipboard functions}\label{clipsboard}
2021 These clipboard functions are implemented for Windows only. The use of these functions
2022 is deprecated and the code is no longer maintained. Use the \helpref{wxClipboard}{wxclipboard}
2025 \wxheading{Include files}
2029 \membersection{::wxClipboardOpen}\label{functionwxclipboardopen}
2031 \func{bool}{wxClipboardOpen}{\void}
2033 Returns TRUE if this application has already opened the clipboard.
2035 \membersection{::wxCloseClipboard}\label{wxcloseclipboard}
2037 \func{bool}{wxCloseClipboard}{\void}
2039 Closes the clipboard to allow other applications to use it.
2041 \membersection{::wxEmptyClipboard}\label{wxemptyclipboard}
2043 \func{bool}{wxEmptyClipboard}{\void}
2045 Empties the clipboard.
2047 \membersection{::wxEnumClipboardFormats}\label{wxenumclipboardformats}
2049 \func{int}{wxEnumClipboardFormats}{\param{int}{dataFormat}}
2051 Enumerates the formats found in a list of available formats that belong
2052 to the clipboard. Each call to this function specifies a known
2053 available format; the function returns the format that appears next in
2056 {\it dataFormat} specifies a known format. If this parameter is zero,
2057 the function returns the first format in the list.
2059 The return value specifies the next known clipboard data format if the
2060 function is successful. It is zero if the {\it dataFormat} parameter specifies
2061 the last format in the list of available formats, or if the clipboard
2064 Before it enumerates the formats function, an application must open the clipboard by using the
2065 wxOpenClipboard function.
2067 \membersection{::wxGetClipboardData}\label{wxgetclipboarddata}
2069 \func{wxObject *}{wxGetClipboardData}{\param{int}{dataFormat}}
2071 Gets data from the clipboard.
2073 {\it dataFormat} may be one of:
2075 \begin{itemize}\itemsep=0pt
2076 \item wxCF\_TEXT or wxCF\_OEMTEXT: returns a pointer to new memory containing a null-terminated text string.
2077 \item wxCF\_BITMAP: returns a new wxBitmap.
2080 The clipboard must have previously been opened for this call to succeed.
2082 \membersection{::wxGetClipboardFormatName}\label{wxgetclipboardformatname}
2084 \func{bool}{wxGetClipboardFormatName}{\param{int}{dataFormat}, \param{const wxString\& }{formatName}, \param{int}{maxCount}}
2086 Gets the name of a registered clipboard format, and puts it into the buffer {\it formatName} which is of maximum
2087 length {\it maxCount}. {\it dataFormat} must not specify a predefined clipboard format.
2089 \membersection{::wxIsClipboardFormatAvailable}\label{wxisclipboardformatavailable}
2091 \func{bool}{wxIsClipboardFormatAvailable}{\param{int}{dataFormat}}
2093 Returns TRUE if the given data format is available on the clipboard.
2095 \membersection{::wxOpenClipboard}\label{wxopenclipboard}
2097 \func{bool}{wxOpenClipboard}{\void}
2099 Opens the clipboard for passing data to it or getting data from it.
2101 \membersection{::wxRegisterClipboardFormat}\label{wxregisterclipboardformat}
2103 \func{int}{wxRegisterClipboardFormat}{\param{const wxString\& }{formatName}}
2105 Registers the clipboard data format name and returns an identifier.
2107 \membersection{::wxSetClipboardData}\label{wxsetclipboarddata}
2109 \func{bool}{wxSetClipboardData}{\param{int}{dataFormat}, \param{wxObject *}{data}, \param{int}{width}, \param{int}{height}}
2111 Passes data to the clipboard.
2113 {\it dataFormat} may be one of:
2115 \begin{itemize}\itemsep=0pt
2116 \item wxCF\_TEXT or wxCF\_OEMTEXT: {\it data} is a null-terminated text string.
2117 \item wxCF\_BITMAP: {\it data} is a wxBitmap.
2118 \item wxCF\_DIB: {\it data} is a wxBitmap. The bitmap is converted to a DIB (device independent bitmap).
2119 \item wxCF\_METAFILE: {\it data} is a wxMetafile. {\it width} and {\it height} are used to give recommended dimensions.
2122 The clipboard must have previously been opened for this call to succeed.
2124 \section{Miscellaneous functions}\label{miscellany}
2126 \membersection{wxEXPLICIT}\label{wxexplicit}
2128 {\tt wxEXPLICIT} is a macro which expands to the C++ {\tt explicit} keyword if
2129 the compiler supports it or nothing otherwise. Thus, it can be used even in the
2130 code which might have to be compiled with an old compiler without support for
2131 this language feature but still take advantage of it when it is available.
2133 \membersection{wxLL}\label{wxll}
2135 \func{wxLongLong\_t}{wxLL}{\param{}{number}}
2137 This macro is defined for the platforms with a native 64 bit integer type and
2138 allows to define 64 bit compile time constants:
2142 wxLongLong_t ll = wxLL(0x1234567890abcdef);
2146 \wxheading{Include files}
2150 \membersection{wxLongLongFmtSpec}\label{wxlonglongfmtspec}
2152 This macro is defined to contain the {\tt printf()} format specifier using
2153 which 64 bit integer numbers (i.e. those of type {\tt wxLongLong\_t}) can be
2154 printed. Example of using it:
2158 wxLongLong_t ll = wxLL(0x1234567890abcdef);
2159 printf("Long long = %" wxLongLongFmtSpec "x\n", ll);
2163 \wxheading{See also}
2165 \helpref{wxLL}{wxll}
2167 \wxheading{Include files}
2171 \membersection{::wxNewId}\label{wxnewid}
2173 \func{long}{wxNewId}{\void}
2175 Generates an integer identifier unique to this run of the program.
2177 \wxheading{Include files}
2181 \membersection{::wxRegisterId}\label{wxregisterid}
2183 \func{void}{wxRegisterId}{\param{long}{ id}}
2185 Ensures that ids subsequently generated by {\bf NewId} do not clash with
2188 \wxheading{Include files}
2192 \membersection{::wxDDECleanUp}\label{wxddecleanup}
2194 \func{void}{wxDDECleanUp}{\void}
2196 Called when wxWindows exits, to clean up the DDE system. This no longer needs to be
2197 called by the application.
2199 See also \helpref{wxDDEInitialize}{wxddeinitialize}.
2201 \wxheading{Include files}
2205 \membersection{::wxDDEInitialize}\label{wxddeinitialize}
2207 \func{void}{wxDDEInitialize}{\void}
2209 Initializes the DDE system. May be called multiple times without harm.
2211 This no longer needs to be called by the application: it will be called
2212 by wxWindows if necessary.
2214 See also \helpref{wxDDEServer}{wxddeserver}, \helpref{wxDDEClient}{wxddeclient}, \helpref{wxDDEConnection}{wxddeconnection},
2215 \helpref{wxDDECleanUp}{wxddecleanup}.
2217 \wxheading{Include files}
2221 \membersection{::wxEnableTopLevelWindows}\label{wxenabletoplevelwindows}
2223 \func{void}{wxEnableTopLevelWindow}{\param{bool}{ enable = TRUE}}
2225 This function enables or disables all top level windows. It is used by
2226 \helpref{::wxSafeYield}{wxsafeyield}.
2228 \wxheading{Include files}
2232 \membersection{::wxFindMenuItemId}\label{wxfindmenuitemid}
2234 \func{int}{wxFindMenuItemId}{\param{wxFrame *}{frame}, \param{const wxString\& }{menuString}, \param{const wxString\& }{itemString}}
2236 Find a menu item identifier associated with the given frame's menu bar.
2238 \wxheading{Include files}
2242 \membersection{::wxFindWindowByLabel}\label{wxfindwindowbylabel}
2244 \func{wxWindow *}{wxFindWindowByLabel}{\param{const wxString\& }{label}, \param{wxWindow *}{parent=NULL}}
2246 {\bf NB:} This function is obsolete, please use
2247 \helpref{wxWindow::FindWindowByLabel}{wxwindowfindwindowbylabel} instead.
2249 Find a window by its label. Depending on the type of window, the label may be a window title
2250 or panel item label. If {\it parent} is NULL, the search will start from all top-level
2251 frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
2252 The search is recursive in both cases.
2254 \wxheading{Include files}
2258 \membersection{::wxFindWindowByName}\label{wxfindwindowbyname}
2260 \func{wxWindow *}{wxFindWindowByName}{\param{const wxString\& }{name}, \param{wxWindow *}{parent=NULL}}
2262 {\bf NB:} This function is obsolete, please use
2263 \helpref{wxWindow::FindWindowByName}{wxwindowfindwindowbyname} instead.
2265 Find a window by its name (as given in a window constructor or {\bf Create} function call).
2266 If {\it parent} is NULL, the search will start from all top-level
2267 frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
2268 The search is recursive in both cases.
2270 If no such named window is found, {\bf wxFindWindowByLabel} is called.
2272 \wxheading{Include files}
2276 \membersection{::wxFindWindowAtPoint}\label{wxfindwindowatpoint}
2278 \func{wxWindow *}{wxFindWindowAtPoint}{\param{const wxPoint\& }{pt}}
2280 Find the deepest window at the given mouse position in screen coordinates,
2281 returning the window if found, or NULL if not.
2283 \membersection{::wxFindWindowAtPointer}\label{wxfindwindowatpointer}
2285 \func{wxWindow *}{wxFindWindowAtPointer}{\param{wxPoint\& }{pt}}
2287 Find the deepest window at the mouse pointer position, returning the window
2288 and current pointer position in screen coordinates.
2290 \membersection{::wxGetActiveWindow}\label{wxgetactivewindow}
2292 \func{wxWindow *}{wxGetActiveWindow}{\void}
2294 Gets the currently active window (Windows only).
2296 \wxheading{Include files}
2300 \membersection{::wxGetDisplayName}\label{wxgetdisplayname}
2302 \func{wxString}{wxGetDisplayName}{\void}
2304 Under X only, returns the current display name. See also \helpref{wxSetDisplayName}{wxsetdisplayname}.
2306 \wxheading{Include files}
2310 \membersection{::wxGetMousePosition}\label{wxgetmouseposition}
2312 \func{wxPoint}{wxGetMousePosition}{\void}
2314 Returns the mouse position in screen coordinates.
2316 \wxheading{Include files}
2320 \membersection{::wxGetResource}\label{wxgetresource}
2322 \func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2323 \param{const wxString\& *}{value}, \param{const wxString\& }{file = NULL}}
2325 \func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2326 \param{float *}{value}, \param{const wxString\& }{file = NULL}}
2328 \func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2329 \param{long *}{value}, \param{const wxString\& }{file = NULL}}
2331 \func{bool}{wxGetResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2332 \param{int *}{value}, \param{const wxString\& }{file = NULL}}
2334 Gets a resource value from the resource database (for example, WIN.INI, or
2335 .Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used,
2336 otherwise the specified file is used.
2338 Under X, if an application class (wxApp::GetClassName) has been defined,
2339 it is appended to the string /usr/lib/X11/app-defaults/ to try to find
2340 an applications default file when merging all resource databases.
2342 The reason for passing the result in an argument is that it
2343 can be convenient to define a default value, which gets overridden
2344 if the value exists in the resource file. It saves a separate
2345 test for that resource's existence, and it also allows
2346 the overloading of the function for different types.
2348 See also \helpref{wxWriteResource}{wxwriteresource}, \helpref{wxConfigBase}{wxconfigbase}.
2350 \wxheading{Include files}
2354 \membersection{::wxGetTopLevelParent}\label{wxgettoplevelparent}
2356 \func{wxWindow *}{wxGetTopLevelParent}{\param{wxWindow }{*win}}
2358 Returns the first top level parent of the given window, or in other words, the
2359 frame or dialog containing it, or {\tt NULL}.
2361 \wxheading{Include files}
2365 \membersection{::wxLoadUserResource}\label{wxloaduserresource}
2367 \func{wxString}{wxLoadUserResource}{\param{const wxString\& }{resourceName}, \param{const wxString\& }{resourceType=``TEXT"}}
2369 Loads a user-defined Windows resource as a string. If the resource is found, the function creates
2370 a new character array and copies the data into it. A pointer to this data is returned. If unsuccessful, NULL is returned.
2372 The resource must be defined in the {\tt .rc} file using the following syntax:
2375 myResource TEXT file.ext
2378 where {\tt file.ext} is a file that the resource compiler can find.
2380 One use of this is to store {\tt .wxr} files instead of including the data in the C++ file; some compilers
2381 cannot cope with the long strings in a {\tt .wxr} file. The resource data can then be parsed
2382 using \helpref{wxResourceParseString}{wxresourceparsestring}.
2384 This function is available under Windows only.
2386 \wxheading{Include files}
2390 \membersection{::wxPostDelete}\label{wxpostdelete}
2392 \func{void}{wxPostDelete}{\param{wxObject *}{object}}
2394 Tells the system to delete the specified object when
2395 all other events have been processed. In some environments, it is
2396 necessary to use this instead of deleting a frame directly with the
2397 delete operator, because some GUIs will still send events to a deleted window.
2399 Now obsolete: use \helpref{wxWindow::Close}{wxwindowclose} instead.
2401 \wxheading{Include files}
2405 \membersection{::wxPostEvent}\label{wxpostevent}
2407 \func{void}{wxPostEvent}{\param{wxEvtHandler *}{dest}, \param{wxEvent\& }{event}}
2409 In a GUI application, this function posts {\it event} to the specified {\it dest}
2410 object using \helpref{wxEvtHandler::AddPendingEvent}{wxevthandleraddpendingevent}.
2411 Otherwise, it dispatches {\it event} immediately using
2412 \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent}.
2413 See the respective documentation for details (and caveats).
2415 \wxheading{Include files}
2419 \membersection{::wxSetDisplayName}\label{wxsetdisplayname}
2421 \func{void}{wxSetDisplayName}{\param{const wxString\& }{displayName}}
2423 Under X only, sets the current display name. This is the X host and display name such
2424 as ``colonsay:0.0", and the function indicates which display should be used for creating
2425 windows from this point on. Setting the display within an application allows multiple
2426 displays to be used.
2428 See also \helpref{wxGetDisplayName}{wxgetdisplayname}.
2430 \wxheading{Include files}
2434 \membersection{::wxStripMenuCodes}\label{wxstripmenucodes}
2436 \func{wxString}{wxStripMenuCodes}{\param{const wxString\& }{in}}
2438 \func{void}{wxStripMenuCodes}{\param{char *}{in}, \param{char *}{out}}
2440 {\bf NB:} This function is obsolete, please use
2441 \helpref{wxMenuItem::GetLabelFromText}{wxmenuitemgetlabelfromtext} instead.
2443 Strips any menu codes from {\it in} and places the result
2444 in {\it out} (or returns the new string, in the first form).
2446 Menu codes include \& (mark the next character with an underline
2447 as a keyboard shortkey in Windows and Motif) and $\backslash$t (tab in Windows).
2449 \wxheading{Include files}
2453 \membersection{::wxWriteResource}\label{wxwriteresource}
2455 \func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2456 \param{const wxString\& }{value}, \param{const wxString\& }{file = NULL}}
2458 \func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2459 \param{float }{value}, \param{const wxString\& }{file = NULL}}
2461 \func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2462 \param{long }{value}, \param{const wxString\& }{file = NULL}}
2464 \func{bool}{wxWriteResource}{\param{const wxString\& }{section}, \param{const wxString\& }{entry},
2465 \param{int }{value}, \param{const wxString\& }{file = NULL}}
2467 Writes a resource value into the resource database (for example, WIN.INI, or
2468 .Xdefaults). If {\it file} is NULL, WIN.INI or .Xdefaults is used,
2469 otherwise the specified file is used.
2471 Under X, the resource databases are cached until the internal function
2472 \rtfsp{\bf wxFlushResources} is called automatically on exit, when
2473 all updated resource databases are written to their files.
2475 Note that it is considered bad manners to write to the .Xdefaults
2476 file under Unix, although the WIN.INI file is fair game under Windows.
2478 See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfigbase}.
2480 \wxheading{Include files}
2484 \section{Byte order macros}\label{byteordermacros}
2486 The endian-ness issues (that is the difference between big-endian and
2487 little-endian architectures) are important for the portable programs working
2488 with the external binary data (for example, data files or data coming from
2489 network) which is usually in some fixed, platform-independent format. The
2490 macros are helpful for transforming the data to the correct format.
2492 \membersection{wxINTXX\_SWAP\_ALWAYS}\label{intswapalways}
2494 \func{wxInt32}{wxINT32\_SWAP\_ALWAYS}{\param{wxInt32 }{value}}
2496 \func{wxUint32}{wxUINT32\_SWAP\_ALWAYS}{\param{wxUint32 }{value}}
2498 \func{wxInt16}{wxINT16\_SWAP\_ALWAYS}{\param{wxInt16 }{value}}
2500 \func{wxUint16}{wxUINT16\_SWAP\_ALWAYS}{\param{wxUint16 }{value}}
2502 These macros will swap the bytes of the {\it value} variable from little
2503 endian to big endian or vice versa unconditionally, i.e. independently of the
2506 \membersection{wxINTXX\_SWAP\_ON\_BE}\label{intswaponbe}
2508 \func{wxInt32}{wxINT32\_SWAP\_ON\_BE}{\param{wxInt32 }{value}}
2510 \func{wxUint32}{wxUINT32\_SWAP\_ON\_BE}{\param{wxUint32 }{value}}
2512 \func{wxInt16}{wxINT16\_SWAP\_ON\_BE}{\param{wxInt16 }{value}}
2514 \func{wxUint16}{wxUINT16\_SWAP\_ON\_BE}{\param{wxUint16 }{value}}
2516 This macro will swap the bytes of the {\it value} variable from little
2517 endian to big endian or vice versa if the program is compiled on a
2518 big-endian architecture (such as Sun work stations). If the program has
2519 been compiled on a little-endian architecture, the value will be unchanged.
2521 Use these macros to read data from and write data to a file that stores
2522 data in little-endian (for example Intel i386) format.
2524 \membersection{wxINTXX\_SWAP\_ON\_LE}\label{intswaponle}
2526 \func{wxInt32}{wxINT32\_SWAP\_ON\_LE}{\param{wxInt32 }{value}}
2528 \func{wxUint32}{wxUINT32\_SWAP\_ON\_LE}{\param{wxUint32 }{value}}
2530 \func{wxInt16}{wxINT16\_SWAP\_ON\_LE}{\param{wxInt16 }{value}}
2532 \func{wxUint16}{wxUINT16\_SWAP\_ON\_LE}{\param{wxUint16 }{value}}
2534 This macro will swap the bytes of the {\it value} variable from little
2535 endian to big endian or vice versa if the program is compiled on a
2536 little-endian architecture (such as Intel PCs). If the program has
2537 been compiled on a big-endian architecture, the value will be unchanged.
2539 Use these macros to read data from and write data to a file that stores
2540 data in big-endian format.
2542 \section{RTTI functions}\label{rttimacros}
2544 wxWindows uses its own RTTI ("run-time type identification") system which
2545 predates the current standard C++ RTTI and so is kept for backwards
2546 compatibility reasons but also because it allows some things which the
2547 standard RTTI doesn't directly support (such as creating a class from its
2550 The standard C++ RTTI can be used in the user code without any problems and in
2551 general you shouldn't need to use the functions and the macros in this section
2552 unless you are thinking of modifying or adding any wxWindows classes.
2554 \wxheading{See also}
2556 \helpref{RTTI overview}{runtimeclassoverview}
2558 \membersection{CLASSINFO}\label{classinfo}
2560 \func{wxClassInfo *}{CLASSINFO}{className}
2562 Returns a pointer to the wxClassInfo object associated with this class.
2564 \wxheading{Include files}
2568 \membersection{DECLARE\_ABSTRACT\_CLASS}\label{declareabstractclass}
2570 \func{}{DECLARE\_ABSTRACT\_CLASS}{className}
2572 Used inside a class declaration to declare that the class should be
2573 made known to the class hierarchy, but objects of this class cannot be created
2574 dynamically. The same as DECLARE\_CLASS.
2579 class wxCommand: public wxObject
2581 DECLARE_ABSTRACT_CLASS(wxCommand)
2590 \wxheading{Include files}
2594 \membersection{DECLARE\_APP}\label{declareapp}
2596 \func{}{DECLARE\_APP}{className}
2598 This is used in headers to create a forward declaration of the wxGetApp function implemented
2599 by IMPLEMENT\_APP. It creates the declaration {\tt className\& wxGetApp(void)}.
2607 \wxheading{Include files}
2611 \membersection{DECLARE\_CLASS}\label{declareclass}
2613 \func{}{DECLARE\_CLASS}{className}
2615 Used inside a class declaration to declare that the class should be
2616 made known to the class hierarchy, but objects of this class cannot be created
2617 dynamically. The same as DECLARE\_ABSTRACT\_CLASS.
2619 \wxheading{Include files}
2623 \membersection{DECLARE\_DYNAMIC\_CLASS}\label{declaredynamicclass}
2625 \func{}{DECLARE\_DYNAMIC\_CLASS}{className}
2627 Used inside a class declaration to declare that the objects of this class should be dynamically
2628 creatable from run-time type information.
2633 class wxFrame: public wxWindow
2635 DECLARE_DYNAMIC_CLASS(wxFrame)
2638 const wxString& frameTitle;
2644 \wxheading{Include files}
2648 \membersection{IMPLEMENT\_ABSTRACT\_CLASS}\label{implementabstractclass}
2650 \func{}{IMPLEMENT\_ABSTRACT\_CLASS}{className, baseClassName}
2652 Used in a C++ implementation file to complete the declaration of
2653 a class that has run-time type information. The same as IMPLEMENT\_CLASS.
2658 IMPLEMENT_ABSTRACT_CLASS(wxCommand, wxObject)
2660 wxCommand::wxCommand(void)
2666 \wxheading{Include files}
2670 \membersection{IMPLEMENT\_ABSTRACT\_CLASS2}\label{implementabstractclass2}
2672 \func{}{IMPLEMENT\_ABSTRACT\_CLASS2}{className, baseClassName1, baseClassName2}
2674 Used in a C++ implementation file to complete the declaration of
2675 a class that has run-time type information and two base classes. The same as IMPLEMENT\_CLASS2.
2677 \wxheading{Include files}
2681 \membersection{IMPLEMENT\_APP}\label{implementapp}
2683 \func{}{IMPLEMENT\_APP}{className}
2685 This is used in the application class implementation file to make the application class known to
2686 wxWindows for dynamic construction. You use this instead of
2697 IMPLEMENT_APP(MyApp)
2700 See also \helpref{DECLARE\_APP}{declareapp}.
2702 \wxheading{Include files}
2706 \membersection{IMPLEMENT\_CLASS}\label{implementclass}
2708 \func{}{IMPLEMENT\_CLASS}{className, baseClassName}
2710 Used in a C++ implementation file to complete the declaration of
2711 a class that has run-time type information. The same as IMPLEMENT\_ABSTRACT\_CLASS.
2713 \wxheading{Include files}
2717 \membersection{IMPLEMENT\_CLASS2}\label{implementclass2}
2719 \func{}{IMPLEMENT\_CLASS2}{className, baseClassName1, baseClassName2}
2721 Used in a C++ implementation file to complete the declaration of a
2722 class that has run-time type information and two base classes. The
2723 same as IMPLEMENT\_ABSTRACT\_CLASS2.
2725 \wxheading{Include files}
2729 \membersection{IMPLEMENT\_DYNAMIC\_CLASS}\label{implementdynamicclass}
2731 \func{}{IMPLEMENT\_DYNAMIC\_CLASS}{className, baseClassName}
2733 Used in a C++ implementation file to complete the declaration of
2734 a class that has run-time type information, and whose instances
2735 can be created dynamically.
2740 IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
2742 wxFrame::wxFrame(void)
2748 \wxheading{Include files}
2752 \membersection{IMPLEMENT\_DYNAMIC\_CLASS2}\label{implementdynamicclass2}
2754 \func{}{IMPLEMENT\_DYNAMIC\_CLASS2}{className, baseClassName1, baseClassName2}
2756 Used in a C++ implementation file to complete the declaration of
2757 a class that has run-time type information, and whose instances
2758 can be created dynamically. Use this for classes derived from two
2761 \wxheading{Include files}
2765 \membersection{wxConstCast}\label{wxconstcast}
2767 \func{classname *}{wxConstCast}{ptr, classname}
2769 This macro expands into {\tt const\_cast<classname *>(ptr)} if the compiler
2770 supports {\it const\_cast} or into an old, C-style cast, otherwise.
2772 \wxheading{See also}
2774 \helpref{wxDynamicCast}{wxdynamiccast}\\
2775 \helpref{wxStaticCast}{wxstaticcast}
2777 \membersection{::wxCreateDynamicObject}\label{wxcreatedynamicobject}
2779 \func{wxObject *}{wxCreateDynamicObject}{\param{const wxString\& }{className}}
2781 Creates and returns an object of the given class, if the class has been
2782 registered with the dynamic class system using DECLARE... and IMPLEMENT... macros.
2784 \membersection{WXDEBUG\_NEW}\label{debugnew}
2786 \func{}{WXDEBUG\_NEW}{arg}
2788 This is defined in debug mode to be call the redefined new operator
2789 with filename and line number arguments. The definition is:
2792 #define WXDEBUG_NEW new(__FILE__,__LINE__)
2795 In non-debug mode, this is defined as the normal new operator.
2797 \wxheading{Include files}
2801 \membersection{wxDynamicCast}\label{wxdynamiccast}
2803 \func{classname *}{wxDynamicCast}{ptr, classname}
2805 This macro returns the pointer {\it ptr} cast to the type {\it classname *} if
2806 the pointer is of this type (the check is done during the run-time) or
2807 {\tt NULL} otherwise. Usage of this macro is preferred over obsoleted
2808 wxObject::IsKindOf() function.
2810 The {\it ptr} argument may be {\tt NULL}, in which case {\tt NULL} will be
2816 wxWindow *win = wxWindow::FindFocus();
2817 wxTextCtrl *text = wxDynamicCast(win, wxTextCtrl);
2820 // a text control has the focus...
2824 // no window has the focus or it is not a text control
2828 \wxheading{See also}
2830 \helpref{RTTI overview}{runtimeclassoverview}\\
2831 \helpref{wxDynamicCastThis}{wxdynamiccastthis}\\
2832 \helpref{wxConstCast}{wxconstcast}\\
2833 \helpref{wxStatiicCast}{wxstaticcast}
2835 \membersection{wxDynamicCastThis}\label{wxdynamiccastthis}
2837 \func{classname *}{wxDynamicCastThis}{classname}
2839 This macro is equivalent to {\tt wxDynamicCast(this, classname)} but the
2840 latter provokes spurious compilation warnings from some compilers (because it
2841 tests whether {\tt this} pointer is non {\tt NULL} which is always true), so
2842 this macro should be used to avoid them.
2844 \wxheading{See also}
2846 \helpref{wxDynamicCast}{wxdynamiccast}
2848 \membersection{wxStaticCast}\label{wxstaticcast}
2850 \func{classname *}{wxStaticCast}{ptr, classname}
2852 This macro checks that the cast is valid in debug mode (an assert failure will
2853 result if {\tt wxDynamicCast(ptr, classname) == NULL}) and then returns the
2854 result of executing an equivalent of {\tt static\_cast<classname *>(ptr)}.
2856 \helpref{wxDynamicCast}{wxdynamiccast}\\
2857 \helpref{wxConstCast}{wxconstcast}
2859 \section{Resource functions}\label{resourcefuncs}
2861 \overview{Resource functions}{resourceformats}
2863 This section details functions for manipulating wxWindows (.WXR) resource
2864 files and loading user interface elements from resources.
2866 \normalbox{Please note that this use of the word `resource' is different from that used when talking
2867 about initialisation file resource reading and writing, using such functions
2868 as wxWriteResource and wxGetResource. It is just an unfortunate clash of terminology.}
2870 \helponly{For an overview of the wxWindows resource mechanism, see \helpref{the wxWindows resource system}{resourceformats}.}
2872 See also \helpref{wxWindow::LoadFromResource}{wxwindowloadfromresource} for
2873 loading from resource data.
2875 \membersection{::wxResourceAddIdentifier}\label{wxresourceaddidentifier}
2877 \func{bool}{wxResourceAddIdentifier}{\param{const wxString\& }{name}, \param{int }{value}}
2879 Used for associating a name with an integer identifier (equivalent to dynamically\rtfsp
2880 {\tt\#}defining a name to an integer). Unlikely to be used by an application except
2881 perhaps for implementing resource functionality for interpreted languages.
2883 \membersection{::wxResourceClear}\label{wxresourceclear}
2885 \func{void}{wxResourceClear}{\void}
2887 Clears the wxWindows resource table.
2889 \membersection{::wxResourceCreateBitmap}\label{wxresourcecreatebitmap}
2891 \func{wxBitmap *}{wxResourceCreateBitmap}{\param{const wxString\& }{resource}}
2893 Creates a new bitmap from a file, static data, or Windows resource, given a valid
2894 wxWindows bitmap resource identifier. For example, if the .WXR file contains
2898 static const wxString\& project_resource = "bitmap(name = 'project_resource',\
2899 bitmap = ['project', wxBITMAP_TYPE_BMP_RESOURCE, 'WINDOWS'],\
2900 bitmap = ['project.xpm', wxBITMAP_TYPE_XPM, 'X']).";
2903 then this function can be called as follows:
2906 wxBitmap *bitmap = wxResourceCreateBitmap("project_resource");
2909 \membersection{::wxResourceCreateIcon}\label{wxresourcecreateicon}
2911 \func{wxIcon *}{wxResourceCreateIcon}{\param{const wxString\& }{resource}}
2913 Creates a new icon from a file, static data, or Windows resource, given a valid
2914 wxWindows icon resource identifier. For example, if the .WXR file contains
2918 static const wxString\& project_resource = "icon(name = 'project_resource',\
2919 icon = ['project', wxBITMAP_TYPE_ICO_RESOURCE, 'WINDOWS'],\
2920 icon = ['project', wxBITMAP_TYPE_XBM_DATA, 'X']).";
2923 then this function can be called as follows:
2926 wxIcon *icon = wxResourceCreateIcon("project_resource");
2929 \membersection{::wxResourceCreateMenuBar}\label{wxresourcecreatemenubar}
2931 \func{wxMenuBar *}{wxResourceCreateMenuBar}{\param{const wxString\& }{resource}}
2933 Creates a new menu bar given a valid wxWindows menubar resource
2934 identifier. For example, if the .WXR file contains the following:
2937 static const wxString\& menuBar11 = "menu(name = 'menuBar11',\
2941 ['&Open File', 2, 'Open a file'],\
2942 ['&Save File', 3, 'Save a file'],\
2944 ['E&xit', 4, 'Exit program']\
2947 ['&About', 6, 'About this program']\
2952 then this function can be called as follows:
2955 wxMenuBar *menuBar = wxResourceCreateMenuBar("menuBar11");
2959 \membersection{::wxResourceGetIdentifier}\label{wxresourcegetidentifier}
2961 \func{int}{wxResourceGetIdentifier}{\param{const wxString\& }{name}}
2963 Used for retrieving the integer value associated with an identifier.
2964 A zero value indicates that the identifier was not found.
2966 See \helpref{wxResourceAddIdentifier}{wxresourceaddidentifier}.
2968 \membersection{::wxResourceParseData}\label{wxresourcedata}
2970 \func{bool}{wxResourceParseData}{\param{const wxString\& }{resource}, \param{wxResourceTable *}{table = NULL}}
2972 Parses a string containing one or more wxWindows resource objects. If
2973 the resource objects are global static data that are included into the
2974 C++ program, then this function must be called for each variable
2975 containing the resource data, to make it known to wxWindows.
2977 {\it resource} should contain data in the following form:
2980 dialog(name = 'dialog1',
2981 style = 'wxCAPTION | wxDEFAULT_DIALOG_STYLE',
2982 title = 'Test dialog box',
2983 x = 312, y = 234, width = 400, height = 300,
2985 control = [1000, wxStaticBox, 'Groupbox', '0', 'group6', 5, 4, 380, 262,
2986 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],
2987 control = [1001, wxTextCtrl, '', 'wxTE_MULTILINE', 'text3',
2988 156, 126, 200, 70, 'wxWindows is a multi-platform, GUI toolkit.',
2989 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],
2990 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]]).
2993 This function will typically be used after including a {\tt .wxr} file into
2994 a C++ program as follows:
2997 #include "dialog1.wxr"
3000 Each of the contained resources will declare a new C++ variable, and each
3001 of these variables should be passed to wxResourceParseData.
3003 \membersection{::wxResourceParseFile}\label{wxresourceparsefile}
3005 \func{bool}{wxResourceParseFile}{\param{const wxString\& }{filename}, \param{wxResourceTable *}{table = NULL}}
3007 Parses a file containing one or more wxWindows resource objects
3008 in C++-compatible syntax. Use this function to dynamically load
3009 wxWindows resource data.
3011 \membersection{::wxResourceParseString}\label{wxresourceparsestring}
3013 \func{bool}{wxResourceParseString}{\param{char *}{s}, \param{wxResourceTable *}{table = NULL}}
3015 Parses a string containing one or more wxWindows resource objects. If
3016 the resource objects are global static data that are included into the
3017 C++ program, then this function must be called for each variable
3018 containing the resource data, to make it known to wxWindows.
3020 {\it resource} should contain data with the following form:
3023 dialog(name = 'dialog1',
3024 style = 'wxCAPTION | wxDEFAULT_DIALOG_STYLE',
3025 title = 'Test dialog box',
3026 x = 312, y = 234, width = 400, height = 300,
3028 control = [1000, wxStaticBox, 'Groupbox', '0', 'group6', 5, 4, 380, 262,
3029 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],
3030 control = [1001, wxTextCtrl, '', 'wxTE_MULTILINE', 'text3',
3031 156, 126, 200, 70, 'wxWindows is a multi-platform, GUI toolkit.',
3032 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],
3033 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]]).
3036 This function will typically be used after calling \helpref{wxLoadUserResource}{wxloaduserresource} to
3037 load an entire {\tt .wxr file} into a string.
3039 \membersection{::wxResourceRegisterBitmapData}\label{registerbitmapdata}
3041 \func{bool}{wxResourceRegisterBitmapData}{\param{const wxString\& }{name}, \param{char *}{xbm\_data}, \param{int }{width},
3042 \param{int }{height}, \param{wxResourceTable *}{table = NULL}}
3044 \func{bool}{wxResourceRegisterBitmapData}{\param{const wxString\& }{name}, \param{char **}{xpm\_data}}
3046 Makes {\tt\#}included XBM or XPM bitmap data known to the wxWindows resource system.
3047 This is required if other resources will use the bitmap data, since otherwise there
3048 is no connection between names used in resources, and the global bitmap data.
3050 \membersection{::wxResourceRegisterIconData}\label{wxresourceregistericondata}
3052 Another name for \helpref{wxResourceRegisterBitmapData}{registerbitmapdata}.
3054 \section{Log functions}\label{logfunctions}
3056 These functions provide a variety of logging functions: see \helpref{Log classes overview}{wxlogoverview} for
3057 further information. The functions use (implicitly) the currently active log
3058 target, so their descriptions here may not apply if the log target is not the
3059 standard one (installed by wxWindows in the beginning of the program).
3061 \wxheading{Include files}
3065 \membersection{::wxDebugMsg}\label{wxdebugmsg}
3067 \func{void}{wxDebugMsg}{\param{const wxString\& }{fmt}, \param{...}{}}
3069 {\bf NB:} This function is now obsolete, replaced by \helpref{Log
3070 functions}{logfunctions} and \helpref{wxLogDebug}{wxlogdebug} in particular.
3072 Display a debugging message; under Windows, this will appear on the
3073 debugger command window, and under Unix, it will be written to standard
3076 The syntax is identical to {\bf printf}: pass a format string and a
3077 variable list of arguments.
3079 {\bf Tip:} under Windows, if your application crashes before the
3080 message appears in the debugging window, put a wxYield call after
3081 each wxDebugMsg call. wxDebugMsg seems to be broken under WIN32s
3082 (at least for Watcom C++): preformat your messages and use OutputDebugString
3085 \wxheading{Include files}
3089 \membersection{::wxError}\label{wxerror}
3091 \func{void}{wxError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Internal Error"}}
3093 {\bf NB:} This function is now obsolete, please use \helpref{wxLogError}{wxlogerror}
3096 Displays {\it msg} and continues. This writes to standard error under
3097 Unix, and pops up a message box under Windows. Used for internal
3098 wxWindows errors. See also \helpref{wxFatalError}{wxfatalerror}.
3100 \wxheading{Include files}
3104 \membersection{::wxFatalError}\label{wxfatalerror}
3106 \func{void}{wxFatalError}{\param{const wxString\& }{msg}, \param{const wxString\& }{title = "wxWindows Fatal Error"}}
3108 {\bf NB:} This function is now obsolete, please use
3109 \helpref{wxLogFatalError}{wxlogfatalerror} instead.
3111 Displays {\it msg} and exits. This writes to standard error under Unix,
3112 and pops up a message box under Windows. Used for fatal internal
3113 wxWindows errors. See also \helpref{wxError}{wxerror}.
3115 \wxheading{Include files}
3119 \membersection{::wxLogError}\label{wxlogerror}
3121 \func{void}{wxLogError}{\param{const char *}{formatString}, \param{...}{}}
3123 \func{void}{wxVLogError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3125 The functions to use for error messages, i.e. the messages that must be shown
3126 to the user. The default processing is to pop up a message box to inform the
3129 \membersection{::wxLogFatalError}\label{wxlogfatalerror}
3131 \func{void}{wxLogFatalError}{\param{const char *}{formatString}, \param{...}{}}
3133 \func{void}{wxVLogFatalError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3135 Like \helpref{wxLogError}{wxlogerror}, but also
3136 terminates the program with the exit code 3. Using {\it abort()} standard
3137 function also terminates the program with this exit code.
3139 \membersection{::wxLogWarning}\label{wxlogwarning}
3141 \func{void}{wxLogWarning}{\param{const char *}{formatString}, \param{...}{}}
3143 \func{void}{wxVLogWarning}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3145 For warnings - they are also normally shown to the user, but don't interrupt
3148 \membersection{::wxLogMessage}\label{wxlogmessage}
3150 \func{void}{wxLogMessage}{\param{const char *}{formatString}, \param{...}{}}
3152 \func{void}{wxVLogMessage}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3154 For all normal, informational messages. They also appear in a message box by
3155 default (but it can be changed). Notice that the standard behaviour is to not
3156 show informational messages if there are any errors later - the logic being
3157 that the later error messages make the informational messages preceding them
3160 \membersection{::wxLogVerbose}\label{wxlogverbose}
3162 \func{void}{wxLogVerbose}{\param{const char *}{formatString}, \param{...}{}}
3164 \func{void}{wxVLogVerbose}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3166 For verbose output. Normally, it is suppressed, but
3167 might be activated if the user wishes to know more details about the program
3168 progress (another, but possibly confusing name for the same function is {\bf wxLogInfo}).
3170 \membersection{::wxLogStatus}\label{wxlogstatus}
3172 \func{void}{wxLogStatus}{\param{wxFrame *}{frame}, \param{const char *}{formatString}, \param{...}{}}
3174 \func{void}{wxVLogStatus}{\param{wxFrame *}{frame}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
3176 \func{void}{wxLogStatus}{\param{const char *}{formatString}, \param{...}{}}
3178 \func{void}{wxVLogStatus}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3180 Messages logged by these functions will appear in the statusbar of the {\it
3181 frame} or of the top level application window by default (i.e. when using
3182 the second version of the functions).
3184 If the target frame doesn't have a statusbar, the message will be lost.
3186 \membersection{::wxLogSysError}\label{wxlogsyserror}
3188 \func{void}{wxLogSysError}{\param{const char *}{formatString}, \param{...}{}}
3190 \func{void}{wxVLogSysError}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3192 Mostly used by wxWindows itself, but might be handy for logging errors after
3193 system call (API function) failure. It logs the specified message text as well
3194 as the last system error code ({\it errno} or {\it ::GetLastError()} depending
3195 on the platform) and the corresponding error message. The second form
3196 of this function takes the error code explicitly as the first argument.
3198 \wxheading{See also}
3200 \helpref{wxSysErrorCode}{wxsyserrorcode},
3201 \helpref{wxSysErrorMsg}{wxsyserrormsg}
3203 \membersection{::wxLogDebug}\label{wxlogdebug}
3205 \func{void}{wxLogDebug}{\param{const char *}{formatString}, \param{...}{}}
3207 \func{void}{wxVLogDebug}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3209 The right functions for debug output. They only do something in debug
3210 mode (when the preprocessor symbol \_\_WXDEBUG\_\_ is defined) and expand to
3211 nothing in release mode (otherwise).
3213 \membersection{::wxLogTrace}\label{wxlogtrace}
3215 \func{void}{wxLogTrace}{\param{const char *}{formatString}, \param{...}{}}
3217 \func{void}{wxVLogTrace}{\param{const char *}{formatString}, \param{va\_list }{argPtr}}
3219 \func{void}{wxLogTrace}{\param{const char *}{mask}, \param{const char *}{formatString}, \param{...}{}}
3221 \func{void}{wxVLogTrace}{\param{const char *}{mask}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
3223 \func{void}{wxLogTrace}{\param{wxTraceMask}{ mask}, \param{const char *}{formatString}, \param{...}{}}
3225 \func{void}{wxVLogTrace}{\param{wxTraceMask}{ mask}, \param{const char *}{formatString}, \param{va\_list }{argPtr}}
3227 As {\bf wxLogDebug}, trace functions only do something in debug build and
3228 expand to nothing in the release one. The reason for making
3229 it a separate function from it is that usually there are a lot of trace
3230 messages, so it might make sense to separate them from other debug messages.
3232 The trace messages also usually can be separated into different categories and
3233 the second and third versions of this function only log the message if the
3234 {\it mask} which it has is currently enabled in \helpref{wxLog}{wxlog}. This
3235 allows to selectively trace only some operations and not others by changing
3236 the value of the trace mask (possible during the run-time).
3238 For the second function (taking a string mask), the message is logged only if
3239 the mask has been previously enabled by the call to
3240 \helpref{AddTraceMask}{wxlogaddtracemask}. The predefined string trace masks
3241 used by wxWindows are:
3243 \begin{itemize}\itemsep=0pt
3244 \item wxTRACE\_MemAlloc: trace memory allocation (new/delete)
3245 \item wxTRACE\_Messages: trace window messages/X callbacks
3246 \item wxTRACE\_ResAlloc: trace GDI resource allocation
3247 \item wxTRACE\_RefCount: trace various ref counting operations
3248 \item wxTRACE\_OleCalls: trace OLE method calls (Win32 only)
3251 The third version of the function only logs the message if all the bit
3252 corresponding to the {\it mask} are set in the wxLog trace mask which can be
3253 set by \helpref{SetTraceMask}{wxlogsettracemask}. This version is less
3254 flexible than the previous one because it doesn't allow defining the user
3255 trace masks easily - this is why it is deprecated in favour of using string
3258 \begin{itemize}\itemsep=0pt
3259 \item wxTraceMemAlloc: trace memory allocation (new/delete)
3260 \item wxTraceMessages: trace window messages/X callbacks
3261 \item wxTraceResAlloc: trace GDI resource allocation
3262 \item wxTraceRefCount: trace various ref counting operations
3263 \item wxTraceOleCalls: trace OLE method calls (Win32 only)
3266 \membersection{::wxSafeShowMessage}\label{wxsafeshowmessage}
3268 \func{void}{wxSafeShowMessage}{\param{const wxString\& }{title}, \param{const wxString\& }{text}}
3270 This function shows a message to the user in a safe way and should be safe to
3271 call even before the application has been initialized or if it is currently in
3272 some other strange state (for example, about to crash). Under Windows this
3273 function shows a message box using a native dialog instead of
3274 \helpref{wxMessageBox}{wxmessagebox} (which might be unsafe to call), elsewhere
3275 it simply prints the message to the standard output using the title as prefix.
3277 \wxheading{Parameters}
3279 \docparam{title}{The title of the message box shown to the user or the prefix
3280 of the message string}
3282 \docparam{text}{The text to show to the user}
3284 \wxheading{See also}
3286 \helpref{wxLogFatalError}{wxlogfatalerror}
3288 \wxheading{Include files}
3292 \membersection{::wxSysErrorCode}\label{wxsyserrorcode}
3294 \func{unsigned long}{wxSysErrorCode}{\void}
3296 Returns the error code from the last system call. This function uses
3297 {\tt errno} on Unix platforms and {\tt GetLastError} under Win32.
3299 \wxheading{See also}
3301 \helpref{wxSysErrorMsg}{wxsyserrormsg},
3302 \helpref{wxLogSysError}{wxlogsyserror}
3304 \membersection{::wxSysErrorMsg}\label{wxsyserrormsg}
3306 \func{const wxChar *}{wxSysErrorMsg}{\param{unsigned long }{errCode = 0}}
3308 Returns the error message corresponding to the given system error code. If
3309 {\it errCode} is $0$ (default), the last error code (as returned by
3310 \helpref{wxSysErrorCode}{wxsyserrorcode}) is used.
3312 \wxheading{See also}
3314 \helpref{wxSysErrorCode}{wxsyserrorcode},
3315 \helpref{wxLogSysError}{wxlogsyserror}
3317 \membersection{WXTRACE}\label{trace}
3319 \wxheading{Include files}
3323 \func{}{WXTRACE}{formatString, ...}
3325 {\bf NB:} This macro is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3327 Calls wxTrace with printf-style variable argument syntax. Output
3328 is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3330 \wxheading{Include files}
3334 \membersection{WXTRACELEVEL}\label{tracelevel}
3336 \func{}{WXTRACELEVEL}{level, formatString, ...}
3338 {\bf NB:} This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3340 Calls wxTraceLevel with printf-style variable argument syntax. Output
3341 is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3342 The first argument should be the level at which this information is appropriate.
3343 It will only be output if the level returned by wxDebugContext::GetLevel is equal to or greater than
3346 \wxheading{Include files}
3350 \membersection{::wxTrace}\label{wxtrace}
3352 \func{void}{wxTrace}{\param{const wxString\& }{fmt}, \param{...}{}}
3354 {\bf NB:} This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3356 Takes printf-style variable argument syntax. Output
3357 is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3359 \wxheading{Include files}
3363 \membersection{::wxTraceLevel}\label{wxtracelevel}
3365 \func{void}{wxTraceLevel}{\param{int}{ level}, \param{const wxString\& }{fmt}, \param{...}{}}
3367 {\bf NB:} This function is now obsolete, replaced by \helpref{Log functions}{logfunctions}.
3369 Takes printf-style variable argument syntax. Output
3370 is directed to the current output stream (see \helpref{wxDebugContext}{wxdebugcontextoverview}).
3371 The first argument should be the level at which this information is appropriate.
3372 It will only be output if the level returned by wxDebugContext::GetLevel is equal to or greater than
3375 \wxheading{Include files}
3379 \section{Time functions}\label{timefunctions}
3381 The functions in this section deal with getting the current time and
3382 starting/stopping the global timers. Please note that the timer functions are
3383 deprecated because they work with one global timer only and
3384 \helpref{wxTimer}{wxtimer} and/or \helpref{wxStopWatch}{wxstopwatch} classes
3385 should be used instead. For retrieving the current time, you may also use
3386 \helpref{wxDateTime::Now}{wxdatetimenow} or
3387 \helpref{wxDateTime::UNow}{wxdatetimeunow} methods.
3389 \membersection{::wxGetElapsedTime}\label{wxgetelapsedtime}
3391 \func{long}{wxGetElapsedTime}{\param{bool}{ resetTimer = TRUE}}
3393 Gets the time in milliseconds since the last \helpref{::wxStartTimer}{wxstarttimer}.
3395 If {\it resetTimer} is TRUE (the default), the timer is reset to zero
3398 See also \helpref{wxTimer}{wxtimer}.
3400 \wxheading{Include files}
3404 \membersection{::wxGetLocalTime}\label{wxgetlocaltime}
3406 \func{long}{wxGetLocalTime}{\void}
3408 Returns the number of seconds since local time 00:00:00 Jan 1st 1970.
3410 \wxheading{See also}
3412 \helpref{wxDateTime::Now}{wxdatetimenow}
3414 \wxheading{Include files}
3418 \membersection{::wxGetLocalTimeMillis}\label{wxgetlocaltimemillis}
3420 \func{wxLongLong}{wxGetLocalTimeMillis}{\void}
3422 Returns the number of milliseconds since local time 00:00:00 Jan 1st 1970.
3424 \wxheading{See also}
3426 \helpref{wxDateTime::Now}{wxdatetimenow},\\
3427 \helpref{wxLongLong}{wxlonglong}
3429 \wxheading{Include files}
3433 \membersection{::wxGetUTCTime}\label{wxgetutctime}
3435 \func{long}{wxGetUTCTime}{\void}
3437 Returns the number of seconds since GMT 00:00:00 Jan 1st 1970.
3439 \wxheading{See also}
3441 \helpref{wxDateTime::Now}{wxdatetimenow}
3443 \wxheading{Include files}
3447 \membersection{::wxNow}\label{wxnow}
3449 \func{wxString}{wxNow}{\void}
3451 Returns a string representing the current date and time.
3453 \wxheading{Include files}
3457 \membersection{::wxSleep}\label{wxsleep}
3459 \func{void}{wxSleep}{\param{int}{ secs}}
3461 Sleeps for the specified number of seconds.
3463 \wxheading{Include files}
3467 \membersection{::wxStartTimer}\label{wxstarttimer}
3469 \func{void}{wxStartTimer}{\void}
3471 Starts a stopwatch; use \helpref{::wxGetElapsedTime}{wxgetelapsedtime} to get the elapsed time.
3473 See also \helpref{wxTimer}{wxtimer}.
3475 \wxheading{Include files}
3479 \membersection{::wxUsleep}\label{wxusleep}
3481 \func{void}{wxUsleep}{\param{unsigned long}{ milliseconds}}
3483 Sleeps for the specified number of milliseconds. Notice that usage of this
3484 function is encouraged instead of calling usleep(3) directly because the
3485 standard usleep() function is not MT safe.
3487 \wxheading{Include files}
3491 \section{Debugging macros and functions}\label{debugmacros}
3493 Useful macros and functions for error checking and defensive programming.
3494 wxWindows defines three families of the assert-like macros:
3495 the wxASSERT and wxFAIL macros only do anything if \_\_WXDEBUG\_\_ is defined
3496 (in other words, in the debug build) but disappear completely in the release
3497 build. On the other hand, the wxCHECK macros stay event in release builds but a
3498 check failure doesn't generate any user-visible effects then. Finally, the
3499 compile time assertions don't happen during the run-time but result in the
3500 compilation error messages if the condition they check fail.
3502 \wxheading{Include files}
3506 \membersection{::wxOnAssert}\label{wxonassert}
3508 \func{void}{wxOnAssert}{\param{const char *}{fileName}, \param{int}{ lineNumber}, \param{const char *}{cond}, \param{const char *}{msg = NULL}}
3510 This function is called whenever one of debugging macros fails (i.e. condition
3511 is false in an assertion). It is only defined in the debug mode, in release
3512 builds the \helpref{wxCHECK}{wxcheck} failures don't result in anything.
3514 To override the default behaviour in the debug builds which is to show the user
3515 a dialog asking whether he wants to abort the program, continue or continue
3516 ignoring any subsequent assert failures, you may override
3517 \helpref{wxApp::OnAssert}{wxapponassert} which is called by this function if
3518 the global application object exists.
3520 \membersection{wxASSERT}\label{wxassert}
3522 \func{}{wxASSERT}{\param{}{condition}}
3524 Assert macro. An error message will be generated if the condition is FALSE in
3525 debug mode, but nothing will be done in the release build.
3527 Please note that the condition in wxASSERT() should have no side effects
3528 because it will not be executed in release mode at all.
3530 \wxheading{See also}
3532 \helpref{wxASSERT\_MSG}{wxassertmsg},\\
3533 \helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}
3535 \membersection{wxASSERT\_MIN\_BITSIZE}\label{wxassertminbitsize}
3537 \func{}{wxASSERT\_MIN\_BITSIZE}{\param{}{type}, \param{}{size}}
3539 This macro results in a
3540 \helpref{compile time assertion failure}{wxcompiletimeassert} if the size
3541 of the given type {\it type} is less than {\it size} bits.
3543 You may use it like this, for example:
3546 // we rely on the int being able to hold values up to 2^32
3547 wxASSERT_MIN_BITSIZE(int, 32);
3549 // can't work with the platforms using UTF-8 for wchar_t
3550 wxASSERT_MIN_BITSIZE(wchar_t, 16);
3553 \membersection{wxASSERT\_MSG}\label{wxassertmsg}
3555 \func{}{wxASSERT\_MSG}{\param{}{condition}, \param{}{msg}}
3557 Assert macro with message. An error message will be generated if the condition is FALSE.
3559 \wxheading{See also}
3561 \helpref{wxASSERT}{wxassert},\\
3562 \helpref{wxCOMPILE\_TIME\_ASSERT}{wxcompiletimeassert}
3564 \membersection{wxCOMPILE\_TIME\_ASSERT}\label{wxcompiletimeassert}
3566 \func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}}
3568 Using {\tt wxCOMPILE\_TIME\_ASSERT} results in a compilation error if the
3569 specified {\it condition} is false. The compiler error message should include
3570 the {\it msg} identifier - please note that it must be a valid C++ identifier
3571 and not a string unlike in the other cases.
3573 This macro is mostly useful for testing the expressions involving the
3574 {\tt sizeof} operator as they can't be tested by the preprocessor but it is
3575 sometimes desirable to test them at the compile time.
3577 Note that this macro internally declares a struct whose name it tries to make
3578 unique by using the {\tt \_\_LINE\_\_} in it but it may still not work if you
3579 use it on the same line in two different source files. In this case you may
3580 either change the line in which either of them appears on or use the
3581 \helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2} macro.
3583 \wxheading{See also}
3585 \helpref{wxASSERT\_MSG}{wxassertmsg},\\
3586 \helpref{wxASSERT\_MIN\_BITSIZE}{wxassertminbitsize}
3588 \membersection{wxCOMPILE\_TIME\_ASSERT2}\label{wxcompiletimeassert2}
3590 \func{}{wxCOMPILE\_TIME\_ASSERT}{\param{}{condition}, \param{}{msg}, \param{}{name}}
3592 This macro is identical to \helpref{wxCOMPILE\_TIME\_ASSERT2}{wxcompiletimeassert2}
3593 except that it allows you to specify a unique {\it name} for the struct
3594 internally defined by this macro to avoid getting the compilation errors
3595 described \helpref{above}{wxcompiletimeassert}.
3597 \membersection{wxFAIL}\label{wxfail}
3599 \func{}{wxFAIL}{\void}
3601 Will always generate an assert error if this code is reached (in debug mode).
3603 See also: \helpref{wxFAIL\_MSG}{wxfailmsg}
3605 \membersection{wxFAIL\_MSG}\label{wxfailmsg}
3607 \func{}{wxFAIL\_MSG}{\param{}{msg}}
3609 Will always generate an assert error with specified message if this code is reached (in debug mode).
3611 This macro is useful for marking unreachable" code areas, for example
3612 it may be used in the "default:" branch of a switch statement if all possible
3613 cases are processed above.
3615 \wxheading{See also}
3617 \helpref{wxFAIL}{wxfail}
3619 \membersection{wxCHECK}\label{wxcheck}
3621 \func{}{wxCHECK}{\param{}{condition}, \param{}{retValue}}
3623 Checks that the condition is true, returns with the given return value if not (FAILs in debug mode).
3624 This check is done even in release mode.
3626 \membersection{wxCHECK\_MSG}\label{wxcheckmsg}
3628 \func{}{wxCHECK\_MSG}{\param{}{condition}, \param{}{retValue}, \param{}{msg}}
3630 Checks that the condition is true, returns with the given return value if not (FAILs in debug mode).
3631 This check is done even in release mode.
3633 This macro may be only used in non void functions, see also
3634 \helpref{wxCHECK\_RET}{wxcheckret}.
3636 \membersection{wxCHECK\_RET}\label{wxcheckret}
3638 \func{}{wxCHECK\_RET}{\param{}{condition}, \param{}{msg}}
3640 Checks that the condition is true, and returns if not (FAILs with given error
3641 message in debug mode). This check is done even in release mode.
3643 This macro should be used in void functions instead of
3644 \helpref{wxCHECK\_MSG}{wxcheckmsg}.
3646 \membersection{wxCHECK2}\label{wxcheck2}
3648 \func{}{wxCHECK2}{\param{}{condition}, \param{}{operation}}
3650 Checks that the condition is true and \helpref{wxFAIL}{wxfail} and execute
3651 {\it operation} if it is not. This is a generalisation of
3652 \helpref{wxCHECK}{wxcheck} and may be used when something else than just
3653 returning from the function must be done when the {\it condition} is false.
3655 This check is done even in release mode.
3657 \membersection{wxCHECK2\_MSG}\label{wxcheck2msg}
3659 \func{}{wxCHECK2}{\param{}{condition}, \param{}{operation}, \param{}{msg}}
3661 This is the same as \helpref{wxCHECK2}{wxcheck2}, but
3662 \helpref{wxFAIL\_MSG}{wxfailmsg} with the specified {\it msg} is called
3663 instead of wxFAIL() if the {\it condition} is false.
3665 \membersection{::wxTrap}\label{wxtrap}
3667 \func{void}{wxTrap}{\void}
3669 In debug mode (when {\tt \_\_WXDEBUG\_\_} is defined) this function generates a
3670 debugger exception meaning that the control is passed to the debugger if one is
3671 attached to the process. Otherwise the program just terminates abnormally.
3673 In release mode this function does nothing.
3675 \wxheading{Include files}
3679 \section{Environment access functions}\label{environfunctions}
3681 The functions in this section allow to access (get) or change value of
3682 environment variables in a portable way. They are currently implemented under
3683 Win32 and POSIX-like systems (Unix).
3685 % TODO add some stuff about env var inheriting but not propagating upwards (VZ)
3687 \wxheading{Include files}
3691 \membersection{wxGetenv}\label{wxgetenvmacro}
3693 \func{wxChar *}{wxGetEnv}{\param{const wxString\&}{ var}}
3695 This is a macro defined as {\tt getenv()} or its wide char version in Unicode
3698 Note that under Win32 it may not return correct value for the variables set
3699 with \helpref{wxSetEnv}{wxsetenv}, use \helpref{wxGetEnv}{wxgetenv} function
3702 \membersection{wxGetEnv}\label{wxgetenv}
3704 \func{bool}{wxGetEnv}{\param{const wxString\&}{ var}, \param{wxString *}{value}}
3706 Returns the current value of the environment variable {\it var} in {\it value}.
3707 {\it value} may be {\tt NULL} if you just want to know if the variable exists
3708 and are not interested in its value.
3710 Returns {\tt TRUE} if the variable exists, {\tt FALSE} otherwise.
3712 \membersection{wxSetEnv}\label{wxsetenv}
3714 \func{bool}{wxSetEnv}{\param{const wxString\&}{ var}, \param{const wxChar *}{value}}
3716 Sets the value of the environment variable {\it var} (adding it if necessary)
3719 Returns {\tt TRUE} on success.
3721 \membersection{wxUnsetEnv}\label{wxunsetenv}
3723 \func{bool}{wxUnsetEnv}{\param{const wxString\&}{ var}}
3725 Removes the variable {\it var} from the environment.
3726 \helpref{wxGetEnv}{wxgetenv} will return {\tt NULL} after the call to this
3729 Returns {\tt TRUE} on success.