Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Showing a modal progress bar
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00616707
Message ID:
00616923
Views:
32
Well, you could add the necessary object to do the work in the Init and fire it from there. I kind of like my rendition, since it shows the percentage in the middle of the bar and changes colors as the thermometer moves over it. For any lurkers who would like to do this
**************************************************
*-- Class:        therm (c:\program files\microsoft visual foxpro 7\ida\classes\therm.vcx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   06/22/98 03:55:10 PM
*-- Thermometer
*
DEFINE CLASS therm AS form


	Height = 87
	Width = 328
	ShowWindow = 1
	DoCreate = .T.
	AutoCenter = .T.
	BorderStyle = 2
	Caption = ""
	ControlBox = .F.
	Closable = .F.
	MaxButton = .F.
	MinButton = .F.
	Movable = .F.
	*-- Denominator used to define the width of the bar and the label
	n_denominator = 0
	Name = "therm"


	ADD OBJECT backshape AS shape WITH ;
		Top = 36, ;
		Left = 15, ;
		Height = 34, ;
		Width = 300, ;
		BackStyle = 1, ;
		BorderStyle = 0, ;
		BackColor = RGB(255,255,255), ;
		Name = "Backshape"


	ADD OBJECT label1 AS label WITH ;
		FontBold = .T., ;
		FontName = "MS Sans Serif", ;
		Alignment = 2, ;
		Caption = "Label1", ;
		Height = 18, ;
		Left = 117, ;
		Top = 45, ;
		Width = 93, ;
		TabIndex = 2, ;
		ForeColor = RGB(0,0,255), ;
		BackColor = RGB(255,255,255), ;
		Name = "Label1"


	ADD OBJECT foreshape AS shape WITH ;
		Top = 37, ;
		Left = 15, ;
		Height = 32, ;
		Width = 0, ;
		BackStyle = 0, ;
		BorderStyle = 0, ;
		DrawMode = 10, ;
		FillStyle = 0, ;
		BackColor = RGB(255,255,255), ;
		FillColor = RGB(0,0,255), ;
		Name = "ForeShape"


	ADD OBJECT text1 AS textbox WITH ;
		BackStyle = 0, ;
		Height = 38, ;
		Left = 12, ;
		Top = 33, ;
		Width = 304, ;
		Name = "Text1"


	ADD OBJECT label2 AS label WITH ;
		AutoSize = .T., ;
		FontName = "MS Sans Serif", ;
		FontSize = 8, ;
		Caption = "Processing...", ;
		Height = 15, ;
		Left = 14, ;
		Top = 11, ;
		Width = 63, ;
		Name = "Label2"


	*-- Update thermometer
	PROCEDURE updatetherm
		LPARAMETER p_newnumer

		LOCAL n_pct, n_barwidth
		n_pct = (p_newnumer / Thisform.n_denominator)
		n_barwidth = INT(300 * n_pct)
		Thisform.ForeShape.Width = n_barwidth
		Thisform.Label1.Caption = TRANSFORM(ROUND(n_pct * 100, 0), '###%')
		Thisform.Refresh
	ENDPROC


	PROCEDURE Init
		LPARAMETERS pn_denom, pc_msg
		LOCAL n_args
		n_args = PARAMETERS()
		This.Label1.Caption = '0%'
		Thisform.n_denominator = pn_denom
		IF n_args = 2
		  Thisform.Label2.Caption = pc_msg
		ENDIF
	ENDPROC


	PROCEDURE text1.When
		RETURN .F.
	ENDPROC


ENDDEFINE
*
*-- EndDefine: therm
**************************************************
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform