Hi Jeff,

    I got the listview working for my Clipboard app and the problem is what you 
get and no object sent in, for the only information given is from the EventInfo 
which only tells you who did it.

    but will experiment more and set a time element for once out of the event 
it can check the focus point.

    Now that may be the way to get what you want, for the keyup event is 
triggered and once up you can check the status of what transpired, such as new 
object focus.

    I will lay it out once I get testing, for the ListBox gives better 
information then the list view does.

        Bruce

Sent: Tuesday, January 14, 2014 12:11 PM
Subject: Re: listbox change


I was unable to get any info while still in the list.  I found another way to 
do what I wanted.
I added an extra button, made it the default button with enter as its shortcut, 
and by pressing enter while still in the list, I can get extra information.  
That's not exactly what I wanted, but it's close.

Below is a .vbs and a .xml file showing a simple listbox with 2 buttons.
The files are nameed

DialogListBoxFromScript.vbs
DialogListBoxFromScript.xml

If anybody wants to try to add something to the select case section to 
automatically speak additional information when you are just up or down 
arrowing through the list, I would certainly appreciate knowing how to do this.
thanks again,
Jeff Weiss


' DialogListBoxFromScript

Dim IsVisible : IsVisible = 0

Dim myHotkey : Set myHotkey = 
Keyboard.RegisterHotkey("Alt-Control-Shift-I","LaunchDialog")

Sub LaunchDialog()
'This routine is called when the hotkey is pressed.

If isVisible = 0 Then
Queue "DisplayDialog"
End If
End Sub

Sub DisplayDialog()
Dialog "DialogListBoxFromScript.xml", "Dialoglistbox", "DialogEventHandler"
End Sub

Function DialogEventHandler(dObj, dEvent, dId, dControl)
Dim Result : Result = ""
dObj.Control("lst").Width = 800

If dEvent = dialogCreated Then
BuildList dObj, Result
End If

DialogEventHandler = False

Select Case dEvent

' Process dialog events
Case dialogCreated

DialogEventHandler = True

Case buttonClicked

sButton = dControl.Text
sButton = Replace(sButton, "&", "")
Speak sButton

If sButton = "Close" Then
dObj.Control("lst").Clear
dObj.Close
Exit Function
End If

If sButton = "Ok" Then
Result = dObj.Control("lst").Text
SaySelectedItem dObj, Result

Result = ""
Exit Function
End If

End Select
End Function

Function BuildList(dObj, Result)

dObj.Control("lst").Add "This is the first line in the listBox!"
dObj.Control("lst").Add "Here is the second line."
dObj.Control("lst").Add "Here is the third and longest line in the listbox!"

dObj.Control("lst").FocusedIndex = 1
End Function

Sub SaySelectedItem(dObj, Result)
Sleep 200
Speak " "
Speak "The item you selected was " & VbCrLf & Result
Sleep 1000
End Sub


' here is the .xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wescriptui>
<options>
<languageorder>
WE,OS,en-us
</languageorder>
</options>
<language id="en-us">

<dialog id="Dialoglistbox" modal="yes">
ListBox from Script
<group>
<group>

<static shortcut="l">
List
</static>
<listbox id="lst" sort = "no">
</listbox>

</group>
<group justify="center">
<button id="BtnOk" default="yes" widthclass="button" shortcut="Enter">
Ok
</button>
<button id="btnCancel" system="cancel" widthclass="button">
Close
</button>
</group>
</group>
</dialog>

</language>
</wescriptui>



From: Chip Orange [mailto:[email protected]]
Sent: Monday, January 13, 2014 12:21 PM
To: [email protected]
Subject: RE: listbox change

Jeff,

I don't see that you're initializing the variable Temp anywhere, and I also 
don't see that you are setting the focusedIndex property of the listbox 
anywhere (which is usually done when you add items to the listbox; you usually 
set it to 1 when you add your listbox items).

Take out the line:
If fObj("lst").FocusedIndex <> Temp Then
And you should then hear something spoken each time your listbox item is 
changed.

Chip


From: Jeff Weiss [mailto:[email protected]]
Sent: Sunday, January 12, 2014 10:33 PM
To: [email protected]
Subject: Re: listbox change

Thank you for all of the suggestions.
This is indeed my own xml listbox dialog and I can get the button to work but 
not the listbox change to register where I can do something when it changes.
The list works fine and displays 12 spelling words.
Here is the function:

Function DialogEventHandler3(fObj, fEvent, fId, fControl)
DialogEventHandler3 = False

Dim Result : Result = ""
fObj.Control("lst").Width = 200

If fEvent = dialogCreated Then
BuildList fObj, Result
End If

DialogEventHandler3 = False

Select Case fId
Case fId = "lst"
If fEvent = listboxSelectionChange Then
If fObj("lst").FocusedIndex <> Temp Then
Temp = fObj.Control("lst").FocusedIndex
Result = fObj.Control("lst").Text
Speak Result
Speak Temp
Speak "this is a test."
Result = ""
Exit Function
End If
End If

Case "button_MainMenu"
If fEvent = buttonClicked Then
Speak ""
Sleep 200
Speak "Returning to Main Menu"
Sleep 200
fObj.Control("lst").Clear
fObj.Close
DialogEventHandler3 = True
Exit Function
End If

Case Else
If fEvent = dialogCreated Then
DialogEventHandler3 = True

Exit Function
End If

End Select
End Function

I must be missing something here.  Please let me know what I am missing here.
thanks
Jeff Weiss


Jeff Weiss, M.Ed.
Director of Life Skills
Rehabilitation Teacher
World Services for the Blind
2811 Fair Park Blvd.
Little Rock, AR 72204
Email: [email protected]
www.wsblind.org

The mission of World Services for the Blind is empowering blind or visually 
impaired adults in the United States and around the world to achieve 
sustainable independence.


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com

Reply via email to