accessibility for a blinds users on my project

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
marco_84
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Jul 08, 2019 7:30 pm

accessibility for a blinds users on my project

Post by marco_84 » Tue Jul 09, 2019 6:48 pm

Hello everyone I state that I am blind and I have a school-leaving certification of information tecnology,
I want to implement wxaccessible in my project,
I built the example of wxwidgets with gcc version 3.4.5 and wxwidgets version 3.0.4 on windows10 o.s.,
I use the narrator under windows10 operating system, the narrator on listbox component speak perfectly,
I would like to bring the accessibility of the listbox on my program that uses the treelist,
I try to adapt the accessibility class of the example found on wxwidgets 3.0.4 to my program,
the narrator speak the name of the window only
but when I want to listen inside the treelist the narrator is mute.
If possible, someone help me make my program accessible?
I have already consulted the manual of the wxaccessible but I don't understand it very well


thanks for all

marco_84

User avatar
doublemax
Moderator
Moderator
Posts: 13736
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: accessibility for a blinds users on my project

Post by doublemax » Tue Jul 09, 2019 7:15 pm

Hi and welcome to the forum.

First of all, wxAccessible is modeled closely after Microsofts MSAA, so reading about that might help you understand the concept a little better: https://en.wikipedia.org/wiki/Microsoft ... essibility

In general:
For each type of control you want to make accessible, you derive your own class from wxAccessible and you override all methods that make sense for that particular control.

I've only done that once, for a simple button, so take the following with a grain of salt:

For a listbox, you'll probably need to override quite a few of them. E.g.:
wxAccessible::GetChildCount - would return the number of items in the list
wxAccessible::GetDescription or GetName() will probably return the text that the narrator will speak
wxAccessible::GetRole should return wxROLE_SYSTEM_LISTITEM (defined in <wx\access.h> )

I don't know which are absolutely necessary to make it work, you'll have to experiment a bit.

Then, in order to activate this, you use code like this:

Code: Select all

your_control_pointer->SetAccessible( new MyControlAccessible(your_control_pointer) );
Or, if it was in the constructor of a class derived from a control:

Code: Select all

SetAccessible( new MyControlAccessible(this) );
BTW: There is another blind wxWidgets developer who is often active on the wxWidgets mailing list / user group: https://groups.google.com/forum/#!forum/wx-users

His name is Tim Burgess <[email protected]>
www.raisedbar.net

He might have more experience with wxAccessible.
Use the source, Luke!

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1970
Joined: Sun Jan 03, 2010 5:45 pm

Re: accessibility for a blinds users on my project

Post by PB » Tue Jul 09, 2019 8:36 pm

Hello!

I have no experience with accessibility but I noticed that you are using wxWidgets version 3.0.4. Accessibility support under Windows should be significantly improved in version 3.1.2 so perhaps you could try this version.

While 3.1 branch is marked "unstable", it should be safe to use, in its release announcement it is stated
It is not inherently more buggy or less stable than the "stable" releases and you're encouraged to use it, including in production.
See also here.

marco_84
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Jul 08, 2019 7:30 pm

Re: accessibility for a blinds users on my project

Post by marco_84 » Tue Jul 09, 2019 9:29 pm

Hi doublemax, thanks for the reply
I try before writing on the forum to implement the getname function and the narrator speak the name of the window without another word
below the getname function code:

Code: Select all

// Gets the name of the specified object.
wxAccStatus PanelWindowAccessible::GetName(int childId, wxString* name)
{
    if (childId == wxACC_SELF)
    {
        * name = wxT("Elenco delle letture e dei contatori inseriti");
        return wxACC_OK;
    }
    wxPanel * splitter = wxDynamicCast(GetWindow(), wxPanel);
    if (splitter)
    {
//        if (splitter->IsSplit())
        {
            // Two windows, and the sash.
            if (childId == 1 || childId == 3)
                return wxACC_NOT_IMPLEMENTED;
            else if (childId == 2)
            {
                *name = wxT("Sash");
                return wxACC_OK;
            }
        }
    }
    // Let the framework handle the other cases.
    return wxACC_NOT_IMPLEMENTED;
}

// Can return either a child object, or an integer
// representing the child element, starting from 1.

I need to implement something that makes speak the narrator at the internal of treelist the item names but I don't understand what's missing



Hi PB
I update to the next version of the wxwidgets when I learn well the instructions of the wxapi
now I practice with this version
thanks

marco_84
Last edited by marco_84 on Tue Jul 09, 2019 9:34 pm, edited 1 time in total.

User avatar
doublemax
Moderator
Moderator
Posts: 13736
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: accessibility for a blinds users on my project

Post by doublemax » Tue Jul 09, 2019 9:34 pm

I would guess you need to implement a wxAccessible specific for the treelist, but i'm not sure. I'd have to experiment with this myself, but i probably won't have time for that before the weekend.
Use the source, Luke!

marco_84
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Jul 08, 2019 7:30 pm

Re: accessibility for a blinds users on my project

Post by marco_84 » Tue Jul 09, 2019 9:37 pm

Thank you very much

marco_84

User avatar
doublemax
Moderator
Moderator
Posts: 13736
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: accessibility for a blinds users on my project

Post by doublemax » Wed Jul 17, 2019 4:02 pm

While i managed to get a custom wxAccessiblity for a wxListbox to work, i failed to do so for a wxTreeCtrl. The main problem was that "GetChildCount" never got called and therefore the system never requested the information for the tree items.

I ran out of time and currently can't spend any more time on this, sorry.
Use the source, Luke!

marco_84
In need of some credit
In need of some credit
Posts: 4
Joined: Mon Jul 08, 2019 7:30 pm

Re: accessibility for a blinds users on my project

Post by marco_84 » Wed Jul 17, 2019 8:46 pm

hello doublemax thanks for help,
I have to study how to intercept the call of items to the narrator of windows10 o.s. and make an implementation on wxaccessible,
thanks anyway, I don't know to do this easy
can you help me do this?

User avatar
doublemax
Moderator
Moderator
Posts: 13736
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: accessibility for a blinds users on my project

Post by doublemax » Wed Jul 17, 2019 9:43 pm

This is a minimal sample using a custom wxAccessible for wxListBox. Maybe this helps.
Attachments
minimal.cpp
(11.47 KiB) Downloaded 3 times
Use the source, Luke!

Post Reply