Skip to content

Commit

Permalink
NVDAObjects.UIA: introduce base implementation of UIA item status pro…
Browse files Browse the repository at this point in the history
…perty event. Re nvaccess#13973.

Announce item status UIA property whenever it changes provided that there is no pending event of the same coming from the same element. Note that both the element name and item status are announced.
  • Loading branch information
josephsl committed Aug 28, 2022
1 parent 8c982cd commit be08255
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/NVDAObjects/UIA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import config
import speech
import api
import eventHandler
import textInfos
from logHandler import log
from UIAHandler.types import (
Expand Down Expand Up @@ -2035,6 +2036,20 @@ def event_UIA_notification(self, notificationKind=None, notificationProcessing=U
speech.cancelSpeech()
ui.message(displayString)

def event_UIA_itemStatus(self):
"""
Base implementation of UIA item status property event.
By default NVDA will announce element name and item status if any.
"""
itemStatus = self.UIAElement.currentItemStatus
# Filter duplicate events.
if (
eventHandler.isPendingEvents(eventName="UIA_itemStatus", obj=self)
):
return
ui.message(f"{self.name} {itemStatus}")


class TreeviewItem(UIA):

def _get_value(self):
Expand Down

0 comments on commit be08255

Please sign in to comment.