1. moving a listview item
- Posted by pampeano at rocketmail.com Jun 13, 2002
- 419 views
Hi all, I've a routine that's supposed to move the icons of a listview, but it's working very weird. Code: elsif msg = WM_LBUTTONDOWN then Dragging = 1 elsif msg = WM_LBUTTONUP then Dragging = 0 elsif msg = WM_MOUSEMOVE then if Dragging = 1 and getLVSelectedCount(Desktop) > 0 then ptrPOINT = acquire_mem(0, SIZEOF_POINT) DesktopSelected = getLVSelected(Desktop) if fetch(ptrPOINT, ptX) >= 0 and fetch(ptrPOINT, ptY) >= 0 then fResult = w32Func(xGetCursorPos,{ptrPOINT}) fResult = w32Func(xScreenToClient,{Desktop,ptrPOINT}) store( ptrPOINT, ptX, fetch(ptrPOINT,ptX) ) store( ptrPOINT, ptY, fetch(ptrPOINT,ptY) ) fResult = sendMessage(Desktop, LVM_SETITEMPOSITION32, DesktopSelected[1], ptrPOINT) end if release_mem( ptrPOINT ) end if end if When i click on the icon an try to drag it it doesn't do anything. Then i click on another one and drags the one that i clicked first to that place. After that i can freely drag the icon all over the listview without the button pressed.. ===== Best Regards, Guillermo Bonvehi AKA: Knixeur - Caballero Rojo
2. Re: moving a listview item
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 15, 2002
- 393 views
Hi Guillermo, the code sample you supplied can't be all of the offending code. Because in this snippet, the memory acquired in ptrPOINT is not set to anything, thus the fetch() will always return zero. Also the line of code ... > store( ptrPOINT, ptX, fetch(ptrPOINT,ptX) ) seems to be doing nothing. It fetches whatever is at ptX in ptrPOINT and then stores that back into the same spot. As an alternative, have you looked at the demo program ListTreeView.exw as this moves items from a listview. ------------ Derek. ----- Original Message ----- From: <pampeano at rocketmail.com> To: "EUforum" <EUforum at topica.com> Sent: Friday, June 14, 2002 6:35 AM Subject: moving a listview item > > Hi all, > I've a routine that's supposed to move the icons of a listview, but > it's working very weird. > Code: > elsif msg = WM_LBUTTONDOWN then > Dragging = 1 > elsif msg = WM_LBUTTONUP then > Dragging = 0 > elsif msg = WM_MOUSEMOVE then > if Dragging = 1 and getLVSelectedCount(Desktop) > 0 then > ptrPOINT = acquire_mem(0, SIZEOF_POINT) > DesktopSelected = getLVSelected(Desktop) > if fetch(ptrPOINT, ptX) >= 0 and fetch(ptrPOINT, ptY) >= 0 then > fResult = w32Func(xGetCursorPos,{ptrPOINT}) > fResult = w32Func(xScreenToClient,{Desktop,ptrPOINT}) > store( ptrPOINT, ptX, fetch(ptrPOINT,ptX) ) > store( ptrPOINT, ptY, fetch(ptrPOINT,ptY) ) > fResult = sendMessage(Desktop, LVM_SETITEMPOSITION32, > DesktopSelected[1], ptrPOINT) > end if > release_mem( ptrPOINT ) > end if > end if > When i click on the icon an try to drag it it doesn't do > anything. Then i click on another one and drags the one that i clicked > first to that place. After that i can freely drag the icon all over the > listview without the button pressed.. > > ===== > Best Regards, > Guillermo Bonvehi > AKA: Knixeur - Caballero Rojo > > > >
3. Re: moving a listview item
- Posted by pampeano at rocketmail.com Jun 16, 2002
- 405 views
Thanks Derek, i think i was too sleepy when i did that =P Oh, another ques, is there a way to create a windows with a parent that's not a win32lib prog (i'm trying to create a shell and I need to create a window with GetDesktopWindow as parent). I done the same work using only api calls, but unfortunatly couldn't succesfully create a listview. Best Regards, Guillermo Bonvehi --- Derek Parnell <ddparnell at bigpond.com> wrote: > > Hi Guillermo, > the code sample you supplied can't be all of the offending code. > Because in > this snippet, the memory acquired in ptrPOINT is not set to anything, > thus > the fetch() will always return zero. > Also the line of code ... > > > store( ptrPOINT, ptX, fetch(ptrPOINT,ptX) ) > > seems to be doing nothing. It fetches whatever is at ptX in ptrPOINT > and > then stores that back into the same spot. > > As an alternative, have you looked at the demo program > ListTreeView.exw as > this moves items from a listview. > > ------------ > Derek. > > ----- Original Message ----- > From: <pampeano at rocketmail.com> > To: "EUforum" <EUforum at topica.com> > Sent: Friday, June 14, 2002 6:35 AM > Subject: moving a listview item > > > > > > Hi all, > > I've a routine that's supposed to move the icons of a listview, > but > > it's working very weird. > > Code: > > elsif msg = WM_LBUTTONDOWN then > > Dragging = 1 > > elsif msg = WM_LBUTTONUP then > > Dragging = 0 > > elsif msg = WM_MOUSEMOVE then > > if Dragging = 1 and getLVSelectedCount(Desktop) > 0 then > > ptrPOINT = acquire_mem(0, SIZEOF_POINT) > > DesktopSelected = getLVSelected(Desktop) > > if fetch(ptrPOINT, ptX) >= 0 and fetch(ptrPOINT, ptY) >= 0 then > > fResult = w32Func(xGetCursorPos,{ptrPOINT}) > > fResult = w32Func(xScreenToClient,{Desktop,ptrPOINT}) > > store( ptrPOINT, ptX, fetch(ptrPOINT,ptX) ) > > store( ptrPOINT, ptY, fetch(ptrPOINT,ptY) ) > > fResult = sendMessage(Desktop, LVM_SETITEMPOSITION32, > > DesktopSelected[1], ptrPOINT) > > end if > > release_mem( ptrPOINT ) > > end if > > end if > > When i click on the icon an try to drag it it doesn't do > > anything. Then i click on another one and drags the one that i > clicked > > first to that place. After that i can freely drag the icon all over > the > > listview without the button pressed.. > > > > ===== > > Best Regards, > > Guillermo Bonvehi > > AKA: Knixeur - Caballero Rojo > > > > > > > > > ===== Best Regards, Guillermo Bonvehi AKA: Knixeur - Caballero Rojo