how to read a value of a control?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to read a value of a control?

Ralf Kefferpuetz-2
Hello everybody,

I'm still struggling with Python and maybe somebody can light me up-
I have a Window with lots of controls and I want to read the value of
certain controls.
I'M able to get the value when I am on one of that controls, but how do I
create a handle to a control I don't have focused?

        def chooseNVDAObjectOverlayClasses(self, obj, clsList):
                if obj.windowClassName == "RichEdit20WPT" and
obj.windowControlID == 4099:
                        clsList.insert(0, EnhancedEditField)

class EnhancedEditField(IAccessible):

        def script_reportLength(self, gesture):
                msg = self.name+": "+self.value
                ui.message(msg)

        __gestures = {
                "kb:NVDA+l": "reportLength",
        }
this gives me the focused control value by pressing NVDA-L, but I want to
get the value of other class names and class ID's which are not focused.
In VBScript I did built an array of all controls and could put a handle on
one of the controls in the array by its array number.

Any hints welcome.

Cheers,
   Ralf




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to read a value of a control?

Joseph Lee
Hi,
This requires emulating object navigation:
someObj.next/previous/parent/firstChild, etc. The manual way to do this is
using object navigation commands to locate where controls are in relation to
the tree the window presents. Once you figure out where the object lives,
then you can use dev info command (NVDA+F1) and dump info about this object
(such as name, window class name, IAccessible info, etc.) to the log viewer.
Cheers,
Joseph

-----Original Message-----
From: Ralf Kefferpuetz [mailto:[hidden email]]
Sent: Wednesday, June 28, 2017 5:38 AM
To: 'NVDA screen reader development' <[hidden email]>
Subject: [Nvda-devel] how to read a value of a control?

Hello everybody,

I'm still struggling with Python and maybe somebody can light me up- I have
a Window with lots of controls and I want to read the value of certain
controls.
I'M able to get the value when I am on one of that controls, but how do I
create a handle to a control I don't have focused?

        def chooseNVDAObjectOverlayClasses(self, obj, clsList):
                if obj.windowClassName == "RichEdit20WPT" and
obj.windowControlID == 4099:
                        clsList.insert(0, EnhancedEditField)

class EnhancedEditField(IAccessible):

        def script_reportLength(self, gesture):
                msg = self.name+": "+self.value
                ui.message(msg)

        __gestures = {
                "kb:NVDA+l": "reportLength",
        }
this gives me the focused control value by pressing NVDA-L, but I want to
get the value of other class names and class ID's which are not focused.
In VBScript I did built an array of all controls and could put a handle on
one of the controls in the array by its array number.

Any hints welcome.

Cheers,
   Ralf




----------------------------------------------------------------------------
--
Check out the vibrant tech community on one of the world's most engaging
tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Loading...