home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / tk_bar / config.frm < prev    next >
Text File  |  1993-11-20  |  4KB  |  158 lines

  1. VERSION 2.00
  2. Begin Form frmConfig 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Configure"
  6.    ClientHeight    =   2175
  7.    ClientLeft      =   1170
  8.    ClientTop       =   1560
  9.    ClientWidth     =   3660
  10.    Height          =   2610
  11.    KeyPreview      =   -1  'True
  12.    Left            =   1095
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2175
  17.    ScaleWidth      =   3660
  18.    Top             =   1200
  19.    Width           =   3810
  20.    Begin CommandButton cmdCancel 
  21.       BackColor       =   &H00000000&
  22.       Caption         =   "Cancel"
  23.       Height          =   435
  24.       Left            =   2220
  25.       TabIndex        =   4
  26.       Top             =   1020
  27.       Width           =   1215
  28.    End
  29.    Begin CommandButton cmdOk 
  30.       BackColor       =   &H00000000&
  31.       Caption         =   "OK"
  32.       Default         =   -1  'True
  33.       Height          =   435
  34.       Left            =   2220
  35.       TabIndex        =   3
  36.       Top             =   480
  37.       Width           =   1215
  38.    End
  39.    Begin SSFrame fraOrient 
  40.       Caption         =   "Grid Size"
  41.       Font3D          =   0  'None
  42.       Height          =   1275
  43.       Left            =   180
  44.       TabIndex        =   5
  45.       Top             =   345
  46.       Width           =   1755
  47.       Begin TextBox txtCols 
  48.          Height          =   315
  49.          Left            =   960
  50.          TabIndex        =   1
  51.          Top             =   720
  52.          Width           =   555
  53.       End
  54.       Begin TextBox txtRows 
  55.          Height          =   315
  56.          Left            =   960
  57.          TabIndex        =   0
  58.          Top             =   300
  59.          Width           =   555
  60.       End
  61.       Begin Label Label2 
  62.          AutoSize        =   -1  'True
  63.          BackColor       =   &H00C0C0C0&
  64.          Caption         =   "Columns:"
  65.          Height          =   195
  66.          Left            =   120
  67.          TabIndex        =   7
  68.          Top             =   840
  69.          Width           =   780
  70.       End
  71.       Begin Label Label1 
  72.          AutoSize        =   -1  'True
  73.          BackColor       =   &H00C0C0C0&
  74.          Caption         =   "Rows:"
  75.          Height          =   195
  76.          Left            =   360
  77.          TabIndex        =   6
  78.          Top             =   420
  79.          Width           =   540
  80.       End
  81.    End
  82.    Begin CheckBox chkOnTop 
  83.       BackColor       =   &H00C0C0C0&
  84.       Caption         =   "Always On Top"
  85.       Height          =   285
  86.       Left            =   180
  87.       TabIndex        =   2
  88.       Top             =   1725
  89.       Width           =   1650
  90.    End
  91.    Begin Label lblItemCount 
  92.       AutoSize        =   -1  'True
  93.       BackColor       =   &H00C0C0C0&
  94.       Caption         =   "Item Count"
  95.       ForeColor       =   &H00C00000&
  96.       Height          =   195
  97.       Left            =   225
  98.       TabIndex        =   8
  99.       Top             =   75
  100.       Width           =   930
  101.    End
  102. End
  103. Option Explicit
  104.  
  105. Sub cmdCancel_Click ()
  106.   Unload Me
  107. End Sub
  108.  
  109. Sub cmdOk_Click ()
  110. Dim Cond1%, Cond2%
  111.  
  112.    Cond1 = (Val(txtRows.Text) <= 0 Or Val(txtCols.Text) <= 0)
  113.    Cond2 = ((Val(txtRows.Text) * Val(txtCols.Text)) < gActualItemCt)
  114.  
  115.    If Cond1 Or Cond2 Then
  116.       MsgBadNews "Invalid grid size setting."
  117.    Else
  118.       gOnTop = (chkOnTop.Value = 1)
  119.       gGridRows = Val(txtRows.Text)
  120.       gGridCols = Val(txtCols.Text)
  121.       Unload Me
  122.       ButtonBarDraw
  123.    End If
  124. End Sub
  125.  
  126. Sub Form_KeyPress (KeyAscii As Integer)
  127.   If KeyAscii = 27 Then Call cmdCancel_Click
  128. End Sub
  129.  
  130. Sub Form_Load ()
  131.    txtRows.Text = LTrim$(Str$(gGridRows))
  132.    txtCols.Text = LTrim$(Str$(gGridCols))
  133.    chkOnTop.Value = Abs(gOnTop)
  134.    lblItemCount.Caption = "Note: " & Str$(gActualItemCt) & " items total"
  135.    CenterForm Me
  136. End Sub
  137.  
  138. Sub txtCols_KeyPress (KeyAscii As Integer)
  139.    Select Case KeyAscii
  140.      Case 8, 9, 10, 13
  141.      Case Is < Asc("0")
  142.         KeyAscii = 0
  143.      Case Is > Asc("9")
  144.         KeyAscii = 0
  145.    End Select
  146. End Sub
  147.  
  148. Sub txtRows_KeyPress (KeyAscii As Integer)
  149.    Select Case KeyAscii
  150.      Case 8, 9, 10, 13
  151.      Case Is < Asc("0")
  152.         KeyAscii = 0
  153.      Case Is > Asc("9")
  154.         KeyAscii = 0
  155.    End Select
  156. End Sub
  157.  
  158.