home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / termset.fr_ / termset.bin
Text File  |  1993-04-28  |  14KB  |  596 lines

  1. VERSION 2.00
  2. Begin Form ConfigScrn 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Communication Settings"
  5.    Height          =   4245
  6.    Icon            =   TERMSET.FRX:0000
  7.    Left            =   1050
  8.    LinkMode        =   1  'Source
  9.    LinkTopic       =   "Form3"
  10.    ScaleHeight     =   3840
  11.    ScaleWidth      =   4980
  12.    Top             =   1185
  13.    Width           =   5100
  14.    Begin OptionButton ComPort 
  15.       Caption         =   "Com1"
  16.       Height          =   252
  17.       Index           =   1
  18.       Left            =   1920
  19.       TabIndex        =   31
  20.       Top             =   2340
  21.       Width           =   852
  22.    End
  23.    Begin OptionButton ComPort 
  24.       Caption         =   "Com4"
  25.       Height          =   252
  26.       Index           =   4
  27.       Left            =   1920
  28.       TabIndex        =   30
  29.       Top             =   3240
  30.       Width           =   852
  31.    End
  32.    Begin OptionButton ComPort 
  33.       Caption         =   "Com3"
  34.       Height          =   252
  35.       Index           =   3
  36.       Left            =   1920
  37.       TabIndex        =   29
  38.       Top             =   2940
  39.       Width           =   852
  40.    End
  41.    Begin OptionButton ComPort 
  42.       Caption         =   "Com2"
  43.       Height          =   252
  44.       Index           =   2
  45.       Left            =   1920
  46.       TabIndex        =   28
  47.       Top             =   2640
  48.       Width           =   852
  49.    End
  50.    Begin Frame Frame1 
  51.       Caption         =   "&Baud Rate"
  52.       Height          =   975
  53.       Left            =   240
  54.       TabIndex        =   2
  55.       Top             =   120
  56.       Width           =   3315
  57.       Begin OptionButton Baud3 
  58.          Caption         =   "300"
  59.          Height          =   255
  60.          Left            =   300
  61.          TabIndex        =   3
  62.          Top             =   240
  63.          Width           =   735
  64.       End
  65.       Begin OptionButton Baud6 
  66.          Caption         =   "600"
  67.          Height          =   255
  68.          Left            =   1260
  69.          TabIndex        =   4
  70.          Top             =   240
  71.          Width           =   615
  72.       End
  73.       Begin OptionButton Baud12 
  74.          Caption         =   "1200"
  75.          Height          =   255
  76.          Left            =   2220
  77.          TabIndex        =   5
  78.          Top             =   240
  79.          Width           =   735
  80.       End
  81.       Begin OptionButton Baud24 
  82.          Caption         =   "2400"
  83.          Height          =   255
  84.          Left            =   300
  85.          TabIndex        =   6
  86.          Top             =   600
  87.          Width           =   735
  88.       End
  89.       Begin OptionButton Baud48 
  90.          Caption         =   "4800"
  91.          Height          =   255
  92.          Left            =   1260
  93.          TabIndex        =   7
  94.          Top             =   600
  95.          Width           =   735
  96.       End
  97.       Begin OptionButton Baud96 
  98.          Caption         =   "9600"
  99.          Height          =   255
  100.          Left            =   2220
  101.          TabIndex        =   8
  102.          Top             =   600
  103.          Width           =   735
  104.       End
  105.    End
  106.    Begin CommandButton OKButton 
  107.       Caption         =   "OK"
  108.       Default         =   -1  'True
  109.       Height          =   375
  110.       Left            =   3780
  111.       TabIndex        =   0
  112.       Top             =   240
  113.       Width           =   975
  114.    End
  115.    Begin CommandButton CancelButton 
  116.       Cancel          =   -1  'True
  117.       Caption         =   "Cancel"
  118.       Height          =   375
  119.       Left            =   3780
  120.       TabIndex        =   1
  121.       Top             =   720
  122.       Width           =   975
  123.    End
  124.    Begin Frame Frame2 
  125.       Caption         =   "&Data Bits"
  126.       Height          =   615
  127.       Left            =   240
  128.       TabIndex        =   9
  129.       Top             =   1260
  130.       Width           =   1275
  131.       Begin OptionButton Data7 
  132.          Caption         =   "7"
  133.          Height          =   255
  134.          Left            =   180
  135.          TabIndex        =   10
  136.          Top             =   240
  137.          Width           =   375
  138.       End
  139.       Begin OptionButton Data8 
  140.          Caption         =   "8"
  141.          Height          =   255
  142.          Left            =   720
  143.          TabIndex        =   11
  144.          Top             =   240
  145.          Width           =   435
  146.       End
  147.    End
  148.    Begin Frame Frame3 
  149.       Caption         =   "&Stop Bits"
  150.       Height          =   615
  151.       Left            =   1740
  152.       TabIndex        =   12
  153.       Top             =   1260
  154.       Width           =   1335
  155.       Begin OptionButton Stop1 
  156.          Caption         =   "1"
  157.          Height          =   255
  158.          Left            =   240
  159.          TabIndex        =   13
  160.          Top             =   240
  161.          Width           =   435
  162.       End
  163.       Begin OptionButton Stop2 
  164.          Caption         =   "2"
  165.          Height          =   255
  166.          Left            =   780
  167.          TabIndex        =   14
  168.          Top             =   240
  169.          Width           =   495
  170.       End
  171.    End
  172.    Begin Frame Frame7 
  173.       Caption         =   "&Echo"
  174.       Height          =   615
  175.       Left            =   3300
  176.       TabIndex        =   15
  177.       Top             =   1260
  178.       Width           =   1455
  179.       Begin OptionButton EchoOff 
  180.          Caption         =   "Off"
  181.          Height          =   315
  182.          Left            =   780
  183.          TabIndex        =   17
  184.          Top             =   240
  185.          Width           =   615
  186.       End
  187.       Begin OptionButton EchoOn 
  188.          Caption         =   "On"
  189.          Height          =   195
  190.          Left            =   180
  191.          TabIndex        =   16
  192.          Top             =   300
  193.          Width           =   555
  194.       End
  195.    End
  196.    Begin Frame Frame4 
  197.       Caption         =   "&Parity"
  198.       Height          =   1575
  199.       Left            =   240
  200.       TabIndex        =   18
  201.       Top             =   2040
  202.       Width           =   1275
  203.       Begin OptionButton NoParity 
  204.          Caption         =   "None"
  205.          Height          =   255
  206.          Left            =   180
  207.          TabIndex        =   19
  208.          Top             =   300
  209.          Width           =   855
  210.       End
  211.       Begin OptionButton OddParity 
  212.          Caption         =   "Odd"
  213.          Height          =   255
  214.          Left            =   180
  215.          TabIndex        =   20
  216.          Top             =   600
  217.          Width           =   735
  218.       End
  219.       Begin OptionButton EvenParity 
  220.          Caption         =   "Even"
  221.          Height          =   255
  222.          Left            =   180
  223.          TabIndex        =   21
  224.          Top             =   900
  225.          Width           =   855
  226.       End
  227.    End
  228.    Begin Frame Frame6 
  229.       Caption         =   "&Com Port"
  230.       Height          =   1575
  231.       Left            =   1740
  232.       TabIndex        =   22
  233.       Top             =   2040
  234.       Width           =   1335
  235.    End
  236.    Begin Frame Frame5 
  237.       Caption         =   "&Flow Control"
  238.       Height          =   1575
  239.       Left            =   3300
  240.       TabIndex        =   23
  241.       Top             =   2040
  242.       Width           =   1455
  243.       Begin OptionButton NoFlow 
  244.          Caption         =   "None"
  245.          Height          =   255
  246.          Left            =   180
  247.          TabIndex        =   26
  248.          Top             =   300
  249.          Width           =   855
  250.       End
  251.       Begin OptionButton XonFlow 
  252.          Caption         =   "Xon/Xoff"
  253.          Height          =   255
  254.          Left            =   180
  255.          TabIndex        =   24
  256.          Top             =   600
  257.          Width           =   1095
  258.       End
  259.       Begin OptionButton RTSFlow 
  260.          Caption         =   "RTS"
  261.          Height          =   255
  262.          Left            =   180
  263.          TabIndex        =   25
  264.          Top             =   900
  265.          Width           =   735
  266.       End
  267.       Begin OptionButton BothFlow 
  268.          Caption         =   "Xon/RTS"
  269.          Height          =   255
  270.          Left            =   180
  271.          TabIndex        =   27
  272.          Top             =   1200
  273.          Width           =   1155
  274.       End
  275.    End
  276. End
  277. '***********  Communication Settings Configuration Form
  278.  
  279. 'Copyright (c) 1991, Crescent Software
  280.  
  281. DefInt A-Z
  282.  
  283. Dim Shared NewPort                 'temp config settings
  284. Dim Shared NewBaud$, NewParity$
  285. Dim Shared NewData$, NewStop$
  286. Dim Shared NewShake
  287.  
  288. '
  289. '--- 1200 baud option button
  290. '
  291. Sub Baud12_Click ()
  292.  
  293.     NewBaud$ = "1200"
  294.  
  295. End Sub
  296.  
  297. '
  298. '--- 2400 baud option button
  299. '
  300. Sub Baud24_Click ()
  301.  
  302.     NewBaud$ = "2400"
  303.  
  304. End Sub
  305.  
  306. '
  307. '--- 300 baud option button
  308. '
  309. Sub Baud3_Click ()
  310.  
  311.     NewBaud$ = "300"
  312.  
  313. End Sub
  314.  
  315. '
  316. '--- 4800 baud option button
  317. '
  318. Sub Baud48_Click ()
  319.  
  320.     NewBaud$ = "4800"
  321.  
  322. End Sub
  323.  
  324. '
  325. '--- 600 baud option button
  326. '
  327. Sub Baud6_Click ()
  328.  
  329.     NewBaud$ = "600"
  330.  
  331. End Sub
  332.  
  333. '
  334. '--- 9600 baud option button
  335. '
  336. Sub Baud96_Click ()
  337.  
  338.     NewBaud$ = "9600"
  339.  
  340. End Sub
  341.  
  342. '
  343. '--- Both RTS and Xon/Xoff handshaking option button
  344. '
  345. Sub BothFlow_Click ()
  346.  
  347.     NewShake = 3
  348.  
  349. End Sub
  350.  
  351. '
  352. '--- Cancel button actions
  353. '
  354. Sub CancelButton_Click ()
  355.  
  356.     Unload ConfigScrn
  357.  
  358. End Sub
  359.  
  360. Sub ComPort_Click (Index As Integer)
  361.     NewPort = Index
  362. End Sub
  363.  
  364. '
  365. '--- 7 data bits option button
  366. '
  367. Sub Data7_Click ()
  368.  
  369.     NewData$ = "7"
  370.  
  371. End Sub
  372.  
  373. '
  374. '--- 8 data bits option button
  375. '
  376. Sub Data8_Click ()
  377.  
  378.     NewData$ = "8"
  379.  
  380. End Sub
  381.  
  382. '
  383. '--- Echo off option button
  384. '
  385. Sub EchoOff_Click ()
  386.  
  387.     Echo = 0
  388.  
  389. End Sub
  390.  
  391. '
  392. '--- Echo on option button
  393. '
  394. Sub EchoOn_Click ()
  395.  
  396.     Echo = True
  397.  
  398. End Sub
  399.  
  400. '
  401. '--- Even parity option button
  402. '
  403. Sub EvenParity_Click ()
  404.  
  405.     NewParity$ = "E"
  406.     
  407. End Sub
  408.  
  409. '
  410. '--- Initialize and display configuration form
  411. '
  412. Sub Form_Load ()
  413.     
  414.     '--- Get current port
  415.     Port = Form1.MSComm1.CommPort
  416.     ConfigScrn.ComPort(Port).Value = True       'Set option button
  417.  
  418.     '--- Get current baud
  419.     FirstComma = InStr(Form1.MSComm1.Settings, ",")
  420.     Baud$ = Left$(Form1.MSComm1.Settings, FirstComma - 1)
  421.     
  422.     Select Case Val(Baud$)                  'select baud
  423.     Case 300                                'set active baud
  424.         ConfigScrn.Baud3.Value = True       'option button
  425.     Case 600
  426.         ConfigScrn.Baud6.Value = True
  427.     Case 1200
  428.         ConfigScrn.Baud12.Value = True
  429.     Case 2400
  430.         ConfigScrn.Baud24.Value = True
  431.     Case 4800
  432.         ConfigScrn.Baud48.Value = True
  433.     Case 9600
  434.         ConfigScrn.Baud96.Value = True
  435.     End Select
  436.  
  437.     '--- Get current parity
  438.     Parity$ = Mid$(Form1.MSComm1.Settings, FirstComma + 1, 1)
  439.     
  440.     Select Case UCase$(Parity$)             'select parity
  441.     Case "N"                                'set active parity
  442.         ConfigScrn.NoParity.Value = True    'option button
  443.     Case "E"
  444.         ConfigScrn.EvenParity.Value = True
  445.     Case "O"
  446.         ConfigScrn.OddParity.Value = True
  447.     End Select
  448.  
  449.     
  450.     '--- Get data bits
  451.     SecondComma = FirstComma + 2
  452.     DBits$ = Mid$(Form1.MSComm1.Settings, SecondComma + 1, 1)
  453.     Select Case Val(DBits$)              'select data bits
  454.     Case 7                              'set active choice
  455.         ConfigScrn.Data7.Value = True       'option button
  456.     Case 8
  457.         ConfigScrn.Data8.Value = True
  458.     End Select
  459.  
  460.     '--- Get stop bits
  461.     ThirdComma = SecondComma + 2
  462.     SBits$ = Mid$(Form1.MSComm1.Settings, ThirdComma + 1, 1)
  463.     Select Case Val(SBits$)                 'select stop bits
  464.     Case 1                                  'set active choice
  465.         ConfigScrn.Stop1.Value = True       'option button
  466.     Case 2
  467.         ConfigScrn.Stop2.Value = True
  468.     End Select
  469.  
  470.     
  471.     Select Case Form1.MSComm1.Handshaking
  472.     Case 0                                  'set active choice
  473.         ConfigScrn.NoFlow.Value = True      'option button
  474.     Case 1
  475.         ConfigScrn.XonFlow.Value = True
  476.     Case 2
  477.         ConfigScrn.RTSFlow.Value = True
  478.     Case 3
  479.         ConfigScrn.BothFlow.Value = True
  480.     End Select
  481.  
  482.     If Echo Then
  483.         ConfigScrn.EchoOn.Value = True
  484.     Else
  485.         ConfigScrn.EchoOff.Value = True
  486.     End If
  487. End Sub
  488.  
  489. '
  490. '--- No handshaking option button
  491. '
  492. Sub NoFlow_Click ()
  493.  
  494.     NewShake = 0
  495.  
  496. End Sub
  497.  
  498. '
  499. '--- No parity option button
  500. '
  501. Sub NoParity_Click ()
  502.  
  503.     NewParity$ = "N"
  504.     
  505. End Sub
  506.  
  507. '
  508. '--- Odd parity option button
  509. '
  510. Sub OddParity_Click ()
  511.  
  512.     NewParity$ = "O"
  513.     
  514. End Sub
  515.  
  516. '
  517. '--- Ok button actions
  518. '
  519. Sub OkButton_Click ()
  520.     On Error Resume Next
  521.  
  522.     OldPort = Form1.MSComm1.CommPort
  523.     If NewPort <> OldPort Then                    'if port num changing
  524.         If Form1.MSComm1.PortOpen Then            'close the old port
  525.            Form1.MSComm1.PortOpen = False
  526.            ReOpen = True
  527.         End If
  528.  
  529.         Form1.MSComm1.CommPort = NewPort          'set new port number
  530.  
  531.         If Err = 0 Then
  532.            If ReOpen Then
  533.               Form1.MSComm1.PortOpen = True
  534.               Form1.MOpen.Checked = Form1.MSComm1.PortOpen
  535.               Form1.MSendText.Enabled = Form1.MSComm1.PortOpen
  536.            End If
  537.         End If
  538.         If Err Then
  539.            MsgBox Error$, 48
  540.            Form1.MSComm1.CommPort = OldPort
  541.            Exit Sub
  542.         End If
  543.     End If
  544.     
  545.     Form1.MSComm1.Settings = NewBaud$ + "," + NewParity$ + "," + NewData$ + "," + NewStop$
  546.     If Err Then
  547.        MsgBox Error$, 48
  548.        Exit Sub
  549.     End If
  550.     Form1.MSComm1.Handshaking = NewShake
  551.     If Err Then
  552.        MsgBox Error$, 48
  553.        Exit Sub
  554.     End If
  555.  
  556.     Unload ConfigScrn                               'remove configuration form
  557.  
  558. End Sub
  559.  
  560. '
  561. '--- RTS handshaking option button
  562. '
  563. Sub RTSFlow_Click ()
  564.  
  565.     NewShake = 2
  566.  
  567. End Sub
  568.  
  569. '
  570. '--- 1 stop bit option button
  571. '
  572. Sub Stop1_Click ()
  573.  
  574.     NewStop$ = "1"
  575.  
  576. End Sub
  577.  
  578. '
  579. '--- 2 stop bits option button
  580. '
  581. Sub Stop2_Click ()
  582.  
  583.     NewStop$ = "2"
  584.  
  585. End Sub
  586.  
  587. '
  588. '--- XON handshaking option button
  589. '
  590. Sub XonFlow_Click ()
  591.  
  592.     NewShake = 1
  593.  
  594. End Sub
  595.  
  596.