1. Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fab
- Posted by Dan Moyer <DANIELMOYER at prodigy.net> Oct 19, 2001
- 411 views
Evan, :) You meant to reply to a different message. Dan ----- Original Message ----- From: "Evan Marshall" <evan at net-link.net> To: "EUforum" <EUforum at topica.com> Subject: Re: [WIN] ListView: what event is response to clicking on item? (& attn: Fab Have you tried PLC Direct? http://www.automationdirect.com I haven't used their products, but they cost somewhat less than AB and Siemens. > > 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> > > > > >