RE: Win32Lib's setIndex against a tree view
- Posted by Jonas Temple <jktemple at yhti.net> Oct 03, 2002
- 462 views
Don't thank me yet....the way I used is this is to force a selection of a tree view item when an item from a list view is selected. After you call setIndex and then use the mouse to select a tree view item the item used in setIndex remains highlighted. Dang-it! Derek Parnell wrote: > Thanks Jonas. > > Jonas Temple wrote: > > All, > > > > The setIndex in V 57.9 of Win32lib does not work for tree views. If > > anyone is interested, here's the code to insert into setIndex to allow > > the routine to work for tree views: > > > > --BEG CJT01 > > elsif window_type[id] = TreeView then > > cur_index = getTVIndex(id) > > if cur_index then > > TVITEM = struct_TVITEM(or_all({TVIF_HANDLE,TVIF_STATE}), > > getHandle({id,cur_index}), > > 0, TVIS_SELECTED,"", 0, 0, 0, 0) > > VOID = sendMessage( id, TVM_SETITEM, 0, TVITEM ) > > release_mem(TVITEM) > > end if > > TVITEM = struct_TVITEM(or_all({TVIF_HANDLE,TVIF_STATE}), > > getHandle({id,index}), > > TVIS_SELECTED, TVIS_SELECTED,"", 0, 0, 0, 0) > > VOID = sendMessage( id, TVM_SETITEM, 0, TVITEM) > > release_mem(TVITEM) > > return > > --END CJT01 > > > >