Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FCC SuperMover (or just Mover) Question 2

Status
Not open for further replies.

CBellucci

Programmer
Apr 20, 2007
38
US
In the SuperMover and Mover classes set up in the FCC, there is the lstRight that holds items the user has selected from the left column. That's all well and good, but what I'm particularly interested in is the moving of items up and down in lstRight. I can seem to isolate the code that does that, and I can't find any documentation on it. (Everything I've found just looks at the moving from left to right and back again. Neat, but I did that on my own a long time ago.)

Anyone have any ideas on the best implementation of the lstRight up and down mover? I can't even find where the button in that list is bound to the list. Any help would be appreciated!
 
The short answer is that you need to set the MoverBars property to .T. This is a property of the listbox. Once set to .T. it allows the user to slide the list items vertically within the box.

But a couple of points to note:

- It only works if the RowSourceType is 0 or 1.

- I don't know if it will interfere in any way with the normal action of moving an item from one list to the other. You will need to try it and see for yourself. If there is any problem, come back so that we can help you sort it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
You don't find any implementation, because there isn't. The Listbox.MoverBars=.T. creates this left mover bar buttons and the functionality is native to the Listbox.
It's better to only use this feature on arrays or the listitems, not with a rowsourcetype of alias or fields.

Bye, Olaf.
 
Thanks, guys! I did not even know that existed... very cool!

I will have to recode to change from cursors/grids to arrays to use that, but it might be worth it.

Thanks again... I rep-ed both of you.
 
Yeah, so not worth it. Items are in a multi-column grid with a cursor as a source now; the list box is too simple to do what I want.

So, looking for a mover within a grid... onward and upward!
 
I will have to recode to change from cursors/grids to arrays to use that

Are you sure? As far as I can see, the Mover class expects you to populate the list box programmatically, that is, by calling AddItem(), with RowsourceType = 0. (I'm not sure if that applies to SuperMover.)

looking for a mover within a grid

Shouldn't be too difficult to create one yourself. But that won't give you the ability to move the rows vertically - other than with quite a lot of tricky programming.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top