Adding support expand-collapse pattern for DateTimePicker#5245
Conversation
082f3ce to
2bf9160
Compare
...stem.Windows.Forms/src/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...stem.Windows.Forms/src/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...stem.Windows.Forms/src/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/DateTimePicker.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/DateTimePicker.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/DateTimePicker.cs
Outdated
Show resolved
Hide resolved
7a5644b to
067c925
Compare
internal override void Expand()
{
SendMessageW(Owner, WM.SYSKEYDOWN, (IntPtr)Keys.Down);
}
internal override void Collapse()
{
SendMessageW(Owner, (WM)DTM.CLOSEMONTHCAL);
} |
067c925 to
12e47c9
Compare
...stem.Windows.Forms/src/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...stem.Windows.Forms/src/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...stem.Windows.Forms/src/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObject.cs
Outdated
Show resolved
Hide resolved
3621a7c to
2358965
Compare
|
Fix a test issue is in progress |
Tanya-Solyanik
left a comment
There was a problem hiding this comment.
Looks good, please address the comment about creation on accessible object on raising an event.
...stem.Windows.Forms/src/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObject.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Please use UiaClientsAreListening API. We should not create accessible object when not required to.
Even though this API returns true in the case of a touch driver, when accessibility tools are not running. Touch driver forces creation of accessibility objects by sending WM_GETOBJECT message, we can treat it as another accessibility tool in regard to creation of Accessibility Objects.
There was a problem hiding this comment.
FWIW, we asked Guy Barker about this API, and we were advised it may not work as expected
(us) Q: We have a problem with
UiaClientsAreListening()method that works incorrectly. It returns true even there are not any Accessiblity clients (AI, Inspect, Narrator, NVDA, etc.). Tanya asked me to take a look at its implementation in OS. (..snip..)(GB) A: ...unfortunately UiaClientsAreListening() can't be used to specifically learn whether an assistive technology (AT) like Narrator, Windows Magnifier, or Windows On-Screen Keyboard is running, (those 3 products are all UIA clients). Other UIA clients which aren't AT will also result in UiaClientsAreListening() returning true. UiaClientsAreListening() was first majorly impacted when the touch keyboard was introduced for Windows touch devices. The touch keyboard used UIA and so UiaClientsAreListening() returned true, regardless of whether any AT is running. As far as I know, this is still how things work today.
Again, as far as I know, there is no supported way in Windows to determine that AT is running, or that a specific type of AT like a screen reader is running. (Don't even think about trying to achieve this with the SystemParameterInfo SPI_GETSCREENREADER flag.) Sorry to be the bearer of bad news. You're not the only person who's looking for some way of doing this without checking what exes are running.
There was a problem hiding this comment.
Do you have any other ideas for this?
There was a problem hiding this comment.
I would use IsAccessibleObjectCreated property here.
UiaClientsAreListening doesn't work.
There was a problem hiding this comment.
Ok, let's try it. If you think it's incorrect, write here please - I will remove it
There was a problem hiding this comment.
Other UIA clients which aren't AT will also result in UiaClientsAreListening() returning true.
Please clarify why this is a problem?
Other UIA clients are creating AccessibleObjects for their purposes, so AccessibleObject would be created anyway. The goal is to not create the Object unnecessarily, not to raise notification only when "real" AT clients are listening.
There was a problem hiding this comment.
I really like your propose. But I take it UiaClientsAreListening() doesn't work correct now. If we paste method with incorrect realization it would not be good. So I would stay with IsAccessibleObjectCreated method here and try this approach when we will have correct api method.
...s/tests/UnitTests/System/Windows/Forms/DateTimePicker.DateTimePickerAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
6e46f1c to
283057e
Compare
Implemented ExpandCollapse pattern in DateTimePickerAccessibleObject class Added unit tests for this implementation
283057e to
b9d9d97
Compare
vladimir-krestov
left a comment
There was a problem hiding this comment.
Looks good. Approved.
|
@DmitryGorokhov , just need clarification on Tanyas question. otherwise, we are ready to merge this. |
|
Unfortunately, we didn't find an fast way to implement announcing state on calendar open action. But it is an additional functionality and it doesn't have any high priority for now. So, we decided that we can separate this into other issue. As a result, I've created issue #5487 for this feature. |
|
@dreddy-work, I guess this pr is ready for merge, you may do it |
|
... and I forgot to tell you - testers approved the fix |
…t#5245) Implemented ExpandCollapse pattern in DateTimePickerAccessibleObject class Added unit tests for this implementation
Implemented expand-collapse pattern in DateTimePickerAccessibleObject class
Fixes #4099
Proposed changes
DateTimePickerAccessibleObjectclassCustomer Impact
Regression?
Risk
Screenshots
Before
IsExpandCollapsePattermAvaliableproperty value is false.After
IsExpandCollapsePattermAvaliableproperty value is true and theExpandCollapseExpandCollapseStateproperty appear.Test methodology
Accessibility testing
Test environment(s)
Microsoft Reviewers: Open in CodeFlow