Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very large numbers of pictures in VFP combos?
Message
De
20/10/2016 14:25:31
 
 
À
20/10/2016 05:42:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01642137
Message ID:
01642170
Vues:
67
*run the code follow and you can constat the time to load is important and this is not interesting.
*A combo (listbox,grid) is made to load a certain quantity of records and its fast if this quantity is small.
*the pictures also must be small (less than 32x32 for ex.) preferably.  
*i guess the limit is the memory allowed only but the time ellapsed is important also.(nearly 25sec inthe code below !)


publi yform
yform=newObject("asup")
yform.show
retu
*
DEFINE CLASS asup AS form
	Height = 224
	Width = 669
	AutoCenter = .T.
	Caption = "Test combo images with 3000 records"
	Name = "Form1"

	ADD OBJECT combo1 AS combobox WITH ;
		Height = 49, ;
		Left = 12, ;
		Top = 12, ;
		Width = 349, ;
		Name = "Combo1"

	ADD OBJECT label1 AS label WITH ;
		AutoSize = .T., ;
		FontBold = .T., ;
		FontSize = 10, ;
		Caption = "", ;
		Height = 18, ;
		Left = 372, ;
		Top = 24, ;
		Width = 2, ;
		ForeColor = RGB(255,0,0), ;
		Name = "Label1"

	PROCEDURE Init
		local t0,m.xpict1,m.xpict2
		t0=seconds()
		m.xpict1=home(1)+"graphics\bitmaps\assorted\note.bmp"
		m.xpict2=home(1)+"graphics\bitmaps\assorted\beany.bmp"

		with thisform.combo1
		for i=1 to 3000
		.additem(trans(i)+"...........")
		if mod(i,2)=0
		.Picture[m.i] =m.xpict1
		else
		.Picture[m.i]=m.xpict2
		endi
		endfor
		.mousepointer=15
		.listindex=1
		.style=2
		endwith
		thisform.label1.caption="Time ellapsed="+trans(seconds()-t0)+" sec !"
	ENDPROC
	

ENDDEFINE
*
*-- EndDefine: asup
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform