home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
- Object = "{89A72C4D-C70A-11D2-9158-004033289E7B}#1.0#0"; "StopWtch.ocx"
- Begin VB.Form SwExample
- Caption = "AussieSoft Stop Watch component example"
- ClientHeight = 6825
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6150
- LinkTopic = "Form1"
- ScaleHeight = 6825
- ScaleWidth = 6150
- StartUpPosition = 2 'CenterScreen
- Begin StopWatchControl.AusClock AusClock1
- Height = 1635
- Left = 1335
- Top = 135
- Width = 1635
- _ExtentX = 2884
- _ExtentY = 2884
- MouseIcon = "SwExample.frx":0000
- InitialTime = ""
- BorderWidth = 2
- BorderColor = -2147483640
- ForeColor = -2147483640
- SecWidth = 1
- MinWidth = 3
- HourWidth = 5
- Appearance = 1
- End
- Begin VB.Frame Frame
- Height = 4065
- Index = 1
- Left = 1500
- TabIndex = 9
- Top = 2400
- Width = 4095
- Begin VB.Frame Frame2
- Caption = "Display"
- Height = 585
- Left = 225
- TabIndex = 29
- Top = 165
- Width = 3510
- Begin VB.OptionButton DisplayOb
- Caption = "Analog"
- Height = 300
- Index = 0
- Left = 165
- TabIndex = 31
- Top = 255
- Value = -1 'True
- Width = 945
- End
- Begin VB.OptionButton DisplayOb
- Caption = "Digital"
- Height = 300
- Index = 1
- Left = 1590
- TabIndex = 30
- Top = 255
- Width = 945
- End
- End
- Begin VB.Frame Frame6
- Caption = "Clock mode"
- Height = 2355
- Left = 225
- TabIndex = 15
- Top = 810
- Width = 3510
- Begin VB.OptionButton ModeOb
- Caption = "Normal"
- Height = 225
- Index = 0
- Left = 165
- TabIndex = 27
- Top = 210
- Value = -1 'True
- Width = 975
- End
- Begin VB.OptionButton ModeOb
- Caption = "Decrement"
- Height = 225
- Index = 1
- Left = 165
- TabIndex = 26
- Top = 1515
- Width = 1245
- End
- Begin VB.TextBox InitTimeTb
- Height = 330
- Left = 1515
- TabIndex = 25
- Top = 1680
- Width = 1080
- End
- Begin VB.CheckBox BellCb
- Caption = "Alert when time expended"
- Height = 315
- Left = 420
- TabIndex = 24
- Top = 1995
- Value = 1 'Checked
- Width = 2160
- End
- Begin VB.CommandButton SetInitialTimePb
- Caption = "Set"
- Height = 330
- Left = 2715
- TabIndex = 23
- Top = 1680
- Width = 555
- End
- Begin VB.Frame Frame7
- Caption = "Alert every:"
- Height = 855
- Left = 375
- TabIndex = 16
- Top = 435
- Width = 2715
- Begin VB.OptionButton AlertOb
- Caption = "Hour"
- Height = 270
- Index = 5
- Left = 1935
- TabIndex = 22
- Top = 495
- Width = 720
- End
- Begin VB.OptionButton AlertOb
- Caption = "30 min."
- Height = 270
- Index = 4
- Left = 1020
- TabIndex = 21
- Top = 495
- Width = 870
- End
- Begin VB.OptionButton AlertOb
- Caption = "15 min."
- Height = 270
- Index = 3
- Left = 120
- TabIndex = 20
- Top = 495
- Width = 870
- End
- Begin VB.OptionButton AlertOb
- Caption = "5 min."
- Height = 270
- Index = 2
- Left = 1935
- TabIndex = 19
- Top = 195
- Width = 750
- End
- Begin VB.OptionButton AlertOb
- Caption = "1 min."
- Height = 270
- Index = 1
- Left = 1020
- TabIndex = 18
- Top = 195
- Value = -1 'True
- Width = 765
- End
- Begin VB.OptionButton AlertOb
- Caption = "No"
- Height = 270
- Index = 0
- Left = 120
- TabIndex = 17
- Top = 210
- Width = 870
- End
- End
- Begin VB.Label Label2
- Alignment = 1 'Right Justify
- Caption = "Initial time(hh:mm:ss)"
- Height = 225
- Left = 1590
- TabIndex = 28
- Top = 1425
- Width = 1515
- End
- Begin VB.Line Line1
- BorderColor = &H00808080&
- Index = 0
- X1 = 210
- X2 = 3240
- Y1 = 1380
- Y2 = 1380
- End
- Begin VB.Line Line1
- BorderColor = &H00E0E0E0&
- Index = 1
- X1 = 210
- X2 = 3240
- Y1 = 1395
- Y2 = 1395
- End
- End
- Begin VB.Frame Frame4
- Caption = "Clock border"
- Height = 675
- Left = 225
- TabIndex = 10
- Top = 3225
- Width = 3510
- Begin VB.TextBox BorderWidthTb
- Alignment = 1 'Right Justify
- Height = 330
- Left = 735
- TabIndex = 13
- Text = "1"
- Top = 255
- Width = 540
- End
- Begin VB.CommandButton BorderColPb
- Caption = "Color"
- Height = 315
- Left = 2460
- TabIndex = 12
- Top = 255
- Width = 825
- End
- Begin VB.CommandButton SetBorderWidthPb
- Caption = "Set"
- Height = 330
- Left = 1440
- TabIndex = 11
- Top = 255
- Width = 555
- End
- Begin VB.Label Label1
- Alignment = 1 'Right Justify
- Caption = "Width"
- Height = 225
- Index = 0
- Left = 75
- TabIndex = 14
- Top = 308
- Width = 540
- End
- End
- End
- Begin VB.Frame Frame
- Height = 4065
- Index = 3
- Left = 1500
- TabIndex = 45
- Top = 2400
- Width = 4095
- Begin VB.Frame Frame5
- Caption = "Digital accuracy"
- Height = 675
- Left = 285
- TabIndex = 52
- Top = 390
- Width = 3660
- Begin VB.OptionButton AccuracyOb
- Caption = "Units"
- Height = 240
- Index = 0
- Left = 165
- TabIndex = 55
- Top = 270
- Value = -1 'True
- Width = 780
- End
- Begin VB.OptionButton AccuracyOb
- Caption = "Tenths"
- Height = 240
- Index = 1
- Left = 1125
- TabIndex = 54
- Top = 270
- Width = 885
- End
- Begin VB.OptionButton AccuracyOb
- Caption = "Hundredths"
- Height = 240
- Index = 2
- Left = 2190
- TabIndex = 53
- Top = 270
- Width = 1230
- End
- End
- Begin VB.Frame Frame1
- Caption = "Size"
- Height = 675
- Left = 285
- TabIndex = 46
- Top = 1215
- Width = 3660
- Begin VB.TextBox DimTb
- Height = 315
- Index = 2
- Left = 1005
- TabIndex = 49
- Top = 270
- Width = 465
- End
- Begin VB.TextBox DimTb
- Height = 315
- Index = 3
- Left = 2400
- TabIndex = 48
- Top = 270
- Width = 465
- End
- Begin VB.CommandButton SetPb
- Caption = "Set"
- Height = 330
- Index = 0
- Left = 2955
- TabIndex = 47
- Top = 270
- Width = 555
- End
- Begin VB.Label Label3
- Alignment = 1 'Right Justify
- Caption = "Height(mm)"
- Height = 240
- Index = 2
- Left = 60
- TabIndex = 51
- Top = 300
- Width = 810
- End
- Begin VB.Label Label3
- Alignment = 1 'Right Justify
- Caption = "Width(mm)"
- Height = 240
- Index = 3
- Left = 1515
- TabIndex = 50
- Top = 300
- Width = 810
- End
- End
- End
- Begin VB.Frame Frame
- Height = 4065
- Index = 2
- Left = 1500
- TabIndex = 32
- Top = 2400
- Width = 4095
- Begin VB.Frame Frame3
- Caption = "Analog face"
- Height = 2070
- Left = 195
- TabIndex = 33
- Top = 300
- Width = 3690
- Begin VB.OptionButton FaceOb
- Caption = "Rectangular"
- Height = 270
- Index = 0
- Left = 165
- TabIndex = 42
- Top = 285
- Width = 1350
- End
- Begin VB.OptionButton FaceOb
- Caption = "Oval"
- Height = 270
- Index = 1
- Left = 1965
- TabIndex = 41
- Top = 285
- Width = 780
- End
- Begin VB.OptionButton AppearanceOb
- Caption = "Flat"
- Height = 270
- Index = 0
- Left = 165
- TabIndex = 40
- Top = 1110
- Width = 660
- End
- Begin VB.OptionButton AppearanceOb
- Caption = "Raised"
- Height = 270
- Index = 1
- Left = 945
- TabIndex = 39
- Top = 1110
- Width = 870
- End
- Begin VB.OptionButton AppearanceOb
- Caption = "Lowered"
- Height = 270
- Index = 2
- Left = 1935
- TabIndex = 38
- Top = 1110
- Width = 1140
- End
- Begin VB.CommandButton BgPb
- Caption = "Background color"
- Height = 315
- Left = 990
- TabIndex = 37
- Top = 1515
- Width = 1545
- End
- Begin VB.TextBox DimTb
- Height = 315
- Index = 0
- Left = 975
- TabIndex = 36
- Top = 630
- Width = 465
- End
- Begin VB.TextBox DimTb
- Height = 315
- Index = 1
- Left = 2415
- TabIndex = 35
- Top = 630
- Width = 465
- End
- Begin VB.CommandButton SetPb
- Caption = "Set"
- Height = 330
- Index = 1
- Left = 3000
- TabIndex = 34
- Top = 615
- Width = 555
- End
- Begin VB.Label Label3
- Alignment = 1 'Right Justify
- Caption = "Height(mm)"
- Height = 240
- Index = 0
- Left = 60
- TabIndex = 44
- Top = 660
- Width = 810
- End
- Begin VB.Label Label3
- Alignment = 1 'Right Justify
- Caption = "Width(mm)"
- Height = 240
- Index = 1
- Left = 1530
- TabIndex = 43
- Top = 660
- Width = 810
- End
- End
- End
- Begin VB.CommandButton StartPb
- Caption = "Start clock"
- Height = 315
- Left = 4500
- TabIndex = 7
- Top = 90
- Width = 990
- End
- Begin VB.CommandButton LapPb
- Caption = "Lap"
- Enabled = 0 'False
- Height = 315
- Left = 90
- TabIndex = 6
- Top = 75
- Width = 990
- End
- Begin VB.ListBox List1
- Height = 1230
- Left = 90
- MousePointer = 13 'Arrow and Hourglass
- TabIndex = 5
- Top = 510
- Width = 990
- End
- Begin VB.CommandButton ResetLapsPb
- Caption = "Reset"
- Height = 315
- Left = 90
- TabIndex = 4
- Top = 1830
- Width = 990
- End
- Begin VB.CommandButton ResetClockPb
- Caption = "Reset"
- Enabled = 0 'False
- Height = 315
- Left = 4500
- TabIndex = 3
- Top = 495
- Width = 990
- End
- Begin VB.TextBox TimeTb
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 18
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 435
- Index = 0
- Left = 3285
- TabIndex = 2
- Text = "00:00:00"
- Top = 1200
- Visible = 0 'False
- Width = 1620
- End
- Begin VB.TextBox TimeTb
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Index = 1
- Left = 4905
- TabIndex = 1
- Text = "0"
- Top = 1260
- Visible = 0 'False
- Width = 270
- End
- Begin VB.TextBox TimeTb
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Index = 2
- Left = 5175
- TabIndex = 0
- Text = "0"
- Top = 1260
- Visible = 0 'False
- Width = 255
- End
- Begin MSComDlg.CommonDialog CommDlg
- Left = 0
- Top = 6165
- _ExtentX = 847
- _ExtentY = 847
- _Version = 327681
- CancelError = -1 'True
- End
- Begin ComctlLib.TabStrip TabStrip
- Height = 4785
- Left = 1350
- TabIndex = 8
- Top = 1890
- Width = 4380
- _ExtentX = 7726
- _ExtentY = 8440
- _Version = 327682
- BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7}
- NumTabs = 3
- BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "General settings"
- Key = ""
- Object.Tag = ""
- ImageVarType = 2
- EndProperty
- BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Analog settings"
- Key = ""
- Object.Tag = ""
- ImageVarType = 2
- EndProperty
- BeginProperty Tab3 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Digital settings"
- Key = ""
- Object.Tag = ""
- ImageVarType = 2
- EndProperty
- EndProperty
- End
- Attribute VB_Name = "SwExample"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim Loading As Boolean
- Private Sub AccuracyOb_Click(Index As Integer)
- If Loading Then
- Exit Sub
- End If
- AusClock1.Accuracy = Index
- If AusClock1.IgnoreDisplay Then
- Select Case Index
- Case 0
- TimeTb(1).Visible = False
- TimeTb(2).Visible = False
- Case 1
- TimeTb(1).Visible = True
- TimeTb(2).Visible = False
- Case 2
- TimeTb(1).Visible = True
- TimeTb(2).Visible = True
- End Select
- TimeTb(1).Visible = False
- TimeTb(2).Visible = False
- End If
- End Sub
- Private Sub AlertOb_Click(Index As Integer)
- Select Case Index
- Case 0
- AusClock1.AlertTime = 0
- Case 1
- AusClock1.AlertTime = 60
- Case 2
- AusClock1.AlertTime = 300
- Case 3
- AusClock1.AlertTime = 900
- Case 4
- AusClock1.AlertTime = 1800
- Case 5
- AusClock1.AlertTime = 3600
- End Select
- End Sub
- Private Sub AppearanceOb_Click(Index As Integer)
- If Loading Then
- Exit Sub
- End If
- AusClock1.Appearance = Index
- End Sub
- Private Sub AusClock1_Alert()
- Dim A As Long, Av As String
- Av = App.Path
- If Right$(Av, 1) <> "\" Then
- Av = Av & "\"
- End If
- A = sndPlaySound(Av & "Ding.wav", 1)
- End Sub
- Private Sub AusClock1_Click()
- AusClock1.Refresh
- End Sub
- Private Sub AusClock1_Notify()
- If AusClock1.IgnoreDisplay Then
- TimeTb(0).Text = Format$(AusClock1.Hours, "00") & ":" & Format$(AusClock1.Minutes, "00") & ":" & Format$(AusClock1.Seconds, "00")
- If AusClock1.Accuracy = SwTenths Then
- TimeTb(1).Text = Format$(AusClock1.Tens, "0")
- End If
- If AusClock1.Accuracy = SwHundredths Then
- TimeTb(1).Text = Format$(AusClock1.Tens, "0")
- TimeTb(2).Text = Format$(AusClock1.Hundreds, "0")
- End If
- End If
- End Sub
- Private Sub AusClock1_TimeExpired()
- Dim A As Long, Av As String
- Av = App.Path
- If Right$(Av, 1) <> "\" Then
- Av = Av & "\"
- End If
- If BellCb.Value = 1 Then
- A = sndPlaySound(Av & "Ding.wav", 1)
- End If
- TimeTb(1).Text = "0"
- TimeTb(2).Text = "0"
- MsgBox "Time expired", vbOKOnly + vbInformation
- StartPb.Caption = "Start"
- StartPb.Enabled = False
- ResetClockPb.Enabled = True
- End Sub
- Private Sub BgPb_Click()
- CommDlg.Color = AusClock1.BackGround
- CommDlg.Action = 3
- If Err = 0 Then
- AusClock1.BackGround = CommDlg.Color
- End If
- End Sub
- Private Sub BorderColPb_Click()
- CommDlg.Color = AusClock1.BorderColor
- CommDlg.Action = 3
- If Err = 0 Then
- AusClock1.BorderColor = CommDlg.Color
- End If
- End Sub
- Private Sub DisplayOb_Click(Index As Integer)
- If Loading Then
- Exit Sub
- End If
- AusClock1.Display = Index
- If Index = 0 Then
- AusClock1.Height = Val(DimTb(0).Text) * 56.7
- AusClock1.Width = Val(DimTb(1).Text) * 56.7
- AusClock1.Height = Val(DimTb(2).Text) * 56.7
- AusClock1.Width = Val(DimTb(3).Text) * 56.7
- End If
- End Sub
- Private Sub FaceOb_Click(Index As Integer)
- If Loading Then
- Exit Sub
- End If
- If AusClock1.Display = swAnalog Then
- AusClock1.ClockFace = Index
- End If
- End Sub
- Private Sub Form_Load()
- Dim K As Integer
- Loading = True
- For K = 1 To 3
- Frame(K).Move TabStrip.ClientLeft, TabStrip.ClientTop, TabStrip.ClientWidth, TabStrip.ClientHeight
- Frame(1).ZOrder
- TimeTb(0).Move 1590, 1245
- TimeTb(1).Move 3210, 1305
- TimeTb(2).Move 3480, 1305
- If AusClock1.IgnoreDisplay Then
- AusClock1.Visible = False
- TimeTb(0).Visible = True
- If AusClock1.Accuracy = SwTenths Then
- TimeTb(1).Visible = True
- End If
- If AusClock1.Accuracy = SwHundredths Then
- TimeTb(1).Visible = True
- TimeTb(2).Visible = True
- End If
- TimeTb(0).Visible = False
- TimeTb(1).Visible = False
- TimeTb(2).Visible = False
- End If
- InitTimeTb.Text = AusClock1.InitialTime
- AppearanceOb(AusClock1.Appearance).Value = True
- AccuracyOb(AusClock1.Accuracy) = True
- DisplayOb(AusClock1.Display).Value = True
- ModeOb(AusClock1.ClockMode).Value = True
- FaceOb(AusClock1.ClockFace).Value = True
- DimTb(0).Text = Int(AusClock1.Height / 56.7)
- DimTb(1).Text = Int(AusClock1.Width / 56.7)
- DimTb(2).Text = Int(AusClock1.Height / 56.7)
- DimTb(3).Text = Int(AusClock1.Width / 56.7)
- BorderWidthTb.Text = Format$(AusClock1.BorderWidth)
- CommDlg.Flags = cdlCCPreventFullOpen Or cdlCCRGBInit
- For K = 0 To 5
- If AlertOb(K).Value Then
- Exit For
- End If
- If K = 6 Then
- AlertOb(0).Value = True
- K = 0
- End If
- Select Case K
- Case 0
- AusClock1.AlertTime = 0
- Case 1
- AusClock1.AlertTime = 60
- Case 2
- AusClock1.AlertTime = 300
- Case 3
- AusClock1.AlertTime = 900
- Case 4
- AusClock1.AlertTime = 1800
- Case 5
- AusClock1.AlertTime = 3600
- End Select
- Loading = False
- End Sub
- Private Sub ModeOb_Click(Index As Integer)
- If Loading Then
- Exit Sub
- End If
- AusClock1.ClockMode = Index
- If Index = 1 Then
- TimeTb(0).Text = AusClock1.InitialTime
- End If
- StartPb.Enabled = True
- End Sub
- Private Sub ResetClockPb_Click()
- If AusClock1.ClockMode = swNormal Then
- AusClock1.ResetClock
- TimeTb(0).Text = "00:00:00"
- TimeTb(1).Text = "0"
- TimeTb(2).Text = "0"
- AusClock1.InitialTime = InitTimeTb.Text
- TimeTb(0).Text = InitTimeTb.Text
- TimeTb(1).Text = "0"
- TimeTb(2).Text = "0"
- StartPb.Enabled = True
- End If
- StartPb.Caption = "Start clock"
- End Sub
- Private Sub ResetLapsPb_Click()
- List1.Clear
- End Sub
- Private Sub SetBorderWidthPb_Click()
- AusClock1.BorderWidth = Val(BorderWidthTb.Text)
- End Sub
- Private Sub SetInitialTimePb_Click()
- AusClock1.InitialTime = InitTimeTb.Text
- End Sub
- Private Sub SetPb_Click(Index As Integer)
- If AusClock1.Display = swAnalog Then
- AusClock1.Width = Val(DimTb(1).Text) * 56.7
- AusClock1.Height = Val(DimTb(0).Text) * 56.7
- AusClock1.Width = Val(DimTb(3).Text) * 56.7
- AusClock1.Height = Val(DimTb(2).Text) * 56.7
- End If
- End Sub
- Private Sub StartPb_Click()
- If StartPb.Caption = "Start clock" Then
- StartPb.Caption = "Stop clock"
- If AusClock1.ClockMode = 0 Then
- LapPb.Enabled = True
- End If
- AusClock1.StartClock
- StartTime = Time
- ResetClockPb.Enabled = False
- StartPb.Caption = "Start clock"
- LapPb.Enabled = False
- AusClock1.StopClock
- FinishTime = Time - StartTime
- ResetClockPb.Enabled = True
- End If
- End Sub
- Private Sub TabStrip_Click()
- Frame(TabStrip.SelectedItem.Index).ZOrder
- End Sub
-