[nvda-addons] Re: Developing Addons - The best way to get started?

  • From: James Scholes <james@xxxxxxxxxxxxx>
  • To: nvda-addons@xxxxxxxxxxxxx
  • Date: Thu, 14 Apr 2016 22:02:12 +0100

Damien Sykes-Pendleton wrote:

The program is a family tree builder – so far the only accessible one I
have found.
When you select a person in the primary navigation area it shows up
summary information for them, (date and place of birth, date, place, and
age at marriage, and date, place and age at death).

Okay, so to sum up, you've got a bunch of static text controls which
change/appear/disappear based on a selection in the primary navigation
area, which I'm guessing is a tree view, list view, list box  or
similar.  Thus, you'd like NVDA to read those static text boxes
automatically when that selection changes.

A good starting point would be to get at least one of those boxes to
read automatically, e.g. the birth date and place which seem to appear
in one static text field.  After that, it's probably just a case of
repeating yourself for all of them.

You could refer to this earlier thread, in which we helped Pranav Lal
achieve something similar inside an app module for DocuScan Plus:

http://bit.ly/nvda-docuscan

Also, here's an excerpt from an app module I wrote for the foobar2000
media player.  This application has a lot of unconventional sliders with
their actual values listed as static text controls next to the sliders
themselves.  Thus, this code ensures that when the value of one of these
sliders changes, NVDA reads the text of the static label, not the value
of the slider itself.  I wrote this a long time ago so it's probably not
the best example of how to write good add-on code, but it does
demonstrate an approach that you could probably use yourself.

class AppModule(appModuleHandler.AppModule):
    def __init__(self, *args, **kwargs):
        super(AppModule, self).__init__(*args, **kwargs)
        self.slider_window_control_ids = [1000, 1004, 1013, 1027, 1128,
1130]

    def event_valueChange(self, obj, nextHandler):
        if obj.role == ROLE_SLIDER and obj.windowControlID in
self.slider_window_control_ids:
            obj.description = obj.simpleNext.name
            ui.message(obj.description)
        else:
            nextHandler()
-- 
James Scholes
http://twitter.com/JamesScholes
----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting 
bugs. 

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: 
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: