home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / apuzzle / pform2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-09-27  |  9.4 KB  |  312 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Begin VB.Form PForm2 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   4560
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   6270
  9.    ControlBox      =   0   'False
  10.    LinkTopic       =   "Form1"
  11.    Moveable        =   0   'False
  12.    ScaleHeight     =   4560
  13.    ScaleWidth      =   6270
  14.    StartUpPosition =   1  'CenterOwner
  15.    Begin VB.Frame Frame3 
  16.       Caption         =   "Pieces"
  17.       BeginProperty Font 
  18.          Name            =   "MS Sans Serif"
  19.          Size            =   12
  20.          Charset         =   0
  21.          Weight          =   700
  22.          Underline       =   0   'False
  23.          Italic          =   0   'False
  24.          Strikethrough   =   0   'False
  25.       EndProperty
  26.       Height          =   1365
  27.       Left            =   2115
  28.       TabIndex        =   4
  29.       Top             =   3060
  30.       Width           =   1995
  31.       Begin VB.OptionButton Option1 
  32.          Caption         =   "35 (7  X 5)"
  33.          Height          =   240
  34.          Index           =   3
  35.          Left            =   180
  36.          TabIndex        =   11
  37.          Top             =   270
  38.          Width           =   1500
  39.       End
  40.       Begin VB.OptionButton Option1 
  41.          Caption         =   "48 (8 X 6)"
  42.          Height          =   240
  43.          Index           =   0
  44.          Left            =   180
  45.          TabIndex        =   7
  46.          Top             =   540
  47.          Width           =   1500
  48.       End
  49.       Begin VB.OptionButton Option1 
  50.          Caption         =   "80 (10 X 8)"
  51.          Height          =   240
  52.          Index           =   1
  53.          Left            =   180
  54.          TabIndex        =   6
  55.          Top             =   810
  56.          Width           =   1500
  57.       End
  58.       Begin VB.OptionButton Option1 
  59.          Caption         =   "120 (12  X 10)"
  60.          Height          =   240
  61.          Index           =   2
  62.          Left            =   180
  63.          TabIndex        =   5
  64.          Top             =   1080
  65.          Width           =   1500
  66.       End
  67.    End
  68.    Begin VB.Frame Frame1 
  69.       Caption         =   "Picture"
  70.       BeginProperty Font 
  71.          Name            =   "MS Sans Serif"
  72.          Size            =   12
  73.          Charset         =   0
  74.          Weight          =   700
  75.          Underline       =   0   'False
  76.          Italic          =   0   'False
  77.          Strikethrough   =   0   'False
  78.       EndProperty
  79.       Height          =   3030
  80.       Left            =   2115
  81.       TabIndex        =   3
  82.       Top             =   0
  83.       Width           =   4065
  84.       Begin VB.Frame Frame2 
  85.          Height          =   1230
  86.          Left            =   0
  87.          TabIndex        =   8
  88.          Top             =   855
  89.          Visible         =   0   'False
  90.          Width           =   4065
  91.          Begin ComctlLib.ProgressBar PBar1 
  92.             Height          =   150
  93.             Left            =   135
  94.             TabIndex        =   10
  95.             Top             =   900
  96.             Width           =   3750
  97.             _ExtentX        =   6615
  98.             _ExtentY        =   265
  99.             _Version        =   327682
  100.             Appearance      =   0
  101.          End
  102.          Begin VB.Label Label1 
  103.             Alignment       =   2  'Center
  104.             BorderStyle     =   1  'Fixed Single
  105.             Caption         =   "Making the puzzle"
  106.             BeginProperty Font 
  107.                Name            =   "MS Sans Serif"
  108.                Size            =   13.5
  109.                Charset         =   0
  110.                Weight          =   700
  111.                Underline       =   0   'False
  112.                Italic          =   0   'False
  113.                Strikethrough   =   0   'False
  114.             EndProperty
  115.             ForeColor       =   &H00FF0000&
  116.             Height          =   420
  117.             Left            =   135
  118.             TabIndex        =   9
  119.             Top             =   225
  120.             Width           =   3795
  121.          End
  122.       End
  123.       Begin VB.Image Image1 
  124.          Height          =   2500
  125.          Left            =   270
  126.          Stretch         =   -1  'True
  127.          Top             =   315
  128.          Width           =   3500
  129.       End
  130.    End
  131.    Begin VB.CommandButton Command2 
  132.       Caption         =   "EXIT"
  133.       BeginProperty Font 
  134.          Name            =   "Tahoma"
  135.          Size            =   12
  136.          Charset         =   0
  137.          Weight          =   700
  138.          Underline       =   0   'False
  139.          Italic          =   0   'False
  140.          Strikethrough   =   0   'False
  141.       EndProperty
  142.       Height          =   375
  143.       Left            =   4905
  144.       TabIndex        =   2
  145.       Top             =   3825
  146.       Width           =   1050
  147.    End
  148.    Begin VB.CommandButton Command1 
  149.       Caption         =   "OK"
  150.       BeginProperty Font 
  151.          Name            =   "Tahoma"
  152.          Size            =   12
  153.          Charset         =   0
  154.          Weight          =   700
  155.          Underline       =   0   'False
  156.          Italic          =   0   'False
  157.          Strikethrough   =   0   'False
  158.       EndProperty
  159.       Height          =   375
  160.       Left            =   4905
  161.       TabIndex        =   1
  162.       Top             =   3285
  163.       Width           =   1050
  164.    End
  165.    Begin VB.FileListBox File1 
  166.       Height          =   4185
  167.       Left            =   45
  168.       TabIndex        =   0
  169.       Top             =   90
  170.       Width           =   1995
  171.    End
  172. Attribute VB_Name = "PForm2"
  173. Attribute VB_GlobalNameSpace = False
  174. Attribute VB_Creatable = False
  175. Attribute VB_PredeclaredId = True
  176. Attribute VB_Exposed = False
  177. Option Explicit
  178. Private Sub Command1_Click()
  179. If clickbit = 0 Then Exit Sub
  180. Frame2.Visible = True
  181. DoEvents
  182. '---------------------
  183. frmMain.Pic1(0).Visible = False
  184. If Pieces > 2 Then
  185. PBar1.Min = 1: PBar1.Max = Pieces - 1
  186. For xx = 1 To Pieces - 1
  187. Unload frmMain.Pic1(xx)
  188. PBar1.Value = xx
  189. Next xx
  190. End If
  191. PBar1.Min = 0: PBar1.Max = 119
  192. For xx = 0 To 119
  193. PForm3.Pic1(xx).Visible = False
  194. PBar1.Value = xx
  195. Next xx
  196. '----------------------
  197. frmMain.PicClip1.Picture = LoadPicture(PicNam)
  198. PicWidth = frmMain.PicClip1.Width
  199. PicHeight = frmMain.PicClip1.Height
  200. If Option1(0).Value = True Then
  201. Pieces = 48
  202. frmMain.PicClip1.Cols = 8: frmMain.PicClip1.Rows = 6
  203. frmMain.Grid1.Cols = 8: frmMain.Grid1.Rows = 6
  204. GrCol = 8: GrRow = 6
  205. End If
  206. If Option1(1).Value = True Then
  207. Pieces = 80
  208. frmMain.PicClip1.Cols = 10: frmMain.PicClip1.Rows = 8
  209. frmMain.Grid1.Cols = 10: frmMain.Grid1.Rows = 8
  210. GrCol = 10: GrRow = 8
  211. End If
  212. If Option1(2).Value = True Then
  213. Pieces = 120
  214. frmMain.PicClip1.Cols = 12: frmMain.PicClip1.Rows = 10
  215. frmMain.Grid1.Cols = 12: frmMain.Grid1.Rows = 10
  216. GrCol = 12: GrRow = 10
  217. End If
  218. If Option1(3).Value = True Then
  219. Pieces = 35
  220. frmMain.PicClip1.Cols = 7: frmMain.PicClip1.Rows = 5
  221. frmMain.Grid1.Cols = 7: frmMain.Grid1.Rows = 5
  222. GrCol = 7: GrRow = 5
  223. End If
  224. For t = 1 To Pieces - 1
  225. PBar1.Min = 1: PBar1.Max = Pieces - 1
  226. Load frmMain.Pic1(t)
  227. Randomize
  228. frmMain.Pic1(t).Left = Int((Rnd * 700) + 25)
  229. Randomize
  230. frmMain.Pic1(t).Top = Int((Rnd * 450) + 50)
  231. frmMain.Pic1(t).ZOrder 0
  232. PBar1.Value = t
  233. Next t
  234. Randomize
  235. frmMain.Pic1(0).Left = Int((Rnd * 700) + 25)
  236. Randomize
  237. frmMain.Pic1(0).Top = Int((Rnd * 450) + 50)
  238. frmMain.Pic1(0).ZOrder 0
  239. PBar1.Min = 0: PBar1.Max = Pieces - 1
  240. For t = 0 To Pieces - 1
  241. frmMain.Pic1(t).Picture = frmMain.PicClip1.GraphicCell(t)
  242. frmMain.Pic1(t).Visible = True
  243. PBar1.Value = t
  244. Next t
  245. '------------------------------
  246. For xx = 0 To GrCol - 1 'corners x
  247. GrCorX(xx) = (xx * frmMain.Pic1(0).Width) + 13 + (frmMain.Pic1(0).Width / 2)
  248. Next xx
  249. For xx = 0 To GrRow - 1
  250. GrCorY(xx) = (xx * frmMain.Pic1(0).Height) + 51 + (frmMain.Pic1(0).Height / 2)
  251. Next xx
  252. '------------------------------
  253. frmMain.Grid1.Width = PicWidth + 2
  254. frmMain.Grid1.Height = PicHeight + 2
  255. frmMain.Grid1.Visible = True
  256. frmMain.Grid1.ZOrder 1
  257. frmMain.Grid1.Top = 10
  258. frmMain.Grid1.Left = 10
  259. For xx = 0 To GrCol - 1
  260. frmMain.Grid1.ColWidth(xx) = frmMain.Pic1(0).Width * 15
  261. Next xx
  262. For xx = 0 To GrRow - 1
  263. frmMain.Grid1.RowHeight(xx) = frmMain.Pic1(0).Height * 15
  264. Next xx
  265. '-----------------
  266. frmMain.Grid1.ForeColor = frmMain.Grid1.BackColor
  267. t = 0
  268. For yy = 0 To GrRow - 1
  269. For xx = 0 To GrCol - 1
  270.     frmMain.Grid1.Col = xx: frmMain.Grid1.Row = yy
  271.     frmMain.Grid1.Picture = LoadPicture("")
  272.     frmMain.Grid1.Text = t: t = t + 1
  273. Next xx
  274. Next yy
  275. '-----------------
  276. frmMain.mnushowthumb.Enabled = True
  277. frmMain.Image1.Picture = Image1.Picture
  278. frmMain.Image1.Width = Image1.Width / 15
  279. frmMain.Image1.Height = Image1.Height / 15
  280. frmMain.Pic2.Width = (Image1.Width / 15) + 4
  281. frmMain.Pic2.Height = (Image1.Height / 15) + 20
  282. '------------------------------
  283. frmMain.Pic1(0).Visible = True
  284. Frame2.Visible = False
  285. PForm2.Hide
  286. PForm2.Enabled = False
  287. frmMain.Enabled = True
  288. frmMain.Show
  289. DoEvents
  290. ImTel = 1: piecestel = 0
  291. frmMain.Pic2.Visible = False
  292. frmMain.mnushowthumb.Enabled = True
  293. End Sub
  294. Private Sub Command2_Click()
  295. PForm2.Enabled = False
  296. frmMain.Enabled = True
  297. frmMain.Show
  298. End Sub
  299. Private Sub File1_Click()
  300. PicNam = App.Path + "\PuzzlePics\" + File1.List(File1.ListIndex)
  301. Image1.Picture = LoadPicture(PicNam)
  302. clickbit = 1
  303. End Sub
  304. Private Sub Form_Activate()
  305. 'clickbit = 0
  306. End Sub
  307. Private Sub Form_Load()
  308. File1.Path = App.Path + "\PuzzlePics"
  309. Option1(1).Value = True
  310. File1.ListIndex = 0
  311. End Sub
  312.