69
def onActiveDescendantChanged(self, event):
70
"""Called when an object who manages its own descendants detects a
71
change in one of its children.
77
# The tree table on the left side of Ekiga's Preferences dialog
78
# has STATE_FOCUSABLE, but not STATE_FOCUSED. The default script
79
# will ignore these events as a result. See bug 574221.
81
window = self.utilities.topLevelObject(event.source)
82
if not window or window.getRole() != pyatspi.ROLE_DIALOG:
83
return default.Script.onActiveDescendantChanged(self, event)
85
# There can be cases when the object that fires an
86
# active-descendant-changed event has no children. In this case,
87
# use the object that fired the event, otherwise, use the child.
89
child = event.any_data
92
orca.setLocusOfFocus(event, child)
94
orca.setLocusOfFocus(event, event.source)
96
# We'll tuck away the activeDescendant information for future
97
# reference since the AT-SPI gives us little help in finding
100
if orca_state.locusOfFocus \
101
and (orca_state.locusOfFocus != event.source):
102
self.pointOfReference['activeDescendantInfo'] = \
103
[orca_state.locusOfFocus.parent,
104
orca_state.locusOfFocus.getIndexInParent()]
106
def onFocus(self, event):
107
"""Called whenever an object gets focus.
113
# Selecting items in Ekiga's Preferences dialog causes objects
114
# of ROLE_PAGE_TAB to issue focus: events. These page tabs are
115
# not showing or visible, but they claim to be both. As a result
116
# Orca attempts to present them. Because these page tabs lack a
117
# name as well as STATE_SENSTIVE, this causes us to present
118
# "page grayed." We just want to ignore this creative use of a
119
# Gtk+ widget. See bug 574221.
121
if event.source.getRole() == pyatspi.ROLE_PAGE_TAB \
122
and not event.source.getState().contains(pyatspi.STATE_SENSITIVE) \
123
and not event.source.name:
126
default.Script.onFocus(self, event)
128
66
def onTextInserted(self, event):
129
67
"""Called whenever text is inserted into one of Ekiga's text objects.
130
68
Overridden here so that we can present new messages to the user.