home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form MhClock
- Caption = "MhClock"
- ClientHeight = 4308
- ClientLeft = 1740
- ClientTop = 2472
- ClientWidth = 9276
- Height = 4692
- Left = 1692
- LinkTopic = "Form1"
- ScaleHeight = 4308
- ScaleWidth = 9276
- Top = 2136
- Width = 9372
- Begin VB.CommandButton Command2
- Caption = "E&xit"
- Height = 375
- Left = 7680
- TabIndex = 30
- Top = 3720
- Width = 1215
- End
- Begin VB.Frame Frame1
- Caption = "Analog"
- Height = 4095
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 4455
- Begin VB.Frame Frame3
- Caption = "Style"
- Height = 2055
- Left = 2280
- TabIndex = 2
- Top = 240
- Width = 2055
- Begin VB.CheckBox SepSeconds
- Caption = "Seperate Seconds"
- Height = 255
- Left = 240
- TabIndex = 7
- Top = 1680
- Width = 1695
- End
- Begin VB.OptionButton aStyle4
- Caption = "24 hour with seconds"
- Height = 255
- Left = 120
- TabIndex = 6
- Top = 1320
- Width = 1815
- End
- Begin VB.OptionButton aStyle3
- Caption = "24 hour"
- Height = 255
- Left = 120
- TabIndex = 5
- Top = 960
- Width = 1815
- End
- Begin VB.OptionButton aStyle2
- Caption = "12 hour with seconds"
- Height = 255
- Left = 120
- TabIndex = 4
- Top = 600
- Width = 1815
- End
- Begin VB.OptionButton aStyle1
- Caption = "12 hour"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 240
- Width = 1815
- End
- End
- Begin VB.Frame Frame4
- Caption = "Settings"
- Height = 1695
- Left = 120
- TabIndex = 8
- Top = 2280
- Width = 4215
- Begin VB.PictureBox Picture2
- ClipControls = 0 'False
- Height = 495
- Left = 360
- Negotiate = -1 'True
- ScaleHeight = 156.757
- ScaleMode = 0 'User
- ScaleWidth = 1031.746
- TabIndex = 29
- Top = 960
- Width = 1230
- End
- Begin VB.OptionButton PMOption1
- Caption = "PM"
- Enabled = 0 'False
- Height = 195
- Left = 1320
- TabIndex = 16
- Top = 600
- Width = 615
- End
- Begin VB.OptionButton AMOption1
- Caption = "AM"
- Enabled = 0 'False
- Height = 195
- Left = 1320
- TabIndex = 15
- Top = 360
- Width = 615
- End
- Begin VB.CheckBox Check1
- Caption = "Alarm"
- Height = 195
- Left = 120
- TabIndex = 11
- Top = 240
- Width = 855
- End
- Begin VB.ComboBox Combo2
- Height = 315
- Left = 2160
- Style = 2 'Dropdown List
- TabIndex = 10
- Top = 1200
- Width = 1935
- End
- Begin VB.ComboBox Combo1
- Height = 315
- ItemData = "MhClock.frx":0000
- Left = 2160
- List = "MhClock.frx":0002
- Style = 2 'Dropdown List
- TabIndex = 9
- Top = 480
- Width = 1935
- End
- Begin MhintimeLib.MhTimeInput MhTimeInput1
- Height = 315
- Left = 120
- TabIndex = 14
- Top = 480
- Width = 1095
- _Version = 65536
- _ExtentX = 1931
- _ExtentY = 556
- _StockProps = 77
- BackColor = 16777215
- Enabled = 0 'False
- TintColor = 16711935
- Alignment = 0
- BevelSize = 2
- BevelStyle = 0
- BorderColor = -2147483642
- BorderStyle = 0
- FillColor = 16777215
- LightColor = 16777215
- ShadowColor = 8421504
- TextColor = -2147483640
- Text = ""
- ReadOnly = 0 'False
- Spin = 2
- SpinDelay = 500
- SpinSpeed = 500
- Indent = 0
- AutoHScroll = 0 'False
- FontStyle = 0
- Verbose = 0 'False
- CaretHeight = 10
- CaretWidth = 0
- CaretColor = -2147483640
- CaretStyle = 1
- CaretVAlign = 1
- CaretInterval = 400
- CaretVisible = -1 'True
- Separator = 58
- TimeFormat = 1
- Country = 0
- VAlignment = 2
- MaxHours = 11
- MaxMinutes = 59
- MaxSeconds = 59
- MinHours = 1
- MinMinutes = 0
- MinSeconds = 0
- SpinChange = 1
- AllowBlank = 0 'False
- FocusSelect = 0 'False
- AM = 0 'False
- End
- Begin VB.Label Label3
- AutoSize = -1 'True
- Caption = "Font Style"
- Height = 195
- Left = 2160
- TabIndex = 13
- Top = 960
- Width = 705
- End
- Begin VB.Label Label2
- AutoSize = -1 'True
- Caption = "Picture"
- Height = 195
- Left = 2160
- TabIndex = 12
- Top = 240
- Width = 495
- End
- End
- Begin Mhcl200Lib.MhClock MhClock1
- Height = 2055
- Left = 120
- TabIndex = 31
- Top = 240
- Width = 2055
- _Version = 65536
- _ExtentX = 3625
- _ExtentY = 3625
- _StockProps = 77
- TintColor = 16711935
- Style = 5
- PictureAClock = "MhClock.frx":0004
- PictureDClock = "MhClock.frx":0020
- Hour = -1
- Minute = -1
- Second = -1
- HourHandLen = 50
- HourHandWidth = 4
- MinuteHandLen = 80
- MinuteHandWidth = 2
- SecondHandLen = 90
- SecondHandWidth = 1
- ScaleMode = 3
- AlarmHour = -1
- AlarmMinute = -1
- AlarmSecond = -1
- DiffHour = -1
- DiffMinute = -1
- DiffSecond = -1
- Interval = 1000
- TextColor = -2147483630
- LightColor = -2147483628
- ShadowColor = -2147483632
- FillColor = -2147483633
- BorderColor = -2147483642
- HourTop = 0
- HourLeft = 0
- HourWidth = 172
- HourHeight = 172
- MinuteTop = 0
- MinuteLeft = 0
- MinuteWidth = 172
- MinuteHeight = 172
- SecondTop = 0
- SecondLeft = 0
- SecondWidth = 172
- SecondHeight = 172
- BestFit = -1 'True
- End
- End
- Begin VB.Frame Frame2
- Caption = "Digital"
- Height = 3135
- Left = 4800
- TabIndex = 1
- Top = 120
- Width = 4335
- Begin VB.PictureBox Picture1
- BackColor = &H00C0C0C0&
- FillColor = &H000000FF&
- FillStyle = 0 'Solid
- Height = 195
- Left = 2475
- ScaleHeight = 144
- ScaleWidth = 204
- TabIndex = 18
- Top = 870
- Width = 255
- End
- Begin VB.Frame Frame5
- Caption = "Settings"
- Height = 1665
- Left = 120
- TabIndex = 19
- Top = 1260
- Width = 4110
- Begin VB.ComboBox Combo4
- Height = 315
- Left = 2040
- TabIndex = 28
- Text = "Combo4"
- Top = 1200
- Width = 1935
- End
- Begin VB.CommandButton Command1
- Caption = "&Font"
- Height = 375
- Left = 240
- TabIndex = 26
- Top = 1080
- Width = 1215
- End
- Begin VB.ComboBox Combo3
- Height = 315
- Left = 2040
- TabIndex = 25
- Text = "Combo3"
- Top = 450
- Width = 1935
- End
- Begin VB.OptionButton PMOption2
- Caption = "PM"
- Enabled = 0 'False
- Height = 195
- Left = 1320
- TabIndex = 23
- Top = 600
- Width = 615
- End
- Begin VB.OptionButton AMOption2
- Caption = "AM"
- Enabled = 0 'False
- Height = 195
- Left = 1320
- TabIndex = 22
- Top = 360
- Width = 615
- End
- Begin VB.CheckBox Check2
- Caption = "Alarm"
- Height = 195
- Left = 120
- TabIndex = 20
- Top = 240
- Width = 735
- End
- Begin VB.Label Label4
- AutoSize = -1 'True
- Caption = "Font Style"
- Height = 195
- Left = 2040
- TabIndex = 27
- Top = 960
- Width = 705
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- Caption = "Picture"
- Height = 195
- Left = 2040
- TabIndex = 24
- Top = 225
- Width = 495
- End
- Begin MhintimeLib.MhTimeInput MhTimeInput2
- Height = 315
- Left = 120
- TabIndex = 21
- Top = 480
- Width = 1095
- _Version = 65536
- _ExtentX = 1931
- _ExtentY = 556
- _StockProps = 77
- Enabled = 0 'False
- TintColor = 16711935
- Alignment = 0
- BevelSize = 2
- BevelStyle = 0
- BorderColor = -2147483642
- BorderStyle = 0
- FillColor = 16777215
- LightColor = -2147483643
- ShadowColor = -2147483632
- TextColor = -2147483640
- Text = ""
- ReadOnly = 0 'False
- Spin = 2
- SpinDelay = 500
- SpinSpeed = 500
- Indent = 0
- AutoHScroll = 0 'False
- FontStyle = 0
- Verbose = 0 'False
- CaretHeight = 10
- CaretWidth = 0
- CaretColor = -2147483640
- CaretStyle = 1
- CaretVAlign = 1
- CaretInterval = 400
- CaretVisible = -1 'True
- Separator = 58
- TimeFormat = 1
- Country = 0
- VAlignment = 2
- MaxHours = 11
- MaxMinutes = 59
- MaxSeconds = 59
- MinHours = 0
- MinMinutes = 0
- MinSeconds = 0
- SpinChange = 1
- AllowBlank = 0 'False
- FocusSelect = 0 'False
- AM = 0 'False
- End
- End
- Begin VB.Shape Shape1
- BorderStyle = 0 'Transparent
- Height = 195
- Left = 2340
- Top = 885
- Width = 225
- End
- Begin Mhcl200Lib.MhClock MhClock2
- Height = 915
- Left = 600
- TabIndex = 17
- Top = 300
- Width = 3135
- _Version = 65536
- _ExtentX = 5530
- _ExtentY = 1614
- _StockProps = 77
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 12
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- TintColor = 16711935
- Style = 1
- PictureAClock = "MhClock.frx":003C
- PictureDClock = "MhClock.frx":0058
- Hour = 9
- Minute = 35
- Second = 30
- HourHandLen = 50
- HourHandWidth = 4
- MinuteHandLen = 90
- MinuteHandWidth = 2
- SecondHandLen = 100
- SecondHandWidth = 1
- ScaleMode = 1
- AlarmHour = -1
- AlarmMinute = -1
- AlarmSecond = -1
- DiffHour = 9
- DiffMinute = 35
- DiffSecond = 30
- Interval = 1000
- TextColor = 16777215
- LightColor = 16777215
- ShadowColor = 8421504
- FillColor = 12632256
- BorderColor = -2147483642
- HourTop = 195
- HourLeft = 150
- HourWidth = 451
- HourHeight = 571
- MinuteTop = 195
- MinuteLeft = 705
- MinuteWidth = 451
- MinuteHeight = 571
- SecondTop = 195
- SecondLeft = 1245
- SecondWidth = 571
- SecondHeight = 541
- MousePointer = 87
- MouseIcon = "MhClock.frx":30EA
- End
- End
- Begin MSComDlg.CommonDialog FontDlg
- Left = 4920
- Top = 3480
- _version = 65536
- _extentx = 677
- _extenty = 677
- _stockprops = 0
- flags = 103
- End
- Attribute VB_Name = "MhClock"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Dim Alarm1, Flash1 As Boolean 'Used for Analog Clock
- Dim Alarm2, Flash2 As Boolean 'Used for Digital Clock
- Private Sub aStyle1_Click()
- 'Set Style of Analog Clock to 12 Hour no Second
- 'Hand and force Seperate Seconds to FALSE
- MhClock1.Style = 4
- SepSeconds.Value = False
- End Sub
- Private Sub aStyle2_Click()
- 'Set Style of Analog Clock to 12 Hour with Seconds
- 'Hand and check to see if the Seperate Seconds box
- 'is check and set Clock face if it is.
- MhClock1.Style = 5
- If SepSeconds.Value Then
- Combo1.ListIndex = 2
- MhClock1.SecondTop = 65
- MhClock1.SecondBottom = 39
- MhClock1.SecondLeft = 29
- MhClock1.SecondRight = 77
- MhClock1.PictureAClock = LoadPicture(App.Path & "\sClock12.bmp")
- MhClock1.TextColor = &HFFFF00
- End If
- End Sub
- Private Sub aStyle3_Click()
- 'Set Style of Analog Clock to 24 Hour no Seconds
- 'Hand and force Seperate Seconds to FALSE
- MhClock1.Style = 6
- MhClock1.PictureAClock = LoadPicture("")
- SepSeconds.Value = False
- Combo1.ListIndex = 0
- End Sub
- Private Sub aStyle4_Click()
- 'Set Style of Analog Clock to 24 Hour with Seconds
- 'Hand and force Seperate Seconds to FALSE
- MhClock1.Style = 7
- MhClock1.PictureAClock = LoadPicture("")
- SepSeconds.Value = False
- Combo1.ListIndex = 0
- End Sub
- Private Sub Check1_Click()
- Dim cNow
- 'Toggle .Enabled property of Alarm controls
- MhTimeInput1.Enabled = Not MhTimeInput1.Enabled
- AMOption1.Enabled = Not AMOption1.Enabled
- PMOption1.Enabled = Not PMOption1.Enabled
- Alarm1 = Not Alarm1
- 'If Alarm is Checked
- If Alarm1 Then
- 'Default Alarm time to 10 seconds from now
- cNow = Format(Now, "hh:mm:ss AMPM")
-
- If Int(Mid(cNow, 7, 2)) >= 50 Then
- MhTimeInput1.Text = Left(cNow, 3) + IIf(Len(Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) = 1, "0" + Trim(Str(Int(Mid(cNow, 4, 2) + 1))), Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) + ":10"
- Else
- MhTimeInput1.Text = Left(cNow, 6) + Trim(Str(Int(Mid(cNow, 7, 2) + 10)))
- End If
-
- If Right(cNow, 2) = "PM" Then
- PMOption1.Value = True
- Else
- AMOption1.Value = True
- End If
-
- 'Check to see if it's 'AM' or 'PM'
- If PMOption1.Value Then
- MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2)) + 12
- Else
- MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2))
- End If
- MhClock1.AlarmMinute = Int(Mid(MhTimeInput1.Text, 4, 2))
- MhClock1.AlarmSecond = Int(Mid(MhTimeInput1.Text, 7, 2))
- Else
- 'Turn off and disable Alarm
- Flash1 = False
- Picture2.BackColor = &H8000000F
- MhClock1.AlarmHour = -1
- MhClock1.AlarmMinute = -1
- MhClock1.AlarmSecond = -1
- End If
- End Sub
- Private Sub Check2_Click()
- Dim cNow
- 'Toggle .Enabled property of Alarm controls
- MhTimeInput2.Enabled = Not MhTimeInput2.Enabled
- AMOption2.Enabled = Not AMOption2.Enabled
- PMOption2.Enabled = Not PMOption2.Enabled
- Alarm2 = Not Alarm2
- 'If Alarm is Checked
- If Alarm2 Then
- 'Default Alarm time to 10 seconds from now
- cNow = Format(Now, "hh:mm:ss AMPM")
-
- If Int(Mid(cNow, 7, 2)) >= 50 Then
- MhTimeInput2.Text = Left(cNow, 3) + IIf(Len(Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) = 1, "0" + Trim(Str(Int(Mid(cNow, 4, 2) + 1))), Trim(Str(Int(Mid(cNow, 4, 2) + 1)))) + ":10"
- Else
- MhTimeInput2.Text = Left(cNow, 6) + Trim(Str(Int(Mid(cNow, 7, 2) + 10)))
- End If
-
- If Right(cNow, 2) = "PM" Then
- PMOption2.Value = True
- Else
- AMOption2.Value = True
- End If
-
- 'Check to see if it's 'AM' or 'PM'
- If PMOption2.Value Then
- MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2)) + 12
- Else
- MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2))
- End If
- MhClock2.AlarmMinute = Int(Mid(MhTimeInput2.Text, 4, 2))
- MhClock2.AlarmSecond = Int(Mid(MhTimeInput2.Text, 7, 2))
- Else
- 'Turn off and disable Alarm
- Flash2 = False
- Picture1.BackColor = &H8000000F
- MhClock2.AlarmHour = -1
- MhClock2.AlarmMinute = -1
- MhClock2.AlarmSecond = -1
- End If
- End Sub
- Private Sub Combo1_Click()
- 'Set MhClock1.Picture property correctl and set
- 'Second Hand Height, Width, Position correctly.
- Select Case Combo1.ListIndex
-
- Case Is = 0
- SepSeconds.Value = False
- MhClock1.SecondTop = 0
- MhClock1.SecondBottom = 0
- MhClock1.SecondLeft = 0
- MhClock1.SecondRight = 0
- MhClock1.PictureAClock = LoadPicture("")
- MhClock1.TextColor = &H0
-
- Case Is = 1
- SepSeconds.Value = False
- MhClock1.SecondTop = 0
- MhClock1.SecondBottom = 0
- MhClock1.SecondLeft = 0
- MhClock1.SecondRight = 0
- MhClock1.PictureAClock = LoadPicture(App.Path & "\aClock12.bmp")
- MhClock1.TextColor = &HFFFF00
-
- Case Is = 2
- If Not SepSeconds.Value Then SepSeconds.Value = 1
- MhClock1.SecondTop = 65
- MhClock1.SecondBottom = 39
- MhClock1.SecondLeft = 29
- MhClock1.SecondRight = 77
- MhClock1.PictureAClock = LoadPicture(App.Path & "\sClock12.bmp")
- MhClock1.TextColor = &HFFFF00
-
- End Select
- End Sub
- Private Sub Combo2_Click()
-
- 'Set the .FontStyle for clock
- MhClock1.FontStyle = Combo2.ListIndex
-
- End Sub
- Private Sub Combo3_Click()
- 'What picture do I want to see?
- Select Case Combo3.ListIndex
-
- Case Is = 0
- Picture1.Visible = False
- MhClock2.PictureDClock = LoadPicture("")
- MhClock2.TextColor = &H0
-
- Case Is = 1
- MhClock2.PictureDClock = LoadPicture(App.Path & "\digital.bmp")
- Picture1.Visible = True
- MhClock2.TextColor = &HFFFFFF
-
- End Select
- End Sub
- Private Sub Combo4_Click()
- 'Set the .FontStyle for the clock
- MhClock2.FontStyle = Combo4.ListIndex
- End Sub
- Private Sub Command1_Click()
- 'Bring up the standard Windows Font Dialog
- FontDlg.FontName = MhClock2.FontName
- FontDlg.FontSize = MhClock2.FontSize
- FontDlg.ShowFont
- MhClock2.FontName = FontDlg.FontName
- MhClock2.FontUnderline = FontDlg.FontUnderline
- MhClock2.FontStrikethru = FontDlg.FontStrikethru
- MhClock2.FontBold = FontDlg.FontBold
- MhClock2.FontItalic = FontDlg.FontItalic
- MhClock2.FontSize = FontDlg.FontSize
- End Sub
- Private Sub Command2_Click()
- 'See 'ya
- End
- End Sub
- Private Sub Form_Load()
- 'Set all default values for the two clocks
- ChDir App.Path
- Combo1.AddItem "None"
- Combo1.AddItem "12 Hour Clock Face"
- Combo1.AddItem "12 Hour Clock sep. Secs."
- Combo1.ListIndex = 0
- Combo2.AddItem "Normal"
- Combo2.AddItem "Raised"
- Combo2.AddItem "Raised more Shading"
- Combo2.AddItem "Lowered"
- Combo2.AddItem "Lowered more Shading"
- Combo2.ListIndex = 0
-
- Combo3.AddItem "None"
- Combo3.AddItem "Clock Radio"
- Combo3.ListIndex = 1
- Combo4.AddItem "Normal"
- Combo4.AddItem "Raised"
- Combo4.AddItem "Raised more Shading"
- Combo4.AddItem "Lowered"
- Combo4.AddItem "Lowered more Shading"
- Combo4.ListIndex = 0
- MhClock1.Hour = -1
- MhClock1.Minute = -1
- MhClock1.Second = -1
- MhClock2.Hour = -1
- MhClock2.Minute = -1
- MhClock2.Second = -1
- AMOption1.Value = True
- AMOption2.Value = True
- aStyle2.Value = True
- MhClock1.Style = 5
- MhClock2.Style = 1
- Picture1.ZOrder (0)
- End Sub
- Private Sub MhClock1_Alarm()
- 'Alarming, isn't it?
- Flash1 = True
- End Sub
- Private Sub MhClock1_ChangeSecond()
- 'Let'em see something if Alarm is going off
- DoEvents
- If Flash1 And Picture2.BackColor <> &HFF& Then
- Picture2.BackColor = &HFF&
- ElseIf Flash1 And Picture2.BackColor = &HFF& Then
- Picture2.BackColor = &H8000000F
- End If
- End Sub
- Private Sub MhClock2_Alarm()
- 'Alarming, isn't it
- Flash2 = True
- End Sub
- Private Sub MhClock2_ChangeSecond()
- 'Let'em see something again
- DoEvents
- If Flash2 And Picture1.BackColor <> &HFF& Then
- Picture1.BackColor = &HFF&
- ElseIf Flash2 And Picture1.BackColor = &HFF& Then
- Picture1.BackColor = &H8000000F
- End If
- End Sub
- Private Sub MhTimeInput1_Change()
-
- 'Set Alarm as the time value changes
- If PMOption1Value Then
- MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2)) + 12
- Else
- MhClock1.AlarmHour = Int(Left(MhTimeInput1.Text, 2))
- End If
- MhClock1.AlarmMinute = Int(Mid(MhTimeInput1.Text, 4, 2))
- MhClock1.AlarmSecond = Int(Mid(MhTimeInput1.Text, 7, 2))
- End Sub
- Private Sub MhTimeInput2_Change()
- 'Set Alarm as the time value changes
- If PMOption2.Value Then
- MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2)) + 12
- Else
- MhClock2.AlarmHour = Int(Left(MhTimeInput2.Text, 2))
- End If
- MhClock2.AlarmMinute = Int(Mid(MhTimeInput2.Text, 4, 2))
- MhClock2.AlarmSecond = Int(Mid(MhTimeInput2.Text, 7, 2))
- End Sub
- Private Sub Picture1_Click()
- 'Turn off Alarm
- MhClock2.AlarmHour = -1
- MhClock2.AlarmMinute = -1
- MhClock2.AlarmSecond = -1
- Picture1.BackColor = &H8000000F
- Flash2 = False
-
- End Sub
- Private Sub Picture2_Click()
- 'Turn off Alarm
- MhClock1.AlarmHour = -1
- MhClock1.AlarmMinute = -1
- MhClock1.AlarmSecond = -1
- Picture2.BackColor = &H8000000F
- Flash1 = False
- End Sub
- Private Sub SepSeconds_Click()
- 'Do you want to have a seperate second dial?
- If SepSeconds.Value Then
- aStyle2.Value = True
- Combo1.ListIndex = 2
- Else
- aStyle1.Value = True
- Combo1.ListIndex = 1
- End If
- End Sub
-