Re: Detecting cursor in ListView (Combo Box - W32Lib)
- Posted by Judith Evans <camping at arkansas.net> Jan 26, 2006
- 495 views
Pete Stoner wrote: > > When a user clicks on a dropdown to open it (Combo box actually) and the > highlight > follows the cursor as he moves down the list, is there any way to detect which > item he is on (highlighted but not selected)? > > I would like to be able to display some text giving more information on each > item as the user moves the cursor down the list... > > Regards PeteS Here is some code Roland Stowasser wrote for me. It assumes right click but you might be able to use when moving the mouse with some adjustments.
procedure MenuEditList_Mouse (integer self, integer event, sequence params) --Roland right click integer index, state atom bool,height,topindex,indexoffset if params[1] = RightDown then --you would use MouseMove above instead of RightDown or LeftDoubleClick height=sendMessage(Combo2,LB_GETITEMHEIGHT,0,0) topindex=sendMessage(Combo2,LB_GETTOPINDEX,0,0) indexoffset=floor(params[3]/height) index=indexoffset+topindex bool=sendMessage(Combo2,LB_SETCURSEL,index,0) index+=1 if index>getCount(Combo2) then index=0 end if end if
Hope this helps; sorry I did not have time to test the code. ~judith