home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / jpi / mainfrm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-12-02  |  4.7 KB  |  166 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Object Editor"
  5.    ClientHeight    =   2055
  6.    ClientLeft      =   4365
  7.    ClientTop       =   2295
  8.    ClientWidth     =   6585
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   2055
  13.    ScaleWidth      =   6585
  14.    Begin VB.CommandButton Command3 
  15.       Caption         =   "About"
  16.       Height          =   255
  17.       Left            =   3240
  18.       TabIndex        =   7
  19.       Top             =   1680
  20.       Width           =   975
  21.    End
  22.    Begin VB.CommandButton Command2 
  23.       Caption         =   "Revert"
  24.       Height          =   255
  25.       Left            =   1200
  26.       TabIndex        =   6
  27.       Top             =   1680
  28.       Width           =   975
  29.    End
  30.    Begin VB.CommandButton Command1 
  31.       Caption         =   "Save"
  32.       Height          =   255
  33.       Left            =   120
  34.       TabIndex        =   5
  35.       Top             =   1680
  36.       Width           =   975
  37.    End
  38.    Begin VB.ComboBox Combo1 
  39.       Height          =   315
  40.       Left            =   120
  41.       Style           =   2  'Dropdown List
  42.       TabIndex        =   4
  43.       Top             =   480
  44.       Visible         =   0   'False
  45.       Width           =   4095
  46.    End
  47.    Begin VB.TextBox Text1 
  48.       Height          =   285
  49.       Left            =   120
  50.       Locked          =   -1  'True
  51.       TabIndex        =   3
  52.       Text            =   "TagName"
  53.       Top             =   120
  54.       Width           =   4095
  55.    End
  56.    Begin VB.HScrollBar HScroll1 
  57.       Height          =   255
  58.       Left            =   120
  59.       Max             =   100
  60.       Min             =   1
  61.       TabIndex        =   2
  62.       Top             =   840
  63.       Value           =   1
  64.       Width           =   4095
  65.    End
  66.    Begin VB.TextBox Text2 
  67.       Height          =   285
  68.       Left            =   120
  69.       TabIndex        =   1
  70.       Top             =   480
  71.       Width           =   4095
  72.    End
  73.    Begin VB.ListBox List1 
  74.       Height          =   1815
  75.       Left            =   4320
  76.       TabIndex        =   0
  77.       Top             =   120
  78.       Width           =   2175
  79.    End
  80. Attribute VB_Name = "Form1"
  81. Attribute VB_GlobalNameSpace = False
  82. Attribute VB_Creatable = False
  83. Attribute VB_PredeclaredId = True
  84. Attribute VB_Exposed = False
  85. Private Sub Combo1_Click()
  86. If Combo1.Text <> "" Then Objects(CObj).Tags(Form1.HScroll1.Value) = Combo1.Text
  87. End Sub
  88. Private Sub Command1_Click()
  89. Call SaveObjz
  90. End Sub
  91. Private Sub Command2_Click()
  92. Call LoadObjz
  93. End Sub
  94. Private Sub Command3_Click()
  95. AboutFrm.Show
  96. End Sub
  97. Private Sub Form_Load()
  98. Form1.List1.AddItem "[New Object]"
  99. Call LoadObjectTags
  100. Call LoadObjz
  101. If Form1.List1.ListCount = 1 Then Form1.List1.ListIndex = 0 Else Form1.List1.ListIndex = 1
  102. End Sub
  103. Private Sub Form_Unload(Cancel As Integer)
  104. Style = vbYesNo
  105. Response = MsgBox("Save Changes?", Style)
  106. If Response = vbYes Then
  107.   Call SaveObjz
  108. End If
  109. End Sub
  110. Private Sub HScroll1_Change()
  111. DoEvents
  112. Call UpdatePage
  113. End Sub
  114. Private Sub List1_Click()
  115. If CObj <> List1.ListIndex Then
  116.     CObj = List1.ListIndex
  117.     If List1.ListIndex = 0 Then
  118.       If HScroll1.Value <> 1 Then HScroll1.Value = 1: DoEvents: Call UpdatePage
  119.       HScroll1.Enabled = False
  120.     Else
  121.       HScroll1.Enabled = True
  122.     End If
  123.     If List1.ListIndex = 0 Then HScroll1.Value = 1
  124.     Call UpdatePage
  125. End If
  126. End Sub
  127. Private Sub List1_KeyDown(KeyCode As Integer, Shift As Integer)
  128. If KeyCode = 46 Then 'delete
  129.   If List1.ListIndex <> 0 Then
  130.     pp = List1.ListIndex
  131.     For i = List1.ListIndex To MAXOBJZ - 1
  132.       Objects(i).active = Objects(i + 1).active
  133.       For i2 = 1 To TAGDEFMAX
  134.         Objects(i).Tags(i2) = Objects(i + 1).Tags(i2)
  135.       Next i2
  136.     Next i
  137.     Objects(MAXOBJZ).active = False
  138.     For i2 = 1 To TAGDEFMAX
  139.       Objects(MAXOBJZ).Tags(i2) = ""
  140.     Next i2
  141.     List1.ListIndex = pp - 1
  142.     Call UpdatePage
  143.   End If
  144. End If
  145. End Sub
  146. Private Sub Text2_Change()
  147. If Text2.Text <> "-Enter a value-" Then
  148.     If List1.ListIndex = 0 Then
  149.       For i = 1 To MAXOBJZ
  150.         If Objects(i).active = False Then
  151.           Objects(i).active = True
  152.           CObj = i
  153.           Objects(CObj).Tags(1) = Text2.Text
  154.           SS = Text2.SelStart
  155.           Call UpdatePage
  156.           List1.ListIndex = List1.ListCount - 1
  157.           Text2.SelStart = SS
  158.           Exit For
  159.         End If
  160.       Next i
  161.     End If
  162. End If
  163. If Text2.Text <> "-Enter a value-" Then If List1.ListIndex <> 0 Then Objects(CObj).Tags(Form1.HScroll1.Value) = Text2.Text
  164. Call UpdatePage
  165. End Sub
  166.