Skip to content

Commit 3792e90

Browse files
authored
Merge 74724cf into 51f5a38
2 parents 51f5a38 + 74724cf commit 3792e90

2 files changed

Lines changed: 42 additions & 10 deletions

File tree

source/NVDAObjects/UIA/__init__.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,6 +2055,35 @@ def event_UIA_itemStatus(self):
20552055
ui.message(f"{self.name} {itemStatus}")
20562056
self._itemStatusCache = itemStatus
20572057

2058+
def event_UIA_dragDropEffect(self):
2059+
# UIA drag drop effect was introduced in Windows 8.
2060+
try:
2061+
ui.message(self._getUIACacheablePropertyValue(UIAHandler.UIA_DragDropEffectPropertyId))
2062+
except COMError:
2063+
pass
2064+
2065+
def event_UIA_dropTargetEffect(self):
2066+
# UIA drop target effect property was introduced in Windows 8.
2067+
try:
2068+
dropTargetEffect = self._getUIACacheablePropertyValue(
2069+
UIAHandler.UIA_DropTargetDropTargetEffectPropertyId
2070+
)
2071+
except COMError:
2072+
dropTargetEffect = ""
2073+
# Sometimes drop target effect text is empty as it comes from a different object.
2074+
if not dropTargetEffect:
2075+
for element in reversed(api.getFocusAncestors()):
2076+
try:
2077+
dropTargetEffect = element._getUIACacheablePropertyValue(
2078+
UIAHandler.UIA_DropTargetDropTargetEffectPropertyId
2079+
)
2080+
except (COMError, AttributeError):
2081+
dropTargetEffect = ""
2082+
if dropTargetEffect:
2083+
break
2084+
if dropTargetEffect:
2085+
ui.message(dropTargetEffect)
2086+
20582087

20592088
class TreeviewItem(UIA):
20602089

source/UIAHandler/__init__.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,22 @@
169169
}
170170

171171
UIAPropertyIdsToNVDAEventNames={
172-
UIA_NamePropertyId:"nameChange",
173-
UIA_HelpTextPropertyId:"descriptionChange",
174-
UIA_ExpandCollapseExpandCollapseStatePropertyId:"stateChange",
175-
UIA_ToggleToggleStatePropertyId:"stateChange",
176-
UIA_IsEnabledPropertyId:"stateChange",
177-
UIA_ValueValuePropertyId:"valueChange",
178-
UIA_RangeValueValuePropertyId:"valueChange",
179-
UIA_ControllerForPropertyId:"UIA_controllerFor",
180-
UIA_ItemStatusPropertyId:"UIA_itemStatus",
172+
UIA.UIA_NamePropertyId: "nameChange",
173+
UIA.UIA_HelpTextPropertyId: "descriptionChange",
174+
UIA.UIA_ExpandCollapseExpandCollapseStatePropertyId: "stateChange",
175+
UIA.UIA_ToggleToggleStatePropertyId: "stateChange",
176+
UIA.UIA_IsEnabledPropertyId: "stateChange",
177+
UIA.UIA_ValueValuePropertyId: "valueChange",
178+
UIA.UIA_RangeValueValuePropertyId: "valueChange",
179+
UIA.UIA_ControllerForPropertyId: "UIA_controllerFor",
180+
UIA.UIA_ItemStatusPropertyId: "UIA_itemStatus",
181+
UIA.UIA_DragDropEffectPropertyId: "UIA_dragDropEffect",
182+
UIA.UIA_DropTargetDropTargetEffectPropertyId: "UIA_dropTargetEffect",
181183
}
182184

183185
globalEventHandlerGroupUIAPropertyIds = {
184-
UIA.UIA_RangeValueValuePropertyId
186+
UIA.UIA_RangeValueValuePropertyId,
187+
UIA.UIA_DropTargetDropTargetEffectPropertyId
185188
}
186189

187190
localEventHandlerGroupUIAPropertyIds = (

0 commit comments

Comments
 (0)