home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / update / crescent / mwupd / mwterm.frm < prev   
Text File  |  1994-10-17  |  17KB  |  612 lines

  1. VERSION 2.00
  2. Begin Form MWTerm 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Terminal Settings"
  5.    ClientHeight    =   4248
  6.    ClientLeft      =   756
  7.    ClientTop       =   1452
  8.    ClientWidth     =   5880
  9.    Height          =   4620
  10.    Icon            =   MWTERM.FRX:0000
  11.    Left            =   708
  12.    LinkTopic       =   "Form2"
  13.    ScaleHeight     =   4248
  14.    ScaleWidth      =   5880
  15.    Top             =   1128
  16.    Width           =   5976
  17.    Begin PDQComm Comm1 
  18.       AutoScroll      =   4  'Vertical and on keypress
  19.       AutoSize        =   -1  'True
  20.       BackColor       =   1
  21.       Columns         =   20
  22.       Echo            =   0   'False
  23.       Emulation       =   2  'Ansi
  24.       FastScroll      =   -1  'True
  25.       ForeColor       =   15
  26.       Height          =   960
  27.       InBufferSize    =   16384
  28.       Interval        =   55
  29.       KeyTranslation  =   0  'None
  30.       Left            =   240
  31.       Notification    =   0  'Manual
  32.       OutBufferSize   =   16384
  33.       Rows            =   5
  34.       RTSEnable       =   -1  'True
  35.       ScrollRows      =   10
  36.       SmoothScroll    =   0   'False
  37.       Top             =   1080
  38.       Width           =   2172
  39.    End
  40.    Begin CommandButton cmdCancel 
  41.       Cancel          =   -1  'True
  42.       Caption         =   "Cancel"
  43.       Height          =   492
  44.       Left            =   4680
  45.       TabIndex        =   34
  46.       Top             =   3600
  47.       Width           =   972
  48.    End
  49.    Begin CommandButton cmdOK 
  50.       Caption         =   "OK"
  51.       Default         =   -1  'True
  52.       Height          =   492
  53.       Left            =   3600
  54.       TabIndex        =   33
  55.       Top             =   3600
  56.       Width           =   972
  57.    End
  58.    Begin TextBox tbScrollRows 
  59.       Height          =   288
  60.       Left            =   3840
  61.       TabIndex        =   31
  62.       Top             =   1800
  63.       Width           =   852
  64.    End
  65.    Begin ComboBox cbScreenFilter 
  66.       Height          =   288
  67.       Left            =   3840
  68.       TabIndex        =   30
  69.       Top             =   2520
  70.       Width           =   1692
  71.    End
  72.    Begin TextBox tbFontSize 
  73.       Height          =   288
  74.       Left            =   3840
  75.       TabIndex        =   29
  76.       Top             =   360
  77.       Width           =   852
  78.    End
  79.    Begin ComboBox cbFontName 
  80.       Height          =   288
  81.       Left            =   240
  82.       TabIndex        =   28
  83.       Top             =   360
  84.       Width           =   3252
  85.    End
  86.    Begin ComboBox cbEmulation 
  87.       Height          =   288
  88.       Left            =   3840
  89.       TabIndex        =   27
  90.       Top             =   1080
  91.       Width           =   1692
  92.    End
  93.    Begin PictureBox pbForeColor 
  94.       Height          =   372
  95.       Left            =   2400
  96.       ScaleHeight     =   348
  97.       ScaleWidth      =   348
  98.       TabIndex        =   26
  99.       Top             =   2880
  100.       Width           =   372
  101.    End
  102.    Begin PictureBox pbBackColor 
  103.       Height          =   372
  104.       Left            =   960
  105.       ScaleHeight     =   348
  106.       ScaleWidth      =   348
  107.       TabIndex        =   25
  108.       Top             =   2880
  109.       Width           =   372
  110.    End
  111.    Begin PictureBox BColr 
  112.       BackColor       =   &H00FFFFFF&
  113.       DragIcon        =   MWTERM.FRX:0302
  114.       Height          =   372
  115.       Index           =   15
  116.       Left            =   2760
  117.       ScaleHeight     =   348
  118.       ScaleWidth      =   348
  119.       TabIndex        =   24
  120.       Tag             =   "15"
  121.       Top             =   3720
  122.       Width           =   372
  123.    End
  124.    Begin PictureBox BColr 
  125.       BackColor       =   &H0000FFFF&
  126.       DragIcon        =   MWTERM.FRX:0604
  127.       Height          =   372
  128.       Index           =   14
  129.       Left            =   2400
  130.       ScaleHeight     =   348
  131.       ScaleWidth      =   348
  132.       TabIndex        =   23
  133.       Tag             =   "14"
  134.       Top             =   3720
  135.       Width           =   372
  136.    End
  137.    Begin PictureBox BColr 
  138.       BackColor       =   &H00FF00FF&
  139.       DragIcon        =   MWTERM.FRX:0906
  140.       Height          =   372
  141.       Index           =   13
  142.       Left            =   2040
  143.       ScaleHeight     =   348
  144.       ScaleWidth      =   348
  145.       TabIndex        =   22
  146.       Tag             =   "13"
  147.       Top             =   3720
  148.       Width           =   372
  149.    End
  150.    Begin PictureBox BColr 
  151.       BackColor       =   &H000000FF&
  152.       DragIcon        =   MWTERM.FRX:0C08
  153.       Height          =   372
  154.       Index           =   12
  155.       Left            =   1680
  156.       ScaleHeight     =   348
  157.       ScaleWidth      =   348
  158.       TabIndex        =   21
  159.       Tag             =   "12"
  160.       Top             =   3720
  161.       Width           =   372
  162.    End
  163.    Begin PictureBox BColr 
  164.       BackColor       =   &H00FFFF00&
  165.       DragIcon        =   MWTERM.FRX:0F0A
  166.       Height          =   372
  167.       Index           =   11
  168.       Left            =   1320
  169.       ScaleHeight     =   348
  170.       ScaleWidth      =   348
  171.       TabIndex        =   20
  172.       Tag             =   "11"
  173.       Top             =   3720
  174.       Width           =   372
  175.    End
  176.    Begin PictureBox BColr 
  177.       BackColor       =   &H0000FF00&
  178.       DragIcon        =   MWTERM.FRX:120C
  179.       Height          =   372
  180.       Index           =   10
  181.       Left            =   960
  182.       ScaleHeight     =   348
  183.       ScaleWidth      =   348
  184.       TabIndex        =   19
  185.       Tag             =   "10"
  186.       Top             =   3720
  187.       Width           =   372
  188.    End
  189.    Begin PictureBox BColr 
  190.       BackColor       =   &H00FF0000&
  191.       DragIcon        =   MWTERM.FRX:150E
  192.       Height          =   372
  193.       Index           =   9
  194.       Left            =   600
  195.       ScaleHeight     =   348
  196.       ScaleWidth      =   348
  197.       TabIndex        =   18
  198.       Tag             =   "9"
  199.       Top             =   3720
  200.       Width           =   372
  201.    End
  202.    Begin PictureBox BColr 
  203.       BackColor       =   &H00808080&
  204.       DragIcon        =   MWTERM.FRX:1810
  205.       Height          =   372
  206.       Index           =   8
  207.       Left            =   240
  208.       ScaleHeight     =   348
  209.       ScaleWidth      =   348
  210.       TabIndex        =   17
  211.       Tag             =   "8"
  212.       Top             =   3720
  213.       Width           =   372
  214.    End
  215.    Begin PictureBox BColr 
  216.       BackColor       =   &H00C0C0C0&
  217.       DragIcon        =   MWTERM.FRX:1B12
  218.       Height          =   372
  219.       Index           =   7
  220.       Left            =   2760
  221.       ScaleHeight     =   348
  222.       ScaleWidth      =   348
  223.       TabIndex        =   16
  224.       Tag             =   "7"
  225.       Top             =   3360
  226.       Width           =   372
  227.    End
  228.    Begin PictureBox BColr 
  229.       BackColor       =   &H000040C0&
  230.       DragIcon        =   MWTERM.FRX:1E14
  231.       Height          =   372
  232.       Index           =   6
  233.       Left            =   2400
  234.       ScaleHeight     =   348
  235.       ScaleWidth      =   348
  236.       TabIndex        =   15
  237.       Tag             =   "6"
  238.       Top             =   3360
  239.       Width           =   372
  240.    End
  241.    Begin PictureBox BColr 
  242.       BackColor       =   &H00800080&
  243.       DragIcon        =   MWTERM.FRX:2116
  244.       Height          =   372
  245.       Index           =   5
  246.       Left            =   2040
  247.       ScaleHeight     =   348
  248.       ScaleWidth      =   348
  249.       TabIndex        =   14
  250.       Tag             =   "5"
  251.       Top             =   3360
  252.       Width           =   372
  253.    End
  254.    Begin PictureBox BColr 
  255.       BackColor       =   &H00000080&
  256.       DragIcon        =   MWTERM.FRX:2418
  257.       Height          =   372
  258.       Index           =   4
  259.       Left            =   1680
  260.       ScaleHeight     =   348
  261.       ScaleWidth      =   348
  262.       TabIndex        =   13
  263.       Tag             =   "4"
  264.       Top             =   3360
  265.       Width           =   372
  266.    End
  267.    Begin PictureBox BColr 
  268.       BackColor       =   &H00808000&
  269.       DragIcon        =   MWTERM.FRX:271A
  270.       Height          =   372
  271.       Index           =   3
  272.       Left            =   1320
  273.       ScaleHeight     =   348
  274.       ScaleWidth      =   348
  275.       TabIndex        =   12
  276.       Tag             =   "3"
  277.       Top             =   3360
  278.       Width           =   372
  279.    End
  280.    Begin PictureBox BColr 
  281.       BackColor       =   &H00008000&
  282.       DragIcon        =   MWTERM.FRX:2A1C
  283.       Height          =   372
  284.       Index           =   2
  285.       Left            =   960
  286.       ScaleHeight     =   348
  287.       ScaleWidth      =   348
  288.       TabIndex        =   11
  289.       Tag             =   "2"
  290.       Top             =   3360
  291.       Width           =   372
  292.    End
  293.    Begin PictureBox BColr 
  294.       BackColor       =   &H00000000&
  295.       DragIcon        =   MWTERM.FRX:2D1E
  296.       Height          =   372
  297.       Index           =   0
  298.       Left            =   240
  299.       ScaleHeight     =   348
  300.       ScaleWidth      =   348
  301.       TabIndex        =   10
  302.       Tag             =   "0"
  303.       Top             =   3360
  304.       Width           =   372
  305.    End
  306.    Begin PictureBox BColr 
  307.       BackColor       =   &H00800000&
  308.       DragIcon        =   MWTERM.FRX:3020
  309.       Height          =   372
  310.       Index           =   1
  311.       Left            =   600
  312.       ScaleHeight     =   348
  313.       ScaleWidth      =   348
  314.       TabIndex        =   9
  315.       Tag             =   "1"
  316.       Top             =   3360
  317.       Width           =   372
  318.    End
  319.    Begin CheckBox chkBold 
  320.       Caption         =   "B&old"
  321.       Height          =   252
  322.       Left            =   4920
  323.       TabIndex        =   4
  324.       Top             =   360
  325.       Width           =   852
  326.    End
  327.    Begin Label Label1 
  328.       Caption         =   "Drag and Drop Colors:"
  329.       Height          =   252
  330.       Index           =   8
  331.       Left            =   240
  332.       TabIndex        =   3
  333.       Top             =   2520
  334.       Width           =   2292
  335.    End
  336.    Begin Label Label1 
  337.       Caption         =   "S&le:"
  338.       Height          =   252
  339.       Index           =   7
  340.       Left            =   240
  341.       TabIndex        =   32
  342.       Top             =   840
  343.       Width           =   852
  344.    End
  345.    Begin Label Label1 
  346.       Caption         =   "Scrollback &Rows:"
  347.       Height          =   252
  348.       Index           =   6
  349.       Left            =   3840
  350.       TabIndex        =   8
  351.       Top             =   1560
  352.       Width           =   1572
  353.    End
  354.    Begin Label Label1 
  355.       Caption         =   "Screen F&ilter"
  356.       Height          =   252
  357.       Index           =   5
  358.       Left            =   3840
  359.       TabIndex        =   7
  360.       Top             =   2280
  361.       Width           =   1812
  362.    End
  363.    Begin Label Label1 
  364.       Alignment       =   1  'Right Justify
  365.       Caption         =   "&Fore:"
  366.       Height          =   252
  367.       Index           =   4
  368.       Left            =   1680
  369.       TabIndex        =   6
  370.       Top             =   2880
  371.       Width           =   612
  372.    End
  373.    Begin Label Label1 
  374.       Alignment       =   1  'Right Justify
  375.       Caption         =   "&Back:"
  376.       Height          =   252
  377.       Index           =   3
  378.       Left            =   240
  379.       TabIndex        =   5
  380.       Top             =   2880
  381.       Width           =   612
  382.    End
  383.    Begin Label Label1 
  384.       Caption         =   "Font &Size:"
  385.       Height          =   252
  386.       Index           =   2
  387.       Left            =   3840
  388.       TabIndex        =   2
  389.       Top             =   120
  390.       Width           =   972
  391.    End
  392.    Begin Label Label1 
  393.       Caption         =   "Font &Name:"
  394.       Height          =   252
  395.       Index           =   1
  396.       Left            =   240
  397.       TabIndex        =   1
  398.       Top             =   120
  399.       Width           =   1092
  400.    End
  401.    Begin Label Label1 
  402.       Caption         =   "&Emulation:"
  403.       Height          =   252
  404.       Index           =   0
  405.       Left            =   3840
  406.       TabIndex        =   0
  407.       Top             =   840
  408.       Width           =   1092
  409.    End
  410. End
  411. Option Explicit
  412.  
  413. '-- ModemWare Copyright (c) 1992 - 1994 Crescent Software.
  414. '   Written by Carl Franklin with help from and thanks to Bill Conley.
  415.  
  416. '001 10/17/94 - Fixed Invalid Property error when setting Comm1.FontBold
  417. '               to the chkBold check box.
  418.  
  419. Sub BColr_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  420.     
  421.     BColr(Index).Drag
  422.  
  423. End Sub
  424.  
  425. Sub cbEmulation_LostFocus ()
  426.  
  427.     If cbEmulation.ListIndex >= 0 Then
  428.         MW_Global_Comm1.Emulation = cbEmulation.ListIndex + 1
  429.         Comm1.Emulation = cbEmulation.ListIndex + 1
  430.     End If
  431.  
  432. End Sub
  433.  
  434. Sub cbFontName_Click ()
  435.     
  436.     If cbFontName.ListIndex >= 0 Then
  437.         Comm1.FontName = cbFontName.List(cbFontName.ListIndex)
  438.     End If
  439.  
  440. End Sub
  441.  
  442. Sub cbFontName_LostFocus ()
  443.  
  444.     If cbFontName.ListIndex >= 0 Then
  445.         MW_Global_Comm1.FontName = cbFontName.List(cbFontName.ListIndex)
  446.         Comm1.FontName = MW_Global_Comm1.FontName
  447.         chkBold.Value = Abs(Comm1.FontBold)
  448.         Comm1.Text = ""
  449.         Comm1.Disp = "Font Test"
  450.     End If
  451.  
  452. End Sub
  453.  
  454. Sub cbScreenFilter_LostFocus ()
  455.  
  456.     If cbScreenFilter.ListIndex >= 0 Then
  457.         Comm1.ColorFilter = cbScreenFilter.ListIndex
  458.         MW_Global_Comm1.ColorFilter = cbScreenFilter.ListIndex
  459.         Comm1.Text = ""
  460.         Comm1.Disp = "Font Test"
  461.     End If
  462.  
  463. End Sub
  464.  
  465. Sub chkBold_Click ()
  466.     If chkBold.Value Then
  467.         Comm1.FontBold = True
  468.     Else
  469.         Comm1.FontBold = False
  470.     End If
  471. End Sub
  472.  
  473. Sub cmdCancel_Click ()
  474.     
  475.     Tag = ""
  476.     Hide
  477.  
  478. End Sub
  479.  
  480. Sub cmdOK_Click ()
  481.     
  482. Dim Temp$
  483.  
  484.     MW_Global_Comm1.FontName = Comm1.FontName
  485.     MW_Global_Comm1.FontSize = Comm1.FontSize
  486.     MW_Global_Comm1.FontBold = Comm1.FontBold
  487.     MW_Global_Comm1.Emulation = Comm1.Emulation
  488.     MW_Global_Comm1.ScrollRows = Val(tbScrollRows.Text)
  489.     MW_Global_Comm1.ColorFilter = Comm1.ColorFilter
  490.     MW_Global_Comm1.BackColor = Comm1.BackColor
  491.     MW_Global_Comm1.ForeColor = Comm1.ForeColor
  492.     
  493.     Temp$ = MW_Global_Comm1.Text
  494.     MW_Global_Comm1.Text = ""
  495.     
  496.     Do
  497.         If Right$(Temp$, 2) = MW_CR$ + MW_LF$ Then
  498.             Temp$ = Left$(Temp$, Len(Temp$) - 2)
  499.         Else
  500.             Temp$ = Temp$ + MW_CR$ + MW_LF$
  501.             MW_Global_Comm1.Disp = Temp$
  502.             Exit Do
  503.         End If
  504.     Loop
  505.     
  506.     Tag = "X"
  507.     Hide
  508.  
  509. End Sub
  510.  
  511. Sub Form_Activate ()
  512.     
  513.     cbFontName.Text = MW_Global_Comm1.FontName
  514.     Comm1.FontName = MW_Global_Comm1.FontName
  515.     
  516.     tbFontSize.Text = Str$(MW_Global_Comm1.FontSize)
  517.     Comm1.FontSize = MW_Global_Comm1.FontSize + .1
  518.  
  519.     pbBackColor.BackColor = BColr(MW_Global_Comm1.BackColor).BackColor
  520.     pbForeColor.BackColor = BColr(MW_Global_Comm1.ForeColor).BackColor
  521.     
  522.     Comm1.BackColor = MW_Global_Comm1.BackColor
  523.     Comm1.ForeColor = MW_Global_Comm1.ForeColor
  524.     
  525.     chkBold.Value = Abs(MW_Global_Comm1.FontBold)
  526.     tbScrollRows.Text = Trim$(Str$(MW_Global_Comm1.ScrollRows))
  527.  
  528.     Comm1.Text = ""
  529.     Comm1.Disp = "Font Test"
  530.  
  531. End Sub
  532.  
  533. Sub Form_Load ()
  534.     
  535. Dim I As Integer, Fonts As Integer
  536.  
  537.     CenterForm Me
  538.         
  539.     '-- Populate the FontName combo box.
  540.     Fonts = Screen.FontCount - 1
  541.     If Fonts > 150 Then Fonts = 150
  542.     For I = 0 To Fonts - 1
  543.         cbFontName.AddItem Screen.Fonts(I)
  544.     Next
  545.     
  546.     '-- Populate the Emulation combo box.
  547.     cbEmulation.AddItem "TTY"
  548.     cbEmulation.AddItem "ANSI-BBS"
  549.     cbEmulation.AddItem "VT-52"
  550.     cbEmulation.AddItem "VT-100"
  551.     cbEmulation.ListIndex = MW_Global_Comm1.Emulation - 1
  552.     cbEmulation.Text = cbEmulation.List(MW_Global_Comm1.Emulation - 1)
  553.     
  554.     '-- Populate the Screen Filter combo box.
  555.     cbScreenFilter.AddItem "Color"
  556.     cbScreenFilter.AddItem "Gray Scale"
  557.     cbScreenFilter.AddItem "Monochrome"
  558.     cbScreenFilter.Text = "Color"
  559.     
  560.  
  561. End Sub
  562.  
  563. Sub pbBackColor_DragDrop (Source As Control, X As Single, Y As Single)
  564.     
  565.     pbBackColor.BackColor = BColr(Source.Index).BackColor
  566.     Comm1.BackColor = Source.Index
  567.  
  568.     Comm1.Text = ""
  569.     Comm1.Disp = "Font Test"
  570.  
  571. End Sub
  572.  
  573. Sub pbForeColor_DragDrop (Source As Control, X As Single, Y As Single)
  574.     
  575.     pbForeColor.BackColor = BColr(Source.Index).BackColor
  576.     Comm1.ForeColor = Source.Index
  577.  
  578.     Comm1.Text = ""
  579.     Comm1.Disp = "Font Test"
  580.  
  581. End Sub
  582.  
  583. Sub tbFontSize_Change ()
  584.  
  585. Dim NewSize!
  586.     
  587.     NewSize! = Val(tbFontSize.Text)
  588.     If NewSize! > 0 Then
  589.         Comm1.FontSize = Val(tbFontSize.Text)
  590.         chkBold.Value = Abs(Comm1.FontBold)
  591.     
  592.         Comm1.Text = ""
  593.         Comm1.Disp = "Font Test"
  594.     End If
  595.  
  596. End Sub
  597.  
  598. Sub tbScrollRows_Change ()
  599.     
  600. Dim BytesPerRow As Integer, MaxRows As Integer, NumRows As Integer
  601.  
  602.     BytesPerRow = MW_Global_Comm1.Columns * 2
  603.     MaxRows = 65535 \ BytesPerRow
  604.     NumRows = Val(tbScrollRows.Text)
  605.     
  606.     If NumRows > MaxRows Then
  607.         MsgBox "You can only allocate 64K for a scrollback buffer (Rows * Columns * 2)"
  608.     End If
  609.         
  610. End Sub
  611.  
  612.