Beispiel #1
0
    def addBookmark(self, inputEvent):
        """ Add an in-page accessible object bookmark for this key. """
        context = self._script.getFlatReviewContext()
        self._bookmarks[inputEvent.hw_code] = self._contextToBookmark(context)

        # Translators: this announces that a bookmark has been entered.
        # Orca allows users to tell it to remember a particular spot in an
        # application window and provides keystrokes for the user to jump to
        # those spots.  These spots are known as 'bookmarks'.
        #
        utterances = [_('bookmark entered')]
        utterances.extend(self._script.speechGenerator.getSpeech( \
                          context.getCurrentAccessible(), False))
        speech.speakUtterances(utterances)
 def addBookmark(self, inputEvent):
     """ Add an in-page accessible object bookmark for this key. """
     context = self._script.getFlatReviewContext()
     self._bookmarks[inputEvent.hw_code] = self._contextToBookmark(context)
     
     # Translators: this announces that a bookmark has been entered.  
     # Orca allows users to tell it to remember a particular spot in an 
     # application window and provides keystrokes for the user to jump to 
     # those spots.  These spots are known as 'bookmarks'. 
     #
     utterances = [_('bookmark entered')]
     utterances.extend(self._script.speechGenerator.getSpeech( \
                       context.getCurrentAccessible(), False))
     speech.speakUtterances(utterances)
Beispiel #3
0
    def visualAppearanceChanged(self, event, obj):
        """Called when the visual appearance of an object changes.  This
        method should not be called for objects whose visual appearance
        changes solely because of focus -- setLocusOfFocus is used for that.
        Instead, it is intended mostly for objects whose notional 'value' has
        changed, such as a checkbox changing state, a progress bar advancing,
        a slider moving, text inserted, caret moved, etc.

        Arguments:
        - event: if not None, the Event that caused this to happen
        - obj: the Accessible whose visual appearance changed.
        """

        self._debug("visualAppearanceChanged: %s '%s', locusOfFocus=%s" % \
                    (obj.role, obj.name, orca_state.locusOfFocus.role))

        # Present to Braille and Speech an object that is the same
        # with the last focused object, only if it is a label.
        # This case is for LISTs which contain labels as items
        # (see Open dialog lists).
        #
        if orca_state.activeScript.isSameObject(obj, orca_state.locusOfFocus):
            if obj.role == rolenames.ROLE_LABEL:
                self.updateBraille(orca_state.locusOfFocus)
                speech.speakUtterances(
                    self.speechGenerator.getSpeech(orca_state.locusOfFocus,
                                                   True))
                return

        if obj.role == rolenames.ROLE_SPIN_BOX:
            # Check for the spinbox text object being null. There appears
            # to be a bug where the text object for some text fields
            # is null.
            if orca_state.locusOfFocus.role == rolenames.ROLE_TEXT and \
               orca_state.locusOfFocus.text == None:
                # Set the locusOfFocus to the spinbox itself.
                orca.setLocusOfFocus(event, obj)

        default.Script.visualAppearanceChanged(self, event, obj)
    def visualAppearanceChanged(self, event, obj):
        """Called when the visual appearance of an object changes.  This
        method should not be called for objects whose visual appearance
        changes solely because of focus -- setLocusOfFocus is used for that.
        Instead, it is intended mostly for objects whose notional 'value' has
        changed, such as a checkbox changing state, a progress bar advancing,
        a slider moving, text inserted, caret moved, etc.

        Arguments:
        - event: if not None, the Event that caused this to happen
        - obj: the Accessible whose visual appearance changed.
        """

        self._debug("visualAppearanceChanged: %s '%s', locusOfFocus=%s" % \
                    (obj.role, obj.name, orca_state.locusOfFocus.role))

        # Present to Braille and Speech an object that is the same
        # with the last focused object, only if it is a label.
        # This case is for LISTs which contain labels as items
        # (see Open dialog lists).
        #
        if orca_state.activeScript.isSameObject(obj, orca_state.locusOfFocus):
            if obj.role == rolenames.ROLE_LABEL:
                self.updateBraille(orca_state.locusOfFocus)
                speech.speakUtterances(self.speechGenerator.getSpeech(orca_state.locusOfFocus, True))
                return

        if obj.role == rolenames.ROLE_SPIN_BOX:
            # Check for the spinbox text object being null. There appears
            # to be a bug where the text object for some text fields
            # is null. 
            if orca_state.locusOfFocus.role == rolenames.ROLE_TEXT and \
               orca_state.locusOfFocus.text == None:
                # Set the locusOfFocus to the spinbox itself.
                orca.setLocusOfFocus(event, obj)

        default.Script.visualAppearanceChanged(self, event, obj)