home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhtinp / ctdmngr.cls < prev    next >
Encoding:
Text File  |  1995-11-30  |  1.5 KB  |  62 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "CTimeDisplayManager"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. ' This class manages the CTimeZoneControl objects
  9. Option Explicit
  10. Private m_GMT_Offset As Integer ' indicates Greenwich Mean Time
  11. Private m_colTimeZones As Collection
  12. Private Sub Class_Initialize()
  13.  
  14.  
  15.     ' intialize private data
  16.     Set m_colTimeZones = New Collection
  17.     
  18.     
  19. End Sub
  20. Public Sub Add(oYourTimeZoneControl As CTimeZoneControl)
  21.  
  22.  
  23.     ' add this object to the collection
  24.     m_colTimeZones.Add oYourTimeZoneControl
  25.     
  26.     
  27. End Sub
  28. ' This procedure updates the display of all of the CTimeZoneControl controls with their
  29. '   respective times
  30. Public Sub UpdateTimeZoneControls()
  31.  
  32.     
  33.     Dim oTempTimeZoneControl As CTimeZoneControl
  34.     
  35.     ' set the relative time of each CTimeZoneControl
  36.     For Each oTempTimeZoneControl In m_colTimeZones
  37.         With oTempTimeZoneControl
  38.             .InputControl.Text = Format$(DateAdd("h", .TimeZoneOffset - m_GMT_Offset, Time), "h:nn:ss")
  39.         End With ' oTempTimeZoneControl
  40.     Next oTempTimeZoneControl
  41.     
  42.  
  43. End Sub
  44. Public Property Let GreenwichMeanTimeOffset(iNew_GMT As Integer)
  45.  
  46.  
  47.     ' set GMT offset
  48.     m_GMT_Offset = iNew_GMT
  49.     ' update controls
  50.     Call UpdateTimeZoneControls
  51.     
  52.     
  53. End Property
  54. Public Property Get GreenwichMeanTimeOffset() As Integer
  55.  
  56.  
  57.     ' return GMT offset
  58.     GreenwichMeanTimeOffset = m_GMT_Offset
  59.     
  60.     
  61. End Property
  62.