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 / dlgProp.frm next >
Text File  |  2006-05-06  |  6KB  |  211 lines

  1. VERSION 5.00
  2. Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
  3. Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
  4. Begin VB.Form dlgProp 
  5.    BackColor       =   &H00000000&
  6.    Caption         =   "Matrix Properties"
  7.    ClientHeight    =   675
  8.    ClientLeft      =   2385
  9.    ClientTop       =   1500
  10.    ClientWidth     =   8115
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    ScaleHeight     =   675
  14.    ScaleMode       =   0  'User
  15.    ScaleWidth      =   7955.881
  16.    Begin MSMask.MaskEdBox txtR 
  17.       Height          =   375
  18.       Left            =   600
  19.       TabIndex        =   2
  20.       Top             =   120
  21.       Width           =   735
  22.       _ExtentX        =   1296
  23.       _ExtentY        =   661
  24.       _Version        =   393216
  25.       Appearance      =   0
  26.       PromptInclude   =   0   'False
  27.       MaxLength       =   12
  28.       Mask            =   "############"
  29.       PromptChar      =   "_"
  30.    End
  31.    Begin MSMask.MaskEdBox txtC 
  32.       Height          =   375
  33.       Left            =   2280
  34.       TabIndex        =   3
  35.       Top             =   120
  36.       Width           =   735
  37.       _ExtentX        =   1296
  38.       _ExtentY        =   661
  39.       _Version        =   393216
  40.       Appearance      =   0
  41.       PromptInclude   =   0   'False
  42.       MaxLength       =   12
  43.       Mask            =   "############"
  44.       PromptChar      =   "_"
  45.    End
  46.    Begin VB.Line Line1 
  47.       BorderColor     =   &H00C0C0C0&
  48.       BorderStyle     =   6  'Inside Solid
  49.       BorderWidth     =   2
  50.       X1              =   117.647
  51.       X2              =   7882.351
  52.       Y1              =   600
  53.       Y2              =   600
  54.    End
  55.    Begin MSForms.CommandButton CancelButton 
  56.       Cancel          =   -1  'True
  57.       Height          =   375
  58.       Left            =   6840
  59.       TabIndex        =   6
  60.       Top             =   120
  61.       Width           =   1215
  62.       ForeColor       =   14737632
  63.       VariousPropertyBits=   19
  64.       Caption         =   "Cancel"
  65.       Size            =   "2143;661"
  66.       TakeFocusOnClick=   0   'False
  67.       FontHeight      =   165
  68.       FontCharSet     =   0
  69.       FontPitchAndFamily=   2
  70.       ParagraphAlign  =   3
  71.    End
  72.    Begin MSForms.CommandButton OKButton 
  73.       Default         =   -1  'True
  74.       Height          =   375
  75.       Left            =   5520
  76.       TabIndex        =   5
  77.       Top             =   120
  78.       Width           =   1215
  79.       ForeColor       =   14737632
  80.       VariousPropertyBits=   19
  81.       Caption         =   "OK"
  82.       Size            =   "2143;661"
  83.       TakeFocusOnClick=   0   'False
  84.       FontHeight      =   165
  85.       FontCharSet     =   0
  86.       FontPitchAndFamily=   2
  87.       ParagraphAlign  =   3
  88.    End
  89.    Begin MSForms.CommandButton cmdChange 
  90.       Height          =   375
  91.       Left            =   3120
  92.       TabIndex        =   4
  93.       Top             =   120
  94.       Width           =   2295
  95.       ForeColor       =   14737632
  96.       VariousPropertyBits=   19
  97.       Caption         =   "Change Matrix Size"
  98.       Size            =   "4048;661"
  99.       TakeFocusOnClick=   0   'False
  100.       FontHeight      =   165
  101.       FontCharSet     =   0
  102.       FontPitchAndFamily=   2
  103.       ParagraphAlign  =   3
  104.    End
  105.    Begin VB.Label Label2 
  106.       Appearance      =   0  'Flat
  107.       AutoSize        =   -1  'True
  108.       BackColor       =   &H80000005&
  109.       BackStyle       =   0  'Transparent
  110.       Caption         =   "COLUMN:"
  111.       ForeColor       =   &H00E0E0E0&
  112.       Height          =   195
  113.       Left            =   1440
  114.       TabIndex        =   1
  115.       Top             =   210
  116.       Width           =   735
  117.    End
  118.    Begin VB.Label Label1 
  119.       Appearance      =   0  'Flat
  120.       AutoSize        =   -1  'True
  121.       BackColor       =   &H80000005&
  122.       BackStyle       =   0  'Transparent
  123.       Caption         =   "ROW:"
  124.       ForeColor       =   &H00E0E0E0&
  125.       Height          =   255
  126.       Left            =   120
  127.       TabIndex        =   0
  128.       Top             =   180
  129.       Width           =   450
  130.    End
  131. End
  132. Attribute VB_Name = "dlgProp"
  133. Attribute VB_GlobalNameSpace = False
  134. Attribute VB_Creatable = False
  135. Attribute VB_PredeclaredId = True
  136. Attribute VB_Exposed = False
  137. 'ht = 980
  138. 'width = 8250
  139.  
  140. Dim where As Integer
  141. Dim newmatrix As New Matrix
  142.  
  143. Option Explicit
  144.  
  145.  
  146. Public Sub showThis(ByVal ind As Integer)
  147.     
  148.     Me.Caption = "Properties of Matrix " & ind
  149.  
  150.     showMatrixFields mymatrix(ind).getRow, mymatrix(ind).getColumn
  151.     openMatrix mymatrix(ind)
  152.     newmatrix.clone mymatrix(ind)
  153.     txtR.Text = mymatrix(ind).getRow
  154.     txtC.Text = mymatrix(ind).getColumn
  155.     where = ind
  156.     Me.Show vbModal
  157.     
  158. End Sub
  159.  
  160. Private Sub CancelButton_Click()
  161.     Unload Me
  162.     
  163. End Sub
  164.  
  165. Private Sub cmdChange_Click()
  166.     Dim row As Integer, col As Integer
  167.     If CInt(txtR.Text) > max Or CInt(txtC.Text) > max Then
  168.         MsgBox "Invalid input!" & vbCrLf & vbCrLf & _
  169.                "Please enter within the range" & vbCrLf & _
  170.                " of the maximum dimension.", vbExclamation, _
  171.                "Matrix dimension error."
  172.     Else
  173.         hideAll
  174.         showMatrixFields CInt(txtR.Text), CInt(txtC.Text)
  175.         newmatrix.Initialize CInt(txtR.Text), CInt(txtC.Text)
  176.         openMatrix newmatrix
  177.         openMatrix mymatrix(where)
  178.         
  179.     End If
  180.     
  181.     
  182. End Sub
  183.  
  184. Private Sub Form_Load()
  185.     ReDim elem(1 To max, 1 To max) As TextBox
  186.     addTillMax
  187.     
  188. End Sub
  189.  
  190. Private Sub OKButton_Click()
  191.     hideAll
  192.     showMatrixFields txtR.Text, txtC.Text
  193.     On Error GoTo onError
  194.     initializeThis newmatrix
  195.     openMatrix newmatrix
  196.     newmatrix.Initialize txtR.Text, txtC.Text
  197.     initializeThis newmatrix
  198.     mymatrix(where).clone newmatrix
  199.     frmMain.txtMat1.Text = mymatrix(1).toString
  200.     frmMain.txtMat2.Text = mymatrix(2).toString
  201.     
  202.     Unload Me
  203.     Exit Sub
  204.     
  205. onError:
  206.     MsgBox "Some inputs are invalid." & _
  207.             "Please review inputs.", vbExclamation
  208.     Exit Sub
  209.     
  210. End Sub
  211.