home *** CD-ROM | disk | FTP | other *** search
/ CD Direkt 1995 #6 / CDD_6_95.ISO / cdd / winanw / emedit / notepad.frm < prev    next >
Text File  |  1994-09-05  |  13KB  |  533 lines

  1. VERSION 2.00
  2. Begin Form frmNotePad 
  3.    Caption         =   "Untitled"
  4.    ClientHeight    =   3552
  5.    ClientLeft      =   480
  6.    ClientTop       =   2220
  7.    ClientWidth     =   5436
  8.    Height          =   4272
  9.    Icon            =   NOTEPAD.FRX:0000
  10.    KeyPreview      =   -1  'True
  11.    Left            =   444
  12.    LinkTopic       =   "Form1"
  13.    MDIChild        =   -1  'True
  14.    ScaleHeight     =   3552
  15.    ScaleWidth      =   5436
  16.    Top             =   1536
  17.    Visible         =   0   'False
  18.    Width           =   5508
  19.    Begin Editor Text1 
  20.       BorderStyle     =   0  'None
  21.       BottomMargin    =   0
  22.       CaretHeight     =   -1
  23.       CaretWidth      =   -1
  24.       FileOpen        =   ""
  25.       Height          =   3420
  26.       InsertMode      =   -1  'True
  27.       Left            =   120
  28.       LeftMargin      =   5
  29.       Password        =   0
  30.       ReadOnly        =   0   'False
  31.       RightMargin     =   0
  32.       ScrollBars      =   3  'Both
  33.       SearchCaseSensitive=   0   'False
  34.       SearchOrigin    =   0  'From Cursor
  35.       SearchReplacement=   ""
  36.       SearchTarget    =   ""
  37.       SearchTo        =   1  'Bottom of text
  38.       Prop82          =   0   'False
  39.       SelBackColor    =   &H00800000&
  40.       SelDefaultType  =   1  'Stream
  41.       SelDragDropEnable=   -1  'True
  42.       SelForeColor    =   &H00FFFFFF&
  43.       TabDefaultWidth =   -1
  44.       TabIndex        =   0
  45.       Top             =   120
  46.       TopMargin       =   0
  47.       UndoLimit       =   255
  48.       Width           =   5115
  49.       WrapAutomatically=   0   'False
  50.       WrapWholeWords  =   -1  'True
  51.       WrapX           =   -1
  52.    End
  53.    Begin Menu mnuFile 
  54.       Caption         =   "&File"
  55.       Begin Menu mnuFNew 
  56.          Caption         =   "&New"
  57.          Shortcut        =   ^N
  58.       End
  59.       Begin Menu mnuFOpen 
  60.          Caption         =   "&Open..."
  61.          Shortcut        =   ^O
  62.       End
  63.       Begin Menu mnuFClose 
  64.          Caption         =   "&Close"
  65.       End
  66.       Begin Menu mnuFSave 
  67.          Caption         =   "&Save"
  68.          Shortcut        =   ^S
  69.       End
  70.       Begin Menu mnuFSaveAs 
  71.          Caption         =   "Save &As..."
  72.       End
  73.       Begin Menu mnuFilePrintSeparator 
  74.          Caption         =   "-"
  75.       End
  76.       Begin Menu mnuFilePrint 
  77.          Caption         =   "&Print"
  78.       End
  79.       Begin Menu mnuFilePageSetup 
  80.          Caption         =   "Page Se&tup..."
  81.       End
  82.       Begin Menu mnuFilePrintSetup 
  83.          Caption         =   "P&rint Setup..."
  84.       End
  85.       Begin Menu mnuFSep 
  86.          Caption         =   "-"
  87.       End
  88.       Begin Menu mnuFExit 
  89.          Caption         =   "E&xit"
  90.       End
  91.       Begin Menu mnuRecentFile 
  92.          Caption         =   "-"
  93.          Index           =   0
  94.          Visible         =   0   'False
  95.       End
  96.       Begin Menu mnuRecentFile 
  97.          Caption         =   "RecentFile1"
  98.          Index           =   1
  99.          Visible         =   0   'False
  100.       End
  101.       Begin Menu mnuRecentFile 
  102.          Caption         =   "RecentFile2"
  103.          Index           =   2
  104.          Visible         =   0   'False
  105.       End
  106.       Begin Menu mnuRecentFile 
  107.          Caption         =   "RecentFile3"
  108.          Index           =   3
  109.          Visible         =   0   'False
  110.       End
  111.       Begin Menu mnuRecentFile 
  112.          Caption         =   "RecentFile4"
  113.          Index           =   4
  114.          Visible         =   0   'False
  115.       End
  116.    End
  117.    Begin Menu mnuEdit 
  118.       Caption         =   "&Edit"
  119.       Begin Menu mnuEditUndo 
  120.          Caption         =   "&Undo"
  121.          Shortcut        =   %{BKSP}
  122.       End
  123.       Begin Menu mnuEditRedo 
  124.          Caption         =   "&Redo"
  125.       End
  126.       Begin Menu mnuEditRedoSeparator 
  127.          Caption         =   "-"
  128.       End
  129.       Begin Menu mnuECut 
  130.          Caption         =   "Cu&t"
  131.          Shortcut        =   ^X
  132.       End
  133.       Begin Menu mnuECopy 
  134.          Caption         =   "&Copy"
  135.          Shortcut        =   ^C
  136.       End
  137.       Begin Menu mnuEPaste 
  138.          Caption         =   "&Paste"
  139.          Shortcut        =   ^V
  140.       End
  141.       Begin Menu mnuEditDelete 
  142.          Caption         =   "Delete"
  143.       End
  144.       Begin Menu mnuEditFormat 
  145.          Caption         =   "&Format"
  146.       End
  147.       Begin Menu mnuESep1 
  148.          Caption         =   "-"
  149.       End
  150.       Begin Menu mnuESelectAll 
  151.          Caption         =   "Select &All"
  152.       End
  153.       Begin Menu mnuEditClearAll 
  154.          Caption         =   "C&lear All"
  155.       End
  156.       Begin Menu mnuETime 
  157.          Caption         =   "Time/&Date"
  158.       End
  159.    End
  160.    Begin Menu mnuSearch 
  161.       Caption         =   "&Search"
  162.       Begin Menu mnuSFind 
  163.          Caption         =   "&Find..."
  164.       End
  165.       Begin Menu mnuSearchReplace 
  166.          Caption         =   "&Replace..."
  167.       End
  168.       Begin Menu mnuSFindNext 
  169.          Caption         =   "Re&peat"
  170.          Shortcut        =   {F3}
  171.       End
  172.       Begin Menu mnuSSep 
  173.          Caption         =   "-"
  174.       End
  175.       Begin Menu mnuSGoto 
  176.          Caption         =   "&Goto Line..."
  177.          Shortcut        =   ^G
  178.       End
  179.    End
  180.    Begin Menu mnuOptions 
  181.       Caption         =   "&Options"
  182.       Begin Menu mnuOToolbar 
  183.          Caption         =   "&Toolbar"
  184.       End
  185.       Begin Menu mnuFont 
  186.          Caption         =   "&Font..."
  187.       End
  188.       Begin Menu mnuEditSeparator2 
  189.          Caption         =   "-"
  190.       End
  191.       Begin Menu mnuEditWrap 
  192.          Caption         =   "&Wrap"
  193.       End
  194.       Begin Menu mnuEditWordWrap 
  195.          Caption         =   "Wrap W&hole Words"
  196.          Checked         =   -1  'True
  197.       End
  198.       Begin Menu mnuOptionsDragDropSeparator 
  199.          Caption         =   "-"
  200.       End
  201.       Begin Menu mnuOptionsDragDrop 
  202.          Caption         =   "&Drag && Drop Blocks"
  203.          Checked         =   -1  'True
  204.       End
  205.    End
  206.    Begin Menu mnuWindow 
  207.       Caption         =   "&Window"
  208.       WindowList      =   -1  'True
  209.       Begin Menu mnuWCascade 
  210.          Caption         =   "&Cascade"
  211.       End
  212.       Begin Menu mnuWindowTileHorizontal 
  213.          Caption         =   "&Tile"
  214.       End
  215.       Begin Menu mnuWArrange 
  216.          Caption         =   "&Arrange Icons"
  217.       End
  218.    End
  219.    Begin Menu mnuHelp 
  220.       Caption         =   "&Help"
  221.       Begin Menu mnuHelpAbout 
  222.          Caption         =   "&About..."
  223.       End
  224.    End
  225. End
  226. Option Explicit
  227.  
  228. Const SmallMarginTwipSize = 0
  229. Declare Function GetKeyState Lib "User" (ByVal nVirtKey As Integer) As Integer
  230.  
  231. Dim BeginCaretX As Long
  232. Dim BeginCaretY As Long
  233. Dim BeginCount As Long
  234. Dim MessageNesting As Integer
  235.  
  236. Sub Form_Activate ()
  237.   Text1.InsertMode = gfInsertMode
  238.   gfBlockType = Text1.SelDefaultType
  239.   UpdateToolBar
  240.   UpdateStatusLine
  241. End Sub
  242.  
  243. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  244.     Dim Msg, Filename, NL
  245.     Dim Response As Integer
  246.  
  247.     If Text1.IsDirty Then
  248.     Filename = Me.Caption
  249.     NL = Chr$(10) & Chr$(13)
  250.     Msg = "The text in [" & Filename & "] has changed."
  251.     Msg = Msg & NL
  252.     Msg = Msg & "Do you want to save the changes?"
  253.     Response = MsgBox(Msg, 51, frmMDI.Caption)
  254.     Select Case Response
  255.     ' User selects Yes
  256.     Case 6
  257.         If Left(Me.Caption, 8) = "Untitled" Then
  258.         ' The file hasn't been saved yet,
  259.         ' get the filename, then call the
  260.         ' save procedure
  261.         Filename = GetFileName()
  262.         Else
  263.         ' The caption contains the name of the open file
  264.         Filename = Me.Caption
  265.         End If
  266.  
  267.         'If the user did notspecify a file name,
  268.         'cancel the unload; otherwise, save it.
  269.         If Filename = "" Then
  270.         Cancel = True
  271.         Else
  272.         SaveFileAs Me, Filename
  273.         End If
  274.  
  275.     ' User selects No
  276.     ' Ok to unload
  277.     Case 7
  278.         Cancel = False
  279.     ' User selects Cancel
  280.     ' Cancel the unload
  281.     Case 2
  282.         Cancel = True
  283.     End Select
  284.     End If
  285. End Sub
  286.  
  287. Sub Form_Resize ()
  288.     If windowstate <> 1 And ScaleHeight <> 0 Then
  289.     Text1.Visible = False
  290.     Text1.Top = SmallMarginTwipSize
  291.     Text1.Left = SmallMarginTwipSize
  292.     Text1.Height = ScaleHeight - SmallMargin