Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moverbar
Message
From
17/04/2018 12:47:27
 
 
To
17/04/2018 11:57:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01659460
Message ID:
01659477
Views:
52
>>Hi,
>>
>>HELP!
>>
>>Can someone PLEASE show me with an example of reading the final re-sequenced list of a Listbox after it has been a subject to the MoverBars. I have spend hours searching the web for an example in doing this. There are a few, but all are Pseudo-Code, partial snippet of code, or answers like "Just do it." I am beginning to believe it can't be done. I have look in the ItemIDToIndex (and it cousin), but not sure how the implement them to get the final resulting list order.
>>
>>I am building list in the Listbox using the AddListItem() from a cursor. Displaying it. They can re-orginize the sequence. Click a Close button that loops though the list (1 to ListCount) and create a single string of the new order (well that's the goal). But when I read the list, it is the same as the original. I know, the ItemIdToIndex() (or the other one) is involved. But how?
>>
>>PS. sorry for anger. It been one of those weeks.
>>
>>Thanks in advance.
>>Greg
>
>
>LOCAL Demo AS ReadMovedItems
>
>m.Demo = CREATEOBJECT("ReadMovedItems")
>m.Demo.Show(1)
>
>DEFINE CLASS ReadMovedItems AS Form
>
>	ADD OBJECT MoveableList AS ListBox WITH MoverBars = .T., Top = 10, Left = 10, Height = 100
>	ADD OBJECT Result AS TextBox WITH Top = 120, Left = 10
>	ADD OBJECT Done AS CommandButton WITH Top = 150, Left = 10, Caption = "Done!"
>
>	FUNCTION MoveableList.Init
>
>		This.AddItem("One")
>		This.AddItem("Two")
>		This.AddItem("Three")
>
>	ENDFUNC
>
>	FUNCTION Done.Click
>
>		LOCAL ItemIndex AS Integer
>		LOCAL Result AS String
>
>		m.Result = ""
>		FOR m.ItemIndex = 1 TO Thisform.MoveableList.ListCount
>			m.Result = m.Result + Thisform.MoveableList.List(m.ItemIndex)
>		ENDFOR
>
>		Thisform.Result.Value = m.Result
>
>	ENDFUNC
>
>ENDDEFINE
>
Thanks.
You are doing the same thing I am doing. This made me rethink the issue. What I discovered is in another part of the form. In the Listbox I am placing a Picture to represent CheckBoxes. When the user click the list item, the checkbox is toggled from checked to not. But if I move any of the items, the licking is getting confused, and may result in a different item getting checked instead the intended one. This then results in the wrong item getting the concatenated string. I need to code review my code as to why and where this is occurring.

Again thanks for show me that I was looking in wrong place.
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform