Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DoDefaultAction
#1
I am having trouble making the default action (Push) work on a push button control when accessed using the "acc" function via navigation.

Acc a=acc(FLD_NAME "CLIENT" WIN_TITLE WINDOW_CLASS "" 0x1001 0 0 "c1")
a.DoDefaultAction()

Is there something I'm doing wrong using the navigation method of finding a pushbutton control. I know the DoDefaultAction works when I locate a checkbox using the just the name of it. Unfortunately, the pushbutton caption is the same as several other pushbutton captions, so I have to use the indirect method of navigation to get access to it.

The problem is the a.DoDefaultAction() doesn't do anything. I have printed the a.Name() to verify I have the correct control.

Help!


MSDN Accessibility indicates:
Quote:Push Button

A push button is a small, rectangular object used to perform an action. For example, the OK and Cancel buttons on a dialog box are push buttons.

The window class name for a push button is "BUTTON".
Supported Properties and Methods
accHitTest
accDoDefaultAction
The DoDefaultAction method clicks the push button.
....

Thanks for your help. QM is really a great tool!

John
#2
I think I figured out a work-around.

a.DoDefaultAction()

-or-

but child(a.a)

The second method appears to click the pushbutton, and I'm good to go.

John
#3
This is how the navigate string should be used:
1. In the "Find accessible object" dialog, capture the object you need.
2. In the tree, click an object near to the object you captured.
3. Check Navigate and enter the navigate string.
4. Click the Test button. If the navigate string is correct, it will find the object you need.


Forum Jump:


Users browsing this thread: 1 Guest(s)