Microsoft KB Archive/194833

= HOWTO: Using the Supermover Foundation Class =

Article ID: 194833

Article Last Modified on 8/21/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q194833



SUMMARY
This article describes how to use the SuperMover Foundation Class that shipped with Visual FoxPro. The SuperMover class is located in the _movers.vcx class library.



MORE INFORMATION
In order to set up a SuperMover Foundation Class in an application, here are some basic properties and methods that you need to understand:

 aChoices[1,0] array property - This array property contains available choices that is in the left list box. aSelections[1,0] array property - This array property contains selected items in the right list box. UseArray property - This property specifies whether to use arrays for the left list box. When the UseArray property is set to .T., a property array is created and the property array can be reference from any object on the form. However, when UseArray is set to .F., it basically using the list box's AddItem method to add the items to the list box. The default value for this property is .T. SortLeft property - This property sorts items in the left list box, the default value is .F.  InitChoices method - This method initializes the aChoices array and populate the initial content of the aChoices array into the list box. The syntax for this method is: Object.InitChoices(@choicearrayname)  choicearrayname specifies the array of initial choices. When the UserArray property is set to .F., the choicearrayname array will use as the source for the list box Additem method to add the item to the list box and no aChoices array will be created.  InitSelections method - This method initializes the aSelections array. The syntax for this method is: Object.InitSelections(@selectionarrayname) </li> Selectionarrayname specifics the array of initial selections.</li>  GetSelections method - The method retrieves the selected items. The syntax for this method is: Object.GetSelections(@targetarrayname) </li> Targetarrayname specifies the name of the array containing the target selections.</li></ul>

Example:
<ol> Create a form, name mymover.scx.</li> Add the SuperMover class, located in _movers.vcx in \Ffc directory, to the form.</li>  In the Init event of the form, put in the following code: DIMENSION aMyChoice[6] LOCAL iCount FOR iCount = ALEN(aMyChoice) to 1 STEP -1 aMyChoice[(ALEN(aMyChoice)+1)-iCount] = CHR(64+iCount)

ENDFOR

&& To initialize the aChoice array property and populate && the left list box Thisform._supermover1.InitChoices(@aMyChoice) </li>  Add two command buttons to the form and change the following properties as shown: Command1.Caption = "Display selected items" Command2.Caption = "Display aChoice array" </li>  In the Click event of Command1, place the following code: DIMENSION aMySelection[1] Thisform._supermover1.GetSelections(@aMySelection) LOCAL iCount FOR iCount = 1 TO ALEN(aMySelection) WAIT WINDOW aMySelection[iCount] ENDFOR </li>  In the Click event of Command2, place the following code: FOR I = 1 to ALEN(Thisform._supermover1.aChoices) WAIT WINDOW thisform._supermover1.aChoices[i] ENDFOR </li> Save and run the form.

The left list box displays F,E,D,C,B,A. Click on the right arrow button to move a few items to the right list box. Click the "Display selected items" button and the selected items will display in the Wait Window. Now, click the "Display aChoice array" button, only the items left in the left list box will display in the Wait Window.</li> Modify the mymover form again, change the _supermover's SortLeft property to .T.</li> Save and run the form again. The left list box now displays A,B,C,D,E,F.</li></ol>

Keywords: kbhowto kbffc KB194833

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.