home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 13 / CD_ASCQ_13_0494.iso / maj / 1697 / samples / mdi.frm < prev    next >
Text File  |  1993-11-21  |  31KB  |  931 lines

  1. VERSION 2.00
  2. Begin MDIForm frmMDI 
  3.    Caption         =   "Early Morning Editor"
  4.    Height          =   5775
  5.    Icon            =   MDI.FRX:0000
  6.    Left            =   375
  7.    LinkTopic       =   "MDIForm1"
  8.    Top             =   480
  9.    Width           =   5700
  10.    Begin PictureBox pictStatusBar 
  11.       Align           =   2  'Align Bottom
  12.       AutoRedraw      =   -1  'True
  13.       BackColor       =   &H00C0C0C0&
  14.       BorderStyle     =   0  'None
  15.       ClipControls    =   0   'False
  16.       Enabled         =   0   'False
  17.       Height          =   345
  18.       Left            =   0
  19.       ScaleHeight     =   345
  20.       ScaleWidth      =   5580
  21.       TabIndex        =   1
  22.       Top             =   4740
  23.       Width           =   5580
  24.       Begin Label labelPosition 
  25.          BackStyle       =   0  'Transparent
  26.          Height          =   195
  27.          Left            =   1005
  28.          TabIndex        =   2
  29.          Top             =   90
  30.          Width           =   31920
  31.       End
  32.       Begin Label labelInsert 
  33.          Alignment       =   2  'Center
  34.          BackStyle       =   0  'Transparent
  35.          Caption         =   "Insert"
  36.          Height          =   195
  37.          Left            =   90
  38.          TabIndex        =   3
  39.          Top             =   90
  40.          Width           =   825
  41.       End
  42.       Begin Line TopLine2 
  43.          BorderColor     =   &H00000000&
  44.          Index           =   0
  45.          X1              =   0
  46.          X2              =   32000
  47.          Y1              =   0
  48.          Y2              =   0
  49.       End
  50.       Begin Line TopLine2 
  51.          BorderColor     =   &H00FFFFFF&
  52.          Index           =   1
  53.          X1              =   0
  54.          X2              =   32000
  55.          Y1              =   15
  56.          Y2              =   15
  57.       End
  58.       Begin Line TimeBoxLine 
  59.          BorderColor     =   &H00808080&
  60.          Index           =   0
  61.          X1              =   975
  62.          X2              =   31995
  63.          Y1              =   60
  64.          Y2              =   60
  65.       End
  66.       Begin Line TimeBoxSide 
  67.          BorderColor     =   &H00808080&
  68.          Index           =   0
  69.          X1              =   975
  70.          X2              =   975
  71.          Y1              =   75
  72.          Y2              =   315
  73.       End
  74.       Begin Line TimeBoxLine 
  75.          BorderColor     =   &H00FFFFFF&
  76.          Index           =   1
  77.          X1              =   975
  78.          X2              =   32000
  79.          Y1              =   300
  80.          Y2              =   300
  81.       End
  82.       Begin Line MsgBoxLine 
  83.          BorderColor     =   &H00808080&
  84.          Index           =   0
  85.          X1              =   60
  86.          X2              =   915
  87.          Y1              =   60
  88.          Y2              =   60
  89.       End
  90.       Begin Line MsgBoxLine 
  91.          BorderColor     =   &H00FFFFFF&
  92.          Index           =   1
  93.          X1              =   60
  94.          X2              =   915
  95.          Y1              =   300
  96.          Y2              =   300
  97.       End
  98.       Begin Line MsgBoxSide 
  99.          BorderColor     =   &H00808080&
  100.          Index           =   0
  101.          X1              =   60
  102.          X2              =   60
  103.          Y1              =   60
  104.          Y2              =   300
  105.       End
  106.       Begin Line MsgBoxSide 
  107.          BorderColor     =   &H00FFFFFF&
  108.          Index           =   1
  109.          X1              =   915
  110.          X2              =   915
  111.          Y1              =   60
  112.          Y2              =   310
  113.       End
  114.    End
  115.    Begin PictureBox picToolbar 
  116.       Align           =   1  'Align Top
  117.       BackColor       =   &H8000000F&
  118.       Height          =   435
  119.       Left            =   0
  120.       ScaleHeight     =   405
  121.       ScaleWidth      =   5550
  122.       TabIndex        =   0
  123.       Top             =   0
  124.       Width           =   5580
  125.       Begin CommonDialog CMFontDialog 
  126.          Left            =   5430
  127.          Top             =   30
  128.       End
  129.       Begin CommonDialog CMDialog1 
  130.          CancelError     =   -1  'True
  131.          Filter          =   "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
  132.          Left            =   5850
  133.          Top             =   0
  134.       End
  135.       Begin Image imgNextButtonUp 
  136.          Height          =   330
  137.          Left            =   8385
  138.          Picture         =   MDI.FRX:0302
  139.          Top             =   135
  140.          Visible         =   0   'False
  141.          Width           =   360
  142.       End
  143.       Begin Image imgNextButtonDn 
  144.          Height          =   330
  145.          Left            =   8805
  146.          Picture         =   MDI.FRX:0484
  147.          Top             =   90
  148.          Visible         =   0   'False
  149.          Width           =   360
  150.       End
  151.       Begin Image imgLookButtonDn 
  152.          Height          =   330
  153.          Left            =   8055
  154.          Picture         =   MDI.FRX:0606
  155.          Top             =   105
  156.          Visible         =   0   'False
  157.          Width           =   360
  158.       End
  159.       Begin Image imgLookButtonUp 
  160.          Height          =   330
  161.          Left            =   7605
  162.          Picture         =   MDI.FRX:0788
  163.          Top             =   120
  164.          Visible         =   0   'False
  165.          Width           =   360
  166.       End
  167.       Begin Image imgNextButton 
  168.          Height          =   330
  169.          Left            =   2850
  170.          Picture         =   MDI.FRX:090A
  171.          Tag             =   "Repeat last find or replace operation"
  172.          Top             =   30
  173.          Width           =   360
  174.       End
  175.       Begin Image imgLookButton 
  176.          Height          =   330
  177.          Left            =   2490
  178.          Picture         =   MDI.FRX:0A8C
  179.          Tag             =   "Searsh for text"
  180.          Top             =   30
  181.          Width           =   360
  182.       End
  183.       Begin Image imgUndoButtonUp 
  184.          Height          =   330
  185.          Left            =   6570
  186.          Picture         =   MDI.FRX:0C0E
  187.          Top             =   30
  188.          Visible         =   0   'False
  189.          Width           =   360
  190.       End
  191.       Begin Image imgUndoButtonDown 
  192.          Height          =   330
  193.          Left            =   6360
  194.          Picture         =   MDI.FRX:0D90
  195.          Top             =   30
  196.          Visible         =   0   'False
  197.          Width           =   360
  198.       End
  199.       Begin Image imgUndoButton 
  200.          Height          =   330
  201.          Left            =   2010
  202.          Picture         =   MDI.FRX:0F12
  203.          Tag             =   "Undo the previous edit action"
  204.          Top             =   30
  205.          Visible         =   0   'False
  206.          Width           =   360
  207.       End
  208.       Begin Image imgStreamButtonPushed 
  209.          Height          =   330
  210.          Left            =   6870
  211.          Picture         =   MDI.FRX:1094
  212.          Top             =   30
  213.          Visible         =   0   'False
  214.          Width           =   360
  215.       End
  216.       Begin Image imgLineButtonPushed 
  217.          Height          =   330
  218.          Left            =   6630
  219.          Picture         =   MDI.FRX:1216
  220.          Top             =   30
  221.          Visible         =   0   'False
  222.          Width           =   360
  223.       End
  224.       Begin Image imgColumnButtonPushed 
  225.          Height          =   330
  226.          Left            =   6810
  227.          Picture         =   MDI.FRX:1398
  228.          Top             =   30
  229.          Visible         =   0   'False
  230.          Width           =   360
  231.       End
  232.       Begin Image imgLineButtonDown 
  233.          Height          =   330
  234.          Left            =   6720
  235.          Picture         =   MDI.FRX:151A
  236.          Top             =   0
  237.          Visible         =   0   'False
  238.          Width           =   360
  239.       End
  240.       Begin Image imgLineButtonUp 
  241.          Height          =   330
  242.          Left            =   6600
  243.          Picture         =   MDI.FRX:169C
  244.          Top             =   30
  245.          Visible         =   0   'False
  246.          Width           =   360
  247.       End
  248.       Begin Image imgColumnButtonUp 
  249.          Height          =   330
  250.          Left            =   6600
  251.          Picture         =   MDI.FRX:181E
  252.          Top             =   0
  253.          Visible         =   0   'False
  254.          Width           =   360
  255.       End
  256.       Begin Image imgColumnButtonDown 
  257.          Height          =   330
  258.          Left            =   6540
  259.          Picture         =   MDI.FRX:19A0
  260.          Top             =   30
  261.          Visible         =   0   'False
  262.          Width           =   360
  263.       End
  264.       Begin Image imgLineButton 
  265.          Height          =   330
  266.          Left            =   3690
  267.          Picture         =   MDI.FRX:1B22
  268.          Tag             =   "Make line blocks the default block type"
  269.          Top             =   30
  270.          Width           =   360
  271.       End
  272.       Begin Image imgColumnButton 
  273.          Height          =   330
  274.          Left            =   4050
  275.          Picture         =   MDI.FRX:1CA4
  276.          Tag             =   "Make column blocks the default block type"
  277.          Top             =   30
  278.          Width           =   360
  279.       End
  280.       Begin Image imgStreamButton 
  281.          Height          =   330
  282.          Left            =   3330
  283.          Picture         =   MDI.FRX:1E26
  284.          Tag             =   "Make stream blocks the default block type"
  285.          Top             =   30
  286.          Width           =   360
  287.       End
  288.       Begin Image imgStreamButtonDown 
  289.          Height          =   330
  290.          Left            =   6750
  291.          Picture         =   MDI.FRX:1FA8
  292.          Top             =   30
  293.          Visible         =   0   'False
  294.          Width           =   360
  295.       End
  296.       Begin Image imgStreamButtonUp 
  297.          Height          =   330
  298.          Left            =   6570
  299.          Picture         =   MDI.FRX:212A
  300.          Top             =   30
  301.          Visible         =   0   'False
  302.          Width           =   360
  303.       End
  304.       Begin Image imgPasteButtonUp 
  305.          Height          =   330
  306.          Left            =   7020
  307.          Picture         =   MDI.FRX:22AC
  308.          Top             =   0
  309.          Visible         =   0   'False
  310.          Width           =   375
  311.       End
  312.       Begin Image imgPasteButtonDn 
  313.          Height          =   330
  314.          Left            =   6900
  315.          Picture         =   MDI.FRX:2486
  316.          Top             =   -30
  317.          Visible         =   0   'False
  318.          Width           =   375
  319.       End
  320.       Begin Image imgCopyButtonDn 
  321.          Height          =   330
  322.          Left            =   6840
  323.          Picture         =   MDI.FRX:2660
  324.          Top             =   0
  325.          Visible         =   0   'False
  326.          Width           =   375
  327.       End
  328.       Begin Image imgCopyButtonUp 
  329.          Height          =   330
  330.          Left            =   6870
  331.          Picture         =   MDI.FRX:283A
  332.          Top             =   0
  333.          Visible         =   0   'False
  334.          Width           =   375
  335.       End
  336.       Begin Image imgCutButtonDn 
  337.          Height          =   330
  338.          Left            =   6870
  339.          Picture         =   MDI.FRX:2A14
  340.          Top             =   0
  341.          Visible         =   0   'False
  342.          Width           =   375
  343.       End
  344.       Begin Image imgCutButtonUp 
  345.          Height          =   330
  346.          Left            =   6690
  347.          Picture         =   MDI.FRX:2BEE
  348.          Top             =   0
  349.          Visible         =   0   'False
  350.          Width           =   375
  351.       End
  352.       Begin Image imgFileOpenButtonDn 
  353.          Height          =   330
  354.          Left            =   6540
  355.          Picture         =   MDI.FRX:2DC8
  356.          Top             =   -30
  357.          Visible         =   0   'False
  358.          Width           =   360
  359.       End
  360.       Begin Image imgFileOpenButtonUp 
  361.          Height          =   330
  362.          Left            =   6600
  363.          Picture         =   MDI.FRX:2F4A
  364.          Top             =   0
  365.          Visible         =   0   'False
  366.          Width           =   360
  367.       End
  368.       Begin Image imgFileNewButtonUp 
  369.          Height          =   330
  370.          Left            =   6690
  371.          Picture         =   MDI.FRX:30CC
  372.          Top             =   0
  373.          Visible         =   0   'False
  374.          Width           =   360
  375.       End
  376.       Begin Image imgFileNewButtonDn 
  377.          Height          =   330
  378.          Left            =   6540
  379.          Picture         =   MDI.FRX:324E
  380.          Top             =   30
  381.          Visible         =   0   'False
  382.          Width           =   375
  383.       End
  384.       Begin Image imgPasteButton 
  385.          Height          =   330
  386.          Left            =   1650
  387.          Picture         =   MDI.FRX:3428
  388.          Tag             =   "Paste the Clipboard text at the insertion point"
  389.          Top             =   30
  390.          Width           =   375
  391.       End
  392.       Begin Image imgCopyButton 
  393.          Height          =   330
  394.          Left            =   1290
  395.          Picture         =   MDI.FRX:3602
  396.          Tag             =   "Copy the selected text to the Clipboard"
  397.          Top             =   30
  398.          Width           =   375
  399.       End
  400.       Begin Image imgCutButton 
  401.          Height          =   330
  402.          Left            =   930
  403.          Picture         =   MDI.FRX:37DC
  404.          Tag             =   "Move the selected text to the Clipboard"
  405.          Top             =   30
  406.          Width           =   375
  407.       End
  408.       Begin Image imgFileOpenButton 
  409.          Height          =   330
  410.          Left            =   450
  411.          Picture         =   MDI.FRX:39B6
  412.          Tag             =   "Open an existing file"
  413.          Top             =   30
  414.          Width           =   360
  415.       End
  416.       Begin Image imgFileNewButton 
  417.          Height          =   330
  418.          Left            =   90
  419.          Picture         =   MDI.FRX:3B38
  420.          Tag             =   "Create a new file"
  421.          Top             =   30
  422.          Width           =   360
  423.       End
  424.    End
  425.    Begin Menu mnuFile 
  426.       Caption         =   "&File"
  427.       Begin Menu mnuFNew 
  428.          Caption         =   "&New"
  429.       End
  430.       Begin Menu mnuFOpen 
  431.          Caption         =   "&Open..."
  432.       End
  433.       Begin Menu mnuFExit 
  434.          Caption         =   "E&xit"
  435.       End
  436.       Begin Menu mnuRecentFile 
  437.          Caption         =   "-"
  438.          Index           =   0
  439.          Visible         =   0   'False
  440.       End
  441.       Begin Menu mnuRecentFile 
  442.          Caption         =   "RecentFile1"
  443.          Index           =   1
  444.          Visible         =   0   'False
  445.       End
  446.       Begin Menu mnuRecentFile 
  447.          Caption         =   "RecentFile2"
  448.          Index           =   2
  449.          Visible         =   0   'False
  450.       End
  451.       Begin Menu mnuRecentFile 
  452.          Caption         =   "RecentFile3"
  453.          Index           =   3
  454.          Visible         =   0   'False
  455.       End
  456.       Begin Menu mnuRecentFile 
  457.          Caption         =   "RecentFile4"
  458.          Index           =   4
  459.          Visible         =   0   'False
  460.       End
  461.    End
  462.    Begin Menu mnuOptions 
  463.       Caption         =   "&Options"
  464.       Begin Menu mnuOToolbar 
  465.          Caption         =   "&Toolbar"
  466.       End
  467.    End
  468.    Begin Menu mnuHelp 
  469.       Caption         =   "&Help"
  470.       Begin Menu mnuHelpAbout 
  471.          Caption         =   "&About..."
  472.       End
  473.    End
  474. End
  475. Option Explicit
  476.  
  477. Sub BlockButton_Click (nButton As Integer)
  478.     SetBlockType (nButton)
  479.     UpdateToolBar
  480.     imgStreamButton.Refresh
  481.     imgLineButton.Refresh
  482.     imgColumnButton.Refresh
  483. End Sub
  484.  
  485. Sub DisplayButtonText (imgButtonText As String)
  486.   labelPosition.Caption = imgButtonText
  487. End Sub
  488.  
  489. Sub imgColumnButton_Click ()
  490.     imgColumnButton.Refresh
  491.     BlockButton_Click (3)
  492. End Sub
  493.  
  494. Sub imgColumnButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  495.     If gfBlockType = 3 Then
  496.         imgColumnButton.Picture = imgColumnButtonPushed.Picture
  497.     Else
  498.         imgColumnButton.Picture = imgColumnButtonDown.Picture
  499.     End If
  500.     DisplayButtonText (imgColumnButton.Tag)
  501. End Sub
  502.  
  503. Sub imgColumnButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  504.     ' If the button is pressed, display the up bitmap if the
  505.     ' mouse is dragged outside the button's area, otherwise
  506.     ' display the up bitmap
  507.     Select Case Button
  508.     Case 1
  509.         If X <= 0 Or X > imgColumnButton.Width Or Y < 0 Or Y > imgColumnButton.Height Then
  510.             If gfBlockType <> 3 Then
  511.                 imgColumnButton.Picture = imgColumnButtonUp.Picture
  512.             Else
  513.                 imgColumnButton.Picture = imgColumnButtonPushed.Picture
  514.             End If
  515.         Else
  516.             If gfBlockType <> 3 Then
  517.                 imgColumnButton.Picture = imgColumnButtonDown.Picture
  518.             Else
  519.                 imgColumnButton.Picture = imgColumnButtonPushed.Picture
  520.             End If
  521.         End If
  522.     End Select
  523. End Sub
  524.  
  525. Sub imgColumnButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  526.     UpdateStatusLine
  527. End Sub
  528.  
  529. Sub imgCopyButton_Click ()
  530.     imgCopyButton.Refresh
  531.     EditCopyProc
  532. End Sub
  533.  
  534. Sub imgCopyButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  535.     imgCopyButton.Picture = imgCopyButtonDn.Picture
  536.     DisplayButtonText (imgCopyButton.Tag)
  537. End Sub
  538.  
  539. Sub imgCopyButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  540.     ' If the button is pressed, display the up bitmap if the
  541.     ' mouse is dragged outside the button's area, otherwise
  542.     ' display the up bitmap
  543.     Select Case Button
  544.     Case 1
  545.         If X <= 0 Or X > imgCopyButton.Width Or Y < 0 Or Y > imgCopyButton.Height Then
  546.             imgCopyButton.Picture = imgCopyButtonUp.Picture
  547.         Else
  548.             imgCopyButton.Picture = imgCopyButtonDn.Picture
  549.         End If
  550.     End Select
  551. End Sub
  552.  
  553. Sub imgCopyButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  554.     imgCopyButton.Picture = imgCopyButtonUp.Picture
  555.     UpdateStatusLine
  556. End Sub
  557.  
  558. Sub imgCutButton_Click ()
  559.     imgCutButton.Refresh
  560.     EditCutProc
  561. End Sub
  562.  
  563. Sub imgCutButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  564.     imgCutButton.Picture = imgCutButtonDn.Picture
  565.     DisplayButtonText (imgCutButton.Tag)
  566. End Sub
  567.  
  568. Sub imgCutButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  569.     ' If the button is pressed, display the up bitmap if the
  570.     ' mouse is dragged outside the button's area, otherwise
  571.     ' display the up bitmap
  572.     Select Case Button
  573.     Case 1
  574.         If X <= 0 Or X > imgCutButton.Width Or Y < 0 Or Y > imgCutButton.Height Then
  575.             imgCutButton.Picture = imgCutButtonUp.Picture
  576.         Else
  577.             imgCutButton.Picture = imgCutButtonDn.Picture
  578.         End If
  579.     End Select
  580. End Sub
  581.  
  582. Sub imgCutButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  583.     imgCutButton.Picture = imgCutButtonUp.Picture
  584.     UpdateStatusLine
  585. End Sub
  586.  
  587. Sub imgFileNewButton_Click ()
  588.     imgFileNewButton.Refresh
  589.     FileNew
  590. End Sub
  591.  
  592. Sub imgFileNewButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  593.     imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  594.     DisplayButtonText (imgFileNewButton.Tag)
  595. End Sub
  596.  
  597. Sub imgFileNewButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  598.     ' If the button is pressed, display the up bitmap if the
  599.     ' mouse is dragged outside the button's area, otherwise
  600.     ' display the up bitmap
  601.     Select Case Button
  602.     Case 1
  603.         If X <= 0 Or X > imgFileNewButton.Width Or Y < 0 Or Y > imgFileNewButton.Height Then
  604.             imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  605.         Else
  606.             imgFileNewButton.Picture = imgFileNewButtonDn.Picture
  607.         End If
  608.     End Select
  609. End Sub
  610.  
  611. Sub imgFileNewButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  612.     imgFileNewButton.Picture = imgFileNewButtonUp.Picture
  613.     UpdateStatusLine
  614. End Sub
  615.  
  616. Sub imgFileOpenButton_Click ()
  617.     imgFileOpenButton.Refresh
  618.     FOpenProc
  619. End Sub
  620.  
  621. Sub imgFileOpenButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  622.     imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  623.     DisplayButtonText (imgFileOpenButton.Tag)
  624. End Sub
  625.  
  626. Sub imgFileOpenButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  627.     ' If the button is pressed, display the up bitmap if the
  628.     ' mouse is dragged outside the button's area, otherwise
  629.     ' display the up bitmap
  630.     Select Case Button
  631.     Case 1
  632.         If X <= 0 Or X > imgFileOpenButton.Width Or Y < 0 Or Y > imgFileOpenButton.Height Then
  633.             imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  634.         Else
  635.             imgFileOpenButton.Picture = imgFileOpenButtonDn.Picture
  636.         End If
  637.     End Select
  638. End Sub
  639.  
  640. Sub imgFileOpenButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  641.     imgFileOpenButton.Picture = imgFileOpenButtonUp.Picture
  642.     UpdateStatusLine
  643. End Sub
  644.  
  645. Sub imgLineButton_Click ()
  646.     imgLineButton.Refresh
  647.     BlockButton_Click (2)
  648. End Sub
  649.  
  650. Sub imgLineButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  651.     If gfBlockType = 2 Then
  652.         imgLineButton.Picture = imgLineButtonPushed.Picture
  653.     Else
  654.         imgLineButton.Picture = imgLineButtonDown.Picture
  655.     End If
  656.     DisplayButtonText (imgLineButton.Tag)
  657. End Sub
  658.  
  659. Sub imgLineButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  660.     ' If the button is pressed, display the up bitmap if the
  661.     ' mouse is dragged outside the button's area, otherwise
  662.     ' display the up bitmap
  663.     Select Case Button
  664.     Case 1
  665.         If X <= 0 Or X > imgLineButton.Width Or Y < 0 Or Y > imgLineButton.Height Then
  666.             If gfBlockType <> 2 Then
  667.                 imgLineButton.Picture = imgLineButtonUp.Picture
  668.             Else
  669.                 imgLineButton.Picture = imgLineButtonPushed.Picture
  670.             End If
  671.         Else
  672.             If gfBlockType <> 2 Then
  673.                 imgLineButton.Picture = imgLineButtonDown.Picture
  674.             Else
  675.                 imgLineButton.Picture = imgLineButtonPushed.Picture
  676.             End If
  677.         End If
  678.     End Select
  679. End Sub
  680.  
  681. Sub imgLineButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  682.     UpdateStatusLine
  683. End Sub
  684.  
  685. Sub imgLookButton_Click ()
  686.     imgLookButton.Refresh
  687.     FindProc
  688. End Sub
  689.  
  690. Sub imgLookButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  691.     imgLookButton.Picture = imgLookButtonDn.Picture
  692.     DisplayButtonText (imgLookButton.Tag)
  693. End Sub
  694.  
  695. Sub imgLookButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  696.     ' If the button is pressed, display the up bitmap if the
  697.     ' mouse is dragged outside the button's area, otherwise
  698.     ' display the up bitmap
  699.     Select Case Button
  700.     Case 1
  701.         If X <= 0 Or X > imgLookButton.Width Or Y < 0 Or Y > imgLookButton.Height Then
  702.             imgLookButton.Picture = imgLookButtonUp.Picture
  703.         Else
  704.             imgLookButton.Picture = imgLookButtonDn.Picture
  705.         End If
  706.     End Select
  707.  
  708. End Sub
  709.  
  710. Sub imgLookButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  711.     imgLookButton.Picture = imgLookButtonUp.Picture
  712.     UpdateStatusLine
  713.  
  714. End Sub
  715.  
  716. Sub imgNextButton_Click ()
  717.     imgNextButton.Refresh
  718.     FindNextProc
  719. End Sub
  720.  
  721. Sub imgNextButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  722.     imgNextButton.Picture = imgNextButtonDn.Picture
  723.     DisplayButtonText (imgNextButton.Tag)
  724. End Sub
  725.  
  726. Sub imgNextButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  727.     ' If the button is pressed, display the up bitmap if the
  728.     ' mouse is dragged outside the button's area, otherwise
  729.     ' display the up bitmap
  730.     Select Case Button
  731.     Case 1
  732.         If X <= 0 Or X > imgNextButton.Width Or Y < 0 Or Y > imgNextButton.Height Then
  733.             imgNextButton.Picture = imgNextButtonUp.Picture
  734.         Else
  735.             imgNextButton.Picture = imgNextButtonDn.Picture
  736.         End If
  737.     End Select
  738. End Sub
  739.  
  740. Sub imgNextButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  741.     imgNextButton.Picture = imgNextButtonUp.Picture
  742.     UpdateStatusLine
  743. End Sub
  744.  
  745. Sub imgPasteButton_Click ()
  746.     imgPasteButton.Refresh
  747.     EditPasteProc
  748. End Sub
  749.  
  750. Sub imgPasteButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  751.     imgPasteButton.Picture = imgPasteButtonDn.Picture
  752.     DisplayButtonText (imgPasteButton.Tag)
  753. End Sub
  754.  
  755. Sub imgPasteButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  756.     ' If the button is pressed, display the up bitmap if the
  757.     ' mouse is dragged outside the button's area, otherwise
  758.     ' display the up bitmap
  759.     Select Case Button
  760.     Case 1
  761.         If X <= 0 Or X > imgPasteButton.Width Or Y < 0 Or Y > imgPasteButton.Height Then
  762.             imgPasteButton.Picture = imgPasteButtonUp.Picture
  763.         Else
  764.             imgPasteButton.Picture = imgPasteButtonDn.Picture
  765.         End If
  766.     End Select
  767. End Sub
  768.  
  769. Sub imgPasteButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  770.     imgPasteButton.Picture = imgPasteButtonUp.Picture
  771.     UpdateStatusLine
  772. End Sub
  773.  
  774. Sub imgStreamButton_Click ()
  775.     imgStreamButton.Refresh
  776.     BlockButton_Click (1)
  777. End Sub
  778.  
  779. Sub imgStreamButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  780.     If gfBlockType = 1 Then
  781.         imgStreamButton.Picture = imgStreamButtonPushed.Picture
  782.     Else
  783.         imgStreamButton.Picture = imgStreamButtonDown.Picture
  784.     End If
  785.     DisplayButtonText (imgStreamButton.Tag)
  786. End Sub
  787.  
  788. Sub imgStreamButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  789.     ' If the button is pressed, display the up bitmap if the
  790.     ' mouse is dragged outside the button's area, otherwise
  791.     ' display the up bitmap
  792.     Select Case Button
  793.     Case 1
  794.         If X <= 0 Or X > imgStreamButton.Width Or Y < 0 Or Y > imgStreamButton.Height Then
  795.             If gfBlockType <> 1 Then
  796.                 imgStreamButton.Picture = imgStreamButtonUp.Picture
  797.             Else
  798.                 imgStreamButton.Picture = imgStreamButtonPushed.Picture
  799.             End If
  800.         Else
  801.             If gfBlockType <> 1 Then
  802.                 imgStreamButton.Picture = imgStreamButtonDown.Picture
  803.             Else
  804.                 imgStreamButton.Picture = imgStreamButtonPushed.Picture
  805.             End If
  806.         End If
  807.     End Select
  808. End Sub
  809.  
  810. Sub imgStreamButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  811.     UpdateStatusLine
  812. End Sub
  813.  
  814. Sub imgUndoButton_Click ()
  815.     imgUndoButton.Refresh
  816. End Sub
  817.  
  818. Sub imgUndoButton_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  819.     imgUndoButton.Picture = imgUndoButtonDown.Picture
  820.     DisplayButtonText (imgUndoButton.Tag)
  821. End Sub
  822.  
  823. Sub imgUndoButton_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  824.     ' If the button is pressed, display the up bitmap if the
  825.     ' mouse is dragged outside the button's area, otherwise
  826.     ' display the up bitmap
  827.     Select Case Button
  828.     Case 1
  829.         If X <= 0 Or X > imgUndoButton.Width Or Y < 0 Or Y > imgUndoButton.Height Then
  830.             imgUndoButton.Picture = imgUndoButtonUp.Picture
  831.         Else
  832.             imgUndoButton.Picture = imgUndoButtonDown.Picture
  833.         End If
  834.     End Select
  835.  
  836. End Sub
  837.  
  838. Sub imgUndoButton_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  839.     imgUndoButton.Picture = imgUndoButtonUp.Picture
  840.     UpdateStatusLine
  841. End Sub
  842.  
  843. Sub MDIForm_Load ()
  844.     
  845.     Show ' Application starts here (Load event of Startup form).
  846.  
  847.     ChDir App.Path ' Always set working directory to directory containing the application.
  848.  
  849.     InitMDINOTE 'initialize data in MDINOTE.BAS
  850.  
  851.     Dim Cmd As String, AFileWasLoaded As Integer
  852.     Cmd = Trim$(Command$)
  853.     If Cmd <> "" Then ' If anything was specified on the command line...
  854.         Dim nNextToken As Integer
  855.         Do
  856.             nNextToken = InStr(Cmd, " ") ' find first blank, if any
  857.             If nNextToken = 0 Then nNextToken = Len(Cmd) + 1
  858.  
  859.             Dim OpenFileName As String
  860.             OpenFileName = Mid$(Cmd, 1, nNextToken - 1)
  861.             If OpenFile(OpenFileName, False) = True Then ' open the file
  862.                 If Not AFileWasLoaded Then GetRecentFiles
  863.                 UpdateFileMenu (OpenFileName)     ' add to recent files list
  864.                 AFileWasLoaded = True
  865.             End If
  866.             Cmd = Trim$(Mid$(Cmd, nNextToken + 1)) ' trim the filename off the command line
  867.         Loop While Cmd <> "" ' repeat while there are still filenames on the command line
  868.     End If
  869.     If Not AFileWasLoaded Then
  870.         FileNew
  871.         GetRecentFiles ' Read EMEDIT.INI and set recent file menu items appropriately
  872.     End If
  873. End Sub
  874.  
  875. Sub MDIForm_Unload (Cancel As Integer)
  876.     ' If the Unload was not canceled (in the QueryUnload events for the Notepad forms)
  877.     ' there will be no document windows left, so go ahead and end the application.
  878.  
  879.     If Not AnyPadsLeft() Then
  880.         End
  881.     End If
  882.  
  883. End Sub
  884.  
  885. Sub mnuFExit_Click ()
  886.     End
  887. End Sub
  888.  
  889. Sub mnuFNew_Click ()
  890.     FileNew
  891. End Sub
  892.  
  893. Sub mnuFont_Click ()
  894.     SetFontProc
  895. End Sub
  896.  
  897. Sub mnuFOpen_Click ()
  898.     FOpenProc
  899. End Sub
  900.  
  901. Sub mnuHelpAbout_Click ()
  902.     frmAbout.Show 1 'modal
  903. End Sub
  904.  
  905. Sub mnuOptions_Click ()
  906.     mnuOToolbar.Checked = frmMDI!picToolbar.Visible
  907. End Sub
  908.  
  909. Sub mnuOToolbar_Click ()
  910.     OptionsToolbarProc Me
  911. End Sub
  912.  
  913. Sub mnuRecentFile_Click (index As Integer)
  914.   Dim File2Open As String
  915.   File2Open = mnuRecentFile(index).Caption
  916.   If OpenFile(File2Open, False) = True Then
  917.     ' Update recent files list.
  918.     GetRecentFiles
  919.   End If
  920. End Sub
  921.  
  922. Sub pictStatusBar_Resize ()
  923.     If TopLine2(0).X2 < frmMDI.Width Then
  924.         TopLine2(0).X2 = frmMDI.Width
  925.     End If
  926.     If TopLine2(1).X2 < frmMDI.Width Then
  927.         TopLine2(1).X2 = frmMDI.Width
  928.     End If
  929. End Sub
  930.  
  931.