[Win32Lib] type in mle after select item from tree view?
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Nov 25, 2002
- 462 views
I have a TreeView and a multi-line edit box in a program; I'd like that when the program user selects an item from the TV, they could immediately begin to enter text into the mle. But when I setFocus at the end of a TV change event, it doesn't do that. I have to *click* on the mle before I can enter text. Am I doing something wrong? problem demo follows below. Dan Moyer --<code begins> -- code generated by Win32Lib IDE v0.14.2 include Win32lib.ew without warning ---------------------------------------------------------------------------- ---- -- Window Window1 constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300, 0, 0 ) constant TreeView2 = createEx( TreeView, "TreeView2", Window1, 12, 12, 176, 248, or_all({TVS_HASLINES,TVS_LINESATROOT,TVS_SHOWSELALWAYS}), 0 ) constant MleText3 = createEx( MleText, "", Window1, 208, 16, 176, 244, 0, 0 ) --------------------------------------------------------- ---------------------------------------------------------------------------- ---- constant CrLf = { '\r', '\n' } integer dummy ---------------------------------------------------------------------------- ---- procedure Window1_onActivate (integer self, integer event, sequence params)--params is () for n = 1 to 10 do dummy = addTVItem(TreeView2, 0,0, sprint(n), 0) end for setText(MleText3, "Click on a Tree View item") end procedure setHandler( Window1, w32HActivate, routine_id("Window1_onActivate")) ---------------------------------------------------------------------------- ---- procedure TreeView2_onChange (integer self, integer event, sequence params)--params is () setText(MleText3, "Item " & sprint(getTVIndex(TreeView2)) & CrLf & "I would like that the user could start " & "entering text at the end of this text immediately after selecting a TV item," & " without having to click the mouse over here first. " & " Focus was just set here, but doesn't seem to work.") setFocus(MleText3) end procedure setHandler( TreeView2, w32HChange, routine_id("TreeView2_onChange")) WinMain( Window1,Normal ) --<code ends>