1. 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

new topic     » topic index » view message » categorize

2. Re: moving a listview item

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
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: moving a listview item

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu