Re: [orca-list] Structural HTML navigation by lists



Am 23.01.2011 01:07, schrieb Joanmarie Diggs:
Hey Marcus, all.

Currently I have implemented menus for all structural objects using the
structural navigation shortcuts.

Orca+Ctrl+A pop-ups a menu with all anchors
Orca+Ctrl+Q pop-ups a menu with all blockquotes
Orca+Ctrl+B pop-ups a menu with all buttons

[snip]

Did you do this through automatic generation, or hard-binding? In other
words, consider the following two examples:

1. A user decides to change all of the Structural Navigation keybindings
so that the letters used correspond with the first letter of the element
name in his/her native language. So, maybe anchors is now T and Shift+T.
It would be nice if the user didn't have to also rebind all the lists;
instead Orca+Ctrl+T should automatically just become the binding for a
list of anchors. (As an aside, such an approach would presumably also
address the case where users don't want to have bindings for lists of
structural navigation elements at all. They could just disable the list
functionality through a single setting and those bindings would never
come into existence.)

The bindings are hardcoded. For my new test I have gone another way than
before.

1. I have created a new script object_menu.py, where the code for the
pop-up menu and the functions for label guessing are located.

2. Instead of redefining every search funtion/method in a separate
script, I have extendet structural_navigation.py.

As example for anchors I have added this two lines:

listDesc = _("Show list of anchors.")
bindings["list"] = ["a", settings.ORCA_CTRL_MODIFIER_MASK, listDesc]

Because the "next" and "previous" bindings have a hardcoded "a" binding,
I have used this in my new "list" binding, too.

The new pop-up menu is using the criteria/predicate (for searching) and
present (for presenting) properties of the corresponding
StructuralNavigationObject instance.

This safes many lines of code. The current changes will result into a
patch with ~ 850 lines. My last patch on the other hand has more than
1500 lines.

2. A new structural navigation type gets added: Spelling errors. This
new magical object allows you to jump amongst words flagged as
misspelled. It would be really cool if -- without any additional code or
bindings changes -- one could obtain a list of spelling errors in a dialog.

This could be done if you add two lines like above to the corresponding
method (_spellingErrorsBindings or so). As I said the search and
presentation is done by the *Criteria/*Predicate and *Presentation methods.

I think this is a more better solution than my separeted scripts before.

FWIW, back when I was playing with all this myself -- giving up
(temporarily) due to the speed issue you and Attila mentioned on large
pages -- I merely had made some minor additions to the structural
navigation code which made it possible to list any object type. It also
used the existing 'label guess' code (currently in Gecko, in the process
of being cleaned up and pulled out of Gecko so any module can use it,
e.g. Orca's WebKitGtk support) for guessing the labels of unlabeled form
fields.

joanie, I have tested the guessTheLabel method some days ago to save
more code. But this method has returned mostly empty labels. And
currently it seems to me that this method is only executed on form
fields. Could this be true?

Greetings
Marcus



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]