home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l406 / 1.ddi / NOTEPAD.FR_ / NOTEPAD.bin (.txt)
Encoding:
Visual Basic Form  |  1992-10-21  |  7.3 KB  |  277 lines

  1. VERSION 2.00
  2. Begin Form frmNotePad 
  3.    Caption         =   "Untitled"
  4.    Height          =   4665
  5.    Left            =   840
  6.    LinkTopic       =   "Form1"
  7.    MDIChild        =   -1  'True
  8.    ScaleHeight     =   3975
  9.    ScaleWidth      =   5610
  10.    Top             =   1740
  11.    Visible         =   0   'False
  12.    Width           =   5730
  13.    Begin TextBox Text1 
  14.       Height          =   3855
  15.       HideSelection   =   0   'False
  16.       Left            =   0
  17.       MultiLine       =   -1  'True
  18.       ScrollBars      =   3  'Both
  19.       TabIndex        =   0
  20.       Top             =   0
  21.       Width           =   5655
  22.    End
  23.    Begin Menu mnuFile 
  24.       Caption         =   "&File"
  25.       Begin Menu mnuFNew 
  26.          Caption         =   "&New"
  27.       End
  28.       Begin Menu mnuFOpen 
  29.          Caption         =   "&Open..."
  30.       End
  31.       Begin Menu mnuFClose 
  32.          Caption         =   "&Close"
  33.       End
  34.       Begin Menu mnuFSave 
  35.          Caption         =   "&Save"
  36.       End
  37.       Begin Menu mnuFSaveAs 
  38.          Caption         =   "Save &As..."
  39.       End
  40.       Begin Menu mnuFSep 
  41.          Caption         =   "-"
  42.       End
  43.       Begin Menu mnuFExit 
  44.          Caption         =   "E&xit"
  45.       End
  46.    End
  47.    Begin Menu mnuEdit 
  48.       Caption         =   "&Edit"
  49.       Begin Menu mnuECut 
  50.          Caption         =   "Cu&t"
  51.          Shortcut        =   ^X
  52.       End
  53.       Begin Menu mnuECopy 
  54.          Caption         =   "&Copy"
  55.          Shortcut        =   ^C
  56.       End
  57.       Begin Menu mnuEPaste 
  58.          Caption         =   "&Paste"
  59.          Shortcut        =   ^V
  60.       End
  61.       Begin Menu mnuEDelete 
  62.          Caption         =   "De&lete"
  63.          Shortcut        =   {DEL}
  64.       End
  65.       Begin Menu mnuESep1 
  66.          Caption         =   "-"
  67.       End
  68.       Begin Menu mnuESelectAll 
  69.          Caption         =   "Select &All"
  70.       End
  71.       Begin Menu mnuETime 
  72.          Caption         =   "Time/&Date"
  73.       End
  74.    End
  75.    Begin Menu mnuSearch 
  76.       Caption         =   "&Search"
  77.       Begin Menu mnuSFind 
  78.          Caption         =   "&Find"
  79.       End
  80.       Begin Menu mnuSFindNext 
  81.          Caption         =   "Find &Next"
  82.          Shortcut        =   {F3}
  83.       End
  84.    End
  85.    Begin Menu mnuOptions 
  86.       Caption         =   "&Options"
  87.       Begin Menu mnuOToolbar 
  88.          Caption         =   "&Toolbar"
  89.       End
  90.       Begin Menu mnuFont 
  91.          Caption         =   "&Font"
  92.          Begin Menu mnuFontName 
  93.             Caption         =   "FontName"
  94.             Index           =   0
  95.          End
  96.       End
  97.    End
  98.    Begin Menu mnuWindow 
  99.       Caption         =   "&Window"
  100.       WindowList      =   -1  'True
  101.       Begin Menu mnuWCascade 
  102.          Caption         =   "&Cascade"
  103.       End
  104.       Begin Menu mnuWTile 
  105.          Caption         =   "&Tile"
  106.       End
  107.       Begin Menu mnuWArrange 
  108.          Caption         =   "&Arrange Icons"
  109.       End
  110.    End
  111. Sub Form_Load ()
  112.     Dim i As Integer
  113.     mnuFontName(0).Caption = screen.Fonts(0)
  114.     For i = 1 To screen.FontCount - 1
  115.     Load mnuFontName(i)
  116.     mnuFontName(0).Caption = screen.Fonts(i)
  117.     Next
  118. End Sub
  119. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  120.     Dim Msg, Filename, NL
  121.     Dim Response As Integer
  122.     If FState(Me.Tag).Dirty Then
  123.     Filename = Me.Caption
  124.     NL = Chr$(10) & Chr$(13)
  125.     Msg = "The text in [" & Filename & "] has changed."
  126.     Msg = Msg & NL
  127.     Msg = Msg & "Do you want to save the changes?"
  128.     Response = MsgBox(Msg, 51, frmMDI.Caption)
  129.     Select Case Response
  130.     ' User selects Yes
  131.     ' Load the File Save dialog
  132.     Case 6
  133.         ' Invoke the Save As procedure
  134.         Call mnuFSaveAs_Click
  135.         ' If the user has selected the Cancel button on
  136.         ' the File Save dialog (not the msgbox), then the txtFileName
  137.         ' text box is set to empty and the unload needs to be canceled.
  138.         If IsEmpty(FileForm.txtFileName.Text) Then
  139.         Cancel = True
  140.         End If
  141.     ' User selects No
  142.     ' Ok to unload
  143.         
  144.     Case 7
  145.         Cancel = False
  146.     ' User selects Cancel
  147.     ' Cancel the unload
  148.     Case 2
  149.         Cancel = True
  150.     End Select
  151.     End If
  152. End Sub
  153. Sub Form_Resize ()
  154.     If windowstate <> 1 And ScaleHeight <> 0 Then
  155.     Text1.Visible = False
  156.     Text1.Height = ScaleHeight
  157.     Text1.Width = ScaleWidth
  158.     Text1.Visible = True
  159.     End If
  160. End Sub
  161. Sub Form_Unload (Cancel As Integer)
  162.     FState(Me.Tag).Deleted = True
  163. 'Hide toolbar edit buttons if no notepad windows
  164.     If Not AnyPadsLeft() Then
  165.     frmMDI!imgCutButton.Visible = False
  166.     frmMDI!imgCopyButton.Visible = False
  167.     frmMDI!imgPasteButton.Visible = False
  168.     End If
  169. End Sub
  170. Sub mnuECopy_Click ()
  171.     EditCopyProc
  172. End Sub
  173. Sub mnuECut_Click ()
  174.     EditCutProc
  175. End Sub
  176. Sub mnuEDelete_Click ()
  177.     ' Delete selected text.
  178.     If screen.ActiveControl.SelLength = 0 Then
  179.        screen.ActiveControl.SelLength = 1
  180.     End If
  181.     screen.ActiveControl.SelText = ""
  182. End Sub
  183. Sub mnuEPaste_Click ()
  184.     EditPasteProc
  185. End Sub
  186. Sub mnuESelectAll_Click ()
  187.     frmMDI.ActiveForm.Text1.SelStart = 0
  188.     frmMDI.ActiveForm.Text1.SelLength = Len(frmMDI.ActiveForm.Text1.Text)
  189. End Sub
  190. Sub mnuETime_Click ()
  191.     Dim TimeStr As String, DateStr As String
  192.     Text1.SelText = Now
  193. End Sub
  194. Sub mnuFClose_Click ()
  195.     Unload Me
  196. End Sub
  197. Sub mnuFExit_Click ()
  198.     ' Unloading the MDI form invokes the QueryUnload event
  199.     ' for each child form, then the MDI form - before unloading
  200.     ' the MDI form. Setting the Cancel argument to True in any of the
  201.     ' QueryUnload events aborts the unload.
  202.     Unload frmMDI
  203. End Sub
  204. Sub mnuFNew_Click ()
  205.     FileNew
  206. End Sub
  207. Sub mnuFontName_Click (Index As Integer)
  208.     Text1.FontName = mnuFontName(Index).Caption
  209. End Sub
  210. Sub mnuFOpen_Click ()
  211.     FOpenProc
  212. End Sub
  213. Sub mnuFSave_Click ()
  214.     Dim Filename As String
  215.     If Left(Me.Caption, 8) = "Untitled" Then
  216.     ' The file hasn't been saved yet,
  217.     ' get the filename, then call the
  218.     ' save procedure
  219.     Filename = GetFilename("Save As")
  220.     Else
  221.     ' The caption contains the name of the open file
  222.     Filename = Me.Caption
  223.     End If
  224.     ' call the save procedure, if Filename = Empty then
  225.     ' the user selected Cancel in the Save As dialog, otherwise
  226.     ' save the file
  227.     If Filename <> "" Then
  228.     SaveFileAs Filename
  229.     End If
  230. End Sub
  231. Sub mnuFSaveAs_Click ()
  232.     Dim SaveFileName As String
  233.     SaveFileName = GetFilename("Save As")
  234.     If SaveFileName <> "" Then
  235.     SaveFileAs (SaveFileName)
  236.     End If
  237. End Sub
  238. Sub mnuOptions_Click ()
  239.     mnuOToolbar.Checked = frmMDI!picToolbar.Visible
  240. End Sub
  241. Sub mnuOToolbar_Click ()
  242.     OptionsToolbarProc Me
  243. End Sub
  244. Sub mnuSFind_Click ()
  245.     If Me!Text1.SelText <> "" Then
  246.     frmFind!Text1.Text = Me!Text1.SelText
  247.     Else
  248.     frmFind!Text1.Text = FindString
  249.     End If
  250.     gFirstTime = True
  251.     frmFind.Show
  252. End Sub
  253. Sub mnuSFindNext_Click ()
  254.     If Len(gFindString) > 0 Then
  255.     FindIt
  256.     Else
  257.     mnuSFind_Click
  258.     End If
  259. End Sub
  260. Sub mnuWArrange_Click ()
  261.     frmMDI.Arrange ARRANGE_ICONS
  262. End Sub
  263. Sub mnuWCascade_Click ()
  264.     frmMDI.Arrange CASCADE
  265. End Sub
  266. Sub mnuWTile_Click ()
  267.     frmMDI.Arrange TILE_HORIZONTAL
  268. End Sub
  269. Sub Text1_Change ()
  270.     FState(Me.Tag).Dirty = True
  271. End Sub
  272. Sub Text1_GotFocus ()
  273.     If frmFind.Visible Then
  274.     frmFind.ZOrder 0
  275.     End If
  276. End Sub
  277.