]> code.citadel.org Git - citadel.git/blob - wincit/modemset.frm
Initial revision
[citadel.git] / wincit / modemset.frm
1 VERSION 4.00
2 Begin VB.Form ModemSetup 
3    Appearance      =   0  'Flat
4    BackColor       =   &H00C0C0C0&
5    BorderStyle     =   3  'Fixed Dialog
6    ClientHeight    =   4170
7    ClientLeft      =   2295
8    ClientTop       =   1710
9    ClientWidth     =   5370
10    ControlBox      =   0   'False
11    BeginProperty Font 
12       name            =   "MS Sans Serif"
13       charset         =   0
14       weight          =   700
15       size            =   8.25
16       underline       =   0   'False
17       italic          =   0   'False
18       strikethrough   =   0   'False
19    EndProperty
20    ForeColor       =   &H80000008&
21    Height          =   4575
22    Left            =   2235
23    LinkTopic       =   "Form1"
24    MaxButton       =   0   'False
25    MDIChild        =   -1  'True
26    MinButton       =   0   'False
27    ScaleHeight     =   4170
28    ScaleWidth      =   5370
29    Top             =   1365
30    Width           =   5490
31    Begin VB.CommandButton Cancel_Button 
32       Appearance      =   0  'Flat
33       BackColor       =   &H80000005&
34       Caption         =   "Cancel"
35       Height          =   492
36       Left            =   3960
37       TabIndex        =   23
38       Top             =   3600
39       Width           =   1332
40    End
41    Begin VB.CommandButton Save_Button 
42       Appearance      =   0  'Flat
43       BackColor       =   &H80000005&
44       Caption         =   "Save"
45       Height          =   492
46       Left            =   2520
47       TabIndex        =   22
48       Top             =   3600
49       Width           =   1332
50    End
51    Begin Threed.SSFrame Frame3D7 
52       Height          =   615
53       Left            =   120
54       TabIndex        =   21
55       Top             =   2880
56       Width           =   5175
57       _Version        =   65536
58       _ExtentX        =   9128
59       _ExtentY        =   1085
60       _StockProps     =   14
61       Caption         =   "Dial Command Prefix"
62       ForeColor       =   0
63       Font3D          =   1
64       Begin VB.TextBox uDialPrefix 
65          Appearance      =   0  'Flat
66          BackColor       =   &H00C0C0C0&
67          BorderStyle     =   0  'None
68          Height          =   288
69          Left            =   120
70          TabIndex        =   25
71          Top             =   240
72          Width           =   4932
73       End
74    End
75    Begin Threed.SSFrame Frame3D6 
76       Height          =   615
77       Left            =   120
78       TabIndex        =   20
79       Top             =   2280
80       Width           =   5175
81       _Version        =   65536
82       _ExtentX        =   9128
83       _ExtentY        =   1085
84       _StockProps     =   14
85       Caption         =   "Modem Initialization String"
86       ForeColor       =   0
87       Font3D          =   1
88       Begin VB.TextBox uInitString 
89          Appearance      =   0  'Flat
90          BackColor       =   &H00C0C0C0&
91          BorderStyle     =   0  'None
92          Height          =   288
93          Left            =   120
94          TabIndex        =   24
95          Top             =   240
96          Width           =   4932
97       End
98    End
99    Begin Threed.SSFrame Frame3D5 
100       Height          =   1095
101       Left            =   4320
102       TabIndex        =   16
103       Top             =   1200
104       Width           =   975
105       _Version        =   65536
106       _ExtentX        =   1720
107       _ExtentY        =   1931
108       _StockProps     =   14
109       Caption         =   "Stop Bits"
110       ForeColor       =   0
111       Font3D          =   1
112       Begin VB.OptionButton SB2 
113          Appearance      =   0  'Flat
114          BackColor       =   &H00C0C0C0&
115          Caption         =   "2"
116          ForeColor       =   &H80000008&
117          Height          =   252
118          Left            =   120
119          TabIndex        =   18
120          Top             =   720
121          Width           =   732
122       End
123       Begin VB.OptionButton SB1 
124          Appearance      =   0  'Flat
125          BackColor       =   &H00C0C0C0&
126          Caption         =   "1"
127          ForeColor       =   &H80000008&
128          Height          =   252
129          Left            =   120
130          TabIndex        =   17
131          Top             =   360
132          Width           =   732
133       End
134    End
135    Begin Threed.SSFrame Frame3D4 
136       Height          =   1095
137       Left            =   4320
138       TabIndex        =   6
139       Top             =   0
140       Width           =   975
141       _Version        =   65536
142       _ExtentX        =   1720
143       _ExtentY        =   1931
144       _StockProps     =   14
145       Caption         =   "Data Bits"
146       ForeColor       =   0
147       Font3D          =   1
148       Begin VB.OptionButton DB7 
149          Appearance      =   0  'Flat
150          BackColor       =   &H00C0C0C0&
151          Caption         =   "7"
152          ForeColor       =   &H80000008&
153          Height          =   252
154          Left            =   120
155          TabIndex        =   15
156          Top             =   720
157          Width           =   612
158       End
159       Begin VB.OptionButton DB8 
160          Appearance      =   0  'Flat
161          BackColor       =   &H00C0C0C0&
162          Caption         =   "8"
163          ForeColor       =   &H80000008&
164          Height          =   252
165          Left            =   120
166          TabIndex        =   14
167          Top             =   360
168          Width           =   612
169       End
170    End
171    Begin Threed.SSFrame Frame3D3 
172       Height          =   2295
173       Left            =   3120
174       TabIndex        =   4
175       Top             =   0
176       Width           =   1095
177       _Version        =   65536
178       _ExtentX        =   1931
179       _ExtentY        =   4048
180       _StockProps     =   14
181       Caption         =   "Parity"
182       ForeColor       =   0
183       Font3D          =   1
184       Begin VB.OptionButton ParSpace 
185          Appearance      =   0  'Flat
186          BackColor       =   &H00C0C0C0&
187          Caption         =   "Space"
188          ForeColor       =   &H80000008&
189          Height          =   252
190          Left            =   120
191          TabIndex        =   13
192          Top             =   1800
193          Width           =   852
194       End
195       Begin VB.OptionButton ParMark 
196          Appearance      =   0  'Flat
197          BackColor       =   &H00C0C0C0&
198          Caption         =   "Mark"
199          ForeColor       =   &H80000008&
200          Height          =   252
201          Left            =   120
202          TabIndex        =   12
203          Top             =   1440
204          Width           =   852
205       End
206       Begin VB.OptionButton ParOdd 
207          Appearance      =   0  'Flat
208          BackColor       =   &H00C0C0C0&
209          Caption         =   "Odd"
210          ForeColor       =   &H80000008&
211          Height          =   252
212          Left            =   120
213          TabIndex        =   11
214          Top             =   1080
215          Width           =   852
216       End
217       Begin VB.OptionButton ParEven 
218          Appearance      =   0  'Flat
219          BackColor       =   &H00C0C0C0&
220          Caption         =   "Even"
221          ForeColor       =   &H80000008&
222          Height          =   252
223          Left            =   120
224          TabIndex        =   10
225          Top             =   720
226          Width           =   852
227       End
228       Begin VB.OptionButton ParNone 
229          Appearance      =   0  'Flat
230          BackColor       =   &H00C0C0C0&
231          Caption         =   "None"
232          ForeColor       =   &H80000008&
233          Height          =   252
234          Left            =   120
235          TabIndex        =   5
236          Top             =   360
237          Width           =   852
238       End
239    End
240    Begin Threed.SSFrame Frame3D2 
241       Height          =   855
242       Left            =   1320
243       TabIndex        =   2
244       Top             =   0
245       Width           =   1695
246       _Version        =   65536
247       _ExtentX        =   2990
248       _ExtentY        =   1508
249       _StockProps     =   14
250       Caption         =   "Speed"
251       ForeColor       =   0
252       Font3D          =   1
253       Begin VB.ComboBox SpeedSel 
254          Appearance      =   0  'Flat
255          BackColor       =   &H00C0C0C0&
256          Height          =   315
257          Left            =   120
258          TabIndex        =   3
259          Top             =   360
260          Width           =   1452
261       End
262    End
263    Begin Threed.SSFrame Frame3D1 
264       Height          =   2295
265       Left            =   120
266       TabIndex        =   0
267       Top             =   0
268       Width           =   1095
269       _Version        =   65536
270       _ExtentX        =   1931
271       _ExtentY        =   4048
272       _StockProps     =   14
273       Caption         =   "COM Port"
274       ForeColor       =   0
275       Font3D          =   1
276       Begin VB.OptionButton Com5 
277          Appearance      =   0  'Flat
278          BackColor       =   &H00C0C0C0&
279          Caption         =   "Com 5"
280          ForeColor       =   &H80000008&
281          Height          =   252
282          Left            =   120
283          TabIndex        =   19
284          Top             =   1800
285          Width           =   852
286       End
287       Begin VB.OptionButton Com4 
288          Appearance      =   0  'Flat
289          BackColor       =   &H00C0C0C0&
290          Caption         =   "Com 4"
291          ForeColor       =   &H80000008&
292          Height          =   252
293          Left            =   120
294          TabIndex        =   9
295          Top             =   1440
296          Width           =   852
297       End
298       Begin VB.OptionButton Com3 
299          Appearance      =   0  'Flat
300          BackColor       =   &H00C0C0C0&
301          Caption         =   "Com 3"
302          ForeColor       =   &H80000008&
303          Height          =   252
304          Left            =   120
305          TabIndex        =   8
306          Top             =   1080
307          Width           =   852
308       End
309       Begin VB.OptionButton Com2 
310          Appearance      =   0  'Flat
311          BackColor       =   &H00C0C0C0&
312          Caption         =   "Com 2"
313          ForeColor       =   &H80000008&
314          Height          =   252
315          Left            =   120
316          TabIndex        =   7
317          Top             =   720
318          Width           =   852
319       End
320       Begin VB.OptionButton Com1 
321          Appearance      =   0  'Flat
322          BackColor       =   &H00C0C0C0&
323          Caption         =   "Com 1"
324          ForeColor       =   &H80000008&
325          Height          =   252
326          Left            =   120
327          TabIndex        =   1
328          Top             =   360
329          Width           =   852
330       End
331    End
332 End
333 Attribute VB_Name = "ModemSetup"
334 Attribute VB_Creatable = False
335 Attribute VB_Exposed = False
336
337 Private Sub cancel_button_Click()
338     Unload ModemSetup
339     Load SelectBBS
340 End Sub
341
342 Private Sub Form_Load()
343
344     Select Case comport%
345         Case 1
346             Com1.Value = True
347         Case 2
348             Com2.Value = True
349         Case 3
350             Com3.Value = True
351         Case 4
352             Com4.Value = True
353         Case 5
354             Com5.Value = True
355         End Select
356
357     SpeedSel.Text = Str$(comspeed&)
358     SpeedSel.AddItem ("300")
359     SpeedSel.AddItem ("1200")
360     SpeedSel.AddItem ("2400")
361     SpeedSel.AddItem ("4800")
362     SpeedSel.AddItem ("9600")
363     SpeedSel.AddItem ("19200")
364
365     Select Case ComParity$
366         Case "N"
367             ParNone.Value = True
368         Case "E"
369             ParEven.Value = True
370         Case "O"
371             ParOdd.Value = True
372         Case "M"
373             ParMark.Value = True
374         Case "S"
375             ParSpace.Value = True
376             End Select
377
378     Select Case comdatabits%
379         Case 8
380             DB8.Value = True
381         Case 7
382             DB7.Value = True
383             End Select
384
385     Select Case comstopbits%
386         Case 1
387             SB1.Value = True
388         Case 2
389             SB2.Value = True
390             End Select
391
392     uInitString.Text = cominitstring$
393     uDialPrefix.Text = comdialprefix$
394
395 End Sub
396
397 Private Sub Form_Resize()
398
399     ModemSetup.Left = Abs(Int((MainWin.Width - ModemSetup.Width) / 2))
400     ModemSetup.Top = Abs(Int((MainWin.Height - ModemSetup.Height) / 3))
401
402
403 End Sub
404
405 Private Sub save_button_Click()
406     
407     If Com1.Value = True Then comport% = 1
408     If Com2.Value = True Then comport% = 2
409     If Com3.Value = True Then comport% = 3
410     If Com4.Value = True Then comport% = 4
411     If Com5.Value = True Then comport% = 5
412
413     comspeed& = CLng(SpeedSel.Text)
414
415     If ParNone.Value = True Then ComParity$ = "N"
416     If ParEven.Value = True Then ComParity$ = "E"
417     If ParOdd.Value = True Then ComParity$ = "O"
418     If ParMark.Value = True Then ComParity$ = "M"
419     If ParSpace.Value = True Then ComParity$ = "S"
420
421     If DB8.Value = True Then comdatabits% = 8
422     If DB7.Value = True Then comdatabits% = 7
423
424     If SB1.Value = True Then comstopbits% = 1
425     If SB2.Value = True Then comstopbits% = 2
426     
427     cominitstring$ = uInitString.Text
428     comdialprefix$ = uDialPrefix.Text
429
430     a% = WritePrivateProfileString("Modem Setup", "ComPort", Str$(comport%), "WINCIT.INI")
431     a% = WritePrivateProfileString("Modem Setup", "Speed", CStr(comspeed&), "WINCIT.INI")
432     a% = WritePrivateProfileString("Modem Setup", "Parity", ComParity$, "WINCIT.INI")
433     a% = WritePrivateProfileString("Modem Setup", "DataBits", Str$(comdatabits%), "WINCIT.INI")
434     a% = WritePrivateProfileString("Modem Setup", "StopBits", Str$(comstopbits%), "WINCIT.INI")
435     a% = WritePrivateProfileString("Modem Setup", "InitString", cominitstring$, "WINCIT.INI")
436     a% = WritePrivateProfileString("Modem Setup", "DialPrefix", comdialprefix$, "WINCIT.INI")
437
438     Unload ModemSetup
439     Load SelectBBS
440 End Sub
441