Browse Source

ListBox: Send AccessibilityEvent::rowSelectionChanged events

v6.1.6
ed 4 years ago
parent
commit
8dfb916e9a
1 changed files with 20 additions and 2 deletions
  1. +20
    -2
      modules/juce_gui_basics/widgets/juce_ListBox.cpp

+ 20
- 2
modules/juce_gui_basics/widgets/juce_ListBox.cpp View File

@@ -594,8 +594,14 @@ void ListBox::updateContent()
viewport->updateVisibleArea (isVisible());
viewport->resized();
if (selectionChanged && model != nullptr)
model->selectedRowsChanged (lastRowSelected);
if (selectionChanged)
{
if (model != nullptr)
model->selectedRowsChanged (lastRowSelected);
if (auto* handler = getAccessibilityHandler())
handler->notifyAccessibilityEvent (AccessibilityEvent::rowSelectionChanged);
}
}
//==============================================================================
@@ -630,6 +636,9 @@ void ListBox::selectRowInternal (const int row,
lastRowSelected = row;
model->selectedRowsChanged (row);
if (auto* handler = getAccessibilityHandler())
handler->notifyAccessibilityEvent (AccessibilityEvent::rowSelectionChanged);
}
else
{
@@ -650,6 +659,9 @@ void ListBox::deselectRow (const int row)
viewport->updateContents();
model->selectedRowsChanged (lastRowSelected);
if (auto* handler = getAccessibilityHandler())
handler->notifyAccessibilityEvent (AccessibilityEvent::rowSelectionChanged);
}
}
@@ -666,6 +678,9 @@ void ListBox::setSelectedRows (const SparseSet<int>& setOfRowsToBeSelected,
if (model != nullptr && sendNotificationEventToModel == sendNotification)
model->selectedRowsChanged (lastRowSelected);
if (auto* handler = getAccessibilityHandler())
handler->notifyAccessibilityEvent (AccessibilityEvent::rowSelectionChanged);
}
SparseSet<int> ListBox::getSelectedRows() const
@@ -709,6 +724,9 @@ void ListBox::deselectAllRows()
if (model != nullptr)
model->selectedRowsChanged (lastRowSelected);
if (auto* handler = getAccessibilityHandler())
handler->notifyAccessibilityEvent (AccessibilityEvent::rowSelectionChanged);
}
}


Loading…
Cancel
Save