Initial revision
[citadel.git] / wincit / pageuser.frm
1 VERSION 4.00
2 Begin VB.Form PageUser 
3    BorderStyle     =   1  'Fixed Single
4    Caption         =   "Page another user"
5    ClientHeight    =   5760
6    ClientLeft      =   1545
7    ClientTop       =   1725
8    ClientWidth     =   6690
9    ControlBox      =   0   'False
10    Height          =   6165
11    Left            =   1485
12    LinkTopic       =   "Form1"
13    MDIChild        =   -1  'True
14    ScaleHeight     =   5760
15    ScaleWidth      =   6690
16    Top             =   1380
17    Width           =   6810
18    Begin VB.CommandButton send_button 
19       Caption         =   "&Send message"
20       Height          =   615
21       Left            =   3120
22       TabIndex        =   5
23       Top             =   5040
24       Width           =   1695
25    End
26    Begin VB.TextBox message_text 
27       BeginProperty Font 
28          name            =   "MS Sans Serif"
29          charset         =   0
30          weight          =   400
31          size            =   12
32          underline       =   0   'False
33          italic          =   0   'False
34          strikethrough   =   0   'False
35       EndProperty
36       Height          =   3135
37       Left            =   3120
38       MaxLength       =   200
39       MultiLine       =   -1  'True
40       TabIndex        =   2
41       Top             =   360
42       Width           =   3495
43    End
44    Begin VB.ListBox online_users 
45       Height          =   5325
46       Left            =   120
47       TabIndex        =   1
48       Top             =   360
49       Width           =   2895
50    End
51    Begin VB.CommandButton cancel_button 
52       Caption         =   "&Cancel"
53       Height          =   615
54       Left            =   4920
55       TabIndex        =   0
56       Top             =   5040
57       Width           =   1695
58    End
59    Begin VB.Label Label2 
60       Caption         =   "Message to send:"
61       Height          =   255
62       Left            =   3120
63       TabIndex        =   4
64       Top             =   120
65       Width           =   3375
66    End
67    Begin VB.Label Label1 
68       Caption         =   "User to page:"
69       Height          =   255
70       Left            =   120
71       TabIndex        =   3
72       Top             =   120
73       Width           =   1095
74    End
75 End
76 Attribute VB_Name = "PageUser"
77 Attribute VB_Creatable = False
78 Attribute VB_Exposed = False
79 Private Sub cancel_button_Click()
80
81 Unload PageUser
82 Load RoomPrompt
83
84 End Sub
85
86
87 Private Sub Form_Load()
88
89 PageUser.Width = 6795
90 PageUser.Height = 6135
91 PageUser.WindowState = 0
92 PageUser.Top = Int((MainWin.Height - PageUser.Height) / 3)
93 PageUser.Left = Int((MainWin.Width - PageUser.Width) / 2)
94 Show
95
96 If begin_trans() = True Then
97     serv_puts ("RWHO")
98     a$ = serv_gets()
99     If Left$(a$, 1) = "1" Then
100         Do
101             a$ = serv_gets()
102             If a$ <> "000" Then
103                 online_users.AddItem (extract(a$, 1))
104                 End If
105             Loop Until a$ = "000"
106         End If
107     end_trans
108     End If
109
110 End Sub
111
112
113 Private Sub send_button_Click()
114
115 If Len(message_text.Text) < 1 Then GoTo dont_send
116
117 If online_users.ListIndex >= 0 Then
118     mto$ = online_users.List(online_users.ListIndex)
119 Else
120     GoTo dont_send
121     End If
122     
123 If begin_trans() <> True Then GoTo dont_send
124
125 buf$ = "SEXP " + mto$ + "|"
126
127 For a = 1 To Len(message_text.Text)
128  If Asc(Mid$(message_text.Text, a, 1)) < 32 Then
129     buf$ = buf$ + " "
130  Else
131     buf$ = buf$ + Mid$(message_text.Text, a, 1)
132     End If
133  Next a
134  
135  serv_puts (buf$)
136  buf$ = serv_gets()
137  If Left$(buf$, 1) <> "2" Then
138     MsgBox Right$(buf$, Len(buf$) - 4), 16
139     End If
140
141 end_trans
142
143 Unload PageUser
144 Load RoomPrompt
145
146 dont_send:
147
148 End Sub
149
150