home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 February
/
PCWK0297.iso
/
envelop
/
envelop.5
/
Tools
/
Arsenal
/
apps
/
stopclk
/
stopclk.eto
< prev
next >
Wrap
Text File
|
1996-07-08
|
5KB
|
190 lines
Type StopClockMasterForm From SampleMasterForm
Dim StopWatch As New StopClock
Dim StopFont As New Font
Dim Label1 As New Label
Dim lblElapsed As New Label
Dim Label3 As New Label
Dim lblAccumulated As New Label
Dim btnStart As New Button
Dim btnPause As New Button
Dim btnFinish As New Button
Dim btnReset As New Button
Dim Label2 As New Label
Dim optInterval50 As New OptionButton
Dim optInterval75 As New OptionButton
Dim optInterval100 As New OptionButton
' METHODS for object: StopClockMasterForm
Sub btnReset_Click()
' Disable the timer control
StopTimer.Enabled = "False"
' Reset the stopwatch control
StopWatch.Reset
' Update the display
UpdateDisplay
End Sub
Sub UpdateDisplay()
' Update the Elapsed Time label
lblElapsed.Text = StopWatch.ElapsedTime
lblAccumulated.Text = StopWatch.AccumulatedTime
End Sub
Sub btnStart_Click()
' Activate the timer control and start the StopClock control
StopWatch.Start
StopTimer.Enabled = "True"
End Sub
Sub btnPause_Click()
' Pause the StopClock control
StopWatch.Pause
End Sub
Sub btnFinish_Click()
' Disable the Timer control
StopTimer.Enabled = "False"
' Stop the StopClock control
StopWatch.Finish
' Update the Elapsed and Accumulated times
UpdateDisplay
End Sub
Sub StopTimer_Timeout()
' Update the Elapsed and Accumulated time displays
UpdateDisplay
End Sub
Sub optInterval75_Click()
StopTimer.Interval = 75
End Sub
Sub optInterval100_Click()
StopTimer.Interval = 100
End Sub
Sub optInterval50_Click()
StopTimer.Interval = 50
End Sub
Sub ResetApplication_Click ()
' Set the timer interval
StopTimer.Interval = 100
' Reset the display
btnReset_Click
' Set the timer interval
StopTimer.Interval = 100
optInterval100.Value = True
optInterval75.Value = False
optInterval50.Value = False
End Sub
End Type
Type StopTimer From Timer
' METHODS for object: StopTimer
Sub Timeout()
' Method to trigger an update of the display each time
' the StopTimer object's interval is triggered
StopClockMasterForm.StopTimer_Timeout
End Sub
End Type
Begin Code
' Reconstruction commands for object: StopClockMasterForm
'
With StopClockMasterForm
With .StopWatch
End With 'StopClockMasterForm.StopWatch
With .StopFont
.FaceName = "vtascii_132_dblhiwide"
.Size = 36
.Bold = False
End With 'StopClockMasterForm.StopFont
With .Label1
.Caption = "Elapsed Time"
.ForeColor = 13107200
.Move(300, 300, 1500, 300)
End With 'StopClockMasterForm.Label1
With .lblElapsed
.BackColor = 0
.ForeColor = 16777215
.Font = StopClockMasterForm.StopFont
.Move(1050, 750, 4200, 750)
.BorderStyle = "Fixed Single"
.Alignment = "Center"
End With 'StopClockMasterForm.lblElapsed
With .Label3
.Caption = "Accumulated Time"
.ForeColor = 13107200
.Move(300, 1650, 1950, 300)
End With 'StopClockMasterForm.Label3
With .lblAccumulated
.BackColor = 0
.ForeColor = 16777215
.Font = StopClockMasterForm.StopFont
.Move(1050, 2100, 4200, 750)
.BorderStyle = "Fixed Single"
.Alignment = "Center"
End With 'StopClockMasterForm.lblAccumulated
With .btnStart
.Caption = "Start"
.Move(600, 3150, 1050, 450)
End With 'StopClockMasterForm.btnStart
With .btnPause
.Caption = "Pause"
.Move(1950, 3150, 1050, 450)
End With 'StopClockMasterForm.btnPause
With .btnFinish
.Caption = "Finish"
.Move(3300, 3150, 1050, 450)
End With 'StopClockMasterForm.btnFinish
With .btnReset
.Caption = "Reset"
.Move(4650, 3150, 1050, 450)
End With 'StopClockMasterForm.btnReset
With .Label2
.Caption = "Update Interval"
.ForeColor = 13107200
.Move(300, 4050, 1950, 300)
End With 'StopClockMasterForm.Label2
With .optInterval50
.Caption = "Timer Interval = 50"
.Move(600, 4500, 2550, 300)
.TabStop = True
.TabGroup = True
.Value = True
End With 'StopClockMasterForm.optInterval50
With .optInterval75
.Caption = "Timer Interval = 75"
.Move(600, 4800, 2550, 300)
End With 'StopClockMasterForm.optInterval75
With .optInterval100
.Caption = "Timer Interval = 100"
.Move(600, 5100, 2550, 300)
End With 'StopClockMasterForm.optInterval100
With .helpfile
.FileName = "W:\Examples\stopclk\stopclk.hlp"
End With 'StopClockMasterForm.helpfile
.Caption = "Timer Demonstration"
.Move(4215, 1845, 6420, 6315)
.SampleDir = "W:\Examples\stopclk\"
.SampleName = "stopclk"
.DefaultButton = .btnStart
.CancelButton = .btnReset
End With 'StopClockMasterForm
' Reconstruction commands for object: StopTimer
'
With StopTimer
.Interval = 50
End With 'StopTimer
End Code