home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l407 / 1.ddi / MDI.FR_ / MDI.bin (.txt)
Encoding:
Visual Basic Form  |  1993-04-28  |  11.7 KB  |  344 lines

  1. VERSION 2.00
  2. Begin MDIForm frmMDI 
  3.    Caption         =   "MDI NotePad"
  4.    ClientHeight    =   4785
  5.    ClientLeft      =   1620
  6.    ClientTop       =   1815
  7.    ClientWidth     =   5685
  8.    Height          =   5475
  9.    Left            =   1560
  10.    LinkTopic       =   "MDIForm1"
  11.    Top             =   1185
  12.    Width           =   5805
  13.    Begin PictureBox picToolbar 
  14.       Align           =   1  'Align Top
  15.       BackColor       =   &H8000000F&
  16.       Height          =   375
  17.       Left            =   0
  18.       ScaleHeight     =   345
  19.       ScaleWidth      =   5655
  20.       TabIndex        =   0
  21.       Top             =   0
  22.       Width           =   5685
  23.       Begin CommonDialog CMDialog1 
  24.          CancelError     =   -1  'True
  25.          Filter          =   "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
  26.          Left            =   1680
  27.          Top             =   0
  28.       End
  29.       Begin Image imgPasteButtonUp 
  30.          Height          =   330
  31.          Left            =   5280
  32.          Picture         =   MDI.FRX:0000
  33.          Top             =   0
  34.          Visible         =   0   'False
  35.          Width           =   375
  36.       End
  37.       Begin Image imgPasteButtonDn 
  38.          Height          =   330
  39.          Left            =   4920
  40.          Picture         =   MDI.FRX:01DA
  41.          Top             =   0
  42.          Visible         =   0   'False
  43.          Width           =   375
  44.       End
  45.       Begin Image imgCopyButtonDn 
  46.          Height          =   330
  47.          Left            =   4200
  48.          Picture         =   MDI.FRX:03B4
  49.          Top             =   0
  50.          Visible         =   0   'False
  51.          Width           =   375
  52.       End
  53.       Begin Image imgCopyButtonUp 
  54.          Height          =   330
  55.          Left            =   4560
  56.          Picture         =   MDI.FRX:058E
  57.          Top             =   0
  58.          Visible         =   0   'False
  59.          Width           =   375
  60.       End
  61.       Begin Image imgCutButtonDn 
  62.          Height          =   330
  63.          Left            =   3840
  64.          Picture         =   MDI.FRX:0768
  65.          Top             =   0
  66.          Visible         =   0   'False
  67.          Width           =   375
  68.       End
  69.       Begin Image imgCutButtonUp 
  70.          Height          =   330
  71.          Left            =   3480
  72.          Picture         =   MDI.FRX:0942
  73.          Top             =   0
  74.          Visible         =   0   'False
  75.          Width           =   375
  76.       End
  77.       Begin Image imgFileOpenButtonDn 
  78.          Height          =   330
  79.          Left            =   2760
  80.          Picture         =   MDI.FRX:0B1C
  81.          Top             =   0
  82.          Visible         =   0   'False
  83.          Width           =   360
  84.       End
  85.       Begin Image imgFileOpenButtonUp 
  86.          Height          =   330
  87.          Left            =   3120
  88.          Picture         =   MDI.FRX:0C9E
  89.          Top             =   0
  90.          Visible         =   0   'False
  91.          Width           =   360
  92.       End
  93.       Begin Image imgFileNewButtonUp 
  94.          Height          =   330
  95.          Left            =   2400
  96.          Picture         =   MDI.FRX:0E20
  97.          Top             =   0
  98.          Visible         =   0   'False
  99.          Width           =   360
  100.       End
  101.       Begin Image imgFileNewButtonDn 
  102.          Height          =   330
  103.          Left            =   2040
  104.          Picture         =   MDI.FRX:0FA2
  105.          Top             =   0
  106.          Visible         =   0   'False
  107.          Width           =   375
  108.       End
  109.       Begin Image imgPasteButton 
  110.          Height          =   330
  111.          Left            =   1560
  112.          Picture         =   MDI.FRX:117C
  113.          Top             =   0
  114.          Width           =   375
  115.       End
  116.       Begin Image imgCopyButton 
  117.          Height          =   330
  118.          Left            =   1200
  119.          Picture         =   MDI.FRX:1356
  120.          Top             =   0
  121.          Width           =   375
  122.       End
  123.       Begin Image imgCutButton 
  124.          Height          =   330
  125.          Left            =   840
  126.          Picture         =   MDI.FRX:1530
  127.          Top             =   0
  128.          Width           =   375
  129.       End
  130.       Begin Image imgFileOpenButton 
  131.          Height          =   330
  132.          Left            =   360
  133.          Picture         =   MDI.FRX:170A
  134.          Top             =   0
  135.          Width           =   360
  136.       End
  137.       Begin Image imgFileNewButton 
  138.          Height          =   330
  139.          Left            =   0
  140.          Picture         =   MDI.FRX:188C
  141.          Top             =   0
  142.          Width           =   360
  143.       End
  144.    End
  145.    Begin Menu mnuFile 
  146.       Caption         =   "&File"
  147.       Begin Menu mnuFNew 
  148.          Caption         =   "&New"
  149.       End
  150.       Begin Menu mnuFOpen 
  151.          Caption         =   "&Open"
  152.       End
  153.       Begin Menu mnuFExit 
  154.          Caption         =   "E&xit"
  155.       End
  156.       Begin Menu mnuRecentFile 
  157.          Caption         =   "-"
  158.          Index           =   0
  159.          Visible         =   0   'False
  160.       End
  161.       Begin Menu mnuRecentFile 
  162.          Caption         =   "RecentFile1"
  163.          Index           =   1
  164.          Visible         =   0   'False
  165.       End
  166.       Begin Menu mnuRecentFile 
  167.          Caption         =   "RecentFile2"
  168.          Index           =   2
  169.          Visible         =   0   'False
  170.       End
  171.       Begin Menu mnuRecentFile 
  172.          Caption         =   "RecentFile3"
  173.          Index           =   3
  174.          Visible         =   0   'False
  175.       End
  176.       Begin Menu mnuRecentFile 
  177.          Caption         =   "RecentFile4"
  178.          Index           =   4
  179.          Visible         =   0   'False
  180.       End
  181.    End
  182.    Begin Menu mnuOptions 
  183.       Caption         =   "&Options"
  184.       Begin Menu mnuOToolbar 
  185.          Caption         =   "&Toolbar"
  186.       End
  187.    End
  188. Sub imgCopyButton_Click ()
  189.     imgCopyButton.Refresh
  190.     EditCopyProc
  191. End Sub
  192. Sub imgCopyButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  193.     imgCopyButton.Picture = imgCopyButtonDn.Picture
  194. End Sub
  195. Sub imgCopyButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  196.     ' If the button is pressed, display the up bitmap if the
  197.     ' mouse is dragged outside the button's area, otherwise
  198.     ' display the up bitmap
  199.     Select Case Button
  200.     Case 1
  201.         If X <= 0 Or X > imgCopyButton.Width Or Y < 0 Or Y > imgCopyButton.Height Then
  202.             imgCopyButton.Picture = imgCopyButtonUp.Picture
  203.         Else
  204.             imgCopyButton.Picture = imgCopyButtonDn.Picture
  205.         End If
  206.     End Select
  207. End Sub
  208. Sub imgCopyButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  209.     imgCopyButton.Picture = imgCopyButtonUp.Picture
  210. End Sub
  211. Sub imgCutButton_Click ()
  212.     imgCutButton.Refresh
  213.     EditCutProc
  214. End Sub
  215. Sub imgCutButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  216.     imgCutButton.Picture = imgCutButtonDn.Picture
  217. End Sub
  218. Sub imgCutButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  219.     ' If the button is pressed, display the up bitmap if the
  220.     ' mouse is dragged outside the button's area, otherwise
  221.     ' display the up bitmap
  222.     Select Case Button
  223.     Case 1
  224.         If X <= 0 Or X > imgCutButton.Width Or Y < 0 Or Y > imgCutButton.Height Then
  225.             imgCutButton.Picture = imgCutButtonUp.Picture
  226.         Else
  227.             imgCutButton.Picture = imgCutButtonDn.Picture
  228.         End If
  229.     End Select
  230. End Sub
  231. Sub imgCutButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  232.     imgCutButton.Picture = imgCutButtonUp.Picture
  233. End Sub
  234. Sub imgFileNewButton_Click ()
  235.     imgFileNewButton.Refresh
  236.     FileNew
  237. End Sub
  238. Sub imgFileNewButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  239.     imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  240. End Sub
  241. Sub imgFileNewButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  242.     ' If the button is pressed, display the up bitmap if the
  243.     ' mouse is dragged outside the button's area, otherwise
  244.     ' display the up bitmap
  245.     Select Case Button
  246.     Case 1
  247.         If X <= 0 Or X > imgFileNewButton.Width Or Y < 0 Or Y > imgFileNewButton.Height Then
  248.             imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  249.         Else
  250.             imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  251.         End If
  252.     End Select
  253. End Sub
  254. Sub imgFileNewButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  255.     imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  256. End Sub
  257. Sub imgFileOpenButton_Click ()
  258.     imgFileOpenButton.Refresh
  259.     FOpenProc
  260. End Sub
  261. Sub imgFileOpenButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  262.     imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  263. End Sub
  264. Sub imgFileOpenButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  265.     ' If the button is pressed, display the up bitmap if the
  266.     ' mouse is dragged outside the button's area, otherwise
  267.     ' display the up bitmap
  268.     Select Case Button
  269.     Case 1
  270.         If X <= 0 Or X > imgFileOpenButton.Width Or Y < 0 Or Y > imgFileOpenButton.Height Then
  271.             imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  272.         Else
  273.             imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  274.         End If
  275.     End Select
  276. End Sub
  277. Sub imgFileOpenButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  278.     imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  279. End Sub
  280. Sub imgPasteButton_Click ()
  281.     imgPasteButton.Refresh
  282.     EditPasteProc
  283. End Sub
  284. Sub imgPasteButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  285.     imgPasteButton.Picture = imgPasteButtonDn.Picture
  286. End Sub
  287. Sub imgPasteButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  288.     ' If the button is pressed, display the up bitmap if the
  289.     ' mouse is dragged outside the button's area, otherwise
  290.     ' display the up bitmap
  291.     Select Case Button
  292.     Case 1
  293.         If X <= 0 Or X > imgPasteButton.Width Or Y < 0 Or Y > imgPasteButton.Height Then
  294.             imgPasteButton.Picture = imgPasteButtonUp.Picture
  295.         Else
  296.             imgPasteButton.Picture = imgPasteButtonDn.Picture
  297.         End If
  298.     End Select
  299. End Sub
  300. Sub imgPasteButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  301.     imgPasteButton.Picture = imgPasteButtonUp.Picture
  302. End Sub
  303. Sub MDIForm_Load ()
  304.     ' Application starts here (Load event of Startup form).
  305.     Show
  306.     ' Always set working directory to directory containing the application.
  307.     ChDir App.Path
  308.     'Initialize document form arrays, and show first document.
  309.     ReDim Document(1)
  310.     ReDim FState(1)
  311.     Document(1).Tag = 1
  312.     FState(1).Dirty = False
  313.     Document(1).Show
  314.     ' Read MDINOTE.INI and set recent file menu items appropriately
  315.     GetRecentFiles
  316. End Sub
  317. Sub MDIForm_Unload (Cancel As Integer)
  318.     ' If the Unload was not canceled (in the QueryUnload events for the Notepad forms)
  319.     ' there will be no document windows left, so go ahead and end the application.
  320.     If Not AnyPadsLeft() Then
  321.         End
  322.     End If
  323. End Sub
  324. Sub mnuFExit_Click ()
  325.     End
  326. End Sub
  327. Sub mnuFNew_Click ()
  328.     FileNew
  329. End Sub
  330. Sub mnuFOpen_Click ()
  331.     FOpenProc
  332. End Sub
  333. Sub mnuOptions_Click ()
  334.     mnuOToolbar.Checked = frmMDI!picToolbar.Visible
  335. End Sub
  336. Sub mnuOToolbar_Click ()
  337.     OptionsToolbarProc Me
  338. End Sub
  339. Sub mnuRecentFile_Click (index As Integer)
  340.   OpenFile (mnuRecentFile(index).Caption)
  341.   ' Update recent files list.
  342.   GetRecentFiles
  343. End Sub
  344.