Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by euman at bellsouth.net Oct 17, 2001
- 480 views
I can give you advice TRY: onMouse[LV] = routine_id( "proc/func" ) and below is a procedure I might call once I have a listview item Keep in mind, the below I use to populate a tabitem of data from snippets of info that lies in a listview your case may be different. procedure Loadtab(integer event, integer x, integer y, integer shift) -- load info into tab sequence index, junk -- In Update Mode? -- if update then -- if in update mode then allow LV Mouse to update Focused tabitem. -- if event = WM_LBUTTONDOWN then -- end if -- else if event = WM_LBUTTONDOWN then descindex = getLVCount(ListLV) if descindex = 0 then else index = getLVSelected(ListLV) if length(index) < 1 then else descindex = index[1] setFocus(TabItem5) MasterTab() end if end if end if The way you've been handing out advice I thought you were the Guru...hmm? Just picking Dan......Just picking! I asked this question before...when listviews came about being by Matt Lewis. Euman euman at bellsouth.net ----- Original Message ----- From: "Dan Moyer" <DANIELMOYER at prodigy.net> To: "EUforum" <EUforum at topica.com> Sent: Thursday, October 18, 2001 00:47 Subject: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > I've looked through back postings, and I cannot figure out how to know when > an item in a ListView has been clicked on. I gather that "getLVSelected()" > should be used instead of getIndex. I've seen suggestions for modifying > Win32Lib to allow onChange to work, but that makes it not work for anyone > who doesn't have that modification. > > I found Fabio Ramirez's "Listview Styles", (what a nice looking demo! It > should be included with Win32Lib.), and that helped to make a whole row be > selected, but I can't see how to know when an item has been clicked on. > > BTW, Fabio, > > in your tabbed version of "Listview Styles", it doesn't appear that the > TreeView section works as you probably intended, in that there's only one TV > displayed with info, though you made 9, and it may not have the number & > "sub-ordering" that you intended. If so, here's my fix, it lets all 9 be > filled with items, 3 main & 3 under each main: > > integer tvSubItemNo-- prevents mains & subs getting mixed together > > procedure FillTreeView(atom tvId) > for i = 1 to 3 do > tvItemNo = addTVItem( tvId, icon03, icon03, > sprint(tvId) & " Item " & sprint(i), 0 ) -- 0 makes mains > for j = 1 to 3 do > tvSubItemNo = addTVItem( tvId, icon03, icon03, > sprint(i) & ": " & sprint(j), tvItemNo ) -- puts sub with > correct main > end for > end for > end procedure > > Dan Moyer > > >