1. [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 17, 2001
- 516 views
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
2. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by euman at bellsouth.net Oct 17, 2001
- 481 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 > > >
3. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Derek Parnell <ddparnell at bigpond.com> Oct 18, 2001
- 453 views
It seems that the library doesn't implement this yet. The best you can do for now (other than euman's suggestion) is to trap the WM_NOTIFY event for the listview's parent window. Then extract the notification code and if it's NM_CLICK and the control id in the message matches the Listview's id, you can then use getLVSelected() etc... If you like, I can play around to get the exact code you'd need. ----- Original Message ----- From: "Dan Moyer" <DANIELMOYER at prodigy.net> To: "EUforum" <EUforum at topica.com> 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 > > >
4. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 18, 2001
- 444 views
Euman, Thanks, I'll try onMouse, seems pretty obvious now that you suggest it (I'd tried onClick and onChange & they didn't seem to work, & then I tried onEvent, but couldn't figure out what kind of event message returns to test on). <you wrote:> > 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. Aku also asked a similar question earlier too, but the only advice I saw was to change Win32Lib. As shouldn't be hard to discern, I'm about as far from being a "guru" as is possible, I just try to help out whenever I can so as to show my appreciation for the useful answers & advice I receive here when I ask questions :) I also figure if I can answer a question or provide a code snippet, that might save the really knowledgeable people some time that they could apply to other questions, or possibly prompt people to answer a question in more detail or better, or make a better code sample then I did. Dan ----- Original Message ----- From: <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Thursday, October 18, 2001 12:11 AM Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > 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 > > > >
5. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 18, 2001
- 471 views
Thanks Derek, I'll try Euman's first, then if necessary yours. When you say trap the WM_NOTIFY event, do you meant test for that in an onEvent? Dan ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: "EUforum" <EUforum at topica.com> Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > It seems that the library doesn't implement this yet. The best you can do > for now (other than euman's suggestion) is to trap the WM_NOTIFY event for > the listview's parent window. Then extract the notification code and if it's > NM_CLICK and the control id in the message matches the Listview's id, you > can then use getLVSelected() etc... > > If you like, I can play around to get the exact code you'd need. > > ----- Original Message ----- > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > To: "EUforum" <EUforum at topica.com> > Sent: Thursday, October 18, 2001 3:47 PM > 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 > > > > > >
6. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by euman at bellsouth.net Oct 18, 2001
- 469 views
I know for a fact my method works pretty well. I have an entire Family History program written useing the listview that populates tabitems per item selected. I can help you out further if you need me to, just let me know. Euman euman at bellsouth.net ----- Original Message ----- From: "Dan Moyer" <DANIELMOYER at prodigy.net> To: "EUforum" <EUforum at topica.com> Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > Thanks Derek, > > I'll try Euman's first, then if necessary yours. When you say trap the > WM_NOTIFY event, do you meant test for that in an onEvent? > > Dan > > ----- Original Message ----- > From: "Derek Parnell" <ddparnell at bigpond.com> > To: "EUforum" <EUforum at topica.com> > Sent: Thursday, October 18, 2001 4:04 AM > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > attn: Fabio) > > > > It seems that the library doesn't implement this yet. The best you can do > > for now (other than euman's suggestion) is to trap the WM_NOTIFY event for > > the listview's parent window. Then extract the notification code and if > it's > > NM_CLICK and the control id in the message matches the Listview's id, you > > can then use getLVSelected() etc... > > > > If you like, I can play around to get the exact code you'd need. > > > > ----- Original Message ----- > > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Thursday, October 18, 2001 3:47 PM > > 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 > > > > > > > >
7. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 18, 2001
- 452 views
Euman, Ok, it seemed to work ok for me except that each click on an item in the LV gets the *previously* selected item, so I have to click twice on an item to get it to work right. Here's what I did, is there something wrong with it? procedure onMouse_ListView2(integer event, integer x, integer y, integer shift) sequence index ,mleBuffer index = {} mleBuffer = {} if event = WM_LBUTTONDOWN then if getLVCount(ListView2) then index = getLVSelected(ListView2) -- on first click, sequence is empty because nothing was actually selected "yet"? if length(index) then for n = 1 to length(eMessages[index[1]][4]) do mleBuffer &= eMessages[index[1]][4][n] & CrLf end for setText(MleText3, mleBuffer) end if end if end if end procedure onMouse[ListView2] = routine_id( "onMouse_ListView2" ) Dan ----- Original Message ----- From: <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Thursday, October 18, 2001 8:48 PM Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > I know for a fact my method works pretty well. I have an entire Family History > program written useing the listview that populates tabitems per item selected. > I can help you out further if you need me to, just let me know. > > 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 21:06 > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > > > Thanks Derek, > > > > I'll try Euman's first, then if necessary yours. When you say trap the > > WM_NOTIFY event, do you meant test for that in an onEvent? > > > > Dan > > > > ----- Original Message ----- > > From: "Derek Parnell" <ddparnell at bigpond.com> > > To: "EUforum" <EUforum at topica.com> > > Sent: Thursday, October 18, 2001 4:04 AM > > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > > attn: Fabio) > > > > > > > It seems that the library doesn't implement this yet. The best you can do > > > for now (other than euman's suggestion) is to trap the WM_NOTIFY event for > > > the listview's parent window. Then extract the notification code and if > > it's > > > NM_CLICK and the control id in the message matches the Listview's id, you > > > can then use getLVSelected() etc... > > > > > > If you like, I can play around to get the exact code you'd need. > > > > > > ----- Original Message ----- > > > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > > To: "EUforum" <EUforum at topica.com> > > > Sent: Thursday, October 18, 2001 3:47 PM > > > 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 > > > > > > > > > >
8. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by euman at bellsouth.net Oct 18, 2001
- 473 views
hmmm, looks like it might work but I didnt test it. I do have an idea though. try changeing the mask something like what I have here and get back to me if you still have the same problem. atom lvMask lvMask = or_all({LVS_EX_FULLROWSELECT,LVS_EX_HEADERDRAGDROP,LVS_EX_GRIDLINES,LVS_EX_ONECLICKACTIVATE, LVS_EX_TRACKSELECT }) constant ListLV = create(ListView, "", hWnd, 152, 0,480, 160, or_all({LVS_REPORT,LVS_SHOWSELALWAYS})) --> insert all headers --> insertListViewColumn(ListLV,1,0,LVCFMT_LEFT,60,"Index",0) object junk junk = sendMessage( ListLV, LVM_SETBKCOLOR, 0, rgb(192,192,228)) junk = sendMessage( ListLV, LVM_SETEXTENDEDLISTVIEWSTYLE, lvMask, lvMask) the junks are important so dont forget those either. 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 22:00 Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > Euman, > > Ok, it seemed to work ok for me except that each click on an item in the LV > gets the *previously* selected item, so I have to click twice on an item to > get it to work right. Here's what I did, is there something wrong with it? > > procedure onMouse_ListView2(integer event, integer x, integer y, integer > shift) > sequence index ,mleBuffer > index = {} > mleBuffer = {} > > if event = WM_LBUTTONDOWN then > if getLVCount(ListView2) then > index = getLVSelected(ListView2) > -- on first click, sequence is empty because nothing was actually > selected "yet"? > if length(index) then > for n = 1 to length(eMessages[index[1]][4]) do > mleBuffer &= eMessages[index[1]][4][n] & CrLf > end for > setText(MleText3, mleBuffer) > end if > end if > end if > > end procedure > > onMouse[ListView2] = routine_id( "onMouse_ListView2" ) > > Dan > > ----- Original Message ----- > From: <euman at bellsouth.net> > To: "EUforum" <EUforum at topica.com> > Sent: Thursday, October 18, 2001 8:48 PM > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > attn: Fabio) > > > > I know for a fact my method works pretty well. I have an entire Family > History > > program written useing the listview that populates tabitems per item > selected. > > I can help you out further if you need me to, just let me know. > > > > 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 21:06 > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > (& attn: Fabio) > > > > > > > Thanks Derek, > > > > > > I'll try Euman's first, then if necessary yours. When you say trap the > > > WM_NOTIFY event, do you meant test for that in an onEvent? > > > > > > Dan > > > > > > ----- Original Message ----- > > > From: "Derek Parnell" <ddparnell at bigpond.com> > > > To: "EUforum" <EUforum at topica.com> > > > Sent: Thursday, October 18, 2001 4:04 AM > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > (& > > > attn: Fabio) > > > > > > > > > > It seems that the library doesn't implement this yet. The best you can > do > > > > for now (other than euman's suggestion) is to trap the WM_NOTIFY event > for > > > > the listview's parent window. Then extract the notification code and > if > > > it's > > > > NM_CLICK and the control id in the message matches the Listview's id, > you > > > > can then use getLVSelected() etc... > > > > > > > > If you like, I can play around to get the exact code you'd need. > > > > > > > > ----- Original Message ----- > > > > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > > > To: "EUforum" <EUforum at topica.com> > > > > Sent: Thursday, October 18, 2001 3:47 PM > > > > 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 <snip> > >
9. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by euman at bellsouth.net Oct 18, 2001
- 499 views
Now that I think about it, it could be how you are populating the Listview also.... 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 22:00 Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > Euman, > > Ok, it seemed to work ok for me except that each click on an item in the LV > gets the *previously* selected item, so I have to click twice on an item to > get it to work right. Here's what I did, is there something wrong with it? > > procedure onMouse_ListView2(integer event, integer x, integer y, integer > shift) > sequence index ,mleBuffer > index = {} > mleBuffer = {} > > if event = WM_LBUTTONDOWN then > if getLVCount(ListView2) then > index = getLVSelected(ListView2) > -- on first click, sequence is empty because nothing was actually > selected "yet"? > if length(index) then > for n = 1 to length(eMessages[index[1]][4]) do > mleBuffer &= eMessages[index[1]][4][n] & CrLf > end for > setText(MleText3, mleBuffer) > end if > end if > end if > > end procedure > > onMouse[ListView2] = routine_id( "onMouse_ListView2" ) > > Dan > > ----- Original Message ----- > From: <euman at bellsouth.net> > To: "EUforum" <EUforum at topica.com> > Sent: Thursday, October 18, 2001 8:48 PM > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > attn: Fabio) > > > > I know for a fact my method works pretty well. I have an entire Family > History > > program written useing the listview that populates tabitems per item > selected. > > I can help you out further if you need me to, just let me know. > > > > 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 21:06 > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > (& attn: Fabio) > > > > > > > Thanks Derek, > > > > > > I'll try Euman's first, then if necessary yours. When you say trap the > > > WM_NOTIFY event, do you meant test for that in an onEvent? > > > > > > Dan > > > > > > ----- Original Message ----- > > > From: "Derek Parnell" <ddparnell at bigpond.com> > > > To: "EUforum" <EUforum at topica.com> > > > Sent: Thursday, October 18, 2001 4:04 AM > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > (& > > > attn: Fabio) > > > > > > > > > > It seems that the library doesn't implement this yet. The best you can > do > > > > for now (other than euman's suggestion) is to trap the WM_NOTIFY event > for > > > > the listview's parent window. Then extract the notification code and > if > > > it's > > > > NM_CLICK and the control id in the message matches the Listview's id, > you > > > > can then use getLVSelected() etc... > > > > > > > > If you like, I can play around to get the exact code you'd need. > > > > > > > > ----- Original Message ----- > > > > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > > > To: "EUforum" <EUforum at topica.com> > > > > Sent: Thursday, October 18, 2001 3:47 PM > > > > 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 <snip> > >
10. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 18, 2001
- 464 views
Euman, Well, here's something funny that would suggest the way I'm populating the LV shouldn't be the problem: I tried using "if event = WM_LBUTTONUP then" to make sure the selection action had enough time to occur (after button down), and 1. it wouldn't work *at all* (no response), & I would think it should, and then 2. DOUBLE CLICKING worked EXACTLY right, pulled out the right text from my var & everything! So, when I can get the program to know when an item has been clicked on, it gets everything I would want it to, but the difficulty is getting it to know when an item is clicked on; WM_LBUTTONDOWN responds to the *previously* selected item, as if the down button is being sensed *before* the item has a chance to be/show selected, so it gets the item that *is* selected, the previous one; and WM_LBUTTONUP doesn't get responded to at all in the normal sense, but *does* get responded to if I *double click*, which shouldn't (?) be happening. I checked the constant declarations for them, too, and they seem to be right, at least as far as "Winconst.ew" says. Dan ----- Original Message ----- From: <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Thursday, October 18, 2001 9:17 PM Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > Now that I think about it, it could be how you are populating the Listview also.... > > > 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 22:00 > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > > > Euman, > > > > Ok, it seemed to work ok for me except that each click on an item in the LV > > gets the *previously* selected item, so I have to click twice on an item to > > get it to work right. Here's what I did, is there something wrong with it? > > > > procedure onMouse_ListView2(integer event, integer x, integer y, integer > > shift) > > sequence index ,mleBuffer > > index = {} > > mleBuffer = {} > > > > if event = WM_LBUTTONDOWN then > > if getLVCount(ListView2) then > > index = getLVSelected(ListView2) > > -- on first click, sequence is empty because nothing was actually > > selected "yet"? > > if length(index) then > > for n = 1 to length(eMessages[index[1]][4]) do > > mleBuffer &= eMessages[index[1]][4][n] & CrLf > > end for > > setText(MleText3, mleBuffer) > > end if > > end if > > end if > > > > end procedure > > > > onMouse[ListView2] = routine_id( "onMouse_ListView2" ) > > > > Dan > > > > ----- Original Message ----- > > From: <euman at bellsouth.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Thursday, October 18, 2001 8:48 PM > > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > > attn: Fabio) > > > > > > > I know for a fact my method works pretty well. I have an entire Family > > History > > > program written useing the listview that populates tabitems per item > > selected. > > > I can help you out further if you need me to, just let me know. > > > > > > 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 21:06 > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > > (& attn: Fabio) > > > > > > > > > > Thanks Derek, > > > > > > > > I'll try Euman's first, then if necessary yours. When you say trap the > > > > WM_NOTIFY event, do you meant test for that in an onEvent? > > > > > > > > Dan > > > > > > > > ----- Original Message ----- > > > > From: "Derek Parnell" <ddparnell at bigpond.com> > > > > To: "EUforum" <EUforum at topica.com> > > > > Sent: Thursday, October 18, 2001 4:04 AM > > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > > (& > > > > attn: Fabio) > > > > > > > > > > > > > It seems that the library doesn't implement this yet. The best you can > > do > > > > > for now (other than euman's suggestion) is to trap the WM_NOTIFY event > > for > > > > > the listview's parent window. Then extract the notification code and > > if > > > > it's > > > > > NM_CLICK and the control id in the message matches the Listview's id, > > you > > > > > can then use getLVSelected() etc... > > > > > > > > > > If you like, I can play around to get the exact code you'd need. > > > > > > > > > > ----- Original Message ----- > > > > > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > > > > To: "EUforum" <EUforum at topica.com> > > > > > Sent: Thursday, October 18, 2001 3:47 PM > > > > > 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 > <snip> > > > > >
11. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 18, 2001
- 451 views
Euman, Ok, I'll try those masks. Dan ----- Original Message ----- From: <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > hmmm, looks like it might work but I didnt test it. I do have an idea though. > try changeing the mask something like what I have here and get back to me if > you still have the same problem. > > atom lvMask > lvMask = or_all({LVS_EX_FULLROWSELECT,LVS_EX_HEADERDRAGDROP,LVS_EX_GRIDLINES,LVS_EX_O NECLICKACTIVATE, LVS_EX_TRACKSELECT }) > > constant ListLV = create(ListView, "", hWnd, 152, 0,480, 160, or_all({LVS_REPORT,LVS_SHOWSELALWAYS})) > > --> insert all headers --> insertListViewColumn(ListLV,1,0,LVCFMT_LEFT,60,"Index",0) > > object junk > junk = sendMessage( ListLV, LVM_SETBKCOLOR, 0, rgb(192,192,228)) > > junk = sendMessage( ListLV, LVM_SETEXTENDEDLISTVIEWSTYLE, lvMask, lvMask) > > the junks are important so dont forget those either. > > 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 22:00 > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > > > Euman, > > > > Ok, it seemed to work ok for me except that each click on an item in the LV > > gets the *previously* selected item, so I have to click twice on an item to > > get it to work right. Here's what I did, is there something wrong with it? > > > > procedure onMouse_ListView2(integer event, integer x, integer y, integer > > shift) > > sequence index ,mleBuffer > > index = {} > > mleBuffer = {} > > > > if event = WM_LBUTTONDOWN then > > if getLVCount(ListView2) then > > index = getLVSelected(ListView2) > > -- on first click, sequence is empty because nothing was actually > > selected "yet"? > > if length(index) then > > for n = 1 to length(eMessages[index[1]][4]) do > > mleBuffer &= eMessages[index[1]][4][n] & CrLf > > end for > > setText(MleText3, mleBuffer) > > end if > > end if > > end if > > > > end procedure > > > > onMouse[ListView2] = routine_id( "onMouse_ListView2" ) > > > > Dan > > > > ----- Original Message ----- > > From: <euman at bellsouth.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Thursday, October 18, 2001 8:48 PM > > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > > attn: Fabio) > > > > > > > I know for a fact my method works pretty well. I have an entire Family > > History > > > program written useing the listview that populates tabitems per item > > selected. > > > I can help you out further if you need me to, just let me know. > > > > > > 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 21:06 > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > > (& attn: Fabio) > > > > > > > > > > Thanks Derek, > > > > > > > > I'll try Euman's first, then if necessary yours. When you say trap the > > > > WM_NOTIFY event, do you meant test for that in an onEvent? > > > > > > > > Dan > > > > > > > > ----- Original Message ----- > > > > From: "Derek Parnell" <ddparnell at bigpond.com> > > > > To: "EUforum" <EUforum at topica.com> > > > > Sent: Thursday, October 18, 2001 4:04 AM > > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > > (& > > > > attn: Fabio) > > > > > > > > > > > > > It seems that the library doesn't implement this yet. The best you can > > do > > > > > for now (other than euman's suggestion) is to trap the WM_NOTIFY event > > for > > > > > the listview's parent window. Then extract the notification code and > > if > > > > it's > > > > > NM_CLICK and the control id in the message matches the Listview's id, > > you > > > > > can then use getLVSelected() etc... > > > > > > > > > > If you like, I can play around to get the exact code you'd need. > > > > > > > > > > ----- Original Message ----- > > > > > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > > > > To: "EUforum" <EUforum at topica.com> > > > > > Sent: Thursday, October 18, 2001 3:47 PM > > > > > 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 > <snip> > > > > >
12. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 18, 2001
- 438 views
Euman, Ok, that's interesting. If I wait for the pointing hand to make the resting on item selected, and *then* click on that item, then everything works ok; but if I "rush" it, and click too fast (ie, before the hand has done its work and made the rested on item selected), then it still works as before, getting the *previously* selected item. I would suspect your app would probably do the same? Is it the trackselect that makes the pointing hand select the rested on item? Dan ----- Original Message ----- From: <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Sent: Thursday, October 18, 2001 9:12 PM Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > hmmm, looks like it might work but I didnt test it. I do have an idea though. > try changeing the mask something like what I have here and get back to me if > you still have the same problem. > > atom lvMask > lvMask = or_all({LVS_EX_FULLROWSELECT,LVS_EX_HEADERDRAGDROP,LVS_EX_GRIDLINES,LVS_EX_O NECLICKACTIVATE, LVS_EX_TRACKSELECT }) > > constant ListLV = create(ListView, "", hWnd, 152, 0,480, 160, or_all({LVS_REPORT,LVS_SHOWSELALWAYS})) > > --> insert all headers --> insertListViewColumn(ListLV,1,0,LVCFMT_LEFT,60,"Index",0) > > object junk > junk = sendMessage( ListLV, LVM_SETBKCOLOR, 0, rgb(192,192,228)) > > junk = sendMessage( ListLV, LVM_SETEXTENDEDLISTVIEWSTYLE, lvMask, lvMask) > > the junks are important so dont forget those either. > > 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 22:00 > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > > > Euman, > > > > Ok, it seemed to work ok for me except that each click on an item in the LV > > gets the *previously* selected item, so I have to click twice on an item to > > get it to work right. Here's what I did, is there something wrong with it? > > > > procedure onMouse_ListView2(integer event, integer x, integer y, integer > > shift) > > sequence index ,mleBuffer > > index = {} > > mleBuffer = {} > > > > if event = WM_LBUTTONDOWN then > > if getLVCount(ListView2) then > > index = getLVSelected(ListView2) > > -- on first click, sequence is empty because nothing was actually > > selected "yet"? > > if length(index) then > > for n = 1 to length(eMessages[index[1]][4]) do > > mleBuffer &= eMessages[index[1]][4][n] & CrLf > > end for > > setText(MleText3, mleBuffer) > > end if > > end if > > end if > > > > end procedure > > > > onMouse[ListView2] = routine_id( "onMouse_ListView2" ) > > > > Dan > > > > ----- Original Message ----- > > From: <euman at bellsouth.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Thursday, October 18, 2001 8:48 PM > > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > > attn: Fabio) > > > > > > > I know for a fact my method works pretty well. I have an entire Family > > History > > > program written useing the listview that populates tabitems per item > > selected. > > > I can help you out further if you need me to, just let me know. > > > > > > 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 21:06 > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > > (& attn: Fabio) > > > > > > > > > > Thanks Derek, > > > > > > > > I'll try Euman's first, then if necessary yours. When you say trap the > > > > WM_NOTIFY event, do you meant test for that in an onEvent? > > > > > > > > Dan > > > > > > > > ----- Original Message ----- > > > > From: "Derek Parnell" <ddparnell at bigpond.com> > > > > To: "EUforum" <EUforum at topica.com> > > > > Sent: Thursday, October 18, 2001 4:04 AM > > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > > (& > > > > attn: Fabio) > > > > > > > > > > > > > It seems that the library doesn't implement this yet. The best you can > > do > > > > > for now (other than euman's suggestion) is to trap the WM_NOTIFY event > > for > > > > > the listview's parent window. Then extract the notification code and > > if > > > > it's > > > > > NM_CLICK and the control id in the message matches the Listview's id, > > you > > > > > can then use getLVSelected() etc... > > > > > > > > > > If you like, I can play around to get the exact code you'd need. > > > > > > > > > > ----- Original Message ----- > > > > > From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > > > > To: "EUforum" <EUforum at topica.com> > > > > > Sent: Thursday, October 18, 2001 3:47 PM > > > > > 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 > <snip> > > > > >
13. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by euman at bellsouth.net Oct 18, 2001
- 447 views
Send me the program to look at... maybe two pair of eyes are better than one maybe I'll see something you dont. Euman euman at bellsouth.net From: "Dan Moyer" <DANIELMOYER at prodigy.net> > > Euman, > > Ok, that's interesting. If I wait for the pointing hand to make the resting > on item selected, and *then* click on that item, then everything works ok; > but if I "rush" it, and click too fast (ie, before the hand has done its > work and made the rested on item selected), then it still works as before, > getting the *previously* selected item. I would suspect your app would > probably do the same? > > Is it the trackselect that makes the pointing hand select the rested on > item? > > Dan > ----- Original Message ----- > From: <euman at bellsouth.net> > To: "EUforum" <EUforum at topica.com> > Sent: Thursday, October 18, 2001 9:12 PM > Subject: Re: [WIN] ListView: what event is response to clicking on item? (& > attn: Fabio) > > > > hmmm, looks like it might work but I didnt test it. I do have an idea > though. > > try changeing the mask something like what I have here and get back to me > if > > you still have the same problem. > > > > atom lvMask > > lvMask = > or_all({LVS_EX_FULLROWSELECT,LVS_EX_HEADERDRAGDROP,LVS_EX_GRIDLINES,LVS_EX_O > NECLICKACTIVATE, LVS_EX_TRACKSELECT }) > > > > constant ListLV = create(ListView, "", hWnd, 152, 0,480, 160, > or_all({LVS_REPORT,LVS_SHOWSELALWAYS})) > > > > --> insert all headers --> > insertListViewColumn(ListLV,1,0,LVCFMT_LEFT,60,"Index",0) > > > > object junk > > junk = sendMessage( ListLV, LVM_SETBKCOLOR, 0, rgb(192,192,228)) > > > > junk = sendMessage( ListLV, LVM_SETEXTENDEDLISTVIEWSTYLE, lvMask, lvMask) > > > > the junks are important so dont forget those either. > > > > 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 22:00 > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > (& attn: Fabio) > > > > > > > Euman, > > > > > > Ok, it seemed to work ok for me except that each click on an item in the > LV > > > gets the *previously* selected item, so I have to click twice on an item > to > > > get it to work right. Here's what I did, is there something wrong with > it? > > > > > > procedure onMouse_ListView2(integer event, integer x, integer y, integer > > > shift) > > > sequence index ,mleBuffer > > > index = {} > > > mleBuffer = {} > > > > > > if event = WM_LBUTTONDOWN then > > > if getLVCount(ListView2) then > > > index = getLVSelected(ListView2) > > > -- on first click, sequence is empty because nothing was actually > > > selected "yet"? > > > if length(index) then > > > for n = 1 to length(eMessages[index[1]][4]) do > > > mleBuffer &= eMessages[index[1]][4][n] & CrLf > > > end for > > > setText(MleText3, mleBuffer) > > > end if > > > end if > > > end if > > > > > > end procedure > > > > > > onMouse[ListView2] = routine_id( "onMouse_ListView2" ) > > > > > > Dan > > > > > > ----- Original Message ----- > > > From: <euman at bellsouth.net> > > > To: "EUforum" <EUforum at topica.com> > > > Sent: Thursday, October 18, 2001 8:48 PM > > > Subject: Re: [WIN] ListView: what event is response to clicking on item? > (& <snip> > >
14. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by euman at bellsouth.net Oct 18, 2001
- 465 views
This is the answer to the slow selection junk = sendMessage( ListView2, LVM_SETHOVERTIME, 0, 10) You'll be a believer! Euman euman at bellsouth.net From: "Dan Moyer" <DANIELMOYER at prodigy.net> > Euman, > > Ok, that's interesting. If I wait for the pointing hand to make the resting > on item selected, and *then* click on that item, then everything works ok; > but if I "rush" it, and click too fast (ie, before the hand has done its > work and made the rested on item selected), then it still works as before, > getting the *previously* selected item. I would suspect your app would > probably do the same? > > Is it the trackselect that makes the pointing hand select the rested on > item? > > Dan
15. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 19, 2001
- 505 views
Matt, I did find that LVN_ITEMCHANGED constant in "Winconst.ew", but couldn't figure out how to use it. I can use the "onEvent" thingy in a sort of "cut'n'paste" way, but don't really understand it very well. (I'm guessing that's what's involved?) At your convenience, could you explain more fully how to make use of LVN_ITEMCHANGED ? I've used Eumans suggestion, for listview selection tracking mouse movements, and single click activation, but LVN_ITEMCHANGED is maybe closer to how one might expect to use it, like "onChange" (or at least consistent with how we get stuff from other lists). Dan ----- Original Message ----- From: "Matthew Lewis" <matthewwalkerlewis at YAHOO.COM> To: "EUforum" <EUforum at topica.com> Sent: Friday, October 19, 2001 5:25 AM Subject: RE: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio) > > > > -----Original Message----- > > From: Derek Parnell [mailto:ddparnell at bigpond.com] > > > It seems that the library doesn't implement this yet. The > > best you can do > > for now (other than euman's suggestion) is to trap the > > WM_NOTIFY event for > > the listview's parent window. Then extract the notification > > code and if it's > > NM_CLICK and the control id in the message matches the > > Listview's id, you > > can then use getLVSelected() etc... > > > > If you like, I can play around to get the exact code you'd need. > > > > IIRC, ListViews don't handle mouse events like most controls, but I'm fairly > certain that you can get the NM_CLICK to work. Alternatively, you could > look for LVN_ITEMCHANGED: > > LVN_ITEMCHANGED > > > Notifies a list-view control's parent window that an item has changed. This > notification message is sent in the form of a WM_NOTIFY message. > > LVN_ITEMCHANGED > pnmv = (LPNMLISTVIEW) lParam; > > Parameters > pnmv > Address of an NMLISTVIEW structure that identifies the item and specifies > which of its attributes have changed. If the iItem member of the structure > pointed to by pnmv is -1, the change has been applied to all items in the > list view. > Return Values > No return value. > > Remarks > If a list-view control has the LVS_OWNERDATA style, and the user selects a > range of items by holding down the SHIFT key and clicking the mouse, > LVN_ITEMCHANGED notifications are not sent for each selected or deselected > item. Instead, you will receive a single LVN_ODSTATECHANGED notification, > indicating that a range of items has changed state. > > > Of course, you'll have to make sure that it's the LVIS_SELECTED that's > changed... > > Matt Lewis >
16. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fabio)
- Posted by Martin Stachon <martin.stachon at worldonline.cz> Oct 19, 2001
- 470 views
Hi, > 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. You may try my version of win32lib - 0.55.4. It has onChange for ListViews. You can get it at http://www.webpark.cz/stachon . Martin