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 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
29 #include "wx/string.h"
35 #include "wx/window.h"
38 #include "wx/msgdlg.h"
39 #include "wx/textdlg.h"
40 #include "wx/textctrl.h" // for wxTE_PASSWORD
42 #include "wx/menuitem.h"
48 #include "wx/apptrait.h"
50 #include "wx/process.h"
51 #include "wx/txtstrm.h"
53 #include "wx/mimetype.h"
54 #include "wx/config.h"
56 #if defined(__WXWINCE__) && wxUSE_DATETIME
57 #include "wx/datetime.h"
65 #if !defined(__WATCOMC__)
66 #if !(defined(_MSC_VER) && (_MSC_VER > 800))
72 #include "wx/colordlg.h"
73 #include "wx/fontdlg.h"
74 #include "wx/notebook.h"
76 #include "wx/statusbr.h"
82 #include "wx/msw/wince/time.h"
85 #if !defined(__MWERKS__) && !defined(__WXWINCE__)
86 #include <sys/types.h>
90 #if defined(__WXMSW__)
91 #include "wx/msw/private.h"
96 // ----------------------------------------------------------------------------
98 // ----------------------------------------------------------------------------
100 #if WXWIN_COMPATIBILITY_2_2
101 const wxChar
*wxInternalErrorStr
= wxT("wxWidgets Internal Error");
102 const wxChar
*wxFatalErrorStr
= wxT("wxWidgets Fatal Error");
103 #endif // WXWIN_COMPATIBILITY_2_2
105 // ============================================================================
107 // ============================================================================
109 #if WXWIN_COMPATIBILITY_2_4
112 copystring (const wxChar
*s
)
114 if (s
== NULL
) s
= wxEmptyString
;
115 size_t len
= wxStrlen (s
) + 1;
117 wxChar
*news
= new wxChar
[len
];
118 memcpy (news
, s
, len
* sizeof(wxChar
)); // Should be the fastest
123 #endif // WXWIN_COMPATIBILITY_2_4
125 // ----------------------------------------------------------------------------
126 // String <-> Number conversions (deprecated)
127 // ----------------------------------------------------------------------------
129 #if WXWIN_COMPATIBILITY_2_4
131 WXDLLIMPEXP_DATA_BASE(const wxChar
*) wxFloatToStringStr
= wxT("%.2f");
132 WXDLLIMPEXP_DATA_BASE(const wxChar
*) wxDoubleToStringStr
= wxT("%.2f");
135 StringToFloat (const wxChar
*s
, float *number
)
137 if (s
&& *s
&& number
)
138 *number
= (float) wxStrtod (s
, (wxChar
**) NULL
);
142 StringToDouble (const wxChar
*s
, double *number
)
144 if (s
&& *s
&& number
)
145 *number
= wxStrtod (s
, (wxChar
**) NULL
);
149 FloatToString (float number
, const wxChar
*fmt
)
151 static wxChar buf
[256];
153 wxSprintf (buf
, fmt
, number
);
158 DoubleToString (double number
, const wxChar
*fmt
)
160 static wxChar buf
[256];
162 wxSprintf (buf
, fmt
, number
);
167 StringToInt (const wxChar
*s
, int *number
)
169 if (s
&& *s
&& number
)
170 *number
= (int) wxStrtol (s
, (wxChar
**) NULL
, 10);
174 StringToLong (const wxChar
*s
, long *number
)
176 if (s
&& *s
&& number
)
177 *number
= wxStrtol (s
, (wxChar
**) NULL
, 10);
181 IntToString (int number
)
183 static wxChar buf
[20];
185 wxSprintf (buf
, wxT("%d"), number
);
190 LongToString (long number
)
192 static wxChar buf
[20];
194 wxSprintf (buf
, wxT("%ld"), number
);
198 #endif // WXWIN_COMPATIBILITY_2_4
200 // Array used in DecToHex conversion routine.
201 static wxChar hexArray
[] = wxT("0123456789ABCDEF");
203 // Convert 2-digit hex number to decimal
204 int wxHexToDec(const wxString
& buf
)
206 int firstDigit
, secondDigit
;
208 if (buf
.GetChar(0) >= wxT('A'))
209 firstDigit
= buf
.GetChar(0) - wxT('A') + 10;
211 firstDigit
= buf
.GetChar(0) - wxT('0');
213 if (buf
.GetChar(1) >= wxT('A'))
214 secondDigit
= buf
.GetChar(1) - wxT('A') + 10;
216 secondDigit
= buf
.GetChar(1) - wxT('0');
218 return (firstDigit
& 0xF) * 16 + (secondDigit
& 0xF );
221 // Convert decimal integer to 2-character hex string
222 void wxDecToHex(int dec
, wxChar
*buf
)
224 int firstDigit
= (int)(dec
/16.0);
225 int secondDigit
= (int)(dec
- (firstDigit
*16.0));
226 buf
[0] = hexArray
[firstDigit
];
227 buf
[1] = hexArray
[secondDigit
];
231 // Convert decimal integer to 2-character hex string
232 wxString
wxDecToHex(int dec
)
235 wxDecToHex(dec
, buf
);
236 return wxString(buf
);
239 // ----------------------------------------------------------------------------
241 // ----------------------------------------------------------------------------
243 // Return the current date/time
248 wxDateTime now
= wxDateTime::Now();
251 return wxEmptyString
;
254 time_t now
= time((time_t *) NULL
);
255 char *date
= ctime(&now
);
257 return wxString::FromAscii(date
);
261 void wxUsleep(unsigned long milliseconds
)
263 wxMilliSleep(milliseconds
);
266 const wxChar
*wxGetInstallPrefix()
270 if ( wxGetEnv(wxT("WXPREFIX"), &prefix
) )
271 return prefix
.c_str();
273 #ifdef wxINSTALL_PREFIX
274 return wxT(wxINSTALL_PREFIX
);
276 return wxEmptyString
;
280 wxString
wxGetDataDir()
282 wxString dir
= wxGetInstallPrefix();
283 dir
<< wxFILE_SEP_PATH
<< wxT("share") << wxFILE_SEP_PATH
<< wxT("wx");
287 int wxGetOsVersion(int *verMaj
, int *verMin
)
289 // we want this function to work even if there is no wxApp
290 wxConsoleAppTraits traitsConsole
;
291 wxAppTraits
*traits
= wxTheApp
? wxTheApp
->GetTraits() : NULL
;
293 traits
= &traitsConsole
;
295 wxToolkitInfo
& info
= traits
->GetToolkitInfo();
297 *verMaj
= info
.versionMajor
;
299 *verMin
= info
.versionMinor
;
303 // ----------------------------------------------------------------------------
304 // network and user id functions
305 // ----------------------------------------------------------------------------
307 // Get Full RFC822 style email address
308 bool wxGetEmailAddress(wxChar
*address
, int maxSize
)
310 wxString email
= wxGetEmailAddress();
314 wxStrncpy(address
, email
, maxSize
- 1);
315 address
[maxSize
- 1] = wxT('\0');
320 wxString
wxGetEmailAddress()
324 wxString host
= wxGetFullHostName();
327 wxString user
= wxGetUserId();
330 email
<< user
<< wxT('@') << host
;
337 wxString
wxGetUserId()
339 static const int maxLoginLen
= 256; // FIXME arbitrary number
342 bool ok
= wxGetUserId(wxStringBuffer(buf
, maxLoginLen
), maxLoginLen
);
350 wxString
wxGetUserName()
352 static const int maxUserNameLen
= 1024; // FIXME arbitrary number
355 bool ok
= wxGetUserName(wxStringBuffer(buf
, maxUserNameLen
), maxUserNameLen
);
363 wxString
wxGetHostName()
365 static const size_t hostnameSize
= 257;
368 bool ok
= wxGetHostName(wxStringBuffer(buf
, hostnameSize
), hostnameSize
);
376 wxString
wxGetFullHostName()
378 static const size_t hostnameSize
= 257;
381 bool ok
= wxGetFullHostName(wxStringBuffer(buf
, hostnameSize
), hostnameSize
);
389 wxString
wxGetHomeDir()
399 wxString
wxGetCurrentDir()
406 ok
= getcwd(dir
.GetWriteBuf(len
+ 1), len
) != NULL
;
411 if ( errno
!= ERANGE
)
413 wxLogSysError(_T("Failed to get current directory"));
415 return wxEmptyString
;
419 // buffer was too small, retry with a larger one
431 // ----------------------------------------------------------------------------
433 // ----------------------------------------------------------------------------
435 // wxDoExecuteWithCapture() helper: reads an entire stream into one array
437 // returns true if ok, false if error
439 static bool ReadAll(wxInputStream
*is
, wxArrayString
& output
)
441 wxCHECK_MSG( is
, false, _T("NULL stream in wxExecute()?") );
443 // the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state
446 wxTextInputStream
tis(*is
);
451 wxString line
= tis
.ReadLine();
467 #endif // wxUSE_STREAMS
469 // this is a private function because it hasn't a clean interface: the first
470 // array is passed by reference, the second by pointer - instead we have 2
471 // public versions of wxExecute() below
472 static long wxDoExecuteWithCapture(const wxString
& command
,
473 wxArrayString
& output
,
474 wxArrayString
* error
,
477 // create a wxProcess which will capture the output
478 wxProcess
*process
= new wxProcess
;
481 long rc
= wxExecute(command
, wxEXEC_SYNC
| flags
, process
);
486 if ( !ReadAll(process
->GetInputStream(), output
) )
491 if ( !ReadAll(process
->GetErrorStream(), *error
) )
499 #endif // wxUSE_STREAMS/!wxUSE_STREAMS
506 long wxExecute(const wxString
& command
, wxArrayString
& output
, int flags
)
508 return wxDoExecuteWithCapture(command
, output
, NULL
, flags
);
511 long wxExecute(const wxString
& command
,
512 wxArrayString
& output
,
513 wxArrayString
& error
,
516 return wxDoExecuteWithCapture(command
, output
, &error
, flags
);
519 // ----------------------------------------------------------------------------
520 // Launch default browser
521 // ----------------------------------------------------------------------------
523 bool wxLaunchDefaultBrowser(const wxString
& url
)
527 wxString finalurl
= url
;
529 //if it isn't a full url, try appending http:// to it
530 if(wxURI(url
).IsReference())
531 finalurl
= wxString(wxT("http://")) + url
;
533 #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
537 // ShellExecute() always opens in the same window,
538 // so do it manually for new window (from Mahogany)
539 wxRegKey
key(wxRegKey::HKCR
, url
.BeforeFirst(':') + wxT("\\shell\\open"));
542 wxRegKey
keyDDE(key
, wxT("DDEExec"));
543 if ( keyDDE
.Exists() )
545 wxRegKey
keyTopic(keyDDE
, wxT("topic"));
546 wxString ddeTopic
= keyTopic
.QueryDefaultValue();
548 // we only know the syntax of WWW_OpenURL DDE request
549 if ( ddeTopic
== wxT("WWW_OpenURL") )
551 wxString ddeCmd
= keyDDE
.QueryDefaultValue();
553 // this is a bit naive but should work as -1 can't appear
554 // elsewhere in the DDE topic, normally
555 if ( ddeCmd
.Replace(wxT("-1"), wxT("0"),
556 false /* only first occurence */) == 1 )
558 // and also replace the parameters
559 if ( ddeCmd
.Replace(wxT("%1"), url
, false) == 1 )
561 // magic incantation understood by wxMSW
562 command
<< wxT("WX_DDE#")
563 << wxRegKey(key
, wxT("command")).QueryDefaultValue() << wxT('#')
564 << wxRegKey(keyDDE
, wxT("application")).QueryDefaultValue()
565 << wxT('#') << ddeTopic
<< wxT('#')
573 //Try wxExecute - if it doesn't work or the regkey stuff
574 //above failed, fallback to opening the file in the same
576 if ( command
.empty() || wxExecute(command
) == -1)
578 int nResult
; //HINSTANCE error code
580 #if !defined(__WXWINCE__)
581 // CYGWIN and MINGW may have problems - so load ShellExecute
583 typedef HINSTANCE (WINAPI
*LPShellExecute
)(HWND hwnd
, const wxChar
* lpOperation
,
584 const wxChar
* lpFile
,
585 const wxChar
* lpParameters
,
586 const wxChar
* lpDirectory
,
589 HINSTANCE hShellDll
= ::LoadLibrary(wxT("shell32.dll"));
590 if(hShellDll
== NULL
)
593 LPShellExecute lpShellExecute
=
594 (LPShellExecute
) ::GetProcAddress(hShellDll
,
595 wxString::Format(wxT("ShellExecute%s"),
605 ).mb_str(wxConvLocal
)
608 if(lpShellExecute
== NULL
)
611 // Windows sometimes doesn't open the browser correctly when using mime
612 // types, so do ShellExecute - i.e. start <url> (from James Carroll)
613 nResult
= (int) (*lpShellExecute
)(NULL
, NULL
, finalurl
.c_str(),
614 NULL
, wxT(""), SW_SHOWNORMAL
);
615 // Unload Shell32.dll
616 ::FreeLibrary(hShellDll
);
618 //Windows CE does not have normal ShellExecute - but it has
619 //ShellExecuteEx all the way back to version 1.0
622 //Set up the SHELLEXECUTEINFO structure to pass to ShellExecuteEx
623 SHELLEXECUTEINFO sei
;
624 sei
.cbSize
= sizeof(SHELLEXECUTEINFO
);
629 sei
.hkeyClass
= NULL
;
637 sei
.lpDirectory
= NULL
;
638 sei
.lpFile
= finalurl
.c_str();
640 sei
.lpParameters
= NULL
;
641 sei
.lpVerb
= TEXT("open");
642 sei
.nShow
= SW_SHOWNORMAL
;
644 //Call ShellExecuteEx
645 ShellExecuteEx(&sei
);
648 nResult
= (int) sei
.hInstApp
;
651 // Hack for Firefox (returns file not found for some reason)
652 // from Angelo Mandato's wxHyperlinksCtrl
653 // HINSTANCE_ERROR == 32 (HINSTANCE_ERROR does not exist on Windows CE)
654 if (nResult
<= 32 && nResult
!= SE_ERR_FNF
)
658 // Log something if SE_ERR_FNF happens
659 if(nResult
== SE_ERR_FNF
)
660 wxLogDebug(wxT("Got SE_ERR_FNF from ShellExecute - maybe FireFox"));
667 wxFileType
*ft
= wxTheMimeTypesManager
->GetFileTypeFromExtension (_T("html"));
670 wxLogError(_T("No default application can open .html extension"));
675 ft
->GetMimeType(&mt
);
678 bool ok
= ft
->GetOpenCommand (&cmd
, wxFileType::MessageParameters(finalurl
));
683 if( wxExecute (cmd
, wxEXEC_ASYNC
) == -1 )
685 wxLogError(_T("Failed to launch application for wxLaunchDefaultBrowser"));
691 // fallback to checking for the BROWSER environment variable
692 cmd
= wxGetenv(wxT("BROWSER"));
693 if ( cmd
.empty() || wxExecute(cmd
+ wxT(" ") + finalurl
) == -1)
698 #else // !wxUSE_MIMETYPE && !(WXMSW && wxUSE_NATIVE_CONFIG)
704 //success - hopefully
708 // ----------------------------------------------------------------------------
709 // wxApp::Yield() wrappers for backwards compatibility
710 // ----------------------------------------------------------------------------
714 return wxTheApp
&& wxTheApp
->Yield();
717 bool wxYieldIfNeeded()
719 return wxTheApp
&& wxTheApp
->Yield(true);
724 // ============================================================================
725 // GUI-only functions from now on
726 // ============================================================================
731 static long wxCurrentId
= 100;
735 // skip the part of IDs space that contains hard-coded values:
736 if (wxCurrentId
== wxID_LOWEST
)
737 wxCurrentId
= wxID_HIGHEST
+ 1;
739 return wxCurrentId
++;
743 wxGetCurrentId(void) { return wxCurrentId
; }
746 wxRegisterId (long id
)
748 if (id
>= wxCurrentId
)
749 wxCurrentId
= id
+ 1;
754 // ----------------------------------------------------------------------------
755 // Menu accelerators related functions
756 // ----------------------------------------------------------------------------
758 wxChar
*wxStripMenuCodes(const wxChar
*in
, wxChar
*out
)
760 wxString s
= wxMenuItem::GetLabelFromText(in
);
763 // go smash their buffer if it's not big enough - I love char * params
764 memcpy(out
, s
.c_str(), s
.length() * sizeof(wxChar
));
768 // MYcopystring - for easier search...
769 out
= new wxChar
[s
.length() + 1];
770 wxStrcpy(out
, s
.c_str());
776 wxString
wxStripMenuCodes(const wxString
& in
)
780 size_t len
= in
.length();
783 for ( size_t n
= 0; n
< len
; n
++ )
788 // skip it, it is used to introduce the accel char (or to quote
789 // itself in which case it should still be skipped): note that it
790 // can't be the last character of the string
793 wxLogDebug(_T("Invalid menu string '%s'"), in
.c_str());
797 // use the next char instead
801 else if ( ch
== _T('\t') )
803 // everything after TAB is accel string, exit the loop
813 #endif // wxUSE_MENUS
815 // ----------------------------------------------------------------------------
816 // Window search functions
817 // ----------------------------------------------------------------------------
820 * If parent is non-NULL, look through children for a label or title
821 * matching the specified string. If NULL, look through all top-level windows.
826 wxFindWindowByLabel (const wxString
& title
, wxWindow
* parent
)
828 return wxWindow::FindWindowByLabel( title
, parent
);
833 * If parent is non-NULL, look through children for a name
834 * matching the specified string. If NULL, look through all top-level windows.
839 wxFindWindowByName (const wxString
& name
, wxWindow
* parent
)
841 return wxWindow::FindWindowByName( name
, parent
);
844 // Returns menu item id or wxNOT_FOUND if none.
846 wxFindMenuItemId (wxFrame
* frame
, const wxString
& menuString
, const wxString
& itemString
)
849 wxMenuBar
*menuBar
= frame
->GetMenuBar ();
851 return menuBar
->FindMenuItem (menuString
, itemString
);
852 #endif // wxUSE_MENUS
857 // Try to find the deepest child that contains 'pt'.
858 // We go backwards, to try to allow for controls that are spacially
859 // within other controls, but are still siblings (e.g. buttons within
860 // static boxes). Static boxes are likely to be created _before_ controls
861 // that sit inside them.
862 wxWindow
* wxFindWindowAtPoint(wxWindow
* win
, const wxPoint
& pt
)
867 // Hack for wxNotebook case: at least in wxGTK, all pages
868 // claim to be shown, so we must only deal with the selected one.
870 if (win
->IsKindOf(CLASSINFO(wxNotebook
)))
872 wxNotebook
* nb
= (wxNotebook
*) win
;
873 int sel
= nb
->GetSelection();
876 wxWindow
* child
= nb
->GetPage(sel
);
877 wxWindow
* foundWin
= wxFindWindowAtPoint(child
, pt
);
884 wxWindowList::compatibility_iterator node
= win
->GetChildren().GetLast();
887 wxWindow
* child
= node
->GetData();
888 wxWindow
* foundWin
= wxFindWindowAtPoint(child
, pt
);
891 node
= node
->GetPrevious();
894 wxPoint pos
= win
->GetPosition();
895 wxSize sz
= win
->GetSize();
896 if (win
->GetParent())
898 pos
= win
->GetParent()->ClientToScreen(pos
);
901 wxRect
rect(pos
, sz
);
908 wxWindow
* wxGenericFindWindowAtPoint(const wxPoint
& pt
)
910 // Go backwards through the list since windows
911 // on top are likely to have been appended most
913 wxWindowList::compatibility_iterator node
= wxTopLevelWindows
.GetLast();
916 wxWindow
* win
= node
->GetData();
917 wxWindow
* found
= wxFindWindowAtPoint(win
, pt
);
920 node
= node
->GetPrevious();
925 // ----------------------------------------------------------------------------
927 // ----------------------------------------------------------------------------
930 * N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp
931 * since otherwise the generic code may be pulled in unnecessarily.
936 int wxMessageBox(const wxString
& message
, const wxString
& caption
, long style
,
937 wxWindow
*parent
, int WXUNUSED(x
), int WXUNUSED(y
) )
939 long decorated_style
= style
;
941 if ( ( style
& ( wxICON_EXCLAMATION
| wxICON_HAND
| wxICON_INFORMATION
| wxICON_QUESTION
) ) == 0 )
943 decorated_style
|= ( style
& wxYES
) ? wxICON_QUESTION
: wxICON_INFORMATION
;
946 wxMessageDialog
dialog(parent
, message
, caption
, decorated_style
);
948 int ans
= dialog
.ShowModal();
961 wxFAIL_MSG( _T("unexpected return code from wxMessageDialog") );
966 #endif // wxUSE_MSGDLG
970 wxString
wxGetTextFromUser(const wxString
& message
, const wxString
& caption
,
971 const wxString
& defaultValue
, wxWindow
*parent
,
972 wxCoord x
, wxCoord y
, bool centre
)
975 long style
= wxTextEntryDialogStyle
;
982 wxTextEntryDialog
dialog(parent
, message
, caption
, defaultValue
, style
, wxPoint(x
, y
));
984 if (dialog
.ShowModal() == wxID_OK
)
986 str
= dialog
.GetValue();
992 wxString
wxGetPasswordFromUser(const wxString
& message
,
993 const wxString
& caption
,
994 const wxString
& defaultValue
,
996 wxCoord x
, wxCoord y
, bool centre
)
999 long style
= wxTextEntryDialogStyle
;
1006 wxPasswordEntryDialog
dialog(parent
, message
, caption
, defaultValue
,
1007 style
, wxPoint(x
, y
));
1008 if ( dialog
.ShowModal() == wxID_OK
)
1010 str
= dialog
.GetValue();
1016 #endif // wxUSE_TEXTDLG
1020 wxColour
wxGetColourFromUser(wxWindow
*parent
, const wxColour
& colInit
)
1023 data
.SetChooseFull(true);
1026 data
.SetColour((wxColour
&)colInit
); // const_cast
1030 wxColourDialog
dialog(parent
, &data
);
1031 if ( dialog
.ShowModal() == wxID_OK
)
1033 colRet
= dialog
.GetColourData().GetColour();
1035 //else: leave it invalid
1040 #endif // wxUSE_COLOURDLG
1044 wxFont
wxGetFontFromUser(wxWindow
*parent
, const wxFont
& fontInit
)
1047 if ( fontInit
.Ok() )
1049 data
.SetInitialFont(fontInit
);
1053 wxFontDialog
dialog(parent
, data
);
1054 if ( dialog
.ShowModal() == wxID_OK
)
1056 fontRet
= dialog
.GetFontData().GetChosenFont();
1058 //else: leave it invalid
1063 #endif // wxUSE_FONTDLG
1065 // ----------------------------------------------------------------------------
1066 // wxSafeYield and supporting functions
1067 // ----------------------------------------------------------------------------
1069 void wxEnableTopLevelWindows(bool enable
)
1071 wxWindowList::compatibility_iterator node
;
1072 for ( node
= wxTopLevelWindows
.GetFirst(); node
; node
= node
->GetNext() )
1073 node
->GetData()->Enable(enable
);
1076 wxWindowDisabler::wxWindowDisabler(wxWindow
*winToSkip
)
1078 // remember the top level windows which were already disabled, so that we
1079 // don't reenable them later
1080 m_winDisabled
= NULL
;
1082 wxWindowList::compatibility_iterator node
;
1083 for ( node
= wxTopLevelWindows
.GetFirst(); node
; node
= node
->GetNext() )
1085 wxWindow
*winTop
= node
->GetData();
1086 if ( winTop
== winToSkip
)
1089 // we don't need to disable the hidden or already disabled windows
1090 if ( winTop
->IsEnabled() && winTop
->IsShown() )
1096 if ( !m_winDisabled
)
1098 m_winDisabled
= new wxWindowList
;
1101 m_winDisabled
->Append(winTop
);
1106 wxWindowDisabler::~wxWindowDisabler()
1108 wxWindowList::compatibility_iterator node
;
1109 for ( node
= wxTopLevelWindows
.GetFirst(); node
; node
= node
->GetNext() )
1111 wxWindow
*winTop
= node
->GetData();
1112 if ( !m_winDisabled
|| !m_winDisabled
->Find(winTop
) )
1116 //else: had been already disabled, don't reenable
1119 delete m_winDisabled
;
1122 // Yield to other apps/messages and disable user input to all windows except
1124 bool wxSafeYield(wxWindow
*win
, bool onlyIfNeeded
)
1126 wxWindowDisabler
wd(win
);
1130 rc
= wxYieldIfNeeded();
1137 // Don't synthesize KeyUp events holding down a key and producing KeyDown
1138 // events with autorepeat. On by default and always on in wxMSW. wxGTK version
1141 bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag
) )
1143 return true; // detectable auto-repeat is the only mode MSW supports