home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmChangeTime
- BorderStyle = 3 'Fixed Dialog
- Caption = "System Time"
- ClientHeight = 2970
- ClientLeft = 2295
- ClientTop = 3270
- ClientWidth = 4350
- Height = 3390
- Icon = "time.frx":0000
- Left = 2235
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2970
- ScaleWidth = 4350
- ShowInTaskbar = 0 'False
- Top = 2910
- Width = 4470
- Begin VB.CommandButton cmdOkCancelApply
- Caption = "&Apply"
- Enabled = 0 'False
- Height = 372
- Index = 2
- Left = 2988
- TabIndex = 3
- Top = 2484
- Width = 1212
- End
- Begin VB.CommandButton cmdOkCancelApply
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 372
- Index = 1
- Left = 1692
- TabIndex = 2
- Top = 2484
- Width = 1212
- End
- Begin VB.CommandButton cmdOkCancelApply
- Caption = "OK"
- Default = -1 'True
- Height = 372
- Index = 0
- Left = 396
- TabIndex = 1
- Top = 2484
- Width = 1212
- End
- Begin VB.Timer tmrTimeUpdater
- Interval = 1000
- Left = 36
- Top = 2484
- End
- Begin Threed.SSPanel SSPanel1
- Height = 2250
- Left = 105
- TabIndex = 4
- Top = 150
- Width = 4110
- _Version = 65536
- _ExtentX = 7260
- _ExtentY = 3958
- _StockProps = 15
- BevelWidth = 2
- Begin VB.ComboBox cboTimeZoneOffset
- Height = 288
- ItemData = "time.frx":0442
- Left = 1512
- List = "time.frx":0444
- Style = 2 'Dropdown List
- TabIndex = 8
- Top = 324
- Width = 1092
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- Caption = "Hours Different From Intl. Date Line"
- Height = 228
- Left = 72
- TabIndex = 7
- Top = 72
- Width = 3972
- End
- Begin VB.Label Label1
- Alignment = 2 'Center
- Caption = "&Local Time"
- Height = 228
- Left = 72
- TabIndex = 6
- Top = 1620
- Width = 3972
- End
- Begin MhintimeLib.MhTimeInput MhTimeInputCurrentTime
- Height = 948
- Left = 288
- TabIndex = 5
- TabStop = 0 'False
- Top = 684
- Width = 3576
- _Version = 65536
- _ExtentX = 6308
- _ExtentY = 1672
- _StockProps = 77
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 24
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- TintColor = 16711935
- Alignment = 2
- BevelSize = 0
- BevelStyle = 1
- BorderColor = -2147483642
- BorderStyle = 0
- FillColor = -2147483633
- LightColor = -2147483643
- ShadowColor = -2147483632
- TextColor = -2147483640
- Text = "19:42:02"
- ReadOnly = -1 'True
- Spin = 0
- SpinDelay = 500
- SpinSpeed = 500
- Indent = 0
- AutoHScroll = 0 'False
- FontStyle = 3
- Verbose = 0 'False
- CaretHeight = 0
- CaretWidth = 0
- CaretColor = -2147483640
- CaretStyle = 0
- CaretVAlign = 0
- CaretInterval = 500
- CaretVisible = -1 'True
- Separator = 58
- TimeFormat = 2
- Country = 0
- VAlignment = 2
- MaxHours = 23
- MaxMinutes = 59
- MaxSeconds = 59
- MinHours = 0
- MinMinutes = 0
- MinSeconds = 0
- SpinChange = 1
- AllowBlank = 0 'False
- FocusSelect = 0 'False
- AM = 0 'False
- End
- Begin MhintimeLib.MhTimeInput MhTimeInputNewTime
- Height = 300
- Left = 1512
- TabIndex = 0
- Top = 1836
- Width = 1092
- _Version = 65536
- _ExtentX = 1926
- _ExtentY = 529
- _StockProps = 77
- BackColor = 16777215
- TintColor = 16711935
- Alignment = 2
- BevelSize = 2
- BevelStyle = 0
- BorderColor = -2147483642
- BorderStyle = 0
- FillColor = 16777215
- LightColor = -2147483643
- ShadowColor = -2147483632
- TextColor = -2147483640
- Text = "19:45:06"
- ReadOnly = 0 'False
- Spin = 2
- SpinDelay = 500
- SpinSpeed = 500
- Indent = 0
- AutoHScroll = 0 'False
- FontStyle = 0
- Verbose = 0 'False
- CaretHeight = 0
- CaretWidth = 0
- CaretColor = -2147483640
- CaretStyle = 1
- CaretVAlign = 1
- CaretInterval = 500
- CaretVisible = -1 'True
- Separator = 58
- TimeFormat = 2
- Country = 0
- VAlignment = 2
- MaxHours = 23
- MaxMinutes = 59
- MaxSeconds = 59
- MinHours = 0
- MinMinutes = 0
- MinSeconds = 0
- SpinChange = 1
- AllowBlank = 0 'False
- FocusSelect = 0 'False
- AM = 0 'False
- End
- End
- Attribute VB_Name = "frmChangeTime"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private TimeZoneOffset As Integer
- Private m_oParent As Object
- Private ApplyTimeChanges As Boolean, ApplyTimeZoneChanges As Boolean
- Private Sub cboTimeZoneOffset_Click()
- ' indicate that the user has made changes
- If Not ApplyTimeZoneChanges Then
- ApplyTimeZoneChanges = True
- ' enable the apply button
- cmdOkCancelApply(2).Enabled = True
- End If
- End Sub
- Private Sub cmdOkCancelApply_Click(Index As Integer)
- ' if the user hit ok or apply and there are changes to be applied then apply the changes
- If (Index = 0 Or Index = 2) And (ApplyTimeChanges Or ApplyTimeZoneChanges) Then
- ' set the new system time
- If ApplyTimeChanges Then
- Time = MhTimeInputNewTime
- ApplyTimeChanges = False
- End If
- ' set the time zone offset
- If ApplyTimeZoneChanges Then
- m_oParent.TimeDisplayManager.GreenwichMeanTimeOffset = Int(cboTimeZoneOffset.Text)
- ApplyTimeZoneChanges = False
- End If
- ' disable apply button since changes have been made
- cmdOkCancelApply(2).Enabled = False
- End If
- ' if the user hit ok or cancel then unload the form
- If Index < 2 Then Unload Me
- End Sub
- Private Sub Form_Load()
- Dim iCount As Integer
- ' center the form to top left screen
- Move 0, 0
- ' setup cboTimeZoneOffset
- With cboTimeZoneOffset
- For iCount = -12 To 12
- .AddItem iCount ' VB4 allows this without a type coercion!
- Next iCount
- ' set to current offset
- .ListIndex = m_oParent.TimeDisplayManager.GreenwichMeanTimeOffset + 12
- End With ' cboTimeZoneOffset
- ' update the controls to show current time
- MhTimeInputCurrentTime.Text = Format$(Time, "h:nn:ss")
- MhTimeInputNewTime.Text = Format$(Time, "h:nn:ss")
- ' disable the apply button. Needed since setting the .ListIndex of the combo
- ' fires the click event
- cmdOkCancelApply(2).Enabled = False
- ApplyTimeZoneChanges = False
- End Sub
- Private Sub MhTimeInputNewTime_Change()
- ' indicate that the user has made changes
- If Not ApplyTimeChanges Then
- ApplyTimeChanges = True
- ' enable the apply button
- cmdOkCancelApply(2).Enabled = True
- End If
- End Sub
- Private Sub tmrTimeUpdater_Timer()
- MhTimeInputCurrentTime.Text = Format$(Time, "h:nn:ss")
- End Sub
- Public Property Let ParentObject(oNewParent As Object)
- Set m_oParent = oNewParent
- End Property
-