ok, I decided to write my own test script rather than send GW into
the archives.
I thought I remembered they had fixed it, but my test script shows
it's mostly fixed, but there are places I found, such as listboxes
put up by MSWord, where the text of the selected item was always
empty. you could get the number of the selected item, and I guess
that's something, but you could not get text of any item.
in other places, such as the listbox displayed by WE for the
systray apps, it was able to tell me the text of the selected item.
sorry for the sidetrack.
Chip
*From:* Chip Orange [ mailto:[email protected]]
*Sent:* Saturday, December 12, 2009 12:45 PM
*To:* [email protected] <mailto:[email protected]>
*Subject:* RE: to GW; was Text from a Menu
thanks Jeff.
I appreciate the example of how to create a listbox.
my problems in the past though, and my question, was related to
listboxes which were created by other applications. I would get
pointers to them via the window structures, or via msaa info and
the accessible structures, and neither one would properly indicate
which item was the selected item, even when an msaa event came
through for a selection having been made.
My conversations with Aaron at the time indicated GW knew about the
problem, so I was wondering if they knew if it had been fixed.
thanks.
Chip
*From:* Jeff Weiss [ mailto:[email protected]]
*Sent:* Friday, December 11, 2009 9:35 AM
*To:* [email protected] <mailto:[email protected]>
*Subject:* RE: to GW; was Text from a Menu
I know that identifying a simple listBox item was fixed with an
earlier version of the toolkit.
This example from the manual does work:
' This example creates a simple dialog with a sorted list box of
three items,
' along with custom default ' and cancel buttons, and returns a
string of the
' data associated with the selected item.
Dim myHotkey : Set myHotkey =
Keyboard.RegisterHotkey("Alt-Control-Shift-I","DisplayListBox")
Function DisplayListBox()
Set myListBox =
SharedObjects("com.GWMicro.GwToolkit.SimpleDialogs",
90000).ListBoxDialog
myListBox.AddItem "Red", "Red"
myListBox.AddItem "Green", "Green"
myListBox.AddItem "Blue", "Blue"
myListBox.Sort = True
myListBox.DefaultButton = "&Ok"
myListBox.CancelButton = "Close"
Dim returnValue : returnValue = myListBox.ChooseItem("Select a color")
Sleep 3000
Speak ReturnValue
Sleep 2000
' If the green item was selected with the OK button,
' speak would announce, "Green."
End Function
This may not be the problem you are considering, but I know this
one was fixed.
Jeff Weiss
*From:* Chip Orange [ mailto:[email protected]]
*Sent:* Thursday, December 10, 2009 7:23 PM
*To:* [email protected] <mailto:[email protected]>
*Subject:* to GW; was Text from a Menu
Hello GW,
this reminds me: some versions back I was trying to do this kind of
thing to see which choice of a listbox was the selected one, and
this wasn't working, and was confirmed as a bug in WE. I think it
wasn't working in either the listbox control structure or the
accessible info.
Can you tell me if seeing which choice is the selected one in a
listbox is now possible?
thanks.
Chip
*From:* Stephen Clower [ mailto:[email protected]]
*Sent:* Wednesday, December 09, 2009 10:31 PM
*To:* [email protected] <mailto:[email protected]>
*Subject:* Re: Text from a Menu
J.J.,
If you're looking at the menu through MSAA, you might test for
something like:
Set accObj = FocusedWindow.Accessible ' Assuming the focused window
is a menu, set the accObj variable to hold the Accessible
representation of the focused item.
If accObj.State = state_SYSTEM_CHECKED Then
' item is checked.
Else
' It isn't.
End If
Hope this helps.
Steve
On 12/9/2009 10:22 PM, J.J. Meddaugh wrote:
Hello. I was wondering if someone could point me in the right
direction of how to obtain the state of a checkbox that's inside of
a standard application menu? I was looking all over the script
manual, but apparently not hard enough.
Thanks.
J.J. Meddaugh - ATGuys.com
A premier Licensed Code Factory and KNFB Reader distributor