Improve returning wxSYS_CARET_* metrics in wxMSW
The documentation stated that (a) wxSYS_CARET_{ON|OFF}_MSEC settings were not supported on MSW and (b) if a setting was not supported a negative value was returned. However, when calling wxSystemSettings::GetMetric(wxSYS_CARET_{ON|OFF}_MSEC), not only the method asserted but 0 was returned instead of a negative value. Fix this by using the value returned by ::GetCaretBlinkTime() for wxSYS_CARET_{ON|OFF}_MSEC. The documentation for wxSYS_CARET_TIMEOUT_MSEC does not list any platform limitations; however, attempting to obtain this value resulted in an assert and 0 returned. Fix this by returning -1. Returning -1 may not the be the ideal solution, but there is no value reserved for the setting not being supported and the caret on MSW usually blinks. Closes https://github.com/wxWidgets/wxWidgets/pull/1285
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user