Browse Source

Accessibility: Added AccessibilityEvent::titleChanged

v6.1.6
ed 4 years ago
parent
commit
9ed55a7639
3 changed files with 17 additions and 1 deletions
  1. +7
    -1
      modules/juce_gui_basics/accessibility/enums/juce_AccessibilityEvent.h
  2. +1
    -0
      modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm
  3. +9
    -0
      modules/juce_gui_basics/native/accessibility/juce_win32_Accessibility.cpp

+ 7
- 1
modules/juce_gui_basics/accessibility/enums/juce_AccessibilityEvent.h View File

@@ -43,10 +43,16 @@ enum class AccessibilityEvent
*/
valueChanged,
/** Indicates that the title of the UI element has changed.
This should be called on the handler whose title has changed.
*/
titleChanged,
/** Indicates that the structure of the UI elements has changed in a
significant way.
This should be posted on the top-level handler whose structure has changed.
This should be called on the top-level handler whose structure has changed.
*/
structureChanged,


+ 1
- 0
modules/juce_gui_basics/native/accessibility/juce_mac_Accessibility.mm View File

@@ -1096,6 +1096,7 @@ void AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent eventTyp
case AccessibilityEvent::textChanged:
case AccessibilityEvent::valueChanged: return NSAccessibilityValueChangedNotification;
case AccessibilityEvent::titleChanged: return NSAccessibilityTitleChangedNotification;
case AccessibilityEvent::structureChanged: return NSAccessibilityLayoutChangedNotification;
}


+ 9
- 0
modules/juce_gui_basics/native/accessibility/juce_win32_Accessibility.cpp View File

@@ -166,6 +166,14 @@ void notifyAccessibilityEventInternal (const AccessibilityHandler& handler, Inte
void AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent eventType) const
{
if (eventType == AccessibilityEvent::titleChanged)
{
VARIANT newValue;
VariantHelpers::setString (getTitle(), &newValue);
sendAccessibilityPropertyChangedEvent (*this, UIA_NamePropertyId, newValue);
}
auto event = [eventType] () -> EVENTID
{
switch (eventType)
@@ -174,6 +182,7 @@ void AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent eventTyp
case AccessibilityEvent::textChanged: return UIA_Text_TextChangedEventId;
case AccessibilityEvent::structureChanged: return UIA_StructureChangedEventId;
case AccessibilityEvent::rowSelectionChanged: return UIA_SelectionItem_ElementSelectedEventId;
case AccessibilityEvent::titleChanged:
case AccessibilityEvent::valueChanged: break;
}


Loading…
Cancel
Save