Hi Again Chip,

    When reading your response a second time, I guess you are saying assign
a key that when it is hit it will look at the item on the list and assumes
that to be the selected one and act on it. Yes that would be a nice
approach, but would have to make one for the mouse as well. I guess both
have the same amount of work in them except your approach would eliminate
the event watch for keyup stuff.

    Now having said that, I actually did make one for the spacebar key. It
would also act inside the menu and had no way to shut it off there because
of the lack in events. In other words, hitting the alt key to get to the
menu or the mouse click on the menu, would make things worse to attempt to
shut off the tree view stuff for the spacebar, for all are inside the same
dialog and limited on treeview events, the blur function does not work when 
hitting the alt key nor mouse button. the tree view blur only works when 
leaving the dialog.

    so, I guess once again aI found it there was too much of a headache to
have a non-standard hotkey do what is already there. For I even got rid of
the checkbox by just doing what I did by just waiting for the key up and
which key did the up event. I just have to take out the number 32 ASCII code
for the spacebar and use the built in code because that will cause problems
in other platforms.. that do not use ASCII standard coding.

    so, I guess what you suggested I already did attempt to do and it caused
too much of a headache to use. since the spacebar is used for selection and
button pressing, that was the way to go and my approach the only one to use.
I am sure one with more experience then me may have thought of something I
have not, but with my knowledge of what is inside the object manual, this is
what I could only think of using and keeping things inside standard key
functions like the spacebar.

        Sincerely
        Bruce

Sent: Thursday, August 11, 2011 8:53 PM
Subject: RE: Tree view


Hi Bruce,

It seems like you want something to happen when there's a treeview focused
and the user pressed a key?  You could also define a hotkey then when the
treeview gets focus.  might be simpler ... don't know without having done
the work.

Chip


-----Original Message-----
From: BT [mailto:[email protected]]
Sent: Thursday, August 11, 2011 12:07 PM
To: [email protected]
Subject: Re: Tree view


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


Reply via email to