home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / The_Matrix199261572006.psc / forms / dlgSettings.frm < prev    next >
Text File  |  2006-05-06  |  5KB  |  146 lines

  1. VERSION 5.00
  2. Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
  3. Begin VB.Form dlgSettings 
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "Matrices Settings"
  7.    ClientHeight    =   1440
  8.    ClientLeft      =   1215
  9.    ClientTop       =   2055
  10.    ClientWidth     =   2325
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1440
  16.    ScaleWidth      =   2325
  17.    ShowInTaskbar   =   0   'False
  18.    Begin VB.TextBox txtmax 
  19.       Alignment       =   2  'Center
  20.       Appearance      =   0  'Flat
  21.       BackColor       =   &H00404040&
  22.       BorderStyle     =   0  'None
  23.       BeginProperty Font 
  24.          Name            =   "Verdana"
  25.          Size            =   12
  26.          Charset         =   0
  27.          Weight          =   700
  28.          Underline       =   0   'False
  29.          Italic          =   0   'False
  30.          Strikethrough   =   0   'False
  31.       EndProperty
  32.       ForeColor       =   &H00FFFFFF&
  33.       Height          =   390
  34.       Left            =   315
  35.       TabIndex        =   1
  36.       ToolTipText     =   "Enter a valid maximum matrix dimension here."
  37.       Top             =   480
  38.       Width           =   1695
  39.    End
  40.    Begin MSForms.CommandButton CancelButton 
  41.       Cancel          =   -1  'True
  42.       Height          =   375
  43.       Left            =   1200
  44.       TabIndex        =   3
  45.       Top             =   960
  46.       Width           =   975
  47.       ForeColor       =   14737632
  48.       VariousPropertyBits=   19
  49.       Caption         =   "Cancel"
  50.       Size            =   "1720;661"
  51.       TakeFocusOnClick=   0   'False
  52.       FontHeight      =   165
  53.       FontCharSet     =   0
  54.       FontPitchAndFamily=   2
  55.       ParagraphAlign  =   3
  56.    End
  57.    Begin MSForms.CommandButton OKButton 
  58.       Default         =   -1  'True
  59.       Height          =   375
  60.       Left            =   120
  61.       TabIndex        =   2
  62.       Top             =   960
  63.       Width           =   975
  64.       ForeColor       =   14737632
  65.       VariousPropertyBits=   19
  66.       Caption         =   "OK"
  67.       Size            =   "1720;661"
  68.       TakeFocusOnClick=   0   'False
  69.       FontHeight      =   165
  70.       FontCharSet     =   0
  71.       FontPitchAndFamily=   2
  72.       ParagraphAlign  =   3
  73.    End
  74.    Begin VB.Label Label1 
  75.       AutoSize        =   -1  'True
  76.       BackStyle       =   0  'Transparent
  77.       Caption         =   "Maximum Matrix Dimension:"
  78.       ForeColor       =   &H00C0C0C0&
  79.       Height          =   195
  80.       Left            =   120
  81.       TabIndex        =   0
  82.       Top             =   240
  83.       Width           =   1950
  84.    End
  85. End
  86. Attribute VB_Name = "dlgSettings"
  87. Attribute VB_GlobalNameSpace = False
  88. Attribute VB_Creatable = False
  89. Attribute VB_PredeclaredId = True
  90. Attribute VB_Exposed = False
  91.  
  92. Option Explicit
  93.  
  94. Private Sub CancelButton_Click()
  95.     Unload Me
  96.     
  97. End Sub
  98.  
  99. Private Sub Form_Load()
  100.     txtmax.Text = max
  101.     
  102. End Sub
  103.  
  104. Private Sub OKButton_Click()
  105.     If IsNumeric(txtmax.Text) = False Or CInt(txtmax.Text) = 0 Then
  106.         MsgBox "Invalid input!", vbCritical, "ERROR"
  107.         Exit Sub
  108.     Else
  109.         Dim choice As Integer
  110.         Dim tmpmax As Integer
  111.         tmpmax = txtmax.Text
  112.         
  113.         If tmpmax < mymatrix(1).getColumn Or tmpmax < mymatrix(1).getRow Or _
  114.             tmpmax < mymatrix(2).getColumn Or tmpmax < mymatrix(2).getRow Then
  115.             Dim str As String
  116.             str = "The program has detected that there exists a matrix having a " & _
  117.                 "dimension greater than the newly specified dimension limit. " & vbCrLf & _
  118.                 "Continuing will reset the matrix with the dimension greater " & _
  119.                 "than the specified maximum dimension." & vbCrLf & vbCrLf & _
  120.                 "Do you want to continue?"
  121.             choice = MsgBox(str, vbYesNoCancel + vbQuestion, "Verification")
  122.             Select Case choice
  123.                 Case 6
  124.                     If tmpmax < mymatrix(1).getColumn Or tmpmax < mymatrix(1).getRow Then
  125.                         mymatrix(1).Initialize 1, 1
  126.                         frmMain.txtMat1.Text = mymatrix(1).toString
  127.                     End If
  128.                     If tmpmax < mymatrix(2).getColumn Or tmpmax < mymatrix(2).getRow Then
  129.                         mymatrix(2).Initialize 1, 1
  130.                         frmMain.txtMat2.Text = mymatrix(2).toString
  131.                     End If
  132.                     
  133.                     max = txtmax.Text
  134.                     frmMain.statbar.SimpleText = "Current maximum square matrix dimension is " & max & "."
  135.                     Unload Me
  136.                     
  137.                 Case 7
  138.                     Unload Me
  139.                 Case 2
  140.                     Exit Sub
  141.             End Select
  142.         End If
  143.         Unload Me
  144.     End If
  145. End Sub
  146.