Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Amazing Vanishing Listbox
Message
De
01/10/1999 13:44:16
 
 
À
01/10/1999 11:11:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00269690
Message ID:
00271656
Vues:
21
Hi Harry,

I'm not sure if this is what you are looking for but:

First off there is mention of the selected behavior in The Hacker' Guide.

It is under the heading of "MoverBars" and in short it says the selected behavior sticks with the selected index rather than itemid, so if you switch the list around, the selection stays put so to speak, and the items change.

As for the saving and restoring selected items, does it speed you up enough if you only save and restore the listitems that are actually selected, maybe like this:
y = ThisForm.lst_theList.listCount
z = 0 && Number of elements we init
ln_topid  = ThisForm.lst_theList.topitemid
ln_itemid = ThisForm.lst_theList.Listitemid

* initArray and selArray are custom form properties.
* initArray has the same number of rows as the list (setup in Form.init), and all elems are .F.

* This inits selArray
DIMENSION ThisForm.selArray[ALEN(ThisForm.initArray,1)]
ACOPY(ThisForm.initArray,ThisForm.selArray)

* grab the id's of the selected items
FOR x = 1 TO y
  IF ThisForm.lst_theList.SelectedID[x]
    z = z + 1
    ThisForm.selArray[z] = x
  ENDIF
ENDFOR

* clip length of array
DIMENSION ThisForm.selArray[z]

**** Do what you want to do here:  ****
SELECT delme
SCAN
  * Nothing just testing
ENDSCAN

* restore item id here
ThisForm.lst_theList.Listitemid = ln_itemid

* Restore Selected items only
FOR x = 1 TO ALEN(ThisForm.selArray,1)
  ThisForm.lst_theList.selected[ThisForm.selArray[x]] = .T. 
ENDFOR

* set top id
ThisForm.lst_theList.topitemid  = ln_topid
By saving and restoring only those that are selected, you significantly cut back on the overhead. I tried this in a list box with 250 items, and it seemed to work, there was a slight flash, but your lock form idea may prevent that.

Also I put this in the interactiveChange event, could this event be used instead of MouseUp for your problem? I don't know if that could aggravate the funky behavior or not.

Also did this in VFP 5.0a, NOT VFP6, but the behavior is supposedly the same.

I hope this helps, I was agonizing over listboxes all last week so I feel your pain :)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform