-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGTASADirection.ctl
More file actions
305 lines (281 loc) · 10.3 KB
/
GTASADirection.ctl
File metadata and controls
305 lines (281 loc) · 10.3 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
VERSION 5.00
Begin VB.UserControl GTASADirection
ClientHeight = 1830
ClientLeft = 0
ClientTop = 0
ClientWidth = 1830
LockControls = -1 'True
ScaleHeight = 1830
ScaleWidth = 1830
Begin VB.VScrollBar scrKickStart
Height = 1560
Left = 1575
Max = 0
Min = -2000
TabIndex = 11
TabStop = 0 'False
Top = 225
Visible = 0 'False
Width = 225
End
Begin VB.PictureBox picFlipContainer
Appearance = 0 'Flat
BackColor = &H80000004&
ForeColor = &H80000008&
Height = 1560
Left = 15
ScaleHeight = 1530
ScaleWidth = 1530
TabIndex = 0
TabStop = 0 'False
Top = 225
Width = 1560
Begin VB.CommandButton cmdDirection
Caption = "Set Direction"
Height = 555
Left = 255
TabIndex = 9
TabStop = 0 'False
Top = 465
Width = 990
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 1
Left = 1095
TabIndex = 8
TabStop = 0 'False
ToolTipText = "Nort-East"
Top = 210
Width = 195
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 2
Left = 1305
TabIndex = 7
TabStop = 0 'False
ToolTipText = "East"
Top = 675
Width = 195
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 3
Left = 1125
TabIndex = 6
TabStop = 0 'False
ToolTipText = "South-East"
Top = 1110
Width = 195
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 5
Left = 180
TabIndex = 5
TabStop = 0 'False
ToolTipText = "South-West"
Top = 1095
Width = 195
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 6
Left = 0
TabIndex = 4
TabStop = 0 'False
ToolTipText = "West"
Top = 645
Width = 195
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 7
Left = 225
TabIndex = 3
TabStop = 0 'False
ToolTipText = "North-West"
Top = 195
Width = 195
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 0
Left = 675
TabIndex = 2
TabStop = 0 'False
ToolTipText = "North"
Top = -15
Value = -1 'True
Width = 195
End
Begin VB.OptionButton optFlipDirection
Height = 195
Index = 4
Left = 645
TabIndex = 1
TabStop = 0 'False
ToolTipText = "South"
Top = 1305
Width = 195
End
Begin VB.Shape shpBorder
Height = 1515
Left = 0
Shape = 3 'Circle
Top = 0
Width = 1515
End
End
Begin VB.Label lblCaption
AutoSize = -1 'True
Caption = "Car Direction:"
Height = 195
Left = 0
TabIndex = 10
Top = 0
Width = 1785
End
End
Attribute VB_Name = "GTASADirection"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Default Property Values:
Const m_def_Caption = "Car Direction:"
Const m_def_Direction = 0
Const m_def_HasScroller = False
'Property Variables:
Dim m_Caption As String
Dim m_Direction As Integer
Dim m_HasScroller As Boolean
'Event Declarations:
Event ButtonClick() 'MappingInfo=cmdDirection,cmdDirection,-1,Click
Attribute ButtonClick.VB_Description = "Occurs when the user presses and then releases a mouse button over an object."
Private Sub optFlipDirection_Click(Index As Integer)
On Error Resume Next
'0:North '1:North-East '2:East
'3:South-East '4:South '5:South-West
'6:West '7:North-West
m_Direction = Index
End Sub
Private Sub SetLabelCaption()
On Error Resume Next
If m_HasScroller Then
lblCaption.Caption = Replace(m_Caption, ":", "") & " (" & Abs(scrKickStart.Value / 10) & " %):"
Else
lblCaption.Caption = m_Caption
End If
End Sub
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MemberInfo=7,0,0,0
Public Property Get Direction() As Integer
Direction = m_Direction
End Property
Public Property Let Direction(ByVal New_Direction As Integer)
m_Direction = New_Direction
optFlipDirection(New_Direction).Value = True
PropertyChanged "Direction"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=cmdDirection,cmdDirection,-1,Caption
Public Property Get ButtonCaption() As String
Attribute ButtonCaption.VB_Description = "Returns/sets the text displayed in an object's title bar or below an object's icon."
ButtonCaption = cmdDirection.Caption
End Property
Public Property Let ButtonCaption(ByVal New_ButtonCaption As String)
cmdDirection.Caption = New_ButtonCaption
PropertyChanged "ButtonCaption"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MemberInfo=0,0,0,0
Public Property Get HasScroller() As Boolean
HasScroller = m_HasScroller
End Property
Public Property Let HasScroller(ByVal New_HasScroller As Boolean)
m_HasScroller = New_HasScroller
scrKickStart.Visible = New_HasScroller
SetLabelCaption
PropertyChanged "HasScroller"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=scrKickStart,scrKickStart,-1,Max
Public Property Get ScrollerMax() As Integer
Attribute ScrollerMax.VB_Description = "Returns/sets a scroll bar position's maximum Value property setting."
ScrollerMax = scrKickStart.max
End Property
Public Property Let ScrollerMax(ByVal New_ScrollerMax As Integer)
scrKickStart.max = New_ScrollerMax
SetLabelCaption
PropertyChanged "ScrollerMax"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=scrKickStart,scrKickStart,-1,Min
Public Property Get ScrollerMin() As Integer
Attribute ScrollerMin.VB_Description = "Returns/sets a scroll bar position's maximum Value property setting."
ScrollerMin = scrKickStart.min
End Property
Public Property Let ScrollerMin(ByVal New_ScrollerMin As Integer)
scrKickStart.min = New_ScrollerMin
SetLabelCaption
PropertyChanged "ScrollerMin"
End Property
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=scrKickStart,scrKickStart,-1,Value
Public Property Get ScrollerVal() As Integer
Attribute ScrollerVal.VB_Description = "Returns/sets the value of an object."
ScrollerVal = scrKickStart.Value
End Property
Public Property Let ScrollerVal(ByVal New_ScrollerVal As Integer)
scrKickStart.Value = New_ScrollerVal
SetLabelCaption
PropertyChanged "ScrollerVal"
End Property
Private Sub cmdDirection_Click()
RaiseEvent ButtonClick
End Sub
Private Sub scrKickStart_Change()
SetLabelCaption
End Sub
'Initialize Properties for User Control
Private Sub UserControl_InitProperties()
m_Direction = m_def_Direction
m_HasScroller = m_def_HasScroller
m_Caption = m_def_Caption
End Sub
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_Direction = PropBag.ReadProperty("Direction", m_def_Direction)
cmdDirection.Caption = PropBag.ReadProperty("ButtonCaption", "Set Direction")
m_HasScroller = PropBag.ReadProperty("HasScroller", m_def_HasScroller)
scrKickStart.max = PropBag.ReadProperty("ScrollerMax", 0)
scrKickStart.min = PropBag.ReadProperty("ScrollerMin", -2000)
scrKickStart.Value = PropBag.ReadProperty("ScrollerVal", 0)
m_Caption = PropBag.ReadProperty("Caption", m_def_Caption)
scrKickStart.Visible = m_HasScroller
SetLabelCaption
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Direction", m_Direction, m_def_Direction)
Call PropBag.WriteProperty("ButtonCaption", cmdDirection.Caption, "Set Direction")
Call PropBag.WriteProperty("HasScroller", m_HasScroller, m_def_HasScroller)
Call PropBag.WriteProperty("ScrollerMax", scrKickStart.max, 0)
Call PropBag.WriteProperty("ScrollerMin", scrKickStart.min, -2000)
Call PropBag.WriteProperty("ScrollerVal", scrKickStart.Value, 0)
Call PropBag.WriteProperty("Caption", m_Caption, m_def_Caption)
End Sub
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MemberInfo=13,0,0,Car Direction:
Public Property Get Caption() As String
Attribute Caption.VB_Description = "Returns/sets the text displayed in an object's title bar or below an object's icon."
Caption = m_Caption
End Property
Public Property Let Caption(ByVal New_Caption As String)
m_Caption = New_Caption
SetLabelCaption
PropertyChanged "Caption"
End Property