-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrmChatClient.frm
316 lines (299 loc) · 10.9 KB
/
frmChatClient.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
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form frmChat
AutoRedraw = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "Forem 2000"
ClientHeight = 4785
ClientLeft = 150
ClientTop = 435
ClientWidth = 8055
FillColor = &H00FFFFFF&
BeginProperty Font
Name = "Small Fonts"
Size = 6.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
LinkTopic = "Form1"
ScaleHeight = 319
ScaleMode = 3 'Pixel
ScaleWidth = 537
StartUpPosition = 2 'CenterScreen
Begin VB.Frame fraUsers
Caption = "People: 0"
Height = 3495
Left = 6285
TabIndex = 8
Top = 0
Width = 1695
Begin MSComctlLib.TreeView trvUsers
Height = 3135
Left = 120
TabIndex = 3
ToolTipText = "this will show user info"
Top = 240
Width = 1515
_ExtentX = 2672
_ExtentY = 5530
_Version = 393217
LabelEdit = 1
Sorted = -1 'True
Style = 1
SingleSel = -1 'True
ImageList = "imlMenuIcons"
BorderStyle = 1
Appearance = 1
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Small Fonts"
Size = 6.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
End
Begin VB.Frame fraMessage
Caption = "Message:"
Height = 735
Left = 45
TabIndex = 7
Top = 3960
Width = 6255
Begin RichTextLib.RichTextBox rtbMessage
Height = 375
Left = 120
TabIndex = 0
Top = 240
Width = 6015
_ExtentX = 10610
_ExtentY = 661
_Version = 393217
BackColor = 16777215
MaxLength = 150
TextRTF = $"frmChatClient.frx":0000
End
End
Begin VB.Frame fraChat
Caption = "Chat"
Height = 3495
Left = 45
TabIndex = 6
Top = 0
Width = 6255
Begin RichTextLib.RichTextBox rtbChat
Height = 3090
Left = 120
TabIndex = 2
Top = 240
Width = 6015
_ExtentX = 10610
_ExtentY = 5450
_Version = 393217
BackColor = 16777215
ReadOnly = -1 'True
ScrollBars = 2
TextRTF = $"frmChatClient.frx":00D3
End
End
Begin MSComctlLib.ImageList imlFontOptions
Left = 3960
Top = 240
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 1
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmChatClient.frx":01A6
Key = "IMG1"
EndProperty
EndProperty
End
Begin VB.Frame fraChatOptions
Caption = "Chat Options"
Height = 1215
Left = 6285
TabIndex = 4
Top = 3480
Width = 1695
Begin MSComctlLib.ProgressBar prbProgress
Height = 180
Left = 120
TabIndex = 5
Top = 360
Width = 1515
_ExtentX = 2672
_ExtentY = 318
_Version = 393216
Appearance = 1
Scrolling = 1
End
End
Begin MSComctlLib.ImageList imlMenuIcons
Left = 4560
Top = 240
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 6
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmChatClient.frx":05FA
Key = ""
Object.Tag = "Send File"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmChatClient.frx":0756
Key = ""
Object.Tag = "Exit"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmChatClient.frx":2F0A
Key = ""
Object.Tag = "Network"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmChatClient.frx":56BE
Key = ""
Object.Tag = "Kick User"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmChatClient.frx":7E72
Key = ""
Object.Tag = "Get File"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "frmChatClient.frx":A626
Key = "Send File"
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Height = 360
Left = 165
TabIndex = 1
Top = 3600
Width = 6015
_ExtentX = 10610
_ExtentY = 635
ButtonWidth = 609
ButtonHeight = 582
Appearance = 1
Style = 1
ImageList = "imlFontOptions"
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 3
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
ImageIndex = 1
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Send File"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Object.ToolTipText = "Get File"
EndProperty
EndProperty
BorderStyle = 1
End
End
Attribute VB_Name = "frmChat"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
rtbMessage.SelBold = False
rtbMessage.SelUnderline = False
rtbMessage.SelItalic = False
rtbMessage.SelColor = vbBlack
rtbMessage.SelFontName = "Verdana"
rtbMessage.SelFontSize = 7
AddSysMessage rtbChat, "*** Joined " & ActiveChannel & " ***", vbRed
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmBuddy.WindowState = vbNormal
SocketSend CHATLEAVE & DELIMITER & ClientNick
End Sub
Private Sub rtbMessage_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
If Not rtbMessage.Text <> "" Then Exit Sub
Dim ChatCommand As String
ChatCommand = LCase(Trim(ParseString(rtbMessage.Text, "-", 1)))
Select Case ChatCommand
Case "/private":
Dim ToNick As String
Dim ParsedMessage As String
ToNick = Trim(ParseString(rtbMessage.Text, "-", 2))
ParsedMessage = Trim(ParseString(rtbMessage.Text, "-", 3))
AddSysMessage rtbChat, "*** Private Message [ " & ToNick & " ] ***", vbRed
rtbMessage.Text = ParsedMessage
AddChat rtbChat, ClientNick, rtbMessage.Text, vbBlack
SocketSend PRIVATEMESSAGE & DELIMITER & ToNick & DELIMITER & ClientNick & DELIMITER & rtbMessage.Text
DoEvents
rtbMessage.Text = ""
Exit Sub
AddSysMessage frmChat.rtbChat, "*** Nick Not Found ***", vbRed
Case "/kick":
Dim KickNick As String
Dim ReasonKick As String
KickNick = Trim(ParseString(rtbMessage.Text, "-", 2))
ReasonKick = Trim(ParseString(rtbMessage.Text, "-", 3))
SocketSend KICKUSER & DELIMITER & KickNick & DELIMITER & ReasonKick
AddSysMessage frmChat.rtbChat, "*** Kicked " & KickNick & " [ " & ReasonKick & " ] ***", vbRed
Case "/afk":
Dim ReasonAFK As String
ReasonAFK = Trim(ParseString(ChatCommand, DELIMITER, 2))
SocketSend AFK & DELIMITER & ClientNick & DELIMITER & ReasonAFK
AddSysMessage frmChat.rtbChat, "*** AFK ***", vbRed
Case Else:
AddChat rtbChat, ClientNick, rtbMessage.Text, vbBlack
SocketSend CHATMESSAGE & DELIMITER & ClientNick & DELIMITER & rtbMessage.Text
End Select
rtbMessage.Text = ""
End If
End Sub
Private Sub rtbMessage_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
rtbMessage.SelBold = False
rtbMessage.SelUnderline = False
rtbMessage.SelItalic = False
rtbMessage.SelColor = vbBlack
rtbMessage.SelFontName = "Verdana"
rtbMessage.SelFontSize = 7
End Sub
Private Sub rtbMessage_SelChange()
rtbMessage.SelBold = False
rtbMessage.SelUnderline = False
rtbMessage.SelItalic = False
rtbMessage.SelColor = vbBlack
rtbMessage.SelFontName = "Verdana"
rtbMessage.SelFontSize = 7
End Sub
Private Sub trvUsers_DblClick()
Dim NewIm As New frmIM
NewIm.Caption = Trim(trvUsers.SelectedItem.Text)
NewIm.Show
End Sub
Private Sub trvUsers_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then
Me.PopupMenu frmMenu.mnuUser
End If
End Sub