home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / MultiGradi762724262002.psc / MultiGradient / Form3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2002-04-20  |  6.5 KB  |  226 lines

  1. VERSION 5.00
  2. Begin VB.Form Form3 
  3.    AutoRedraw      =   -1  'True
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Gradient rename"
  6.    ClientHeight    =   3705
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5625
  10.    ControlBox      =   0   'False
  11.    LinkTopic       =   "Form3"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    Moveable        =   0   'False
  15.    ScaleHeight     =   247
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   375
  18.    StartUpPosition =   1  'CenterOwner
  19.    Begin VB.PictureBox Picture1 
  20.       AutoRedraw      =   -1  'True
  21.       BackColor       =   &H00000000&
  22.       BorderStyle     =   0  'None
  23.       Height          =   240
  24.       Left            =   2790
  25.       ScaleHeight     =   16
  26.       ScaleMode       =   3  'Pixel
  27.       ScaleWidth      =   181
  28.       TabIndex        =   9
  29.       Top             =   90
  30.       Width           =   2715
  31.    End
  32.    Begin VB.CommandButton Command3 
  33.       Caption         =   "Rename"
  34.       Height          =   330
  35.       Left            =   4680
  36.       TabIndex        =   6
  37.       Top             =   2070
  38.       Width           =   825
  39.    End
  40.    Begin VB.CommandButton Command1 
  41.       Caption         =   "Done !"
  42.       Height          =   330
  43.       Left            =   4680
  44.       TabIndex        =   5
  45.       Top             =   2520
  46.       Width           =   825
  47.    End
  48.    Begin VB.FileListBox File1 
  49.       BackColor       =   &H00E0E0E0&
  50.       BeginProperty Font 
  51.          Name            =   "MS Sans Serif"
  52.          Size            =   8.25
  53.          Charset         =   0
  54.          Weight          =   700
  55.          Underline       =   0   'False
  56.          Italic          =   0   'False
  57.          Strikethrough   =   0   'False
  58.       EndProperty
  59.       ForeColor       =   &H00C00000&
  60.       Height          =   2820
  61.       Left            =   90
  62.       TabIndex        =   4
  63.       Top             =   45
  64.       Width           =   2625
  65.    End
  66.    Begin VB.TextBox Text1 
  67.       BackColor       =   &H00E0E0E0&
  68.       BeginProperty Font 
  69.          Name            =   "MS Sans Serif"
  70.          Size            =   8.25
  71.          Charset         =   0
  72.          Weight          =   700
  73.          Underline       =   0   'False
  74.          Italic          =   0   'False
  75.          Strikethrough   =   0   'False
  76.       EndProperty
  77.       ForeColor       =   &H00C00000&
  78.       Height          =   285
  79.       Left            =   2790
  80.       TabIndex        =   3
  81.       Text            =   "Text1"
  82.       Top             =   1530
  83.       Width           =   2715
  84.    End
  85.    Begin VB.Label Label5 
  86.       BackColor       =   &H00E0E0E0&
  87.       BorderStyle     =   1  'Fixed Single
  88.       Caption         =   "Label5"
  89.       ForeColor       =   &H00000080&
  90.       Height          =   285
  91.       Left            =   90
  92.       TabIndex        =   8
  93.       Top             =   3330
  94.       Width           =   5460
  95.    End
  96.    Begin VB.Label Label4 
  97.       BackColor       =   &H00E0E0E0&
  98.       BorderStyle     =   1  'Fixed Single
  99.       Caption         =   "Label4"
  100.       ForeColor       =   &H00000080&
  101.       Height          =   285
  102.       Left            =   90
  103.       TabIndex        =   7
  104.       Top             =   2970
  105.       Width           =   5460
  106.    End
  107.    Begin VB.Label Label3 
  108.       Caption         =   "New gradient name:"
  109.       BeginProperty Font 
  110.          Name            =   "MS Sans Serif"
  111.          Size            =   8.25
  112.          Charset         =   0
  113.          Weight          =   700
  114.          Underline       =   0   'False
  115.          Italic          =   0   'False
  116.          Strikethrough   =   0   'False
  117.       EndProperty
  118.       ForeColor       =   &H000000C0&
  119.       Height          =   240
  120.       Left            =   2835
  121.       TabIndex        =   2
  122.       Top             =   1260
  123.       Width           =   2670
  124.    End
  125.    Begin VB.Label Label2 
  126.       BorderStyle     =   1  'Fixed Single
  127.       Caption         =   "Label2"
  128.       BeginProperty Font 
  129.          Name            =   "MS Sans Serif"
  130.          Size            =   8.25
  131.          Charset         =   0
  132.          Weight          =   700
  133.          Underline       =   0   'False
  134.          Italic          =   0   'False
  135.          Strikethrough   =   0   'False
  136.       EndProperty
  137.       ForeColor       =   &H00C00000&
  138.       Height          =   285
  139.       Left            =   2835
  140.       TabIndex        =   1
  141.       Top             =   765
  142.       Width           =   2670
  143.    End
  144.    Begin VB.Label label1 
  145.       Caption         =   "Gradient name:"
  146.       BeginProperty Font 
  147.          Name            =   "MS Sans Serif"
  148.          Size            =   8.25
  149.          Charset         =   0
  150.          Weight          =   700
  151.          Underline       =   0   'False
  152.          Italic          =   0   'False
  153.          Strikethrough   =   0   'False
  154.       EndProperty
  155.       ForeColor       =   &H000000C0&
  156.       Height          =   240
  157.       Left            =   2835
  158.       TabIndex        =   0
  159.       Top             =   495
  160.       Width           =   2670
  161.    End
  162. Attribute VB_Name = "Form3"
  163. Attribute VB_GlobalNameSpace = False
  164. Attribute VB_Creatable = False
  165. Attribute VB_PredeclaredId = True
  166. Attribute VB_Exposed = False
  167. Dim OldFile$, NewFile$
  168. Private Sub Command1_Click()
  169. Form1.Label7 = "Last action: Renaming gradients"
  170. Form3.Hide
  171. End Sub
  172. Private Sub Command3_Click() 'rename
  173. On Error GoTo RenameError
  174. If Text1 = "" Then Exit Sub
  175. If LCase(Right(Text1, 4)) <> ".mgr" Then
  176. Text1 = Text1 & ".Mgr"
  177. End If
  178. NewFile = File1.Path & "\" & Text1
  179. Label5 = NewFile
  180.     For xx = 0 To File1.ListCount - 1
  181.     If LCase(File1.List(xx)) = LCase(Text1) Then
  182.     MsgBox "The gradient " & Text1 & " already exists !", , MGTitle
  183.     Exit Sub
  184.     End If
  185.     Next xx
  186. Name OldFile As NewFile
  187. OldFile = NewFile
  188. Label4 = OldFile
  189. Label5 = NewFile
  190. Label2 = Text1
  191. File1.Refresh
  192. Exit Sub
  193. RenameError:
  194. MsgBox Err.Number & vbCr & Err.Description, , MGTitle
  195. End Sub
  196. Private Sub File1_Click()
  197. Label2 = File1.List(File1.ListIndex)
  198. Text1 = Label2
  199. Text1.SelStart = 0
  200. Text1.SelLength = Len(Text1)
  201. Text1.SetFocus
  202. OldFile = File1.Path & "\" & Text1
  203. Label4 = OldFile
  204. NewFile = OldFile
  205. Label5 = NewFile
  206. ff = FreeFile
  207. Open OldFile For Input As #1
  208. For xx = 0 To 9
  209. Input #ff, MGrad1(xx)
  210. Input #ff, Mgpct3(xx)
  211. MGPct1(xx) = Mgpct3(xx) / 10000
  212. Next xx
  213. Close #ff
  214. Picture1.Cls
  215. MultiGrad3 Picture1
  216. End Sub
  217. Private Sub Form_Activate()
  218. On Error Resume Next
  219. File1.Path = App.Path & "\Gradients"
  220. File1.Refresh
  221. Label2 = ""
  222. Text1 = ""
  223. Label4 = ""
  224. File1.Selected(0)File1.SelxCls
  225. eturet
  226.