-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement IRangeValueProvider #12356
base: main
Are you sure you want to change the base?
Conversation
|
||
|
||
|
||
return S_OK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are not going to implement this, you should return quiet NaN:
https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcore/nf-uiautomationcore-irangevalueprovider-get_largechange
HRESULT __stdcall CompositionDynamicAutomationProvider::get_SmallChange(double *pRetVal) { | ||
if (pRetVal == nullptr) | ||
return E_POINTER; | ||
return S_OK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should return quiet NaN
@@ -158,6 +158,13 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE | |||
AddRef(); | |||
} | |||
|
|||
if (patternId == UIA_RangeValuePatternId) { | |||
*pRetVal = static_cast<IRangeValueProvider *>(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably only return this pattern if the role is set to something that aligns with this pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we also do a role check for UIA_ValuePatternId as well (i.e if the role is not 'adjustable' or 'progressbar' since those roles correspond to RangeValuePattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea i think we'll want roles checks for each of these!
Type of Change
Why
Implements the IRangeValueProvider and supporting methods which is used to provide support for controls that can be set to a value within a range.
What
Implemented SetValue, get_Value, get_Minimum and get_Maximum methods as part of the IRangeValueProvider interface.
TODO: implment get_SmallChange and get_LargeChange.
Screenshots
After:
Testing
Tested locally on playground.
Changelog
Yes