home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Binary_fil52375222002.psc / frmMapOptions.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-02-02  |  4.5 KB  |  149 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMapOptions 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Map Options"
  5.    ClientHeight    =   2190
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2910
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   2190
  13.    ScaleWidth      =   2910
  14.    StartUpPosition =   1  'CenterOwner
  15.    Begin VB.CommandButton cmdCancel 
  16.       Caption         =   "Cancel"
  17.       Height          =   375
  18.       Left            =   1680
  19.       TabIndex        =   5
  20.       Top             =   1680
  21.       Width           =   1095
  22.    End
  23.    Begin VB.ComboBox cboDifficulty 
  24.       Height          =   315
  25.       Left            =   960
  26.       Style           =   2  'Dropdown List
  27.       TabIndex        =   3
  28.       Top             =   1200
  29.       Width           =   1815
  30.    End
  31.    Begin VB.TextBox txtAuthor 
  32.       Height          =   285
  33.       Left            =   960
  34.       TabIndex        =   2
  35.       Top             =   840
  36.       Width           =   1815
  37.    End
  38.    Begin VB.TextBox txtTitle 
  39.       Height          =   285
  40.       Left            =   960
  41.       TabIndex        =   1
  42.       Top             =   480
  43.       Width           =   1815
  44.    End
  45.    Begin VB.CommandButton cmdOK 
  46.       Caption         =   "OK"
  47.       Height          =   375
  48.       Left            =   120
  49.       TabIndex        =   4
  50.       Top             =   1680
  51.       Width           =   1095
  52.    End
  53.    Begin VB.TextBox txtPassword 
  54.       Height          =   285
  55.       IMEMode         =   3  'DISABLE
  56.       Left            =   960
  57.       PasswordChar    =   "*"
  58.       TabIndex        =   0
  59.       Top             =   120
  60.       Width           =   1815
  61.    End
  62.    Begin VB.Label Label4 
  63.       Caption         =   "Password:"
  64.       Height          =   255
  65.       Left            =   120
  66.       TabIndex        =   9
  67.       Top             =   120
  68.       Width           =   855
  69.    End
  70.    Begin VB.Label Label3 
  71.       Caption         =   "Difficulty:"
  72.       Height          =   255
  73.       Left            =   240
  74.       TabIndex        =   8
  75.       Top             =   1200
  76.       Width           =   735
  77.    End
  78.    Begin VB.Label Label2 
  79.       Caption         =   "Author:"
  80.       Height          =   255
  81.       Left            =   360
  82.       TabIndex        =   7
  83.       Top             =   840
  84.       Width           =   615
  85.    End
  86.    Begin VB.Label Label1 
  87.       Caption         =   "Title:"
  88.       Height          =   255
  89.       Left            =   480
  90.       TabIndex        =   6
  91.       Top             =   480
  92.       Width           =   375
  93.    End
  94. Attribute VB_Name = "frmMapOptions"
  95. Attribute VB_GlobalNameSpace = False
  96. Attribute VB_Creatable = False
  97. Attribute VB_PredeclaredId = True
  98. Attribute VB_Exposed = False
  99. Option Explicit
  100. Private Sub cmdCancel_Click()
  101.     'We don't have a bin labled "Recycle" so
  102.     'instead let's unload the form
  103.     Unload Me
  104. End Sub
  105. Private Sub cmdOK_Click()
  106.     'The user has set a password for this map
  107.     'and clicked the "OK" button. I was going
  108.     'to write about my whole life here, but
  109.     'I thought that if anyone were to use this
  110.     'feature, they would be awful mad that it
  111.     'didn't work, so I threw some code in here ;)
  112.     Map.Password = txtPassword.Text
  113.     Map.Title = txtTitle.Text
  114.     Map.Author = txtAuthor.Text
  115.     'Not very impressive; just another Select...End Select case
  116.     'I could have assigned the text value to the file and read it
  117.     'in as text, but I didn't wanna ;)
  118.     Select Case cboDifficulty.Text
  119.         Case "Novice"
  120.             Map.Difficulty = 1
  121.         Case "Easy"
  122.             Map.Difficulty = 2
  123.         Case "Medium"
  124.             Map.Difficulty = 3
  125.         Case "Hard"
  126.             Map.Difficulty = 4
  127.         Case "Hardest"
  128.             Map.Difficulty = 5
  129.     End Select
  130.     'The user might want to know which map or file they are working on
  131.     If Map.Title <> "" Then
  132.         frmMain.Caption = App.Title & " [" & Map.Title & "]"
  133.     ElseIf frmMain.dlgCD.FileName <> "" Then
  134.         frmMain.Caption = App.Title & " [" & frmMain.dlgCD.FileName & "]"
  135.     Else
  136.         frmMain.Caption = App.Title & " [Untitled]"
  137.     End If
  138.     Unload Me
  139. End Sub
  140. Private Sub Form_Load()
  141.     'Let's set the defaults for the user
  142.     cboDifficulty.AddItem "Novice"
  143.     cboDifficulty.AddItem "Easy"
  144.     cboDifficulty.AddItem "Medium"
  145.     cboDifficulty.AddItem "Hard"
  146.     cboDifficulty.AddItem "Hardest"
  147.     cboDifficulty.ListIndex = 0
  148. End Sub
  149.