Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Common Controls library from Alexander Grigoriev
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00537238
Message ID:
00537403
Vues:
8
Rick,

Thanks a lot, I'll look into it. Basically, my problem is, that I need to instantiate it without form (from the program, which makes a long process, like scan.. endscan). The progress bar, we're currently using (from _ftc library, I believe) has a strange bug: instead of showing the whole process, it always stoped at 99% and it also not completely filled. Also I found, that I can not remove it untill table update finishes its work.

The other requirement, I have, it should allow termination by ESC. Here is a sample code using our thermometer class:
select Bldmstr
lnReccount=reccount()
lnCount=0
lcMsgTail = "/" + transform(m.lnReccount) + ".  Wait or press Esc to cancel ..."
* -- Checking all the records in BldMstr one at a time
select BldMstr
set order to
curEsc = set ('escape')
lcOnEsc=on('escape')
set escape on
llEsc= .f.
on escape llEsc = .t.
loTherm = newobject("thermometer", "wg","","Calculating Progress for:" + m.lcTitle, ;
	m.lnReccount)
loTherm.show()
with thisform
	.lockscreen=.t.
	
	scan 
		if m.llEsc and .NiceEsc()
			exit
		else
			llEsc = .f.
		endif
		lnCount=m.lnCount+1
* -- Updating the percentage bar
		if mod(m.lnCount,100) = 0 or (m.lnCount>=m.lnReccount-10)
			loTherm.update(m.lnCount)
			set message to '     Record #'+transform(m.lnCount) + m.lcMsgTail
		endif
		
		do case
		case m.tcMode = "Parse Situs"
			.ProcParse(m.tcMode, m.llProgramExists)

		case m.tcMode = 'Parse Owner'
			.ProcParse(m.tcMode, m.llProgramExists)

		case m.tcMode = 'ResOwner'
			.ProcResOwner()

		case m.tcMode='Auto Situs'
			.AutoAddrSitus()

		case m.tcMode='Auto Owner'
			.AutoAddrOwner()
		endcase
	endscan	
	set message to 'Process is complete...'
*!*	loTherm.complete()
	if vartype(loTherm)='O'
		loTherm.release()
	endif
	release loTherm
I want to have progress bar SMOOTH and a percentage label inside the progress bar (9). Does your file have a sample program?

Thanks again for the response.


>It's a control so it needs to be hosted inside a container, such as a form. You can place it in a form at design time or you can do so programatically. Try this:
>SET CLASSLIB TO commctrl.vcx ADDITIVE
>oForm = CREATEOBJECT("form")
>WITH oForm
>   .ADDOBJECT( "oProgBar", "progressbar")
>   .oProgBar.VISIBLE = .T.
>   .SHOW()
>   CLEAR
>   WITH .oProgBar
>      .SetRange( 0, 100)
>      FOR m.i = 1 TO 10
>         .StepIt()   && default step increment is 10
>         WAIT '' TIMEOUT .2
>      ENDFOR &&* m.i = 1 TO 10
>   ENDWITH
>ENDWITH
>If you're interested in a ready-to-use progress bar based on this class, you can download my progbar.zip from the UT files section (file ID 737). It's based on Alexander's class library, which is used with his permission.
>
>

>>Hi everyone,
>>
>>I'm trying to implement Progress Bar from this library. I tried this code:
>>loTherm=NewObject('progressbar','commctrl.vcx')
>>loTherm.visible=.t.
>>or loThern.show()
>>but nothing appeared on the screen.
>>
>>Is it possible to instantiate this class from a program or it should be always placed on form in design-time?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform