*********************************************************
** gsThermometer by Subramanian.G (ramani)
** www.winnersoft.coolfreepages.com
** FoxAcc Software - ramani_g@yahoo.com
** provided as freeware. Use at your Own Risk.
*********************************************************
* How to use .... (Example)
* Progress Bar or Thermometer Class and how to use .. example
*
* Copy the following and run the PRG
DEFINE POPUP gsTherm SHORTCUT RELATIVE FROM MROW(),MCOL() ;
STYLE "BOLDITALIC" FONT "Arial",12 ;
TITLE "Thermometer Demo" MARGIN
DEFINE BAR 1 OF gsTherm PROMPT "Thermometer using labels"
DEFINE BAR 2 OF gsTherm PROMPT "Thermometer using OLE class"
DEFINE BAR 3 OF gsTherm PROMPT "Thermometer using container"
DEFINE BAR 4 OF gsTherm PROMPT "Exit"
ON SELECTION POPUP gsTherm DEACTIVATE POPUP
*****************************************************
DO WHILE .t.
ACTIVATE POPUP gsTherm
DO CASE
CASE BAR()=1
cThermometer = 'gsThermometer'
CASE BAR()=2
cThermometer = 'gsThermometerOLE'
CASE BAR()=3
cThermometer = 'gsThermometerBar'
CASE BAR()=4
EXIT
ENDCASE
**
oTherm = createobject(cThermometer)
oTherm.Show()
FOR I = 1 TO 100
a = inkey(.01)
oTherm.Progress1.Value = i
ENDFOR
oTherm.Release
**
ENDDO
RETURN
**************************************************
* The above code is for showing example
* Choose the thermometer you like and implement.
*
* Suitably insert lines in your code to set the
* oThermometer.Progress1.Value a % completed.
*
*
**************************************************
** The following shows the
** A combination of Labels as growing for progress bar.
**************************************************
*-- Class: gstherm
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 11/13/04 12:58:04 PM
*
DEFINE CLASS gsThermometer AS form
ENDDEFINE
*
*-- EndDefine: gstherm
**************************************************
*
*
*
*
*
**************************************************
** The following shows the
** OLE class-Microsoft Progressbar Control Ver 5.0 (SP2)
** way of showing a progress bar.
**************************************************
**************************************************
** gsThermometerOLE
**************************************************
*-- Form: gsThermometerOLE
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 11/10/04 12:01:04 AM
*
DEFINE CLASS gsThermometerOLE AS form
ADD OBJECT shape1 AS shape WITH ;
Curvature = 10, ;
Top = 6, ;
Left = 6, ;
Height = 58, ;
Width = 396, ;
Name = "Shape1"
ADD OBJECT lblProgress AS label WITH ;
BackStyle = 0, ;
Caption = "Progress", ;
ForeColor = RGB(0,128,0), ;
Height = 14, ;
Left = 12, ;
Top = 12, ;
Width = 384, ;
Name = "lblProgress"
** OLE class-Microsoft Progressbar Control Ver 5.0 (SP2)
ADD OBJECT Progress1 AS olecontrol WITH ;
Top = 28, ;
Left = 12, ;
Height = 30, ;
Width = 384, ;
OleClass = 'comctl.ProgCtrl.1', ;
Name = "Progress1"
PROCEDURE Destroy
SET CURSOR ON
ENDPROC
PROCEDURE Init
* Simply Set This.Progress1.Value = % completed to display suitably.
*
This.Progress1.Value = 0
SET CURSOR OFF
This.zOrder(0)
INKEY(0.001)
ENDPROC
ENDDEFINE
*
*-- EndDefine: gsThermometerOLE
**************************************************
*
*
*
*
*
**************************************************
** The following shows
** A Container as a growing bar for progress bar.
**************************************************
**************************************************
** gsThermometerBar
**************************************************
*-- Form: gsThermometerBar
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 11/10/04 12:01:04 AM
*
DEFINE CLASS gsThermometerBar AS form
ADD OBJECT shape1 AS shape WITH ;
Curvature = 10, ;
Top = 6, ;
Left = 6, ;
Height = 58, ;
Width = 396, ;
Name = "Shape1"
ADD OBJECT lblProgress AS label WITH ;
BackStyle = 0, ;
Caption = "Progress", ;
ForeColor = RGB(0,0,128), ;
Height = 14, ;
Left = 12, ;
Top = 12, ;
Width = 384, ;
Name = "lblProgress"
ADD OBJECT Progress1 AS textbox WITH ;
Value = 1, ;
Visible = .F., ;
Name = "Progress1"
ADD OBJECT ProgressBarBack AS Container WITH ;
SpecialEffect = 1, ;
Top = 29, ;
Left = 12, ;
Height = 24, ;
Width = 384, ;
Name = "ProgressBarBack"
ADD OBJECT ProgressBar AS container WITH ;
BackColor = RGB(224,0,0), ;
BackStyle = 1, ;
BorderWidth = 0, ;
Top = 31, ;
Left = 14, ;
Height = 20, ;
Width = 380, ;
Name = "ProgressBar"
ADD OBJECT ProgressPercent AS Label WITH ;
BackStyle = 0, ;
BorderStyle = 0, ;
FontItalic = .t., ;
FontSize = 9, ;
ForeColor = RGB(0,0,128), ;
Top = 34, ;
Left = 192, ;
Height = 18, ;
Width = 36, ;
Name = "ProgressPercent"
PROCEDURE Destroy
SET CURSOR ON
ENDPROC
PROCEDURE Init
* Simply Set This.Progress1.Value = % completed to display suitably.
*
This.Progress1.Value = 0
SET CURSOR OFF
This.zOrder(0)
INKEY(0.001)
ENDPROC
PROCEDURE progress1.ProgrammaticChange
* 380 is the Max width of the Progress Bar when 100% completed.
This.Parent.ProgressBar.Width = (This.Value * 380)/100
This.Parent.ProgressPercent.Caption = TRANSFORM(This.Value)+'%'
INKEY(0.001)
ENDPROC
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.