For all new programmers,
Below is the final - finish of my project on tree view selections.
Bruce
This is my dialog procedure for event capture and what I did using the tree
view option instead of buttons; reduced to only the tree view items.
Function MainDialogProc...
If dEvent = treeviewKeyDown Then
Set TV_Obj = myDialog
TV_KeyDown = True
myTV_KeyConnection = ConnectEvent( Keyboard, "OnKeyProcessedUp",
"OnKeyProcessedUp")
End If
If dEvent = treeviewClicked Then
Set TV_Obj = myDialog
TV_MouseDown = True
myTV_MouseConnection = ConnectEvent( Mouse, "OnButtonUp", "OnButtonUp")
End If
If dEvent = treeviewSelectionChange Or dEvent = treeviewClicked Then
TV_Name = dControl.Text
TV_Data = dControl.selected.Data
MainDialogProc = True
Exit Function
End If
'... other event selections
'End of my dialog proc
End Function
Sub OnKeyProcessedUp( ky, md)
Disconnect myTV_KeyConnection
myTV_KeyConnection = 0
If TV_KeyDown and ky = 32 and md = 0 Then
Queue "TV_Options"
End If
TV_KeyDown = False
End Sub
Sub OnButtonUp( button)
Disconnect myTV_MouseConnection
myTV_MouseConnection = 0
If TV_MouseDown and button = 0 Then
Queue "TV_Options"
End If
TV_MouseDown = False
End Sub
Sub TV_Options()
' Do Treeview Items.
Silence
Select Case TV_Data
Case 0
' Speak " Navigate through tree then mouse click on or press space bar to
do selection. "
promptArray(1) = myStrings( "treeview_info")
promptArray(2) = " Cuckoo clock Options "
Queue "msgBoxOk"
Case 1
promptArray(1) = myStrings( "dialogbox_info")
promptArray(2) = " Cuckoo clock Menu "
Queue "msgBoxOk"
Case 2
Queue "DoAnnouncement"
Case 3 ' dId = "btn_mainDialog_listen"
Queue "SearchAndPlayWav", TV_Obj
Case 4 ' dId = "btn_mainDialog_copy"
Queue "SearchAndCopyWav", TV_Obj
Case 5 ' dId = "btn_mainDialog_rename"
Queue "SearchAndRenameWav", TV_Obj
Case 6 ' dId = "btn_mainDialog_delete"
Queue "SearchAnddeleteWav", TV_Obj
Case 7
If RecordEnabled Then
Queue "RecordAndPlay", ""
Else
Speak " No Record Feature Enabled! ", speakerVoice
End If
Case 8 ' "btn_mainDialog_tts"
editSearchType = myStrings( "Txt_Search_Type")
editSearchExtension = myStrings( "Txt_Search_Ext")
Queue "LaunchTtsDialog"
Case 9 ' dId = "btn_mainDialog_playText"
Queue "SearchAndPlayText", TV_Obj
Case 10 ' "btn_mainDialog_time"
Queue "DoTime"
End Select
End sub