-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSystemClock.cls
More file actions
77 lines (58 loc) · 1.75 KB
/
SystemClock.cls
File metadata and controls
77 lines (58 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "SystemClock"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'--------------------------------------------------------------------------------
' Component : SystemClock
' Project : ViDock
'
' Description: [type_description_here]
'
'--------------------------------------------------------------------------------
Option Explicit
Private m_dateTime As String
Private m_Point As gdiplus.POINTF
Private m_width As Long
Private m_graphics As GDIPGraphics
Public Event onPopup(ByVal szText As String)
Public Event onMouseLeaves()
Public Sub Draw()
m_graphics.DrawString m_dateTime, AppDefaultFont, GetBlackBrush, m_Point
End Sub
Public Sub MouseLeft()
RaiseEvent onMouseLeaves
End Sub
Public Sub MouseDown(Button As Integer, X As Single, Y As Single)
End Sub
Public Sub MouseMove(Button As Integer, X As Single, Y As Single)
RaiseEvent onPopup(Format(Now, "dddd, mmmm, dd - hh:mm:ss AM/PM"))
End Sub
Public Sub Update()
m_dateTime = Format(Now(), "dddd hh:mm AM/PM")
End Sub
Public Sub Initialize(ByRef theGraphics As GDIPGraphics)
Set m_graphics = theGraphics
Update
m_width = m_graphics.MeasureString(m_dateTime, AppDefaultFont).Width
End Sub
Public Property Get Width() As Long
Width = m_width
End Property
Public Property Let X(newX As Single)
m_Point.X = newX
End Property
Public Property Get X() As Single
X = m_Point.X
End Property
Public Property Let Y(newY As Single)
m_Point.Y = newY
End Property