]>
git.saurik.com Git - wxWidgets.git/blob - src/common/utilscmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Miscellaneous utility functions and classes
4 // Author: Julian Smart
8 // Copyright: (c) 1998 Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "utils.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
33 #include "wx/string.h"
40 #include "wx/window.h"
43 #include "wx/msgdlg.h"
44 #include "wx/textdlg.h"
45 #include "wx/textctrl.h" // for wxTE_PASSWORD
47 #include "wx/menuitem.h"
54 #include "wx/process.h"
55 #include "wx/txtstrm.h"
63 #if !defined(__WATCOMC__)
64 #if !(defined(_MSC_VER) && (_MSC_VER > 800))
70 #include "wx/colordlg.h"
71 #include "wx/fontdlg.h"
72 #include "wx/notebook.h"
74 #include "wx/statusbr.h"
80 #include <sys/types.h>
89 #include "wx/msw/private.h"
92 // ----------------------------------------------------------------------------
94 // ----------------------------------------------------------------------------
96 #if WXWIN_COMPATIBILITY_2_2
97 const wxChar
*wxInternalErrorStr
= wxT("wxWindows Internal Error");
98 const wxChar
*wxFatalErrorStr
= wxT("wxWindows Fatal Error");
99 #endif // WXWIN_COMPATIBILITY_2_2
101 // ============================================================================
103 // ============================================================================
106 copystring (const wxChar
*s
)
108 if (s
== NULL
) s
= wxT("");
109 size_t len
= wxStrlen (s
) + 1;
111 wxChar
*news
= new wxChar
[len
];
112 memcpy (news
, s
, len
* sizeof(wxChar
)); // Should be the fastest
118 static long wxCurrentId
= 100;
123 return wxCurrentId
++;
127 wxGetCurrentId(void) { return wxCurrentId
; }
130 wxRegisterId (long id
)
132 if (id
>= wxCurrentId
)
133 wxCurrentId
= id
+ 1;
136 // ----------------------------------------------------------------------------
137 // String <-> Number conversions (deprecated)
138 // ----------------------------------------------------------------------------
140 #if WXWIN_COMPATIBILITY_2_4
142 WXDLLEXPORT_DATA(const wxChar
*) wxFloatToStringStr
= wxT("%.2f");
143 WXDLLEXPORT_DATA(const wxChar
*) wxDoubleToStringStr
= wxT("%.2f");
146 StringToFloat (const wxChar
*s
, float *number
)
148 if (s
&& *s
&& number
)
149 *number
= (float) wxStrtod (s
, (wxChar
**) NULL
);
153 StringToDouble (const wxChar
*s
, double *number
)
155 if (s
&& *s
&& number
)
156 *number
= wxStrtod (s
, (wxChar
**) NULL
);
160 FloatToString (float number
, const wxChar
*fmt
)
162 static wxChar buf
[256];
164 wxSprintf (buf
, fmt
, number
);
169 DoubleToString (double number
, const wxChar
*fmt
)
171 static wxChar buf
[256];
173 wxSprintf (buf
, fmt
, number
);
178 StringToInt (const wxChar
*s
, int *number
)
180 if (s
&& *s
&& number
)
181 *number
= (int) wxStrtol (s
, (wxChar
**) NULL
, 10);
185 StringToLong (const wxChar
*s
, long *number
)
187 if (s
&& *s
&& number
)
188 *number
= wxStrtol (s
, (wxChar
**) NULL
, 10);
192 IntToString (int number
)
194 static wxChar buf
[20];
196 wxSprintf (buf
, wxT("%d"), number
);
201 LongToString (long number
)
203 static wxChar buf
[20];
205 wxSprintf (buf
, wxT("%ld"), number
);
209 #endif // WXWIN_COMPATIBILITY_2_4
211 // Array used in DecToHex conversion routine.
212 static wxChar hexArray
[] = wxT("0123456789ABCDEF");
214 // Convert 2-digit hex number to decimal
215 int wxHexToDec(const wxString
& buf
)
217 int firstDigit
, secondDigit
;
219 if (buf
.GetChar(0) >= wxT('A'))
220 firstDigit
= buf
.GetChar(0) - wxT('A') + 10;
222 firstDigit
= buf
.GetChar(0) - wxT('0');
224 if (buf
.GetChar(1) >= wxT('A'))
225 secondDigit
= buf
.GetChar(1) - wxT('A') + 10;
227 secondDigit
= buf
.GetChar(1) - wxT('0');
229 return (firstDigit
& 0xF) * 16 + (secondDigit
& 0xF );
232 // Convert decimal integer to 2-character hex string
233 void wxDecToHex(int dec
, wxChar
*buf
)
235 int firstDigit
= (int)(dec
/16.0);
236 int secondDigit
= (int)(dec
- (firstDigit
*16.0));
237 buf
[0] = hexArray
[firstDigit
];
238 buf
[1] = hexArray
[secondDigit
];
242 // Convert decimal integer to 2-character hex string
243 wxString
wxDecToHex(int dec
)
246 wxDecToHex(dec
, buf
);
247 return wxString(buf
);
250 #if WXWIN_COMPATIBILITY_2
252 StringMatch (const wxChar
*str1
, const wxChar
*str2
, bool subString
, bool exact
)
254 if (str1
== NULL
|| str2
== NULL
)
261 int len1
= wxStrlen (str1
);
262 int len2
= wxStrlen (str2
);
265 // Search for str1 in str2
266 // Slow .... but acceptable for short strings
267 for (i
= 0; i
<= len2
- len1
; i
++)
269 if (wxStrnicmp (str1
, str2
+ i
, len1
) == 0)
275 if (wxStricmp (str1
, str2
) == 0)
280 int len1
= wxStrlen (str1
);
281 int len2
= wxStrlen (str2
);
283 if (wxStrnicmp (str1
, str2
, wxMin (len1
, len2
)) == 0)
291 // Return the current date/time
295 time_t now
= time((time_t *) NULL
);
296 char *date
= ctime(&now
);
298 return wxString::FromAscii(date
);
305 // ----------------------------------------------------------------------------
306 // Menu accelerators related functions
307 // ----------------------------------------------------------------------------
309 wxChar
*wxStripMenuCodes(const wxChar
*in
, wxChar
*out
)
311 wxString s
= wxMenuItem::GetLabelFromText(in
);
314 // go smash their buffer if it's not big enough - I love char * params
315 memcpy(out
, s
.c_str(), s
.length() * sizeof(wxChar
));
325 wxString
wxStripMenuCodes(const wxString
& in
)
329 size_t len
= in
.length();
332 for ( size_t n
= 0; n
< len
; n
++ )
337 // skip it, it is used to introduce the accel char (or to quote
338 // itself in which case it should still be skipped): note that it
339 // can't be the last character of the string
342 wxLogDebug(_T("Invalid menu string '%s'"), in
.c_str());
346 // use the next char instead
350 else if ( ch
== _T('\t') )
352 // everything after TAB is accel string, exit the loop
362 #endif // wxUSE_MENUS
364 // ----------------------------------------------------------------------------
365 // Window search functions
366 // ----------------------------------------------------------------------------
369 * If parent is non-NULL, look through children for a label or title
370 * matching the specified string. If NULL, look through all top-level windows.
375 wxFindWindowByLabel (const wxString
& title
, wxWindow
* parent
)
377 return wxWindow::FindWindowByLabel( title
, parent
);
382 * If parent is non-NULL, look through children for a name
383 * matching the specified string. If NULL, look through all top-level windows.
388 wxFindWindowByName (const wxString
& name
, wxWindow
* parent
)
390 return wxWindow::FindWindowByName( name
, parent
);
393 // Returns menu item id or -1 if none.
395 wxFindMenuItemId (wxFrame
* frame
, const wxString
& menuString
, const wxString
& itemString
)
398 wxMenuBar
*menuBar
= frame
->GetMenuBar ();
400 return menuBar
->FindMenuItem (menuString
, itemString
);
401 #endif // wxUSE_MENUS
406 // Try to find the deepest child that contains 'pt'.
407 // We go backwards, to try to allow for controls that are spacially
408 // within other controls, but are still siblings (e.g. buttons within
409 // static boxes). Static boxes are likely to be created _before_ controls
410 // that sit inside them.
411 wxWindow
* wxFindWindowAtPoint(wxWindow
* win
, const wxPoint
& pt
)
416 // Hack for wxNotebook case: at least in wxGTK, all pages
417 // claim to be shown, so we must only deal with the selected one.
419 if (win
->IsKindOf(CLASSINFO(wxNotebook
)))
421 wxNotebook
* nb
= (wxNotebook
*) win
;
422 int sel
= nb
->GetSelection();
425 wxWindow
* child
= nb
->GetPage(sel
);
426 wxWindow
* foundWin
= wxFindWindowAtPoint(child
, pt
);
435 else if (win->IsKindOf(CLASSINFO(wxFrame)))
437 // Pseudo-children that may not be mentioned in the child list
438 wxWindowList extraChildren;
439 wxFrame* frame = (wxFrame*) win;
440 if (frame->GetStatusBar())
441 extraChildren.Append(frame->GetStatusBar());
442 if (frame->GetToolBar())
443 extraChildren.Append(frame->GetToolBar());
445 wxNode* node = extraChildren.GetFirst();
448 wxWindow* child = (wxWindow*) node->GetData();
449 wxWindow* foundWin = wxFindWindowAtPoint(child, pt);
457 wxWindowList::Node
*node
= win
->GetChildren().GetLast();
460 wxWindow
* child
= node
->GetData();
461 wxWindow
* foundWin
= wxFindWindowAtPoint(child
, pt
);
464 node
= node
->GetPrevious();
467 wxPoint pos
= win
->GetPosition();
468 wxSize sz
= win
->GetSize();
469 if (win
->GetParent())
471 pos
= win
->GetParent()->ClientToScreen(pos
);
474 wxRect
rect(pos
, sz
);
481 wxWindow
* wxGenericFindWindowAtPoint(const wxPoint
& pt
)
483 // Go backwards through the list since windows
484 // on top are likely to have been appended most
486 wxWindowList::Node
*node
= wxTopLevelWindows
.GetLast();
489 wxWindow
* win
= node
->GetData();
490 wxWindow
* found
= wxFindWindowAtPoint(win
, pt
);
493 node
= node
->GetPrevious();
501 On Fri, 21 Jul 1995, Paul Craven wrote:
503 > Is there a way to find the path of running program's executable? I can get
504 > my home directory, and the current directory, but I don't know how to get the
505 > executable directory.
508 The code below (warty as it is), does what you want on most Unix,
509 DOS, and Mac platforms (it's from the ALS Prolog main).
511 || Ken Bowen Applied Logic Systems, Inc. PO Box 180,
512 ||==== Voice: +1 (617)965-9191 Newton Centre,
513 || FAX: +1 (617)965-1636 MA 02159 USA
514 Email: ken@als.com WWW: http://www.als.com
515 ------------------------------------------------------------------------
518 // This code is commented out but it may be integrated with wxWin at
519 // a later date, after testing. Thanks Ken!
522 /*--------------------------------------------------------------------*
523 | whereami is given a filename f in the form: whereami(argv[0])
524 | It returns the directory in which the executable file (containing
525 | this code [main.c] ) may be found. A dot will be returned to indicate
526 | the current directory.
527 *--------------------------------------------------------------------*/
533 register char *cutoff
= NULL
; /* stifle -Wall */
540 * See if the file is accessible either through the current directory
541 * or through an absolute path.
544 if (access(name
, R_OK
) == 0) {
546 /*-------------------------------------------------------------*
547 * The file was accessible without any other work. But the current
548 * working directory might change on us, so if it was accessible
549 * through the cwd, then we should get it for later accesses.
550 *-------------------------------------------------------------*/
553 if (!absolute_pathname(name
)) {
554 #if defined(__DOS__) || defined(__WIN32__)
560 if (*(name
+ 1) == ':') {
561 if (*name
>= 'a' && *name
<= 'z')
562 drive
= (int) (*name
- 'a' + 1);
564 drive
= (int) (*name
- 'A' + 1);
566 *newrbuf
++ = *(name
+ 1);
567 *newrbuf
++ = DIR_SEPARATOR
;
571 *newrbuf
++ = DIR_SEPARATOR
;
573 if (getcwd(newrbuf
, drive
) == 0) { /* } */
575 if (getcwd(newrbuf
, 1024) == 0) { /* } */
579 if (getwd(imagedir
) == 0) { /* } */
580 #else /* !HAVE_GETWD */
581 if (getcwd(imagedir
, 1024) == 0) {
582 #endif /* !HAVE_GETWD */
584 fatal_error(FE_GETCWD
, 0);
586 for (; *t
; t
++) /* Set t to end of buffer */
588 if (*(t
- 1) == DIR_SEPARATOR
) /* leave slash if already
593 cutoff
= t
; /* otherwise put one in */
594 *t
++ = DIR_SEPARATOR
;
597 #if (!defined(__MAC__) && !defined(__DJGPP__) && !defined(__GO32__) && !defined(__WIN32__))
599 (*t
++ = DIR_SEPARATOR
);
602 /*-------------------------------------------------------------*
603 * Copy the rest of the string and set the cutoff if it was not
604 * already set. If the first character of name is a slash, cutoff
605 * is not presently set but will be on the first iteration of the
607 *-------------------------------------------------------------*/
609 for ((*name
== DIR_SEPARATOR
? (s
= name
+1) : (s
= name
));;) {
610 if (*s
== DIR_SEPARATOR
)
619 /*-------------------------------------------------------------*
620 * Get the path list from the environment. If the path list is
621 * inaccessible for any reason, leave with fatal error.
622 *-------------------------------------------------------------*/
625 if ((s
= getenv("Commands")) == (char *) 0)
627 if ((s
= getenv("PATH")) == (char *) 0)
629 fatal_error(FE_PATH
, 0);
632 * Copy path list into ebuf and set the source pointer to the
633 * beginning of this buffer.
641 while (*s
&& *s
!= PATH_SEPARATOR
)
643 if (t
> imagedir
&& *(t
- 1) == DIR_SEPARATOR
)
644 ; /* do nothing -- slash already is in place */
646 *t
++ = DIR_SEPARATOR
; /* put in the slash */
647 cutoff
= t
- 1; /* set cutoff */
649 if (access(imagedir
, R_OK
) == 0)
653 s
++; /* advance source pointer */
655 fatal_error(FE_INFND
, 0);
660 /*-------------------------------------------------------------*
661 | At this point the full pathname should exist in imagedir and
662 | cutoff should be set to the final slash. We must now determine
663 | whether the file name is a symbolic link or not and chase it down
664 | if it is. Note that we reuse ebuf for getting the link.
665 *-------------------------------------------------------------*/
668 while ((cc
= readlink(imagedir
, ebuf
, 512)) != -1) {
671 if (*s
== DIR_SEPARATOR
) {
678 if (*s
== DIR_SEPARATOR
)
679 cutoff
= t
; /* mark the last slash seen */
680 if (!(*t
++ = *s
++)) /* copy the character */
685 #endif /* HAVE_SYMLINK */
687 strcpy(imagename
, cutoff
+ 1); /* keep the image name */
688 *(cutoff
+ 1) = 0; /* chop off the filename part */
695 // ----------------------------------------------------------------------------
697 // ----------------------------------------------------------------------------
700 * N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp
701 * since otherwise the generic code may be pulled in unnecessarily.
706 int wxMessageBox(const wxString
& message
, const wxString
& caption
, long style
,
707 wxWindow
*parent
, int WXUNUSED(x
), int WXUNUSED(y
) )
709 wxMessageDialog
dialog(parent
, message
, caption
, style
);
711 int ans
= dialog
.ShowModal();
724 wxFAIL_MSG( _T("unexpected return code from wxMessageDialog") );
729 #endif // wxUSE_MSGDLG
733 wxString
wxGetTextFromUser(const wxString
& message
, const wxString
& caption
,
734 const wxString
& defaultValue
, wxWindow
*parent
,
735 int x
, int y
, bool WXUNUSED(centre
) )
738 wxTextEntryDialog
dialog(parent
, message
, caption
, defaultValue
, wxOK
|wxCANCEL
, wxPoint(x
, y
));
739 if (dialog
.ShowModal() == wxID_OK
)
741 str
= dialog
.GetValue();
747 wxString
wxGetPasswordFromUser(const wxString
& message
,
748 const wxString
& caption
,
749 const wxString
& defaultValue
,
753 wxTextEntryDialog
dialog(parent
, message
, caption
, defaultValue
,
754 wxOK
| wxCANCEL
| wxTE_PASSWORD
);
755 if ( dialog
.ShowModal() == wxID_OK
)
757 str
= dialog
.GetValue();
763 #endif // wxUSE_TEXTDLG
767 wxColour
wxGetColourFromUser(wxWindow
*parent
, const wxColour
& colInit
)
770 data
.SetChooseFull(TRUE
);
773 data
.SetColour((wxColour
&)colInit
); // const_cast
777 wxColourDialog
dialog(parent
, &data
);
778 if ( dialog
.ShowModal() == wxID_OK
)
780 colRet
= dialog
.GetColourData().GetColour();
782 //else: leave it invalid
787 #endif // wxUSE_COLOURDLG
791 wxFont
wxGetFontFromUser(wxWindow
*parent
, const wxFont
& fontInit
)
796 data
.SetInitialFont(fontInit
);
800 wxFontDialog
dialog(parent
, data
);
801 if ( dialog
.ShowModal() == wxID_OK
)
803 fontRet
= dialog
.GetFontData().GetChosenFont();
805 //else: leave it invalid
810 #endif // wxUSE_FONTDLG
811 // ----------------------------------------------------------------------------
812 // missing C RTL functions (FIXME shouldn't be here at all)
813 // ----------------------------------------------------------------------------
815 #if defined( __MWERKS__ ) && !defined(__MACH__)
816 char *strdup(const char *s
)
818 return strcpy( (char*) malloc( strlen( s
) + 1 ) , s
) ;
822 return ( c
>= 0 && c
< 128 ) ;
826 // ----------------------------------------------------------------------------
827 // wxSafeYield and supporting functions
828 // ----------------------------------------------------------------------------
830 void wxEnableTopLevelWindows(bool enable
)
832 wxWindowList::Node
*node
;
833 for ( node
= wxTopLevelWindows
.GetFirst(); node
; node
= node
->GetNext() )
834 node
->GetData()->Enable(enable
);
837 wxWindowDisabler::wxWindowDisabler(wxWindow
*winToSkip
)
839 // remember the top level windows which were already disabled, so that we
840 // don't reenable them later
841 m_winDisabled
= NULL
;
843 wxWindowList::Node
*node
;
844 for ( node
= wxTopLevelWindows
.GetFirst(); node
; node
= node
->GetNext() )
846 wxWindow
*winTop
= node
->GetData();
847 if ( winTop
== winToSkip
)
850 if ( winTop
->IsEnabled() )
856 if ( !m_winDisabled
)
858 m_winDisabled
= new wxWindowList
;
861 m_winDisabled
->Append(winTop
);
866 wxWindowDisabler::~wxWindowDisabler()
868 wxWindowList::Node
*node
;
869 for ( node
= wxTopLevelWindows
.GetFirst(); node
; node
= node
->GetNext() )
871 wxWindow
*winTop
= node
->GetData();
872 if ( !m_winDisabled
|| !m_winDisabled
->Find(winTop
) )
876 //else: had been already disabled, don't reenable
879 delete m_winDisabled
;
882 // Yield to other apps/messages and disable user input to all windows except
884 bool wxSafeYield(wxWindow
*win
, bool onlyIfNeeded
)
886 wxWindowDisabler
wd(win
);
890 rc
= wxYieldIfNeeded();
897 // ----------------------------------------------------------------------------
899 // ----------------------------------------------------------------------------
901 // Don't synthesize KeyUp events holding down a key and producing KeyDown
902 // events with autorepeat. On by default and always on in wxMSW. wxGTK version
905 bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag
) )
907 return TRUE
; // detectable auto-repeat is the only mode MSW supports
913 const wxChar
*wxGetInstallPrefix()
917 if ( wxGetEnv(wxT("WXPREFIX"), &prefix
) )
918 return prefix
.c_str();
920 #ifdef wxINSTALL_PREFIX
921 return wxT(wxINSTALL_PREFIX
);
927 wxString
wxGetDataDir()
929 wxString format
= wxGetInstallPrefix();
930 format
<< wxFILE_SEP_PATH
931 << wxT("share") << wxFILE_SEP_PATH
932 << wxT("wx") << wxFILE_SEP_PATH
935 dir
.Printf(format
.c_str(), wxMAJOR_VERSION
, wxMINOR_VERSION
);
940 // ----------------------------------------------------------------------------
941 // network and user id functions
942 // ----------------------------------------------------------------------------
944 // Get Full RFC822 style email address
945 bool wxGetEmailAddress(wxChar
*address
, int maxSize
)
947 wxString email
= wxGetEmailAddress();
951 wxStrncpy(address
, email
, maxSize
- 1);
952 address
[maxSize
- 1] = wxT('\0');
957 wxString
wxGetEmailAddress()
961 wxString host
= wxGetFullHostName();
964 wxString user
= wxGetUserId();
967 email
<< user
<< wxT('@') << host
;
974 wxString
wxGetUserId()
976 static const int maxLoginLen
= 256; // FIXME arbitrary number
979 bool ok
= wxGetUserId(buf
.GetWriteBuf(maxLoginLen
), maxLoginLen
);
988 wxString
wxGetUserName()
990 static const int maxUserNameLen
= 1024; // FIXME arbitrary number
993 bool ok
= wxGetUserName(buf
.GetWriteBuf(maxUserNameLen
), maxUserNameLen
);
1002 wxString
wxGetHostName()
1004 static const size_t hostnameSize
= 257;
1007 bool ok
= wxGetHostName(buf
.GetWriteBuf(hostnameSize
), hostnameSize
);
1009 buf
.UngetWriteBuf();
1017 wxString
wxGetFullHostName()
1019 static const size_t hostnameSize
= 257;
1022 bool ok
= wxGetFullHostName(buf
.GetWriteBuf(hostnameSize
), hostnameSize
);
1024 buf
.UngetWriteBuf();
1032 wxString
wxGetHomeDir()
1035 wxGetHomeDir(&home
);
1042 wxString
wxGetCurrentDir()
1049 ok
= getcwd(dir
.GetWriteBuf(len
+ 1), len
) != NULL
;
1050 dir
.UngetWriteBuf();
1054 if ( errno
!= ERANGE
)
1056 wxLogSysError(_T("Failed to get current directory"));
1058 return wxEmptyString
;
1062 // buffer was too small, retry with a larger one
1074 // ----------------------------------------------------------------------------
1076 // ----------------------------------------------------------------------------
1078 // wxDoExecuteWithCapture() helper: reads an entire stream into one array
1080 // returns TRUE if ok, FALSE if error
1082 static bool ReadAll(wxInputStream
*is
, wxArrayString
& output
)
1084 wxCHECK_MSG( is
, FALSE
, _T("NULL stream in wxExecute()?") );
1086 // the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state
1089 wxTextInputStream
tis(*is
);
1094 wxString line
= tis
.ReadLine();
1110 #endif // wxUSE_STREAMS
1112 // this is a private function because it hasn't a clean interface: the first
1113 // array is passed by reference, the second by pointer - instead we have 2
1114 // public versions of wxExecute() below
1115 static long wxDoExecuteWithCapture(const wxString
& command
,
1116 wxArrayString
& output
,
1117 wxArrayString
* error
)
1120 wxFAIL_MSG("Sorry, this version of wxExecute not implemented on WIN16.");
1124 // create a wxProcess which will capture the output
1125 wxProcess
*process
= new wxProcess
;
1126 process
->Redirect();
1128 long rc
= wxExecute(command
, wxEXEC_SYNC
, process
);
1133 if ( !ReadAll(process
->GetInputStream(), output
) )
1138 if ( !ReadAll(process
->GetErrorStream(), *error
) )
1143 #endif // wxUSE_STREAMS
1148 #endif // IO redirection supoprted
1151 long wxExecute(const wxString
& command
, wxArrayString
& output
)
1153 return wxDoExecuteWithCapture(command
, output
, NULL
);
1156 long wxExecute(const wxString
& command
,
1157 wxArrayString
& output
,
1158 wxArrayString
& error
)
1160 return wxDoExecuteWithCapture(command
, output
, &error
);
1163 // ----------------------------------------------------------------------------
1164 // wxApp::Yield() wrappers for backwards compatibility
1165 // ----------------------------------------------------------------------------
1170 return wxTheApp
&& wxTheApp
->Yield();
1176 bool wxYieldIfNeeded()
1179 return wxTheApp
&& wxTheApp
->Yield(TRUE
);