home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.MDIForm frmMDI
- BackColor = &H8000000C&
- Caption = "MDI NotePad"
- ClientHeight = 3495
- ClientLeft = 915
- ClientTop = 2205
- ClientWidth = 7860
- Height = 4185
- Left = 855
- LinkTopic = "MDIForm1"
- Top = 1575
- Width = 7980
- Begin VB.PictureBox picToolbar
- Align = 1 'Align Top
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 405
- Left = 0
- ScaleHeight = 345
- ScaleWidth = 7800
- TabIndex = 0
- Top = 0
- Width = 7860
- Begin MSComDlg.CommonDialog CMDialog1
- Left = 1995
- Top = 0
- _version = 65536
- _extentx = 847
- _extenty = 847
- _stockprops = 0
- cancelerror = -1 'True
- defaultext = "TXT"
- filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
- End
- Begin VB.Image imgPasteButtonUp
- Height = 330
- Left = 5280
- Picture = "MDI.frx":0000
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Image imgPasteButtonDn
- Height = 330
- Left = 4920
- Picture = "MDI.frx":01E2
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Image imgCopyButtonDn
- Height = 330
- Left = 4200
- Picture = "MDI.frx":03C4
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Image imgCopyButtonUp
- Height = 330
- Left = 4560
- Picture = "MDI.frx":05A6
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Image imgCutButtonDn
- Height = 330
- Left = 3840
- Picture = "MDI.frx":0788
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Image imgCutButtonUp
- Height = 330
- Left = 3480
- Picture = "MDI.frx":096A
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Image imgFileOpenButtonDn
- Height = 330
- Left = 2760
- Picture = "MDI.frx":0B4C
- Top = 0
- Visible = 0 'False
- Width = 360
- End
- Begin VB.Image imgFileOpenButtonUp
- Height = 330
- Left = 3120
- Picture = "MDI.frx":0CD6
- Top = 0
- Visible = 0 'False
- Width = 360
- End
- Begin VB.Image imgFileNewButtonUp
- Height = 330
- Left = 2400
- Picture = "MDI.frx":0E60
- Top = 0
- Visible = 0 'False
- Width = 360
- End
- Begin VB.Image imgFileNewButtonDn
- Height = 330
- Left = 2040
- Picture = "MDI.frx":0FEA
- Top = 0
- Visible = 0 'False
- Width = 375
- End
- Begin VB.Image imgPasteButton
- Height = 330
- Left = 1560
- Picture = "MDI.frx":11CC
- Top = 0
- Width = 375
- End
- Begin VB.Image imgCopyButton
- Height = 330
- Left = 1200
- Picture = "MDI.frx":13AE
- Top = 0
- Width = 375
- End
- Begin VB.Image imgCutButton
- Height = 330
- Left = 840
- Picture = "MDI.frx":1590
- Top = 0
- Width = 375
- End
- Begin VB.Image imgFileOpenButton
- Height = 330
- Left = 360
- Picture = "MDI.frx":1772
- Top = 0
- Width = 360
- End
- Begin VB.Image imgFileNewButton
- Height = 330
- Left = 0
- Picture = "MDI.frx":18FC
- Top = 0
- Width = 360
- End
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFNew
- Caption = "&New"
- End
- Begin VB.Menu mnuFOpen
- Caption = "&Open"
- End
- Begin VB.Menu mnuFExit
- Caption = "E&xit"
- End
- Begin VB.Menu mnuSeparator
- Caption = "-"
- End
- Begin VB.Menu mnuRecentFile
- Caption = "-"
- Index = 0
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile1"
- Index = 1
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile2"
- Index = 2
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile3"
- Index = 3
- Visible = 0 'False
- End
- Begin VB.Menu mnuRecentFile
- Caption = "RecentFile4"
- Index = 4
- Visible = 0 'False
- End
- End
- Begin VB.Menu mnuOptions
- Caption = "&Options"
- Begin VB.Menu mnuOToolbar
- Caption = "&Toolbar"
- End
- End
- Attribute VB_Name = "frmMDI"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Private Sub imgCopyButton_Click()
- imgcopybutton.Refresh
- EditCopyProc
- End Sub
- Private Sub imgCopyButton_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgcopybutton.Picture = imgCopyButtonDn.Picture
- End Sub
- Private Sub imgCopyButton_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
- ' If the button is pressed, display the up bitmap when the
- ' mouse is dragged outside the button's area; otherwise
- ' display the down bitmap.
- Select Case Button
- Case 1
- If x <= 0 Or x > imgcopybutton.Width Or Y < 0 Or Y > imgcopybutton.Height Then
- imgcopybutton.Picture = imgCopyButtonUp.Picture
- Else
- imgcopybutton.Picture = imgCopyButtonDn.Picture
- End If
- End Select
- End Sub
- Private Sub imgCopyButton_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgcopybutton.Picture = imgCopyButtonUp.Picture
- End Sub
- Private Sub imgCutButton_Click()
- imgcutbutton.Refresh
- EditCutProc
- End Sub
- Private Sub imgCutButton_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgcutbutton.Picture = imgCutButtonDn.Picture
- End Sub
- Private Sub imgCutButton_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
- ' If the button is pressed, display the up bitmap when the
- ' mouse is dragged outside the button's area; otherwise,
- ' display the down bitmap.
- Select Case Button
- Case 1
- If x <= 0 Or x > imgcutbutton.Width Or Y < 0 Or Y > imgcutbutton.Height Then
- imgcutbutton.Picture = imgCutButtonUp.Picture
- Else
- imgcutbutton.Picture = imgCutButtonDn.Picture
- End If
- End Select
- End Sub
- Private Sub imgCutButton_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgcutbutton.Picture = imgCutButtonUp.Picture
- End Sub
- Private Sub imgFileNewButton_Click()
- imgFileNewButton.Refresh
- FileNew
- End Sub
- Private Sub imgFileNewButton_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgFileNewButton.Picture = imgFileNewButtonDn.Picture
- End Sub
- Private Sub imgFileNewButton_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
- ' If the button is pressed, display the up bitmap when the
- ' mouse is dragged outside the button's area; otherwise,
- ' display the down bitmap.
- Select Case Button
- Case 1
- If x <= 0 Or x > imgFileNewButton.Width Or Y < 0 Or Y > imgFileNewButton.Height Then
- imgFileNewButton.Picture = imgFileNewButtonUp.Picture
- Else
- imgFileNewButton.Picture = imgFileNewButtonDn.Picture
- End If
- End Select
- End Sub
- Private Sub imgFileNewButton_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgFileNewButton.Picture = imgFileNewButtonUp.Picture
- End Sub
- Private Sub imgFileOpenButton_Click()
- imgFileOpenButton.Refresh
- FOpenProc
- End Sub
- Private Sub imgFileOpenButton_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
- End Sub
- Private Sub imgFileOpenButton_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
- ' If the button is pressed, display the up bitmap when the
- ' mouse is dragged outside the button's area; otherwise,
- ' display the down bitmap.
- Select Case Button
- Case 1
- If x <= 0 Or x > imgFileOpenButton.Width Or Y < 0 Or Y > imgFileOpenButton.Height Then
- imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
- Else
- imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
- End If
- End Select
- End Sub
- Private Sub imgFileOpenButton_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
- End Sub
- Private Sub imgPasteButton_Click()
- imgPasteButton.Refresh
- EditPasteProc
- End Sub
- Private Sub imgPasteButton_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgPasteButton.Picture = imgPasteButtonDn.Picture
- End Sub
- Private Sub imgPasteButton_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
- ' If the button is pressed, display the up bitmap when the
- ' mouse is dragged outside the button's area; otherwise,
- ' display the down bitmap.
- Select Case Button
- Case 1
- If x <= 0 Or x > imgPasteButton.Width Or Y < 0 Or Y > imgPasteButton.Height Then
- imgPasteButton.Picture = imgPasteButtonUp.Picture
- Else
- imgPasteButton.Picture = imgPasteButtonDn.Picture
- End If
- End Select
- End Sub
- Private Sub imgPasteButton_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
- imgPasteButton.Picture = imgPasteButtonUp.Picture
- End Sub
- Private Sub MDIForm_Load()
- ' Application starts here (Load event of Startup form).
- Show
- ' Always set the working directory to the directory containing the application.
- ChDir App.Path
- ' Initialize the document form array, and show the first document.
- ReDim Document(1)
- ReDim FState(1)
- Document(1).Tag = 1
- FState(1).Dirty = False
- ' Read System registry and set the recent menu file list control array appropriately.
- GetRecentFiles
- ' Set global variable gFindDirection which determines which direction
- ' the FindIt function will search in.
- gFindDirection = 1
- End Sub
- Private Sub MDIForm_Unload(Cancel As Integer)
- ' If the Unload event was not cancelled (in the QueryUnload events for the Notepad forms),
- ' there will be no document window left, so go ahead and end the application.
- If Not AnyPadsLeft() Then
- End
- End If
- End Sub
- Private Sub mnuFExit_Click()
- End
- End Sub
- Private Sub mnuFileSend_Click()
- End Sub
- Private Sub mnuFNew_Click()
- FileNew
- End Sub
- Private Sub mnuFOpen_Click()
- FOpenProc
- End Sub
- Private Sub mnuOptions_Click()
- mnuOToolbar.Checked = frmMDI!picToolbar.Visible
- End Sub
- Private Sub mnuOToolbar_Click()
- OptionsToolbarProc Me
- End Sub
- Private Sub mnuRecentFile_Click(index As Integer)
- OpenFile (mnuRecentFile(index).Caption)
- ' Update the list of the most recently opened files.
- GetRecentFiles
- End Sub
-