home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Tutorial_M46439152002.psc / frmMake.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-01-04  |  5.8 KB  |  207 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmMake 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Tutorial v1.0.0 (Make) on p. 1"
  6.    ClientHeight    =   4815
  7.    ClientLeft      =   150
  8.    ClientTop       =   435
  9.    ClientWidth     =   6885
  10.    Icon            =   "frmMake.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4815
  15.    ScaleWidth      =   6885
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin MSComDlg.CommonDialog cmm 
  18.       Left            =   3240
  19.       Top             =   2160
  20.       _ExtentX        =   847
  21.       _ExtentY        =   847
  22.       _Version        =   393216
  23.    End
  24.    Begin VB.Frame Frame1 
  25.       Caption         =   "Controls"
  26.       Height          =   2055
  27.       Left            =   4320
  28.       TabIndex        =   3
  29.       Top             =   2640
  30.       Width           =   2535
  31.       Begin VB.CommandButton cmdNext 
  32.          Caption         =   "Next >>"
  33.          Height          =   495
  34.          Left            =   240
  35.          TabIndex        =   6
  36.          Top             =   240
  37.          Width           =   2175
  38.       End
  39.       Begin VB.CommandButton cmdBack 
  40.          Caption         =   "<< Back"
  41.          Height          =   495
  42.          Left            =   240
  43.          TabIndex        =   5
  44.          Top             =   840
  45.          Width           =   2175
  46.       End
  47.       Begin VB.CommandButton cmdChange 
  48.          Caption         =   "Change Pic"
  49.          Height          =   495
  50.          Left            =   240
  51.          TabIndex        =   4
  52.          Top             =   1440
  53.          Width           =   2175
  54.       End
  55.    End
  56.    Begin VB.TextBox txtText 
  57.       Height          =   4215
  58.       Left            =   120
  59.       MultiLine       =   -1  'True
  60.       ScrollBars      =   2  'Vertical
  61.       TabIndex        =   0
  62.       Top             =   480
  63.       Width           =   4095
  64.    End
  65.    Begin VB.Label Label2 
  66.       Caption         =   "Pic:"
  67.       Height          =   255
  68.       Left            =   4320
  69.       TabIndex        =   2
  70.       Top             =   120
  71.       Width           =   2415
  72.    End
  73.    Begin VB.Image imgPic 
  74.       Height          =   2055
  75.       Left            =   4320
  76.       Stretch         =   -1  'True
  77.       Top             =   480
  78.       Width           =   2535
  79.    End
  80.    Begin VB.Label Label1 
  81.       Caption         =   "Text:"
  82.       Height          =   255
  83.       Left            =   120
  84.       TabIndex        =   1
  85.       Top             =   120
  86.       Width           =   4095
  87.    End
  88.    Begin VB.Menu FI 
  89.       Caption         =   "File"
  90.       Begin VB.Menu OP 
  91.          Caption         =   "Open"
  92.       End
  93.       Begin VB.Menu SA 
  94.          Caption         =   "Save"
  95.       End
  96.       Begin VB.Menu COM 
  97.          Caption         =   "Compile to .exe"
  98.       End
  99.       Begin VB.Menu Sep2 
  100.          Caption         =   "-"
  101.       End
  102.       Begin VB.Menu TA 
  103.          Caption         =   "Take"
  104.       End
  105.       Begin VB.Menu sep1 
  106.          Caption         =   "-"
  107.       End
  108.       Begin VB.Menu EX 
  109.          Caption         =   "Exit"
  110.       End
  111.    End
  112. Attribute VB_Name = "frmMake"
  113. Attribute VB_GlobalNameSpace = False
  114. Attribute VB_Creatable = False
  115. Attribute VB_PredeclaredId = True
  116. Attribute VB_Exposed = False
  117. Dim on_page As Long
  118. Dim pic(99) As String, text(99) As String, xx() As String, pic2() As String, text2() As String
  119. Private Sub cmdBack_Click()
  120. If on_page = 1 Then
  121.     Me.Caption = "Tutorial v1.0.0 (Make) on p. 1 - Error lowest number page alowed is 1!"
  122.     Exit Sub
  123. End If
  124. on_page = on_page - 1
  125. Me.Caption = "Tutorial v1.0.0 (Make) on p. " & on_page
  126. imgPic.Picture = LoadPicture(pic(on_page - 1))
  127. txtText.text = text(on_page - 1)
  128. End Sub
  129. Private Sub cmdEnlarge_Click()
  130. End Sub
  131. Private Sub cmdChange_Click()
  132. On Error Resume Next
  133. cmm.Filter = "Bitmap Files (*.bmp)|*.bmp"
  134. cmm.InitDir = App.Path
  135. cmm.DialogTitle = "Open - Keep the pictures in the tutorial's path!"
  136. cmm.ShowOpen
  137. imgPic.Picture = LoadPicture(cmm.FileName)
  138. pic(on_page - 1) = cmm.FileName
  139. End Sub
  140. Private Sub cmdNext_Click()
  141. If on_page = 100 Then
  142.     Me.Caption = "Tutorial v1.0.0 (Make) on p. 100-Error only 100 pages alowed!"
  143.     Exit Sub
  144. End If
  145. on_page = on_page + 1
  146. Me.Caption = "Tutorial v1.0.0 (Make) on p. " & on_page
  147. imgPic.Picture = LoadPicture(pic(on_page - 1))
  148. txtText.text = text(on_page - 1)
  149. End Sub
  150. Private Sub COM_Click()
  151. Open App.Path & "\tmp.tut" For Output As #1
  152.     strpic = Join(pic, "
  153.     strtext = Join(text, "
  154.     Print #1, strpic & "~" & strtext
  155. Close #1
  156. cmm.Filter = "Executable Files (*.exe)|*.exe"
  157. cmm.ShowSave
  158. PutFile App.Path & "\exerun.exe", App.Path & "\tmp.tut", cmm.FileName
  159. End Sub
  160. Private Sub EX_Click()
  161. Unload frmTake
  162. Unload Me
  163. End Sub
  164. Private Sub Form_Load()
  165. on_page = 1
  166. End Sub
  167. Private Sub Form_Unload(Cancel As Integer)
  168. Unload frmTake
  169. Unload Me
  170. End Sub
  171. Private Sub OP_Click()
  172. cmm.Filter = "Tutorial Files (*.tut)|*.tut"
  173. cmm.ShowOpen
  174. Open cmm.FileName For Input As #1
  175.     Line Input #1, a
  176.     xx = Split(a, "~")
  177.     pic2 = Split(xx(0), "
  178.     text2 = Split(xx(1), "
  179. Close #1
  180. For x = 0 To 99
  181.     pic(x) = pic2(x)
  182.     If Not FileExist(pic(x)) Then
  183.         pic(x) = App.Path & "\" & GetFileNameFromPath(pic(x))
  184.     End If
  185.     text(x) = text2(x)
  186. Next x
  187. on_page = 1
  188. cmdNext_Click
  189. cmdBack_Click
  190. End Sub
  191. Private Sub SA_Click()
  192. cmm.Filter = "Tutorial Files (*.tut)|*.tut"
  193. cmm.ShowSave
  194. Open cmm.FileName For Output As #1
  195.     strpic = Join(pic, "
  196.     strtext = Join(text, "
  197.     Print #1, strpic & "~" & strtext
  198. Close #1
  199. End Sub
  200. Private Sub TA_Click()
  201. Me.Hide
  202. frmTake.Show
  203. End Sub
  204. Private Sub txtText_Change()
  205. text(on_page - 1) = txtText.text
  206. End Sub
  207.