home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / lang_ext / vbawk / settabst.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-08-12  |  3.5 KB  |  127 lines

  1. VERSION 2.00
  2. Begin Form SetTabStops 
  3.    Caption         =   "Set Tab Stops:"
  4.    ClientHeight    =   2370
  5.    ClientLeft      =   1695
  6.    ClientTop       =   3045
  7.    ClientWidth     =   6195
  8.    Height          =   2775
  9.    Left            =   1635
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2370
  12.    ScaleWidth      =   6195
  13.    Top             =   2700
  14.    Width           =   6315
  15.    Begin TextBox Text2 
  16.       Enabled         =   0   'False
  17.       Height          =   405
  18.       Left            =   480
  19.       TabIndex        =   6
  20.       Top             =   960
  21.       Width           =   5535
  22.    End
  23.    Begin CommandButton Command2 
  24.       Cancel          =   -1  'True
  25.       Caption         =   "Cancel"
  26.       Height          =   495
  27.       Left            =   3000
  28.       TabIndex        =   5
  29.       Top             =   1680
  30.       Width           =   1215
  31.    End
  32.    Begin CommandButton Command1 
  33.       Caption         =   "OK"
  34.       Default         =   -1  'True
  35.       Height          =   495
  36.       Left            =   1440
  37.       TabIndex        =   4
  38.       Top             =   1680
  39.       Width           =   1215
  40.    End
  41.    Begin TextBox Text1 
  42.       Height          =   315
  43.       Left            =   2160
  44.       TabIndex        =   3
  45.       Text            =   "8"
  46.       Top             =   240
  47.       Width           =   615
  48.    End
  49.    Begin OptionButton Option1 
  50.       Caption         =   "Arbitrary tabs (enter comma-separated list)"
  51.       Height          =   375
  52.       Index           =   1
  53.       Left            =   240
  54.       TabIndex        =   2
  55.       Top             =   600
  56.       Width           =   4335
  57.    End
  58.    Begin OptionButton Option1 
  59.       Caption         =   "Fixed tabs every "
  60.       Height          =   375
  61.       Index           =   0
  62.       Left            =   240
  63.       TabIndex        =   1
  64.       Top             =   240
  65.       Value           =   -1  'True
  66.       Width           =   1815
  67.    End
  68.    Begin Label Label1 
  69.       Caption         =   "spaces"
  70.       Height          =   255
  71.       Left            =   3000
  72.       TabIndex        =   0
  73.       Top             =   360
  74.       Width           =   1455
  75.    End
  76. Sub Command1_Click ()
  77.     Tag = "OK"
  78.     If Option1(0).Value = True Then
  79.         'Fixed tabs; read value and propogate through
  80.         'TabStops array
  81.         On Error GoTo badopt1
  82.         For i% = 0 To HIGHEST_TAB
  83.             TabStops(i%) = ((i% + 1) * CInt(Text1.Text)) + 1
  84.             NumTabStops = HIGHEST_TAB + 1
  85.         Next i%
  86.     Else
  87.         'Arbitrary tabs; parse list and plug into TabStops
  88.         On Error GoTo badopt2
  89.         NextTab$ = StrTok(Text2.Text, " ,")
  90.         i% = 0
  91.         While NextTab$ <> ""
  92.             TabStops(i%) = CInt(NextTab$)
  93.             i% = i% + 1
  94.             NumTabStops = NumTabStops + 1
  95.             NextTab$ = StrTok("", " ,")
  96.         Wend
  97.         TabStops(i%) = 32767        'establish catch-all tab
  98.     End If
  99.     Hide
  100.     Exit Sub
  101. badopt1:
  102.     MsgBox "Bad tab value entered."
  103.     Text1.SetFocus
  104.     Exit Sub
  105. badopt2:
  106.     MsgBox "Bad tab value entered."
  107.     Text2.SetFocus
  108.     Exit Sub
  109. End Sub
  110. Sub Command2_Click ()
  111.     Tag = "CANCEL"
  112.     Hide
  113. End Sub
  114. Sub Option1_Click (Index As Integer)
  115.     If Index = 0 Then
  116.         Text2.Enabled = False
  117.         Text2.Text = ""
  118.         Text1.Enabled = True
  119.         Text1.SetFocus
  120.     Else
  121.         Text2.Enabled = True
  122.         Text1.Enabled = False
  123.         Text1.Text = ""
  124.         Text2.SetFocus
  125.     End If
  126. End Sub
  127.