home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / notepad.fr_ / notepad.bin
Text File  |  1993-04-28  |  8KB  |  357 lines

  1. VERSION 2.00
  2. Begin Form frmNotePad 
  3.    Caption         =   "Untitled"
  4.    ClientHeight    =   3975
  5.    ClientLeft      =   885
  6.    ClientTop       =   2910
  7.    ClientWidth     =   5610
  8.    Height          =   4665
  9.    Left            =   825
  10.    LinkTopic       =   "Form1"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   3975
  13.    ScaleWidth      =   5610
  14.    Top             =   2280
  15.    Visible         =   0   'False
  16.    Width           =   5730
  17.    Begin TextBox Text1 
  18.       Height          =   3855
  19.       HideSelection   =   0   'False
  20.       Left            =   0
  21.       MultiLine       =   -1  'True
  22.       ScrollBars      =   3  'Both
  23.       TabIndex        =   0
  24.       Top             =   0
  25.       Width           =   5655
  26.    End
  27.    Begin Menu mnuFile 
  28.       Caption         =   "&File"
  29.       Begin Menu mnuFNew 
  30.      Caption         =   "&New"
  31.       End
  32.       Begin Menu mnuFOpen 
  33.      Caption         =   "&Open..."
  34.       End
  35.       Begin Menu mnuFClose 
  36.      Caption         =   "&Close"
  37.       End
  38.       Begin Menu mnuFSave 
  39.      Caption         =   "&Save"
  40.       End
  41.       Begin Menu mnuFSaveAs 
  42.      Caption         =   "Save &As..."
  43.       End
  44.       Begin Menu mnuFSep 
  45.      Caption         =   "-"
  46.       End
  47.       Begin Menu mnuFExit 
  48.      Caption         =   "E&xit"
  49.       End
  50.       Begin Menu mnuRecentFile 
  51.      Caption         =   "-"
  52.      Index           =   0
  53.      Visible         =   0   'False
  54.       End
  55.       Begin Menu mnuRecentFile 
  56.      Caption         =   "RecentFile1"
  57.      Index           =   1
  58.      Visible         =   0   'False
  59.       End
  60.       Begin Menu mnuRecentFile 
  61.      Caption         =   "RecentFile2"
  62.      Index           =   2
  63.      Visible         =   0   'False
  64.       End
  65.       Begin Menu mnuRecentFile 
  66.      Caption         =   "RecentFile3"
  67.      Index           =   3
  68.      Visible         =   0   'False
  69.       End
  70.       Begin Menu mnuRecentFile 
  71.      Caption         =   "RecentFile4"
  72.      Index           =   4
  73.      Visible         =   0   'False
  74.       End
  75.    End
  76.    Begin Menu mnuEdit 
  77.       Caption         =   "&Edit"
  78.       Begin Menu mnuECut 
  79.      Caption         =   "Cu&t"
  80.      Shortcut        =   ^X
  81.       End
  82.       Begin Menu mnuECopy 
  83.      Caption         =   "&Copy"
  84.      Shortcut        =   ^C
  85.       End
  86.       Begin Menu mnuEPaste 
  87.      Caption         =   "&Paste"
  88.      Shortcut        =   ^V
  89.       End
  90.       Begin Menu mnuEDelete 
  91.      Caption         =   "De&lete"
  92.      Shortcut        =   {DEL}
  93.       End
  94.       Begin Menu mnuESep1 
  95.      Caption         =   "-"
  96.       End
  97.       Begin Menu mnuESelectAll 
  98.      Caption         =   "Select &All"
  99.       End
  100.       Begin Menu mnuETime 
  101.      Caption         =   "Time/&Date"
  102.       End
  103.    End
  104.    Begin Menu mnuSearch 
  105.       Caption         =   "&Search"
  106.       Begin Menu mnuSFind 
  107.      Caption         =   "&Find"
  108.       End
  109.       Begin Menu mnuSFindNext 
  110.      Caption         =   "Find &Next"
  111.      Shortcut        =   {F3}
  112.       End
  113.    End
  114.    Begin Menu mnuOptions 
  115.       Caption         =   "&Options"
  116.       Begin Menu mnuOToolbar 
  117.      Caption         =   "&Toolbar"
  118.       End
  119.       Begin Menu mnuFont 
  120.      Caption         =   "&Font"
  121.      Begin Menu mnuFontName 
  122.         Caption         =   "FontName"
  123.         Index           =   0
  124.      End
  125.       End
  126.    End
  127.    Begin Menu mnuWindow 
  128.       Caption         =   "&Window"
  129.       WindowList      =   -1  'True
  130.       Begin Menu mnuWCascade 
  131.      Caption         =   "&Cascade"
  132.       End
  133.       Begin Menu mnuWTile 
  134.      Caption         =   "&Tile"
  135.       End
  136.       Begin Menu mnuWArrange 
  137.      Caption         =   "&Arrange Icons"
  138.       End
  139.    End
  140. End
  141.  
  142. Sub Form_Load ()
  143.     Dim i As Integer
  144.     
  145.     mnuFontName(0).Caption = screen.Fonts(0)
  146.     For i = 1 To screen.FontCount - 1
  147.     Load mnuFontName(i)
  148.     mnuFontName(0).Caption = screen.Fonts(i)
  149.     Next
  150. End Sub
  151.  
  152. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  153.     Dim Msg, Filename, NL
  154.     Dim Response As Integer
  155.  
  156.     If FState(Me.Tag).Dirty Then
  157.     Filename = Me.Caption
  158.     NL = Chr$(10) & Chr$(13)
  159.     Msg = "The text in [" & Filename & "] has changed."
  160.     Msg = Msg & NL
  161.     Msg = Msg & "Do you want to save the changes?"
  162.     Response = MsgBox(Msg, 51, frmMDI.Caption)
  163.     Select Case Response
  164.     ' User selects Yes
  165.     Case 6
  166.         'Get the filename to save the file
  167.         Filename = GetFileName()
  168.         'If the user did notspecify a file name,
  169.         'cancel the unload; otherwise, save it.
  170.         If Filename = "" Then
  171.         Cancel = True
  172.         Else
  173.         SaveFileAs (Filename)
  174.         End If
  175.  
  176.     ' User selects No
  177.     ' Ok to unload
  178.     Case 7
  179.         Cancel = False
  180.     ' User selects Cancel
  181.     ' Cancel the unload
  182.     Case 2
  183.         Cancel = True
  184.     End Select
  185.     End If
  186. End Sub
  187.  
  188. Sub Form_Resize ()
  189.     If windowstate <> 1 And ScaleHeight <> 0 Then
  190.     Text1.Visible = False
  191.     Text1.Height = ScaleHeight
  192.     Text1.Width = ScaleWidth
  193.     Text1.Visible = True
  194.     End If
  195. End Sub
  196.  
  197. Sub Form_Unload (Cancel As Integer)
  198.     FState(Me.Tag).Deleted = True
  199.     
  200. 'Hide toolbar edit buttons if no notepad windows
  201.     If Not AnyPadsLeft() Then
  202.     frmMDI!imgCutButton.Visible = False
  203.     frmMDI!imgCopyButton.Visible = False
  204.     frmMDI!imgPasteButton.Visible = False
  205.     End If
  206. End Sub
  207.  
  208. Sub mnuECopy_Click ()
  209.     EditCopyProc
  210. End Sub
  211.  
  212. Sub mnuECut_Click ()
  213.     EditCutProc
  214. End Sub
  215.  
  216. Sub mnuEDelete_Click ()
  217.   ' If cursor is not at the end of the notepad.
  218.   If screen.ActiveControl.SelStart <> Len(screen.ActiveControl.Text) Then
  219.     ' If nothing is selected, extend selection by one.
  220.     If screen.ActiveControl.SelLength = 0 Then
  221.       screen.ActiveControl.SelLength = 1
  222.       ' If cursor is on a blank line, extend selection by two.
  223.       If Asc(screen.ActiveControl.SelText) = 13 Then
  224.     screen.ActiveControl.SelLength = 2
  225.       End If
  226.     End If
  227.     ' Delete selected text.
  228.     screen.ActiveControl.SelText = ""
  229.   End If
  230. End Sub
  231.  
  232. Sub mnuEPaste_Click ()
  233.     EditPasteProc
  234. End Sub
  235.  
  236. Sub mnuESelectAll_Click ()
  237.     frmMDI.ActiveForm.Text1.SelStart = 0
  238.     frmMDI.ActiveForm.Text1.SelLength = Len(frmMDI.ActiveForm.Text1.Text)
  239. End Sub
  240.  
  241. Sub mnuETime_Click ()
  242.     Dim TimeStr As String, DateStr As String
  243.     
  244.     Text1.SelText = Now
  245. End Sub
  246.  
  247. Sub mnuFClose_Click ()
  248.     Unload Me
  249. End Sub
  250.  
  251. Sub mnuFExit_Click ()
  252.     ' Unloading the MDI form invokes the QueryUnload event
  253.     ' for each child form, then the MDI form - before unloading
  254.     ' the MDI form. Setting the Cancel argument to True in any of the
  255.     ' QueryUnload events aborts the unload.
  256.  
  257.     Unload frmMDI
  258.  
  259.  
  260. End Sub
  261.  
  262. Sub mnuFNew_Click ()
  263.     FileNew
  264. End Sub
  265.  
  266. Sub mnuFontName_Click (index As Integer)
  267.     Text1.FontName = mnuFontName(index).Caption
  268. End Sub
  269.  
  270. Sub mnuFOpen_Click ()
  271.     FOpenProc
  272. End Sub
  273.  
  274. Sub mnuFSave_Click ()
  275.     Dim Filename As String
  276.  
  277.     If Left(Me.Caption, 8) = "Untitled" Then
  278.     ' The file hasn't been saved yet,
  279.     ' get the filename, then call the
  280.     ' save procedure
  281.     Filename = GetFileName()
  282.     Else
  283.     ' The caption contains the name of the open file
  284.     Filename = Me.Caption
  285.     End If
  286.     ' call the save procedure, if Filename = Empty then
  287.     ' the user selected Cancel in the Save As dialog, otherwise
  288.     ' save the file
  289.     If Filename <> "" Then
  290.     SaveFileAs Filename
  291.     End If
  292. End Sub
  293.  
  294. Sub mnuFSaveAs_Click ()
  295.     Dim SaveFileName As String
  296.  
  297.     SaveFileName = GetFileName()
  298.     If SaveFileName <> "" Then SaveFileAs (SaveFileName)
  299.     ' Update the recent files menu
  300.     UpdateFileMenu (SaveFileName)
  301. End Sub
  302.  
  303. Sub mnuOptions_Click ()
  304.     mnuOToolbar.Checked = frmMDI!picToolbar.Visible
  305. End Sub
  306.  
  307. Sub mnuOToolbar_Click ()
  308.     OptionsToolbarProc Me
  309. End Sub
  310.  
  311. Sub mnuRecentFile_Click (index As Integer)
  312.   OpenFile (mnuRecentFile(index).Caption)
  313.   ' Update recent files list for new notepad.
  314.   GetRecentFiles
  315. End Sub
  316.  
  317. Sub mnuSFind_Click ()
  318.     If Me!Text1.SelText <> "" Then
  319.     frmFind!Text1.Text = Me!Text1.SelText
  320.     Else
  321.     frmFind!Text1.Text = FindString
  322.     End If
  323.     gFirstTime = True
  324.     frmFind.Show
  325. End Sub
  326.  
  327. Sub mnuSFindNext_Click ()
  328.     If Len(gFindString) > 0 Then
  329.     FindIt
  330.     Else
  331.     mnuSFind_Click
  332.     End If
  333. End Sub
  334.  
  335. Sub mnuWArrange_Click ()
  336.     frmMDI.Arrange ARRANGE_ICONS
  337. End Sub
  338.  
  339. Sub mnuWCascade_Click ()
  340.     frmMDI.Arrange CASCADE
  341. End Sub
  342.  
  343. Sub mnuWTile_Click ()
  344.     frmMDI.Arrange TILE_HORIZONTAL
  345. End Sub
  346.  
  347. Sub Text1_Change ()
  348.     FState(Me.Tag).Dirty = True
  349. End Sub
  350.  
  351. Sub Text1_GotFocus ()
  352.     If frmFind.Visible Then
  353.     frmFind.ZOrder 0
  354.     End If
  355. End Sub
  356.  
  357.