mdiform.frm

来自「吃豆子游戏的源代码。 嘿嘿」· FRM 代码 · 共 297 行

FRM
297
字号
VERSION 5.00
Begin VB.MDIForm MDIFrm 
   BackColor       =   &H8000000C&
   Caption         =   "Pacman Level Editor,  E-Mail VB@Arvinder.co.uk"
   ClientHeight    =   6690
   ClientLeft      =   165
   ClientTop       =   450
   ClientWidth     =   11880
   Icon            =   "MdiForm.frx":0000
   LinkTopic       =   "MDIForm1"
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin VB.PictureBox Picture1 
      Align           =   2  'Align Bottom
      Height          =   330
      Left            =   0
      ScaleHeight     =   270
      ScaleWidth      =   11820
      TabIndex        =   11
      Top             =   6360
      Width           =   11880
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         Caption         =   "To Make Drawing Easier, Hold Down Shift While Moving The Mouse. DO NOT HOLD DOWN ANY MOUSE BUTTONS!"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   240
         Left            =   45
         TabIndex        =   12
         Top             =   45
         Width           =   11760
      End
   End
   Begin VB.PictureBox ToolBar 
      Align           =   1  'Align Top
      BorderStyle     =   0  'None
      Height          =   510
      Left            =   0
      ScaleHeight     =   510
      ScaleWidth      =   11880
      TabIndex        =   0
      Top             =   0
      Width           =   11880
      Begin VB.OptionButton NewWall 
         Height          =   400
         Left            =   870
         Style           =   1  'Graphical
         TabIndex        =   10
         Top             =   45
         UseMaskColor    =   -1  'True
         Value           =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewBerry 
         Height          =   400
         Left            =   1530
         MaskColor       =   &H00FFFFFF&
         Style           =   1  'Graphical
         TabIndex        =   9
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewCherry 
         Height          =   400
         Left            =   2175
         Style           =   1  'Graphical
         TabIndex        =   8
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewBeer 
         Height          =   400
         Left            =   4770
         MaskColor       =   &H00FF00FF&
         Style           =   1  'Graphical
         TabIndex        =   7
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewLife 
         Height          =   400
         Left            =   4125
         MaskColor       =   &H00FF00FF&
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewGhoul 
         Height          =   400
         Left            =   3480
         MaskColor       =   &H00FF00FF&
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewShield 
         Height          =   400
         Left            =   2820
         MaskColor       =   &H00FF00FF&
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton PacMan 
         Height          =   400
         Left            =   6075
         MaskColor       =   &H00000000&
         Style           =   1  'Graphical
         TabIndex        =   3
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewFood 
         Height          =   400
         Left            =   5400
         MaskColor       =   &H00FFFF00&
         Style           =   1  'Graphical
         TabIndex        =   2
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.OptionButton NewFloor 
         BackColor       =   &H00004080&
         Height          =   400
         Left            =   225
         Style           =   1  'Graphical
         TabIndex        =   1
         Top             =   45
         UseMaskColor    =   -1  'True
         Width           =   400
      End
      Begin VB.Shape IsDis 
         BorderStyle     =   2  'Dash
         Height          =   645
         Left            =   -135
         Top             =   -45
         Width           =   12075
      End
   End
   Begin VB.Menu FileMnu 
      Caption         =   "&File"
      Begin VB.Menu NewForm 
         Caption         =   "&New Map"
      End
      Begin VB.Menu MnuSep2 
         Caption         =   "-"
      End
      Begin VB.Menu OpenMnu 
         Caption         =   "&Open Map"
      End
      Begin VB.Menu MnuSep1 
         Caption         =   "-"
      End
      Begin VB.Menu Exitmnu 
         Caption         =   "&Exit"
      End
   End
End
Attribute VB_Name = "MDIFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub ExitMnu_Click()
 Unload Me
 End
End Sub

Private Sub MDIForm_Load()
 'load the first form & the pictures
 IsLoaded = False
 Load FirstForm
 FirstForm.Visible = False
 ' load the object pictures from the child edit form
 Me.NewBeer.Picture = EditFrm.NewBeer.Picture
 Me.NewFood.Picture = EditFrm.NewFood.Picture
 Me.NewBerry.Picture = EditFrm.NewBerry.Picture
 Me.NewGhoul.Picture = EditFrm.NewGhoul.Picture
 Me.PacMan.Picture = EditFrm.PacMan.Picture
 Me.NewShield.Picture = EditFrm.NewShield.Picture
 Me.NewWall.Picture = EditFrm.NewWall.Picture
 Me.NewCherry.Picture = EditFrm.NewCherry.Picture
 Me.NewLife.Picture = EditFrm.NewLife.Picture
 'set the disabled selector indicator to the coorect size
 IsDis.Top = -45
 IsDis.Left = -45
End Sub

'unload all open windows
Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)
 On Error Resume Next
 Unload FirstForm
 Unload EditForm
 Load LoadingForm
 LoadingForm.Refresh
 LoadingForm.MainTitle.Caption = "Unloading Level Editor..."
 LoadingForm.Info.Caption = "Please Wait..."
 LoadingForm.Refresh
 Dim I As Integer
 For I = 0 To (NumFrms + 1)
  LoadingForm.UpdPer I, (NumFrms + 1)
  Unload nEdit(I)
 Next
 Unload LoadingForm
 End
End Sub

Private Sub MDIForm_Resize()
'set the disabled selector indicator to the coorect size
IsDis.Width = Me.Width + 90
IsDis.Height = Me.Height + 90
End Sub

' when the object selection is changed here, change it on the active form
Private Sub NewBerry_Click()
 nForm.NewBerry.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewCherry_Click()
 nForm.NewCherry.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewFood_Click()
 nForm.NewFood.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewWall_Click()
 nForm.NewWall.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewShield_Click()
 nForm.NewShield.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewGhoul_Click()
 nForm.NewGhoul.Value = True
End Sub
'open a level
Private Sub OpenMnu_Click()

Dim NewWin As EditFrm     '
Set NewWin = New EditFrm  '\
Load NewWin               ' |---- Load a new window and hide it. errors ocurr if this is not done, i'm not sure why.
NewWin.Visible = False    '/
SetForm NewWin            '

NewWin.OpenMnu_Click      ' open the level

Do While OpenIsFinished = False 'wait until it's finished
 DoEvents
Loop

Unload NewWin 'unload the new (blank Window)

End Sub
' when the object selection is changed here, change it on the active form
Private Sub PacMan_Click()
 nForm.PacMan.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewBeer_Click()
 nForm.NewBeer.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewFloor_Click()
 nForm.NewFloor.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewLife_Click()
 nForm.NewLife.Value = True
End Sub
' when the object selection is changed here, change it on the active form
Private Sub NewForm_Click()
 NumFrms = NumFrms + 1
 Set nEdit(NumFrms) = New EditFrm
 Load nEdit(NumFrms)
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?