HOWTO: Create a Progress Indicator Using Threed Panel Control
ID: Q167192
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a, 6.0
SUMMARY
This article describes how to create a progress/status indicator using the
Threed Panel ActiveX control in Visual FoxPro.
MORE INFORMATION
You can use the Threed Panel ActiveX control to display plain or three-
dimensional text on a three-dimensional background. It can also present
progress/status information in a dynamically colored circle or bar with or
without showing percent.
Here is a listing of properties required to create a progress/status
indicator:
The following example using a Timer control to simulate the progress/status
indicator:
NOTE: Before you run the example below, making sure you have the Threed
Panel ActiveX control installed(Windows\System\Threed32.ocx).
- Create a .prg file and cut and paste the following code into the .prg:
PUBLIC x
x=CREATEOBJECT("progress")
x.SHOW
**************************************************
*-- Class: progress
*-- ParentClass: form
*-- BaseClass: form
*
DEFINE CLASS progress AS form
Top = 0
Left = 0
Height = 198
Width = 378
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT timer1 AS Timer WITH ;
Top = 9, ;
Left = 18, ;
Height = 23, ;
Width = 23, ;
Enabled = .F., ;
Interval = 100, ;
Name = "Timer1"
ADD OBJECT command1 AS CommandButton WITH ;
Top = 121, ;
Left = 71, ;
Height = 27, ;
Width = 247, ;
Caption = "Click Me to Begin Task", ;
Name = "Command1"
ADD OBJECT sspanel1 AS sspanel WITH ;
Top = 27, ;
Left = 28, ;
Height = 72, ;
Width = 328, ;
Name = "sspanel1"
ADD OBJECT command2 AS CommandButton WITH ;
Top = 159, ;
Left = 70, ;
Height = 26, ;
Width = 247, ;
Caption = "Reset", ;
Name = "Command2"
PROCEDURE Init
* Set the FloodType from Left to Right
THISFORM.sspanel1.FloodType = 1
* Initialize the FloodPercent to 0
THISFORM.sspanel1.FloodPercent = 0
THISFORM.sspanel1.FloodShowPct = .T. && Show the percent sign
ENDPROC
PROCEDURE timer1.Timer
IF THISFORM.sspanel1.FloodPercent < 100
THISFORM.sspanel1.FloodPercent = ;
THISFORM.sspanel1.FloodPercent + 1
ELSE
THISFORM.timer1.Enabled = .F.
THISFORM.command1.Caption = "Click Me to Begin Task"
WAIT WINDOW "Task Completed"
THISFORM.sspanel1.FloodPercent = 0
ENDIF
ENDPROC
PROCEDURE command1.Click
IF THIS.Caption = "Click Me to Begin Task"
THIS.Caption = "Click Me to Stop Task"
THISFORM.timer1.Enabled = .T.
ELSE
THIS.Caption = "Click Me to Begin Task"
THISFORM.timer1.Enabled = .F.
ENDIF
ENDPROC
PROCEDURE command2.Click
THISFORM.Timer1.Enabled = .F.
THISFORM.sspanel1.FloodPercent = 0
THISFORM.Command1.Caption = "Click Me to Begin Task"
ENDPROC
ENDDEFINE
DEFINE CLASS sspanel AS OLECONTROL
OLEClass = "Threed.SSPanel"
ENDDEFINE
*
*-- EndDefine: progress
**************************************************
- Run the .prg file and click the "Click Me to Begin Task" button, and the
progress/status indicator appears in the Threed panel ActiveX
control as FloodPercent property increases.
REFERENCES
Custom Control Reference Help File (Ctrlref.hlp in the Windows\System or
WinNT\System32 folder if using Windows NT). This file may also appear in
the Visual FoxPro folder.
Additional query words:
Keywords : kbinterop kbole kbOOP kbVFp500 kbVFp600
Version :
Platform :
Issue type : kbhowto
|