-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfrmUserInfo.frm
645 lines (612 loc) · 20.1 KB
/
frmUserInfo.frm
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Begin VB.Form frmUserInfo
AutoRedraw = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "用户信息"
ClientHeight = 3660
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 5010
Icon = "frmUserInfo.frx":0000
LockControls = -1 'True
MaxButton = 0 'False
NegotiateMenus = 0 'False
ScaleHeight = 3660
ScaleWidth = 5010
Begin VB.Frame Frame1
BorderStyle = 0 'None
Height = 1275
Left = 240
TabIndex = 38
Top = 495
Width = 795
Begin VB.Image imgIcon
Height = 480
Left = 120
Picture = "frmUserInfo.frx":0E42
Top = 405
Width = 480
End
End
Begin InetCtlsObjects.Inet ietView
Left = 4935
Top = 2415
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
URL = "http://"
RequestTimeout = 30
End
Begin Othello.FlatButton fltbtnClose
Cancel = -1 'True
Height = 375
Left = 240
TabIndex = 15
Top = 2925
Width = 780
_ExtentX = 1376
_ExtentY = 661
Caption = "关闭"
MousePointer = 99
Style = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
EnableHot = -1 'True
ForeColor = 0
End
Begin Othello.FlatButton fltbtnReload
Height = 375
Left = 240
TabIndex = 14
Top = 2460
Width = 780
_ExtentX = 1376
_ExtentY = 661
Caption = "刷新"
MousePointer = 99
Style = 2
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
EnableHot = -1 'True
ForeColor = 0
End
Begin VB.Frame fraTabs
BorderStyle = 0 'None
Height = 3045
Index = 1
Left = 975
TabIndex = 28
Top = 3540
Visible = 0 'False
Width = 3780
Begin VB.Frame fraInfo
Caption = "其它信息"
Height = 2850
Left = 0
TabIndex = 29
Top = 90
Width = 3600
Begin VB.TextBox txtAge
BackColor = &H8000000F&
BeginProperty DataFormat
Type = 0
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
Height = 315
Left = 1830
Locked = -1 'True
MaxLength = 3
TabIndex = 10
Top = 1665
Width = 735
End
Begin VB.TextBox txtName
BackColor = &H8000000F&
Height = 315
Left = 1605
Locked = -1 'True
MaxLength = 15
TabIndex = 8
Top = 585
Width = 1785
End
Begin VB.TextBox txtSex
BackColor = &H8000000F&
Height = 315
Left = 2655
Locked = -1 'True
TabIndex = 11
Top = 1665
Width = 735
End
Begin VB.TextBox txtCity
BackColor = &H8000000F&
Height = 315
Left = 1830
Locked = -1 'True
TabIndex = 13
Top = 2325
Width = 1560
End
Begin VB.TextBox txtState
BackColor = &H8000000F&
Height = 315
Left = 195
Locked = -1 'True
TabIndex = 12
Top = 2325
Width = 1530
End
Begin VB.TextBox txtCountry
BackColor = &H8000000F&
Height = 315
Left = 195
Locked = -1 'True
TabIndex = 9
Top = 1665
Width = 1545
End
Begin VB.PictureBox picFace
AutoRedraw = -1 'True
Height = 630
Left = 420
ScaleHeight = 570
ScaleWidth = 645
TabIndex = 30
TabStop = 0 'False
Top = 585
Width = 705
End
Begin VB.Label Label24
AutoSize = -1 'True
Caption = "年龄:"
Height = 180
Left = 1845
TabIndex = 37
Top = 1425
Width = 450
End
Begin VB.Label Label20
AutoSize = -1 'True
Caption = "性别:"
Height = 180
Left = 2670
TabIndex = 36
Top = 1425
Width = 450
End
Begin VB.Label Label19
AutoSize = -1 'True
Caption = "昵称:"
Height = 180
Left = 1680
TabIndex = 35
Top = 315
Width = 450
End
Begin VB.Label Label18
AutoSize = -1 'True
Caption = "头像:"
Height = 180
Left = 225
TabIndex = 34
Top = 285
Width = 450
End
Begin VB.Label Label21
AutoSize = -1 'True
Caption = "国家/地区:"
Height = 180
Left = 210
TabIndex = 33
Top = 1425
Width = 900
End
Begin VB.Label Label22
AutoSize = -1 'True
Caption = "省份:"
Height = 180
Left = 210
TabIndex = 32
Top = 2100
Width = 450
End
Begin VB.Label Label23
AutoSize = -1 'True
Caption = "城市:"
Height = 180
Left = 1845
TabIndex = 31
Top = 2100
Width = 450
End
Begin VB.Line Line1
BorderColor = &H80000010&
X1 = 1365
X2 = 3435
Y1 = 1155
Y2 = 1155
End
Begin VB.Line Line2
BorderColor = &H80000005&
X1 = 1365
X2 = 3435
Y1 = 1170
Y2 = 1170
End
End
End
Begin VB.Frame fraTabs
BorderStyle = 0 'None
Height = 3045
Index = 0
Left = 1080
TabIndex = 17
Top = 420
Visible = 0 'False
Width = 3780
Begin VB.Frame fraStatus
Caption = "比赛信息"
Height = 1440
Left = 0
TabIndex = 21
Top = 1500
Width = 3600
Begin VB.TextBox txtWin
BackColor = &H8000000F&
Height = 285
Left = 225
Locked = -1 'True
TabIndex = 2
Top = 570
Width = 765
End
Begin VB.TextBox txtLose
BackColor = &H8000000F&
Height = 285
Left = 1035
Locked = -1 'True
TabIndex = 3
Top = 570
Width = 765
End
Begin VB.TextBox txtDraw
BackColor = &H8000000F&
Height = 285
Left = 1845
Locked = -1 'True
TabIndex = 4
Top = 570
Width = 765
End
Begin VB.TextBox txtWinP
BackColor = &H8000000F&
Height = 285
Left = 2655
Locked = -1 'True
TabIndex = 5
Top = 570
Width = 765
End
Begin VB.TextBox txtScore
BackColor = &H8000000F&
Height = 285
Left = 1035
Locked = -1 'True
TabIndex = 6
Top = 975
Width = 765
End
Begin VB.TextBox txtDisconnectP
BackColor = &H8000000F&
Height = 285
Left = 2655
Locked = -1 'True
TabIndex = 7
Top = 975
Width = 765
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "获胜:"
Height = 180
Left = 240
TabIndex = 27
Top = 330
Width = 450
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "失败:"
Height = 180
Left = 1050
TabIndex = 26
Top = 330
Width = 450
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "平局:"
Height = 180
Left = 1860
TabIndex = 25
Top = 330
Width = 450
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "胜率:"
Height = 180
Left = 2670
TabIndex = 24
Top = 330
Width = 450
End
Begin VB.Label Label7
Caption = "总积分:"
Height = 180
Left = 285
TabIndex = 23
Top = 1020
Width = 645
End
Begin VB.Label Label8
Caption = "断线率:"
Height = 180
Left = 1935
TabIndex = 22
Top = 1020
Width = 645
End
End
Begin VB.Frame fraBaseInfo
Caption = "基本信息"
Height = 1320
Left = 0
TabIndex = 18
Top = 90
Width = 3600
Begin VB.TextBox txtUserName
BackColor = &H8000000F&
Height = 315
Left = 915
Locked = -1 'True
TabIndex = 0
Top = 330
Width = 2505
End
Begin VB.TextBox txtEmail
BackColor = &H8000000F&
Height = 315
Left = 915
Locked = -1 'True
TabIndex = 1
Top = 780
Width = 2505
End
Begin VB.Label Label1
Caption = "用户名:"
Height = 180
Left = 225
TabIndex = 20
Top = 390
Width = 630
End
Begin VB.Label Label2
Caption = "E-mail:"
Height = 180
Left = 225
TabIndex = 19
Top = 840
Width = 630
End
End
End
Begin MSComctlLib.TabStrip tabInfo
Height = 3420
Left = 135
TabIndex = 16
Top = 90
Width = 4770
_ExtentX = 8414
_ExtentY = 6033
MultiRow = -1 'True
HotTracking = -1 'True
_Version = 393216
BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628}
NumTabs = 2
BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "基本资料"
Key = "BaseInfo"
ImageVarType = 2
EndProperty
BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628}
Caption = "详细资料"
Key = "Info"
ImageVarType = 2
EndProperty
EndProperty
End
End
Attribute VB_Name = "frmUserInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim mstrUserName As String
Dim mblnServerOK As Boolean
Dim FormVisible As Boolean
Public Sub ShowEx(ByVal UserName As String, ByVal Name As String)
On Error Resume Next
mstrUserName = UserName
FormVisible = True
Call Show(vbModeless)
If Me.WindowState <> vbNormal Then
Me.WindowState = vbNormal
End If
'Me.Caption = LoadString(208) & GetDisplayName(UserName, Name)
Call Clear
Call Me.Refresh
Call ReloadInfo(UserName)
End Sub
Public Sub FormMinimize()
If Me.Visible Then
Call Me.Hide
End If
End Sub
Public Sub FormNormal()
If FormVisible Then
Call Me.Show(vbModeless)
End If
End Sub
Private Function ReloadInfo(ByVal UserName As String) As Boolean
Dim strUrl As String
Dim strStatus As String
Dim strData As String
On Error Resume Next
strUrl = gstrSave_ServerUrl & SERVER_ACTION_USER_VIEW & _
"?username=" & ToUrlString(gMyUserInfo.UserName) & _
"&name=" & ToUrlString(UserName) & _
"&" & MakeServerPassword() & _
"&" & MakeVersion()
If ServerCommand(ietView, mblnServerOK, strUrl, strStatus, strData) Then
If strStatus = STATUS_OK Then
Call SetInfo(strData)
ReloadInfo = True
Exit Function
End If
End If
ReloadInfo = False
End Function
Private Sub SetInfo(ByVal strData As String)
Dim TempUserInfo As tagUserInfo
Dim PlayTimes As Long
On Error Resume Next
Call LoadUserInfo(TempUserInfo, strData)
TempUserInfo.UserName = mstrUserName
PlayTimes = TempUserInfo.Win + TempUserInfo.Draw + TempUserInfo.Lose
Me.Caption = LoadString(208) & GetDisplayName(TempUserInfo.UserName, TempUserInfo.Name)
' 第一部分
txtUserName.Text = TempUserInfo.UserName
txtEmail.Text = TempUserInfo.Email
txtWin.Text = CStr(TempUserInfo.Win)
txtDraw.Text = CStr(TempUserInfo.Draw)
txtLose.Text = CStr(TempUserInfo.Lose)
txtScore.Text = CStr(TempUserInfo.Score)
If PlayTimes < 1 Then
txtWinP.Text = "0%"
Else
txtWinP.Text = Format(TempUserInfo.Win / PlayTimes, "0%")
End If
If gblnGameStart Then
If TempUserInfo.GameTimes < 2 Then
txtDisconnectP.Text = "0%"
Else
txtDisconnectP.Text = Format((TempUserInfo.GameTimes - 1 - PlayTimes) / (TempUserInfo.GameTimes - 1), "0%")
End If
Else
If TempUserInfo.GameTimes < 1 Then
txtDisconnectP.Text = "0%"
Else
txtDisconnectP.Text = Format((TempUserInfo.GameTimes - PlayTimes) / TempUserInfo.GameTimes, "0%")
End If
End If
' 第二部分
'Call picFace.PaintPicture(MainForm.GetFace(TempUserInfo.Face), GetTwipX(6), GetTwipY(3))
Call picFace.Cls
If TempUserInfo.Face > CLng(MainForm.ilsFace.Tag) Then
Call picFace.PaintPicture(frmResource.imgResDefaultFace.Picture, GetTwipX(5), GetTwipY(3))
Else
Call MainForm.ilsFace.ListImages(TempUserInfo.Face).Draw(picFace.hDC, GetTwipX(5), GetTwipY(3), imlTransparent)
End If
Call picFace.Refresh
txtName.Text = TempUserInfo.Name
If TempUserInfo.Sex = SEX_MAN Then
txtSex.Text = LoadString(209)
ElseIf TempUserInfo.Sex = SEX_WOMAN Then
txtSex.Text = LoadString(210)
Else
txtSex.Text = "-"
End If
If TempUserInfo.Age = 0 Then
txtAge.Text = "-"
Else
txtAge.Text = CStr(TempUserInfo.Age)
End If
txtCountry.Text = TempUserInfo.Country
txtState.Text = TempUserInfo.State
txtCity.Text = TempUserInfo.City
End Sub
Private Sub fltbtnClose_Click(Button As Integer)
FormVisible = False
Call Me.Hide
End Sub
Private Sub fltbtnReload_Click(Button As Integer)
Call ReloadInfo(mstrUserName)
End Sub
Private Sub Form_Load()
On Error Resume Next
Call Me.Move(gptsSave_ViewUserInfo.X, gptsSave_ViewUserInfo.Y)
Call fraTabs(0).Move(1080, tabInfo.ClientTop)
fraTabs(0).Visible = True
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
Cancel = True
FormVisible = False
Call Me.Hide
End If
End Sub
Private Sub ietView_StateChanged(ByVal State As Integer)
'Dim strMess As String '消息变量。
Select Case State
Case icResponseReceived
mblnServerOK = True
Case icError '11
mblnServerOK = False
'得到错误文本。
'strMess = "ErrorCode: " & ietRegister.ResponseCode & " : " & ietRegister.ResponseInfo
End Select
End Sub
Private Sub tabInfo_Click()
On Error Resume Next
fraTabs(0).Visible = False
fraTabs(1).Visible = False
Call fraTabs(tabInfo.SelectedItem.Index - 1).Move(1080, tabInfo.ClientTop)
fraTabs(tabInfo.SelectedItem.Index - 1).Visible = True
End Sub
Private Sub Clear()
Dim i As Long
Dim j As Object
On Error Resume Next
For i = 0 To Me.Controls.Count - 1
Set j = Me.Controls(i)
If TypeName(j) = "TextBox" Then
j.Text = ""
ElseIf TypeName(j) = "PictureBox" Then
Call j.Cls
End If
Next i
End Sub