diff --git a/interface/wx/settings.h b/interface/wx/settings.h index 925c6aa9c4..9a6d8621e3 100644 --- a/interface/wx/settings.h +++ b/interface/wx/settings.h @@ -197,7 +197,7 @@ enum wxSystemMetric Time, in milliseconds, for how long a blinking caret should stay visible during a single blink cycle before it disappears. If this value is negative, the platform does not support the - user setting. Implemented only on GTK+ and MacOS X. + user setting. @since 3.1.1 */ @@ -208,8 +208,7 @@ enum wxSystemMetric stay invisible during a single blink cycle before it reappears. If this value is zero, carets should be visible all the time instead of blinking. If the value is negative, the platform - does not support the user setting. Implemented only on GTK+ - and MacOS X. + does not support the user setting. @since 3.1.1 */ diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index 4b8534f18b..3377b5b080 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -253,7 +253,10 @@ static const int gs_metricsMap[] = SM_PENWINDOWS, SM_SHOWSOUNDS, SM_SWAPBUTTON, - -1 // wxSYS_DCLICK_MSEC - not available as system metric + -1, // wxSYS_DCLICK_MSEC - not available as system metric + -1, // wxSYS_CARET_ON_MSEC - not available as system metric + -1, // wxSYS_CARET_OFF_MSEC - not available as system metric + -1 // wxSYS_CARET_TIMEOUT_MSEC - not available as system metric }; // Get a system metric, e.g. scrollbar size @@ -268,6 +271,25 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w return ::GetDoubleClickTime(); } + // return the caret blink time for both + // wxSYS_CARET_ON_MSEC and wxSYS_CARET_OFF_MSEC + if ( index == wxSYS_CARET_ON_MSEC || index == wxSYS_CARET_OFF_MSEC ) + { + const UINT blinkTime = ::GetCaretBlinkTime(); + + if ( blinkTime == 0 ) // error + { + return -1; + } + + if ( blinkTime == INFINITE ) // caret does not blink + { + return 0; + } + + return blinkTime; + } + int indexMSW = gs_metricsMap[index]; if ( indexMSW == -1 ) {