⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
📖 第 1 页 / 共 5 页
字号:
\func{unsigned long}{wxGetProcessId}{\void}Returns the number uniquely identifying the current process in the system.If an error occurs, $0$ is returned.\wxheading{Include files}<wx/utils.h>\membersection{::wxShell}\label{wxshell}\func{bool}{wxShell}{\param{const wxString\& }{command = NULL}}Executes a command in an interactive shell window. If no command isspecified, then just the shell is spawned.See also \helpref{wxExecute}{wxexecute}, \helpref{Exec sample}{sampleexec}.\wxheading{Include files}<wx/utils.h>\membersection{::wxShutdown}\label{wxshutdown}\func{bool}{wxShutdown}{\param{wxShutdownFlags}{flags}}This function shuts down or reboots the computer depending on the value of the{\it flags}. Please notice that doing this requires the corresponding accessrights (superuser under Unix, {\tt SE\_SHUTDOWN} privilege under Windows NT)and that this function is only implemented under Unix and Win32.\wxheading{Parameters}\docparam{flags}{Either {\tt wxSHUTDOWN\_POWEROFF} or {\tt wxSHUTDOWN\_REBOOT}}\wxheading{Returns}\true on success, \false if an error occurred.\wxheading{Include files}<wx/utils.h>\section{Thread functions}\label{threadfunctions}The functions and macros here mainly exist to make it writing the code whichmay be compiled in multi thread build ({\tt wxUSE\_THREADS} $= 1$) as well asin single thread configuration ({\tt wxUSE\_THREADS} $= 0$).For example, a static variable must be protected against simultaneous access bymultiple threads in the former configuration but in the latter the extraoverhead of using the critical section is not needed. To solve this problem,the \helpref{wxCRITICAL\_SECTION}{wxcriticalsectionmacro} macro may be usedto create and use the critical section only when needed.\wxheading{Include files}<wx/thread.h>\wxheading{See also}\helpref{wxThread}{wxthread}, \helpref{wxMutex}{wxmutex}, \helpref{Multithreading overview}{wxthreadoverview}\membersection{wxCRIT\_SECT\_DECLARE}\label{wxcritsectdeclare}\func{}{wxCRIT\_SECT\_DECLARE}{\param{}{cs}}This macro declares a (static) critical section object named {\it cs} if{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.\membersection{wxCRIT\_SECT\_DECLARE\_MEMBER}\label{wxcritsectdeclaremember}\func{}{wxCRIT\_SECT\_DECLARE}{\param{}{cs}}This macro declares a critical section object named {\it cs} if{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$. As it doesn'tinclude the {\tt static} keyword (unlike\helpref{wxCRIT\_SECT\_DECLARE}{wxcritsectdeclare}), it can be used to declarea class or struct member which explains its name.\membersection{wxCRIT\_SECT\_LOCKER}\label{wxcritsectlocker}\func{}{wxCRIT\_SECT\_LOCKER}{\param{}{name}, \param{}{cs}}This macro creates a \helpref{critical section lock}{wxcriticalsectionlocker}object named {\it name} and associated with the critical section {\it cs} if{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.\membersection{wxCRITICAL\_SECTION}\label{wxcriticalsectionmacro}\func{}{wxCRITICAL\_SECTION}{\param{}{name}}This macro combines \helpref{wxCRIT\_SECT\_DECLARE}{wxcritsectdeclare} and\helpref{wxCRIT\_SECT\_LOCKER}{wxcritsectlocker}: it creates a static criticalsection object and also the lock object associated with it. Because of this, itcan be only used inside a function, not at global scope. For example:\begin{verbatim}int IncCount(){    static int s_counter = 0;    wxCRITICAL_SECTION(counter);    return ++s_counter;}\end{verbatim}(note that we suppose that the function is called the first time from the mainthread so that the critical section object is initialized correctly by the timeother threads start calling it, if this is not the case this approach can{\bf not} be used and the critical section must be made a global instead).\membersection{wxENTER\_CRIT\_SECT}\label{wxentercritsect}\func{}{wxENTER\_CRIT\_SECT}{\param{wxCriticalSection\& }{cs}}This macro is equivalent to \helpref{cs.Enter()}{wxcriticalsectionenter} if{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.\membersection{::wxIsMainThread}\label{wxismainthread}\func{bool}{wxIsMainThread}{\void}Returns \true if this thread is the main one. Always returns \true if{\tt wxUSE\_THREADS} is $0$.\membersection{wxLEAVE\_CRIT\_SECT}\label{wxleavecritsect}\func{}{wxLEAVE\_CRIT\_SECT}{\param{wxCriticalSection\& }{cs}}This macro is equivalent to \helpref{cs.Leave()}{wxcriticalsectionleave} if{\tt wxUSE\_THREADS} is $1$ and does nothing if it is $0$.\membersection{::wxMutexGuiEnter}\label{wxmutexguienter}\func{void}{wxMutexGuiEnter}{\void}This function must be called when any thread other than the main GUI threadwants to get access to the GUI library. This function will block the executionof the calling thread until the main thread (or any other thread holding themain GUI lock) leaves the GUI library and no other thread will enter the GUIlibrary until the calling thread calls \helpref{::wxMutexGuiLeave()}{wxmutexguileave}.Typically, these functions are used like this:\begin{verbatim}void MyThread::Foo(void){    // before doing any GUI calls we must ensure that this thread is the only    // one doing it!    wxMutexGuiEnter();    // Call GUI here:    my_window->DrawSomething();    wxMutexGuiLeave();}\end{verbatim}Note that under GTK, no creation of top-level windows is allowed in anythread but the main one.This function is only defined on platforms which support preemptivethreads.\membersection{::wxMutexGuiLeave}\label{wxmutexguileave}\func{void}{wxMutexGuiLeave}{\void}See \helpref{::wxMutexGuiEnter()}{wxmutexguienter}.This function is only defined on platforms which support preemptivethreads.\section{File functions}\label{filefunctions}\wxheading{Include files}<wx/filefn.h>\wxheading{See also}\helpref{wxPathList}{wxpathlist}\\\helpref{wxDir}{wxdir}\\\helpref{wxFile}{wxfile}\\\helpref{wxFileName}{wxfilename}\membersection{::wxDos2UnixFilename}\label{wxdos2unixfilename}\func{void}{wxDos2UnixFilename}{\param{wxChar *}{s}}Converts a DOS to a Unix filename by replacing backslashes with forwardslashes.\membersection{::wxFileExists}\label{functionwxfileexists}\func{bool}{wxFileExists}{\param{const wxString\& }{filename}}Returns true if the file exists and is a plain file.\membersection{::wxFileModificationTime}\label{wxfilemodificationtime}\func{time\_t}{wxFileModificationTime}{\param{const wxString\& }{filename}}Returns time of last modification of given file.The return value is $0$ if an error occured (e.g. file not found).\membersection{::wxFileNameFromPath}\label{wxfilenamefrompath}\func{wxString}{wxFileNameFromPath}{\param{const wxString\& }{path}}\func{char *}{wxFileNameFromPath}{\param{char *}{path}}{\bf NB:} This function is obsolete, please use\helpref{wxFileName::SplitPath}{wxfilenamesplitpath} instead.Returns the filename for a full path. The second form returns a pointer totemporary storage that should not be deallocated.\membersection{::wxFindFirstFile}\label{wxfindfirstfile}\func{wxString}{wxFindFirstFile}{\param{const char *}{spec}, \param{int}{ flags = 0}}This function does directory searching; returns the first filethat matches the path {\it spec}, or the empty string. Use \helpref{wxFindNextFile}{wxfindnextfile} toget the next matching file. Neither will report the current directory "." or theparent directory "..".\wxheading{Warning}As of wx 2.5.2, these functions are not thread-safe! (they use static variables). You probably want to use \helpref{wxDir::GetFirst}{wxdirgetfirst} or \helpref{wxDirTraverser}{wxdirtraverser} instead.{\it spec} may contain wildcards.{\it flags} may be wxDIR for restricting the query to directories, wxFILE for files or zero for either.For example:\begin{verbatim}  wxString f = wxFindFirstFile("/home/project/*.*");  while ( !f.empty() )  {    ...    f = wxFindNextFile();  }\end{verbatim}\membersection{::wxFindNextFile}\label{wxfindnextfile}\func{wxString}{wxFindNextFile}{\void}Returns the next file that matches the path passed to \helpref{wxFindFirstFile}{wxfindfirstfile}.See \helpref{wxFindFirstFile}{wxfindfirstfile} for an example.\membersection{::wxGetDiskSpace}\label{wxgetdiskspace}\func{bool}{wxGetDiskSpace}{\param{const wxString\& }{path}, \param{wxLongLong }{*total = NULL}, \param{wxLongLong }{*free = NULL}}This function returns the total number of bytes and number of free bytes onthe disk containing the directory {\it path} (it should exist). Both{\it total} and {\it free} parameters may be {\tt NULL} if the correspondinginformation is not needed.\wxheading{Returns}\true on success, \false if an error occurred (for example, thedirectory doesn't exist).\wxheading{Portability}This function is implemented for Win32,Mac OS and generic Unix provided the system has {\tt statfs()} function.This function first appeared in wxWidgets 2.3.2.\membersection{::wxGetFileKind}\label{wxgetfilekind}\func{wxFileKind}{wxGetFileKind}{\param{int }{fd}}\func{wxFileKind}{wxGetFileKind}{\param{FILE *}{fp}}Returns the type of an open file. Possible return values are:\begin{verbatim}enum wxFileKind{  wxFILE_KIND_UNKNOWN,  wxFILE_KIND_DISK,     // a file supporting seeking to arbitrary offsets  wxFILE_KIND_TERMINAL, // a tty  wxFILE_KIND_PIPE      // a pipe};\end{verbatim}\wxheading{Include files}<wx/filefn.h>\membersection{::wxGetOSDirectory}\label{wxgetosdirectory}\func{wxString}{wxGetOSDirectory}{\void}Returns the Windows directory under Windows; on other platforms returns the empty string.\membersection{::wxIsAbsolutePath}\label{wxisabsolutepath}\func{bool}{wxIsAbsolutePath}{\param{const wxString\& }{filename}}Returns true if the argument is an absolute filename, i.e. with a slashor drive name at the beginning.\membersection{::wxDirExists}\label{functionwxdirexists}\func{bool}{wxDirExists}{\param{const wxChar *}{dirname}}Returns true if \arg{dirname} exists and is a directory.\membersection{::wxPathOnly}\label{wxpathonly}\func{wxString}{wxPathOnly}{\param{const wxString\& }{path}}Returns the directory part of the filename.\membersection{::wxUnix2DosFilename}\label{wxunix2dosfilename}\func{void}{wxUnix2DosFilename}{\param{wxChar *}{s}}This function is deprecated, use \helpref{wxFileName}{wxfilename} instead.Converts a Unix to a DOS filename by replacing forwardslashes with backslashes.\membersection{wxCHANGE\_UMASK}\label{wxchangeumask}\func{}{wxCHANGE\_UMASK}{\param{int }{mask}}Under Unix this macro changes the current process umask to the given value,unless it is equal to $-1$ in which case nothing is done, and restores it to

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -