home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / TK_BAR / CONFIG.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-11-20  |  4.3 KB  |  148 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. Option Explicit
  103. Sub cmdCancel_Click ()
  104.   Unload Me
  105. End Sub
  106. Sub cmdOk_Click ()
  107. Dim Cond1%, Cond2%
  108.    Cond1 = (Val(txtRows.Text) <= 0 Or Val(txtCols.Text) <= 0)
  109.    Cond2 = ((Val(txtRows.Text) * Val(txtCols.Text)) < gActualItemCt)
  110.    If Cond1 Or Cond2 Then
  111.       MsgBadNews "Invalid grid size setting."
  112.    Else
  113.       gOnTop = (chkOnTop.Value = 1)
  114.       gGridRows = Val(txtRows.Text)
  115.       gGridCols = Val(txtCols.Text)
  116.       Unload Me
  117.       ButtonBarDraw
  118.    End If
  119. End Sub
  120. Sub Form_KeyPress (KeyAscii As Integer)
  121.   If KeyAscii = 27 Then Call cmdCancel_Click
  122. End Sub
  123. Sub Form_Load ()
  124.    txtRows.Text = LTrim$(Str$(gGridRows))
  125.    txtCols.Text = LTrim$(Str$(gGridCols))
  126.    chkOnTop.Value = Abs(gOnTop)
  127.    lblItemCount.Caption = "Note: " & Str$(gActualItemCt) & " items total"
  128.    CenterForm Me
  129. End Sub
  130. Sub txtCols_KeyPress (KeyAscii As Integer)
  131.    Select Case KeyAscii
  132.      Case 8, 9, 10, 13
  133.      Case Is < Asc("0")
  134.         KeyAscii = 0
  135.      Case Is > Asc("9")
  136.         KeyAscii = 0
  137.    End Select
  138. End Sub
  139. Sub txtRows_KeyPress (KeyAscii As Integer)
  140.    Select Case KeyAscii
  141.      Case 8, 9, 10, 13
  142.      Case Is < Asc("0")
  143.         KeyAscii = 0
  144.      Case Is > Asc("9")
  145.         KeyAscii = 0
  146.    End Select
  147. End Sub
  148.