home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Direkt 1995 #6
/
CDD_6_95.ISO
/
cdd
/
winanw
/
emedit
/
notepad.frm
< prev
next >
Wrap
Text File
|
1994-09-05
|
13KB
|
533 lines
VERSION 2.00
Begin Form frmNotePad
Caption = "Untitled"
ClientHeight = 3552
ClientLeft = 480
ClientTop = 2220
ClientWidth = 5436
Height = 4272
Icon = NOTEPAD.FRX:0000
KeyPreview = -1 'True
Left = 444
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 3552
ScaleWidth = 5436
Top = 1536
Visible = 0 'False
Width = 5508
Begin Editor Text1
BorderStyle = 0 'None
BottomMargin = 0
CaretHeight = -1
CaretWidth = -1
FileOpen = ""
Height = 3420
InsertMode = -1 'True
Left = 120
LeftMargin = 5
Password = 0
ReadOnly = 0 'False
RightMargin = 0
ScrollBars = 3 'Both
SearchCaseSensitive= 0 'False
SearchOrigin = 0 'From Cursor
SearchReplacement= ""
SearchTarget = ""
SearchTo = 1 'Bottom of text
Prop82 = 0 'False
SelBackColor = &H00800000&
SelDefaultType = 1 'Stream
SelDragDropEnable= -1 'True
SelForeColor = &H00FFFFFF&
TabDefaultWidth = -1
TabIndex = 0
Top = 120
TopMargin = 0
UndoLimit = 255
Width = 5115
WrapAutomatically= 0 'False
WrapWholeWords = -1 'True
WrapX = -1
End
Begin Menu mnuFile
Caption = "&File"
Begin Menu mnuFNew
Caption = "&New"
Shortcut = ^N
End
Begin Menu mnuFOpen
Caption = "&Open..."
Shortcut = ^O
End
Begin Menu mnuFClose
Caption = "&Close"
End
Begin Menu mnuFSave
Caption = "&Save"
Shortcut = ^S
End
Begin Menu mnuFSaveAs
Caption = "Save &As..."
End
Begin Menu mnuFilePrintSeparator
Caption = "-"
End
Begin Menu mnuFilePrint
Caption = "&Print"
End
Begin Menu mnuFilePageSetup
Caption = "Page Se&tup..."
End
Begin Menu mnuFilePrintSetup
Caption = "P&rint Setup..."
End
Begin Menu mnuFSep
Caption = "-"
End
Begin Menu mnuFExit
Caption = "E&xit"
End
Begin Menu mnuRecentFile
Caption = "-"
Index = 0
Visible = 0 'False
End
Begin Menu mnuRecentFile
Caption = "RecentFile1"
Index = 1
Visible = 0 'False
End
Begin Menu mnuRecentFile
Caption = "RecentFile2"
Index = 2
Visible = 0 'False
End
Begin Menu mnuRecentFile
Caption = "RecentFile3"
Index = 3
Visible = 0 'False
End
Begin Menu mnuRecentFile
Caption = "RecentFile4"
Index = 4
Visible = 0 'False
End
End
Begin Menu mnuEdit
Caption = "&Edit"
Begin Menu mnuEditUndo
Caption = "&Undo"
Shortcut = %{BKSP}
End
Begin Menu mnuEditRedo
Caption = "&Redo"
End
Begin Menu mnuEditRedoSeparator
Caption = "-"
End
Begin Menu mnuECut
Caption = "Cu&t"
Shortcut = ^X
End
Begin Menu mnuECopy
Caption = "&Copy"
Shortcut = ^C
End
Begin Menu mnuEPaste
Caption = "&Paste"
Shortcut = ^V
End
Begin Menu mnuEditDelete
Caption = "Delete"
End
Begin Menu mnuEditFormat
Caption = "&Format"
End
Begin Menu mnuESep1
Caption = "-"
End
Begin Menu mnuESelectAll
Caption = "Select &All"
End
Begin Menu mnuEditClearAll
Caption = "C&lear All"
End
Begin Menu mnuETime
Caption = "Time/&Date"
End
End
Begin Menu mnuSearch
Caption = "&Search"
Begin Menu mnuSFind
Caption = "&Find..."
End
Begin Menu mnuSearchReplace
Caption = "&Replace..."
End
Begin Menu mnuSFindNext
Caption = "Re&peat"
Shortcut = {F3}
End
Begin Menu mnuSSep
Caption = "-"
End
Begin Menu mnuSGoto
Caption = "&Goto Line..."
Shortcut = ^G
End
End
Begin Menu mnuOptions
Caption = "&Options"
Begin Menu mnuOToolbar
Caption = "&Toolbar"
End
Begin Menu mnuFont
Caption = "&Font..."
End
Begin Menu mnuEditSeparator2
Caption = "-"
End
Begin Menu mnuEditWrap
Caption = "&Wrap"
End
Begin Menu mnuEditWordWrap
Caption = "Wrap W&hole Words"
Checked = -1 'True
End
Begin Menu mnuOptionsDragDropSeparator
Caption = "-"
End
Begin Menu mnuOptionsDragDrop
Caption = "&Drag && Drop Blocks"
Checked = -1 'True
End
End
Begin Menu mnuWindow
Caption = "&Window"
WindowList = -1 'True
Begin Menu mnuWCascade
Caption = "&Cascade"
End
Begin Menu mnuWindowTileHorizontal
Caption = "&Tile"
End
Begin Menu mnuWArrange
Caption = "&Arrange Icons"
End
End
Begin Menu mnuHelp
Caption = "&Help"
Begin Menu mnuHelpAbout
Caption = "&About..."
End
End
End
Option Explicit
Const SmallMarginTwipSize = 0
Declare Function GetKeyState Lib "User" (ByVal nVirtKey As Integer) As Integer
Dim BeginCaretX As Long
Dim BeginCaretY As Long
Dim BeginCount As Long
Dim MessageNesting As Integer
Sub Form_Activate ()
Text1.InsertMode = gfInsertMode
gfBlockType = Text1.SelDefaultType
UpdateToolBar
UpdateStatusLine
End Sub
Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
Dim Msg, Filename, NL
Dim Response As Integer
If Text1.IsDirty Then
Filename = Me.Caption
NL = Chr$(10) & Chr$(13)
Msg = "The text in [" & Filename & "] has changed."
Msg = Msg & NL
Msg = Msg & "Do you want to save the changes?"
Response = MsgBox(Msg, 51, frmMDI.Caption)
Select Case Response
' User selects Yes
Case 6
If Left(Me.Caption, 8) = "Untitled" Then
' The file hasn't been saved yet,
' get the filename, then call the
' save procedure
Filename = GetFileName()
Else
' The caption contains the name of the open file
Filename = Me.Caption
End If
'If the user did notspecify a file name,
'cancel the unload; otherwise, save it.
If Filename = "" Then
Cancel = True
Else
SaveFileAs Me, Filename
End If
' User selects No
' Ok to unload
Case 7
Cancel = False
' User selects Cancel
' Cancel the unload
Case 2
Cancel = True
End Select
End If
End Sub
Sub Form_Resize ()
If windowstate <> 1 And ScaleHeight <> 0 Then
Text1.Visible = False
Text1.Top = SmallMarginTwipSize
Text1.Left = SmallMarginTwipSize
Text1.Height = ScaleHeight - SmallMargin