Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug with beautify
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00542537
Message ID:
00546263
Views:
12
Hi again Rick,

I implemented your ProgBar in my form, I made couple of modifications in it (minor: changed color of the upper label to blue, made height smaller and width bigger, etc., used the latest version of CommCtrl, though after some experiencing I left label position as 2). Unfortunately, it showed the similar problems, we had with our class, though it seems to work faster and looks nicer, in my opinion.
For instance, it doesn't immediately release (e.g. stays on form until data are saved) and it doesn't show 100%. The last one is 99%, though I tried to explicitly call UpdatePercent method (I made it public for this purpose).

Here is my code in thisform.doProcess method. I finally was able to release progress bar immediatelly (Note, wait window between locscreens, I tried sleep function before, but it didn't give me the desired effect), but it still shows 99% before releasing. May be you can see some problems here:
curEsc = set ('escape')
lcOnEsc=on('escape')
set escape on
llEsc= .f.
on escape llEsc = .t.
oProgBar = newobject('ProgBar','progbar.vcx')
*!*	oProgBar.SetMessageFont('Arial', 8)
*!*	oProgBar.SetTitleFont('Courier New', 8)
oProgBar.SetTitle('Calculating progress for:'+m.lcTitle)
oProgBar.SetMessage('File '+dbf('BldMstr'))
oProgBar.SetRange(0, m.lnReccount)
oProgBar.show()
*!*	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
*oProgBar.StepIt()
* -- Updating the percentage bar
		if mod(m.lnCount,100) = 0 && or (m.lnCount>=m.lnReccount-10)
*loTherm.update(m.lnCount)
			oProgBar.SetPos(m.lnCount)
			set message to '     Record #'+transform(m.lnCount) + m.lcMsgTail
		endif
        if m.lnCount=m.lnReccount
            oProgBar.UpdatePercent()
        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...'
	oProgBar.release()
	release oProgBar
	.lockscreen=.f.
*!*	loTherm.complete()
*!*		if vartype(loTherm)='O'
*!*			loTherm.release()
*!*		endif
*!*		release loTherm	
    wait window timeout 1 "" 
*    = Sleep(1000) && Wait 1 second
	.lockscreen=.t.
	set message to 'Process is complete... Wait while saving data..'
	wait window nowait set('message',1)
	select Bldmstr
	set relation to 		&& RMM 09/06/00
	if m.curEsc='ON'
		set escape on 	&& rmm 09/13/00
	else
		set escape off
	endif
	on escape &lcOnEsc
	if !m.llEsc
		lnHCursor = LoadCursor(0, IDC_WAIT)
* Get the old cursor
		lnOldCursor = SetCursor(m.lnHCursor)
		if not .editmode		&& If already in Editmode then Just Save
			.navstand.cmdEdit.click()		&& In Edit Mode
		endif
		.add() && Save changes
	endif
	if !empty(m.lcOrder)
		set order to (m.lcOrder)
	endif
	if empty(.FilterStr)
		goto m.lnRecno
	else
		go top
	endif
	.grdBldMstr.setfocus()
	.lockscreen=.f.
* Restore old cursor
	lnOldCursor = SetCursor(m.lnOldCursor)
	wait clear
endwith
return !m.llEsc
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform