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 / frmMain.frm < prev    next >
Text File  |  2006-05-06  |  9KB  |  296 lines

  1. VERSION 5.00
  2. Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form frmMain 
  5.    BackColor       =   &H00000000&
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "The Matrix"
  8.    ClientHeight    =   7410
  9.    ClientLeft      =   825
  10.    ClientTop       =   1185
  11.    ClientWidth     =   11220
  12.    FillStyle       =   0  'Solid
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   7410
  17.    ScaleWidth      =   11220
  18.    Begin MSComctlLib.StatusBar statbar 
  19.       Align           =   2  'Align Bottom
  20.       Height          =   255
  21.       Left            =   0
  22.       TabIndex        =   5
  23.       Top             =   7155
  24.       Width           =   11220
  25.       _ExtentX        =   19791
  26.       _ExtentY        =   450
  27.       Style           =   1
  28.       _Version        =   393216
  29.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  30.          NumPanels       =   1
  31.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  32.          EndProperty
  33.       EndProperty
  34.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  35.          Name            =   "Arial"
  36.          Size            =   9
  37.          Charset         =   0
  38.          Weight          =   700
  39.          Underline       =   0   'False
  40.          Italic          =   0   'False
  41.          Strikethrough   =   0   'False
  42.       EndProperty
  43.    End
  44.    Begin VB.ListBox opsList 
  45.       Appearance      =   0  'Flat
  46.       BackColor       =   &H00404040&
  47.       BeginProperty Font 
  48.          Name            =   "Arial"
  49.          Size            =   8.25
  50.          Charset         =   0
  51.          Weight          =   400
  52.          Underline       =   0   'False
  53.          Italic          =   0   'False
  54.          Strikethrough   =   0   'False
  55.       EndProperty
  56.       ForeColor       =   &H00C0C0C0&
  57.       Height          =   1500
  58.       ItemData        =   "frmMain.frx":0000
  59.       Left            =   4350
  60.       List            =   "frmMain.frx":0019
  61.       TabIndex        =   4
  62.       Top             =   720
  63.       Width           =   2535
  64.    End
  65.    Begin MSForms.TextBox txtResult 
  66.       Height          =   2415
  67.       Left            =   3720
  68.       TabIndex        =   3
  69.       TabStop         =   0   'False
  70.       Top             =   4080
  71.       Width           =   3885
  72.       VariousPropertyBits=   -1610594281
  73.       BackColor       =   0
  74.       ForeColor       =   12632256
  75.       BorderStyle     =   1
  76.       ScrollBars      =   3
  77.       Size            =   "6853;4260"
  78.       BorderColor     =   8421504
  79.       SpecialEffect   =   0
  80.       FontName        =   "Lucida Console"
  81.       FontHeight      =   195
  82.       FontCharSet     =   0
  83.       FontPitchAndFamily=   34
  84.       ParagraphAlign  =   3
  85.    End
  86.    Begin MSForms.CommandButton cmdPerform 
  87.       Default         =   -1  'True
  88.       Height          =   615
  89.       Left            =   4350
  90.       TabIndex        =   8
  91.       Top             =   2280
  92.       Width           =   2535
  93.       ForeColor       =   12632256
  94.       BackColor       =   0
  95.       Caption         =   "Perform Selected Operation"
  96.       Size            =   "4471;1085"
  97.       TakeFocusOnClick=   0   'False
  98.       FontName        =   "Arial Narrow"
  99.       FontEffects     =   1073741825
  100.       FontHeight      =   195
  101.       FontCharSet     =   0
  102.       FontPitchAndFamily=   2
  103.       ParagraphAlign  =   3
  104.       FontWeight      =   700
  105.    End
  106.    Begin MSForms.TextBox txtMat1 
  107.       Height          =   2415
  108.       Left            =   400
  109.       TabIndex        =   1
  110.       TabStop         =   0   'False
  111.       Top             =   480
  112.       Width           =   3375
  113.       VariousPropertyBits=   -1610594281
  114.       BackColor       =   14737632
  115.       ForeColor       =   12632256
  116.       BorderStyle     =   1
  117.       ScrollBars      =   3
  118.       Size            =   "5953;4260"
  119.       BorderColor     =   8421504
  120.       SpecialEffect   =   0
  121.       FontName        =   "Lucida Console"
  122.       FontHeight      =   195
  123.       FontCharSet     =   0
  124.       FontPitchAndFamily=   34
  125.       ParagraphAlign  =   3
  126.    End
  127.    Begin MSForms.CommandButton cmdProp2 
  128.       Height          =   495
  129.       Left            =   8040
  130.       TabIndex        =   7
  131.       Top             =   3000
  132.       Width           =   2295
  133.       ForeColor       =   14737632
  134.       BackColor       =   -2147483630
  135.       Caption         =   "Properties of Matrix B"
  136.       Size            =   "4048;873"
  137.       TakeFocusOnClick=   0   'False
  138.       FontName        =   "Arial Narrow"
  139.       FontEffects     =   1073741825
  140.       FontHeight      =   195
  141.       FontCharSet     =   0
  142.       FontPitchAndFamily=   2
  143.       ParagraphAlign  =   3
  144.       FontWeight      =   700
  145.    End
  146.    Begin MSForms.CommandButton cmdProp1 
  147.       Height          =   495
  148.       Left            =   1080
  149.       TabIndex        =   6
  150.       Top             =   3000
  151.       Width           =   2295
  152.       ForeColor       =   14737632
  153.       BackColor       =   -2147483630
  154.       Caption         =   "Properties of Matrix A"
  155.       Size            =   "4048;873"
  156.       TakeFocusOnClick=   0   'False
  157.       FontName        =   "Arial Narrow"
  158.       FontEffects     =   1073741825
  159.       FontHeight      =   195
  160.       FontCharSet     =   0
  161.       FontPitchAndFamily=   2
  162.       ParagraphAlign  =   3
  163.       FontWeight      =   700
  164.    End
  165.    Begin MSForms.TextBox txtMat2 
  166.       Height          =   2415
  167.       Left            =   7440
  168.       TabIndex        =   2
  169.       TabStop         =   0   'False
  170.       Top             =   480
  171.       Width           =   3375
  172.       VariousPropertyBits=   -1610594281
  173.       BackColor       =   0
  174.       ForeColor       =   12632256
  175.       BorderStyle     =   1
  176.       ScrollBars      =   3
  177.       Size            =   "5953;4260"
  178.       BorderColor     =   8421504
  179.       SpecialEffect   =   0
  180.       FontName        =   "Lucida Console"
  181.       FontHeight      =   195
  182.       FontCharSet     =   0
  183.       FontPitchAndFamily=   34
  184.       ParagraphAlign  =   3
  185.    End
  186.    Begin VB.Label Label3 
  187.       AutoSize        =   -1  'True
  188.       BackStyle       =   0  'Transparent
  189.       Caption         =   "Select an operation:"
  190.       BeginProperty Font 
  191.          Name            =   "Arial"
  192.          Size            =   9.75
  193.          Charset         =   0
  194.          Weight          =   700
  195.          Underline       =   0   'False
  196.          Italic          =   0   'False
  197.          Strikethrough   =   0   'False
  198.       EndProperty
  199.       ForeColor       =   &H00FFFFFF&
  200.       Height          =   240
  201.       Left            =   4320
  202.       TabIndex        =   0
  203.       Top             =   480
  204.       Width           =   1935
  205.    End
  206.    Begin MSForms.Image Image3 
  207.       Height          =   7980
  208.       Left            =   -50
  209.       Top             =   -570
  210.       Width           =   11340
  211.       Size            =   "20002;14076"
  212.       Picture         =   "frmMain.frx":00E1
  213.    End
  214.    Begin VB.Menu mufile 
  215.       Caption         =   "File"
  216.       Index           =   0
  217.       Begin VB.Menu misett 
  218.          Caption         =   "Settings"
  219.       End
  220.       Begin VB.Menu miexit 
  221.          Caption         =   "EXIT"
  222.       End
  223.    End
  224. End
  225. Attribute VB_Name = "frmMain"
  226. Attribute VB_GlobalNameSpace = False
  227. Attribute VB_Creatable = False
  228. Attribute VB_PredeclaredId = True
  229. Attribute VB_Exposed = False
  230. Private Sub cmdPerform_Click()
  231.     Dim index As Integer
  232.     Dim result As New Matrix
  233.     index = opsList.ListIndex
  234.     Dim com As String
  235.     com = check(index)
  236.     If com <> "" Then
  237.         MsgBox com, vbExclamation, "ERROR"
  238.         Exit Sub
  239.     End If
  240.     
  241.     Select Case index
  242.         Case 0, 1, 2, 3, 4
  243.             Select Case index
  244.             Case 0
  245.                 Set result = Addition(mymatrix(1), mymatrix(2))
  246.             Case 1
  247.                 Set result = Subtraction(mymatrix(1), mymatrix(2))
  248.             Case 2
  249.                 Set result = Subtraction(mymatrix(2), mymatrix(1))
  250.             Case 3
  251.                 Set result = Multiplication(mymatrix(1), mymatrix(2))
  252.             Case 4
  253.                 Set result = Multiplication(mymatrix(2), mymatrix(1))
  254.             End Select
  255.             txtResult.Text = result.toString
  256.             
  257.         Case 5, 6
  258.             dlgScal.showThis index - 4
  259.             
  260.     End Select
  261.     
  262. End Sub
  263.  
  264. Private Sub cmdProp1_Click()
  265.     dlgProp.showThis 1
  266.     
  267. End Sub
  268.  
  269. Private Sub cmdProp2_Click()
  270.     dlgProp.showThis 2
  271.     
  272. End Sub
  273.  
  274. Private Sub Form_Load()
  275.     opsList.ListIndex = 0
  276.     max = 10
  277.    
  278.     mymatrix(1).Initialize 1, 1
  279.     mymatrix(2).Initialize 1, 1
  280.     
  281.     txtMat1.Text = mymatrix(1).toString
  282.     txtMat2.Text = mymatrix(2).toString
  283.     statbar.SimpleText = "Current maximum square matrix dimension is " & max & "."
  284. End Sub
  285.  
  286. Private Sub miexit_Click()
  287.     Unload Me
  288.     
  289. End Sub
  290.  
  291. Private Sub misett_Click()
  292.     dlgSettings.Show vbModal
  293.     
  294. End Sub
  295.  
  296.