home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / ED11.ZIP / ED.FRM < prev    next >
Text File  |  1994-01-27  |  6KB  |  243 lines

  1. VERSION 2.00
  2. Begin Form Edit 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Edit"
  5.    ClientHeight    =   4350
  6.    ClientLeft      =   1470
  7.    ClientTop       =   1815
  8.    ClientWidth     =   4575
  9.    Height          =   5040
  10.    Icon            =   ED.FRX:0000
  11.    Left            =   1410
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   4350
  16.    ScaleWidth      =   4575
  17.    Top             =   1185
  18.    Width           =   4695
  19.    Begin CommandButton OK 
  20.       Cancel          =   -1  'True
  21.       Caption         =   "OK"
  22.       Default         =   -1  'True
  23.       Height          =   300
  24.       Left            =   2850
  25.       TabIndex        =   4
  26.       Top             =   3900
  27.       Width           =   1260
  28.    End
  29.    Begin CommandButton Cancel 
  30.       Caption         =   "Cancel / End"
  31.       Height          =   300
  32.       Left            =   615
  33.       TabIndex        =   3
  34.       Top             =   3915
  35.       Width           =   1260
  36.    End
  37.    Begin FileListBox File1 
  38.       Height          =   3150
  39.       Left            =   2445
  40.       TabIndex        =   2
  41.       Top             =   630
  42.       Width           =   2055
  43.    End
  44.    Begin DirListBox Dir1 
  45.       Height          =   3210
  46.       Left            =   75
  47.       TabIndex        =   1
  48.       Top             =   615
  49.       Width           =   2235
  50.    End
  51.    Begin ComboBox wildcard 
  52.       Height          =   300
  53.       Left            =   2445
  54.       Sorted          =   -1  'True
  55.       TabIndex        =   5
  56.       Top             =   210
  57.       Width           =   2070
  58.    End
  59.    Begin DriveListBox Drive1 
  60.       Height          =   315
  61.       Left            =   120
  62.       TabIndex        =   0
  63.       Top             =   210
  64.       Width           =   2235
  65.    End
  66.    Begin Menu file 
  67.       Caption         =   "&File"
  68.       Begin Menu new 
  69.          Caption         =   "&New"
  70.       End
  71.       Begin Menu leave 
  72.          Caption         =   "E&xit"
  73.       End
  74.    End
  75.    Begin Menu options 
  76.       Caption         =   "&Options"
  77.       Begin Menu seted 
  78.          Caption         =   "&Set Editor Name"
  79.       End
  80.       Begin Menu ExitAfter 
  81.          Caption         =   "E&xit After Editor Starts"
  82.       End
  83.    End
  84.    Begin Menu Help 
  85.       Caption         =   "&Help"
  86.       Begin Menu HelpContents 
  87.          Caption         =   "&Contents"
  88.       End
  89.       Begin Menu SepBar 
  90.          Caption         =   "-"
  91.       End
  92.       Begin Menu about 
  93.          Caption         =   "&About Ed..."
  94.       End
  95.    End
  96. End
  97. Option Explicit
  98.  
  99. Sub about_Click ()
  100. Dim m As String
  101.  
  102.    m = "ED 1.1 Editor Interface " & Chr$(13) & Chr$(10)
  103.    m = m & "Written in Microsoft Visual Basic" & Chr$(13) & Chr$(10)
  104.    m = m & "ED 1.0 06/23/91 - R. Neal - 72315,116" & Chr$(13) & Chr$(10)
  105.    m = m & "ED 1.1 01/26/94 - Network Resources - 73472,1543"
  106.    MsgBox m, 0, "About ED"
  107. End Sub
  108.  
  109. Sub Cancel_Click ()
  110.     End
  111. End Sub
  112.  
  113. Sub Dir1_Change ()
  114.     file1.Path = dir1.Path
  115.     wildcard.Text = file1.Pattern
  116. End Sub
  117.  
  118. Sub Drive1_Change ()
  119.     dir1.Path = drive1.Drive
  120.     wildcard.Text = file1.Pattern
  121. End Sub
  122.  
  123. Sub ExitAfter_Click ()
  124. Dim RetVal As Integer, Tmp As String
  125.     
  126.     If ExitAfter.Checked = True Then
  127.     ExitAfter.Checked = False
  128.     Tmp = "False"
  129.     Else
  130.     ExitAfter.Checked = True
  131.     Tmp = "True"
  132.     End If
  133.     RetVal = WritePrivateProfileString("Config", "TermAfterStart", Tmp, "EDCTL.INI")
  134. End Sub
  135.  
  136. Sub File1_Click ()
  137.    wildcard.Text = file1.FileName
  138. End Sub
  139.  
  140. Sub file1_dblclick ()
  141. Dim c As String, i As Integer, r As Integer
  142.     
  143.     ChDrive drive1.Drive
  144.     ChDir dir1.Path
  145.     c = EdName & " " & file1.FileName
  146.     r = Shell(c)
  147.     If ExitAfter.Checked = True Then End
  148. End Sub
  149.  
  150. Sub Form_Load ()
  151. Dim RetVal As Integer, Key As String
  152. Dim IniString As String
  153.  
  154.     ' Must be big enough for the return string from GetPrivateProfileString.
  155.     IniString = String(255, 0)
  156.     
  157.     Key = "TermAfterStart"
  158.     RetVal = GetPrivateProfileString("Config", Key, "None", IniString, Len(IniString), "EDCTL.INI")
  159.     If RetVal And Left(IniString, 4) <> "None" Then
  160.     If UCase$(IniString) = "True" Then
  161.         ExitAfter.Checked = True
  162.     End If
  163.     End If
  164.     
  165.     Key = "Editor"
  166.     RetVal = GetPrivateProfileString("Config", Key, "None", IniString, Len(IniString), "EDCTL.INI")
  167.     If RetVal And Left(IniString, 4) <> "None" Then
  168.     EdName = IniString
  169.     End If
  170.     
  171.     
  172.     dir1.Path = Left$(CurDir$, 2) & "\"
  173.     file1.Pattern = "*.*"
  174.     wildcard.Text = file1.Pattern
  175.     wildcard.AddItem "*.*"
  176.     wildcard.AddItem "*.bat"
  177.     wildcard.AddItem "*.txt"
  178.     wildcard.AddItem "*.doc"
  179.     wildcard.AddItem "*.bas"
  180.     wildcard.AddItem "*.frm"
  181.     wildcard.AddItem "*.c"
  182.     wildcard.AddItem "*.h"
  183.     wildcard.AddItem "*.cob"
  184.     wildcard.AddItem "*.pas"
  185.     wildcard.AddItem "*.prg"
  186.     wildcard.AddItem "*.ini"
  187.     wildcard.AddItem "*.mak"
  188. End Sub
  189.  
  190. Sub Form_Unload (Cancel As Integer)
  191.     End
  192. End Sub
  193.  
  194. Sub HelpContents_Click ()
  195. Dim x As Integer
  196.  
  197.     x = WinHelp(hWnd, "ED.HLP", HELP_INDEX, -1)
  198. End Sub
  199.  
  200. Sub leave_Click ()
  201.      End
  202. End Sub
  203.  
  204. Sub new_Click ()
  205. Dim edf As String, r As Integer
  206.  
  207.     edf = InputBox$("Enter file name:", "New File")
  208.     If edf = "" Then Exit Sub
  209.     r = Shell(EdName + " " + edf)
  210. End Sub
  211.  
  212. Sub OK_Click ()
  213. Dim a As Integer, q As Integer
  214.  
  215.     a = InStr(wildcard.Text, "*")
  216.     q = InStr(wildcard.Text, "?")
  217.     If a > 0 Or q > 0 Then
  218.     file1.Pattern = wildcard.Text
  219.     Else
  220.     file1_dblclick
  221.     End If
  222. End Sub
  223.  
  224. Sub SearchHelp_Click ()
  225. Dim x As Integer
  226.  
  227.     x = WinHelp(hWnd, "ED.HLP", HELP_PARTIALKEY, 0)
  228. End Sub
  229.  
  230. Sub seted_Click ()
  231. Dim RetVal As Integer, e As String
  232.     
  233.     e = InputBox$("Enter the name of the command (.PIF, .EXE, .COM, or .BAT file) that ED should execute to start your editor:", "Set Editor Name", EdName)
  234.     If e = "" Then Exit Sub
  235.     RetVal = WritePrivateProfileString("Config", "Editor", e, "EDCTL.INI")
  236.     EdName = e
  237. End Sub
  238.  
  239. Sub wildcard_Click ()
  240.     file1.Pattern = wildcard.Text
  241. End Sub
  242.  
  243.