forked from Marshallx/Launch-Base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmModCatFails.frm
120 lines (115 loc) · 4.93 KB
/
frmModCatFails.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
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmModCatFails
Caption = "Launch Base: Failed Update Checks"
ClientHeight = 3855
ClientLeft = 60
ClientTop = 450
ClientWidth = 5385
Icon = "frmModCatFails.frx":0000
LinkTopic = "Form1"
ScaleHeight = 3855
ScaleWidth = 5385
StartUpPosition = 3 'Windows Default
Begin MSComctlLib.ListView lvModCatFails
Height = 3375
Left = 0
TabIndex = 0
Top = 0
Width = 4335
_ExtentX = 7646
_ExtentY = 5953
View = 3
LabelEdit = 1
Sorted = -1 'True
LabelWrap = -1 'True
HideSelection = -1 'True
FullRowSelect = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 0
End
End
Attribute VB_Name = "frmModCatFails"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Const LVM_FIRST = &H1000
Public Sub LoadFails() 'can't be run on form load else columns aren't added in time.
Dim itemTemp As ListItem
Dim iRecord As Integer
lvModCatFails.Sorted = False
For iRecord = 1 To UpdateRecordCount
If Len(UpdateRecords(iRecord).FailReason) <> 0 Then
Set itemTemp = lvModCatFails.ListItems.Add
If Len(UpdateRecords(iRecord).ModName) <> 0 Then
itemTemp.Text = UpdateRecords(iRecord).ModName
Else
itemTemp.Text = "<undetermined>"
End If
itemTemp.SubItems(1) = UpdateRecords(iRecord).ModUserVersion
Select Case UpdateRecords(iRecord).ModType
Case TypeMod: itemTemp.SubItems(2) = "Mod"
Case TypePlugin: itemTemp.SubItems(2) = "Plugin"
Case TypeFA2Mod: itemTemp.SubItems(2) = "FA2 Mod"
Case TypeProgram: itemTemp.SubItems(2) = "Tool"
End Select
itemTemp.SubItems(3) = UpdateRecords(iRecord).FailReason
itemTemp.SubItems(4) = UpdateRecords(iRecord).CheckURL
Set itemTemp = Nothing
End If
Next iRecord
'resize the listview
lvModCatFails.Width = 0
iRecord = 1
Do While iRecord <= lvModCatFails.ColumnHeaders.Count
SendMessage lvModCatFails.hWnd, LVM_FIRST + 30, lvModCatFails.ColumnHeaders.Item(iRecord).Index - 1, -1
Select Case iRecord
Case 1: lvModCatFails.ColumnHeaders.Item(iRecord).Width = Max(lvModCatFails.ColumnHeaders.Item(iRecord).Width, 640) 'Name
Case 2: lvModCatFails.ColumnHeaders.Item(iRecord).Width = Max(lvModCatFails.ColumnHeaders.Item(iRecord).Width, 768) 'Version
Case 3: lvModCatFails.ColumnHeaders.Item(iRecord).Width = Max(lvModCatFails.ColumnHeaders.Item(iRecord).Width, 640) 'Type
Case 4: lvModCatFails.ColumnHeaders.Item(iRecord).Width = Max(lvModCatFails.ColumnHeaders.Item(iRecord).Width, 1152) 'Fail reason
Case 5: lvModCatFails.ColumnHeaders.Item(iRecord).Width = Max(lvModCatFails.ColumnHeaders.Item(iRecord).Width, 1152) 'Check URL
End Select
lvModCatFails.Width = lvModCatFails.Width + lvModCatFails.ColumnHeaders.Item(iRecord).Width + 30
iRecord = iRecord + 1
Loop
lvModCatFails.Sorted = True
lvModCatFails.Width = lvModCatFails.Width + 45
frmModCatFails.Width = lvModCatFails.Width
Call lvModCatFails.SetFocus
'center form on screen, as it will probably have been resized
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub
Private Sub Form_Load()
Call lvModCatFails.ColumnHeaders.Add(, , "Name")
Call lvModCatFails.ColumnHeaders.Add(, , "Version")
Call lvModCatFails.ColumnHeaders.Add(, , "Type")
Call lvModCatFails.ColumnHeaders.Add(, , "Failure Reason")
Call lvModCatFails.ColumnHeaders.Add(, , "Update Check URL")
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
frmModCat.Enabled = True
End Sub
Private Sub Form_Resize()
Dim iTemp As Long
iTemp = frmModCatFails.ScaleHeight
lvModCatFails.Width = frmModCatFails.ScaleWidth
If iTemp > 0 Then lvModCatFails.Height = iTemp
End Sub
Private Sub lvModCatFails_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
If lvModCatFails.SortKey = (ColumnHeader.Index - 1) Then
If lvModCatFails.SortOrder = lvwAscending Then
lvModCatFails.SortOrder = lvwDescending
Else
lvModCatFails.SortOrder = lvwAscending
End If
Else
lvModCatFails.SortKey = ColumnHeader.Index - 1
End If
End Sub