home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD39043102000.psc / frmMain.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  2000-03-10  |  33.3 KB  |  821 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "Comctl32.ocx"
  4. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
  5. Object = "{FBC672E3-F04D-11D2-AFA5-E82C878FD532}#5.0#0"; "AS-IFce1.ocx"
  6. Object = "{A6BDE5D5-8F7A-11D1-9C65-4CA605C10E27}#5.0#0"; "ActiveGUI.ocx"
  7. Begin VB.Form frmMain 
  8.    Caption         =   "EzColorTest"
  9.    ClientHeight    =   4170
  10.    ClientLeft      =   165
  11.    ClientTop       =   450
  12.    ClientWidth     =   7950
  13.    Icon            =   "frmMain.frx":0000
  14.    LinkTopic       =   "Form1"
  15.    ScaleHeight     =   4170
  16.    ScaleWidth      =   7950
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin ActiveGUICtl.ActiveToolbar ToolbarContainer 
  19.       Align           =   1  'Align Top
  20.       Height          =   420
  21.       Left            =   0
  22.       Top             =   0
  23.       Width           =   7950
  24.       _ExtentX        =   14023
  25.       _ExtentY        =   741
  26.       Begin AIFCmp1.asxToolbar MainToolbar 
  27.          Height          =   375
  28.          Left            =   120
  29.          Top             =   30
  30.          Width           =   5175
  31.          _ExtentX        =   9128
  32.          _ExtentY        =   661
  33.          BeginProperty ToolTipFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  34.             Name            =   "MS Sans Serif"
  35.             Size            =   8.25
  36.             Charset         =   0
  37.             Weight          =   400
  38.             Underline       =   0   'False
  39.             Italic          =   0   'False
  40.             Strikethrough   =   0   'False
  41.          EndProperty
  42.          ButtonGap       =   1
  43.          BorderStyle     =   0
  44.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  45.             Name            =   "MS Sans Serif"
  46.             Size            =   8.25
  47.             Charset         =   0
  48.             Weight          =   400
  49.             Underline       =   0   'False
  50.             Italic          =   0   'False
  51.             Strikethrough   =   0   'False
  52.          EndProperty
  53.          Appearance      =   1
  54.          ButtonCount     =   18
  55.          PlaySounds      =   0   'False
  56.          ShowSeparators  =   -1  'True
  57.          ButtonKey1      =   "NewFile"
  58.          ButtonPicture1  =   "frmMain.frx":0442
  59.          ButtonToolTipText1=   "New File"
  60.          ButtonKey2      =   "Open"
  61.          ButtonPicture2  =   "frmMain.frx":0764
  62.          ButtonToolTipText2=   "Open File"
  63.          ButtonKey3      =   "save"
  64.          ButtonPicture3  =   "frmMain.frx":0A26
  65.          ButtonToolTipText3=   "Save File"
  66.          ButtonStyle4    =   2
  67.          ButtonEnabled5  =   0   'False
  68.          ButtonKey5      =   "Cut"
  69.          ButtonPicture5  =   "frmMain.frx":0CE0
  70.          ButtonToolTipText5=   "Cut Text"
  71.          ButtonEnabled6  =   0   'False
  72.          ButtonKey6      =   "Copy"
  73.          ButtonPicture6  =   "frmMain.frx":0EBA
  74.          ButtonToolTipText6=   "Copy Text"
  75.          ButtonKey7      =   "Paste"
  76.          ButtonPicture7  =   "frmMain.frx":117C
  77.          ButtonToolTipText7=   "Paste Text"
  78.          ButtonStyle8    =   2
  79.          ButtonKey9      =   "undo"
  80.          ButtonPicture9  =   "frmMain.frx":146E
  81.          ButtonToolTipText9=   "Undo Action"
  82.          ButtonKey10     =   "redo"
  83.          ButtonPicture10 =   "frmMain.frx":15BC
  84.          ButtonToolTipText10=   "Redo Action"
  85.          ButtonStyle11   =   2
  86.          ButtonKey12     =   "Bold"
  87.          ButtonPicture12 =   "frmMain.frx":170A
  88.          ButtonToolTipText12=   "Bold"
  89.          ButtonKey13     =   "Italic"
  90.          ButtonPicture13 =   "frmMain.frx":1858
  91.          ButtonToolTipText13=   "Italic"
  92.          ButtonKey14     =   "underline"
  93.          ButtonPicture14 =   "frmMain.frx":19A6
  94.          ButtonToolTipText14=   "Underline"
  95.          ButtonStyle15   =   2
  96.          ButtonKey16     =   "LeftJustify"
  97.          ButtonPicture16 =   "frmMain.frx":1B18
  98.          ButtonToolTipText16=   "Left Justify"
  99.          ButtonKey17     =   "HtmlCenter"
  100.          ButtonPicture17 =   "frmMain.frx":1D4E
  101.          ButtonToolTipText17=   "Center"
  102.          ButtonKey18     =   "rightjust"
  103.          ButtonPicture18 =   "frmMain.frx":1F84
  104.          ButtonToolTipText18=   "Right Justify"
  105.       End
  106.    End
  107.    Begin VB.CommandButton cmdDummy 
  108.       Height          =   315
  109.       Left            =   14040
  110.       TabIndex        =   3
  111.       Top             =   10560
  112.       Width           =   1215
  113.    End
  114.    Begin VB.PictureBox Container 
  115.       BackColor       =   &H00808080&
  116.       Height          =   2295
  117.       Left            =   0
  118.       ScaleHeight     =   2235
  119.       ScaleWidth      =   5595
  120.       TabIndex        =   1
  121.       Top             =   440
  122.       Width           =   5655
  123.       Begin RichTextLib.RichTextBox RichTxtBox 
  124.          Height          =   1215
  125.          Left            =   360
  126.          TabIndex        =   2
  127.          Top             =   0
  128.          Width           =   2535
  129.          _ExtentX        =   4471
  130.          _ExtentY        =   2143
  131.          _Version        =   327680
  132.          BorderStyle     =   0
  133.          HideSelection   =   0   'False
  134.          ScrollBars      =   3
  135.          Appearance      =   0
  136.          TextRTF         =   $"frmMain.frx":21BA
  137.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  138.             Name            =   "Courier New"
  139.             Size            =   9
  140.             Charset         =   0
  141.             Weight          =   400
  142.             Underline       =   0   'False
  143.             Italic          =   0   'False
  144.             Strikethrough   =   0   'False
  145.          EndProperty
  146.       End
  147.    End
  148.    Begin ComctlLib.StatusBar sbStatusBar 
  149.       Align           =   2  'Align Bottom
  150.       Height          =   270
  151.       Left            =   0
  152.       TabIndex        =   0
  153.       Top             =   3900
  154.       Width           =   7950
  155.       _ExtentX        =   14023
  156.       _ExtentY        =   476
  157.       SimpleText      =   ""
  158.       _Version        =   327682
  159.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  160.          NumPanels       =   4
  161.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  162.             AutoSize        =   1
  163.             Object.Width           =   9790
  164.             TextSave        =   ""
  165.             Key             =   ""
  166.             Object.Tag             =   ""
  167.          EndProperty
  168.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  169.             Style           =   1
  170.             Alignment       =   1
  171.             AutoSize        =   2
  172.             Enabled         =   0   'False
  173.             Object.Width           =   1244
  174.             MinWidth        =   1235
  175.             TextSave        =   "CAPS"
  176.             Key             =   ""
  177.             Object.Tag             =   ""
  178.          EndProperty
  179.          BeginProperty Panel3 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  180.             Style           =   2
  181.             Alignment       =   1
  182.             Object.Width           =   1235
  183.             MinWidth        =   1235
  184.             TextSave        =   "NUM"
  185.             Key             =   ""
  186.             Object.Tag             =   ""
  187.          EndProperty
  188.          BeginProperty Panel4 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  189.             Style           =   3
  190.             Alignment       =   1
  191.             AutoSize        =   2
  192.             Enabled         =   0   'False
  193.             Object.Width           =   1244
  194.             MinWidth        =   1235
  195.             TextSave        =   "INS"
  196.             Key             =   ""
  197.             Object.Tag             =   ""
  198.          EndProperty
  199.       EndProperty
  200.    End
  201.    Begin MSComDlg.CommonDialog CMDialog1 
  202.       Left            =   6960
  203.       Top             =   480
  204.       _ExtentX        =   847
  205.       _ExtentY        =   847
  206.       _Version        =   393216
  207.    End
  208.    Begin VB.Menu mnuFile 
  209.       Caption         =   "&File"
  210.       Begin VB.Menu mnuFileNew 
  211.          Caption         =   "&New"
  212.          Shortcut        =   ^N
  213.       End
  214.       Begin VB.Menu mnuFileOpen 
  215.          Caption         =   "&Open"
  216.          Shortcut        =   ^O
  217.       End
  218.       Begin VB.Menu mnuFileBar1 
  219.          Caption         =   "-"
  220.       End
  221.       Begin VB.Menu mnuFileSave 
  222.          Caption         =   "&Save"
  223.          Shortcut        =   ^S
  224.       End
  225.       Begin VB.Menu mnuFileSaveAs 
  226.          Caption         =   "Save &As..."
  227.       End
  228.       Begin VB.Menu mnuFileBar2 
  229.          Caption         =   "-"
  230.       End
  231.       Begin VB.Menu mnuFileExit 
  232.          Caption         =   "E&xit"
  233.       End
  234.    End
  235.    Begin VB.Menu mnuEdit 
  236.       Caption         =   "&Edit"
  237.       Begin VB.Menu mnuEdit_Undo 
  238.          Caption         =   "Undo"
  239.          Shortcut        =   ^Z
  240.       End
  241.       Begin VB.Menu mnuEdit_Redo 
  242.          Caption         =   "Redo"
  243.       End
  244.       Begin VB.Menu mnuEdit_Sep5 
  245.          Caption         =   "-"
  246.       End
  247.       Begin VB.Menu mnuEdit_Cut 
  248.          Caption         =   "Cut"
  249.          Shortcut        =   ^X
  250.       End
  251.       Begin VB.Menu mnuEdit_Copy 
  252.          Caption         =   "Copy"
  253.          Shortcut        =   ^C
  254.       End
  255.       Begin VB.Menu mnuEdit_Paste 
  256.          Caption         =   "Paste"
  257.          Shortcut        =   ^V
  258.       End
  259.       Begin VB.Menu mnuEdit_Sep2 
  260.          Caption         =   "-"
  261.       End
  262.       Begin VB.Menu mnuEdit_SelectAll 
  263.          Caption         =   "Select All"
  264.          Shortcut        =   ^A
  265.       End
  266.    End
  267.    Begin VB.Menu mnuHelp 
  268.       Caption         =   "&Help"
  269.       Begin VB.Menu mnuHelpAbout 
  270.          Caption         =   "&About EzColorTest..."
  271.       End
  272.    End
  273. Attribute VB_Name = "frmMain"
  274. Attribute VB_GlobalNameSpace = False
  275. Attribute VB_Creatable = False
  276. Attribute VB_PredeclaredId = True
  277. Attribute VB_Exposed = False
  278. '    --------------------------------------------------------------------------
  279. '    EzColorTest HTML Editor Color Coding Test
  280. '    Copyright (C) 2000  Eric Banker
  281. '    This program is free software; you can redistribute it and/or modify
  282. '    it under the terms of the GNU General Public License as published by
  283. '    the Free Software Foundation; either version 2 of the License, or
  284. '    (at your option) any later version.
  285. '    This program is distributed in the hope that it will be useful,
  286. '    but WITHOUT ANY WARRANTY; without even the implied warranty of
  287. '    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  288. '    GNU General Public License for more details.
  289. '    You should have received a copy of the GNU General Public License
  290. '    along with this program; if not, write to the Free Software
  291. '    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  292. '    --------------------------------------------------------------------------
  293. '    Some parts of this code were originally developed by Joel Dueck (BlueIce) and
  294. '    David Hoyt(Vhtml)
  295. Option Explicit
  296. ' This is for line numbering
  297. Private Declare Function SendMessageLong Lib "User32" Alias _
  298.         "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, _
  299.         ByVal wParam As Long, lParam As Long) As Long
  300. Private Const EM_LINEFROMCHAR = &HC9
  301. Private Const EM_LINEINDEX = &HBB
  302. Private Const EM_LINELENGTH = &HC1
  303. ' This variable keeps track of the currently opened file name at all times. Make sure you set it
  304. ' correctly so the user know's what is going on
  305. Public OpenFilename As String
  306. ' Editor constants
  307. Const WM_COPY = &H301
  308. Const WM_CUT = &H300
  309. Const WM_CLEAR = &H303
  310. Const WM_PASTE = &H302
  311. Public trapUndo As Boolean           'flag to indicate whether actions should be trapped
  312. Private UndoStack As New Collection   'collection of undo elements
  313. Private RedoStack As New Collection   'collection of redo elements
  314. ' Keeps track of control key state
  315. Public CtlKey As Boolean
  316. ' ################################################################
  317. ' These are the main form handler functions
  318. ' ################################################################
  319. ' This is the main load function. It sets up the colors and the richtextbox and inserts the template
  320. ' and also colorizes it
  321. Private Sub Form_Load()
  322.     ' Let the user know something is happening, at least that the program is starting up :)
  323.     Screen.MousePointer = vbHourglass
  324.         
  325.     ' Set the RichTextBox for the Color coding Control
  326.     ' This is needed because of the way the control does it's color coding
  327.     'Set EZColorCode.RichTxtBox = RichTxtBox
  328.     ' Set the colors:
  329.     m_TextCol = vbBlack
  330.     m_AttribCol = 8388736
  331.     m_TagCol = 10485760
  332.     m_CommentCol = 8421440
  333.     m_AspCol = 128
  334.     ' Now lets add the template and color code it. First hide the text box from the user
  335.     RichTxtBox.Visible = False
  336.     RichTxtBox.AutoVerbMenu = False
  337.     RichTxtBox.HideSelection = True
  338.     ' Now lets add a template to the new document
  339.     AspTemplate
  340.     ' That template still needs to be color coded so lets do that
  341.     HtmlHighlight
  342.     ' Lets set the caption of the form to say that this is an untitled document
  343.     Me.Caption = "EzColorTest: Untitled"
  344.     ' Lets let the user see the text box now that everything is finished
  345.     RichTxtBox.Visible = True
  346.     RichTxtBox.TabStop = True
  347.     ' Everything is finished so lets set the mouse pointer back so the user knows the wait is over
  348.     Screen.MousePointer = vbNormal
  349.     trapUndo = True     'Enable Undo Trapping
  350.     RichTxtBox_Change      'Initialize First Undo
  351. End Sub
  352. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  353.     If KeyCode = vbKeyControl Then
  354.         CtlKey = True
  355.     ElseIf KeyCode = vbKeyF6 And (Shift And vbAltMask) Then
  356.         KeyCode = 0
  357.     End If
  358. End Sub
  359. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  360.     If KeyCode = vbKeyControl Then
  361.         CtlKey = False
  362.     End If
  363. End Sub
  364. ' This function simply makes sure the text box fits in the form at all times with the gutter
  365. Private Sub Form_Resize()
  366. On Error Resume Next
  367.     Container.Width = Me.Width - 139
  368.     Container.Height = Me.Height - 1400
  369.     RichTxtBox.Width = Container.Width - 420
  370.     RichTxtBox.Height = Container.Height - 50
  371.     ' Make sure the dummy for undo never shows itself
  372.     cmdDummy.Left = Me.Width + 1000
  373.     cmdDummy.Top = Me.Height + 1000
  374.     RichTxtBox.Refresh
  375. End Sub
  376. ' ################################################################
  377. ' This is where the form handler functions stop
  378. ' ################################################################
  379. ' ################################################################
  380. ' This is where the RichTextBox handler functions go. These
  381. ' basically do everything.
  382. ' ################################################################
  383. Private Sub RichTxtBox_Change()
  384.     If Not trapUndo Then Exit Sub 'because trapping is disabled
  385.     Dim newElement As New UndoElement   'create new undo element
  386.     Dim c%, l&
  387.     'remove all redo items because of the change
  388.     For c% = 1 To RedoStack.Count
  389.         RedoStack.Remove 1
  390.     Next c%
  391.     'set the values of the new element
  392.     newElement.SelStart = RichTxtBox.SelStart
  393.     newElement.TextLen = Len(RichTxtBox.Text)
  394.     newElement.Text = RichTxtBox.Text
  395.     'add it to the undo stack
  396.     UndoStack.Add Item:=newElement
  397.     EnableControls
  398. End Sub
  399. ' This makes sure that when the user hits the tab key that it
  400. ' indents the text
  401. Private Sub RichTxtBox_GotFocus()
  402.     On Error Resume Next
  403.     Dim Control As Control
  404.     For Each Control In Controls
  405.         Control.TabStop = False
  406.     Next Control
  407. End Sub
  408. ' This makes the copy and paste menu items disabled when they can't be used
  409. Private Sub RichTxtBox_SelChange()
  410. Dim Ln As Long
  411.     Ln = RichTxtBox.SelLength
  412.     With frmMain
  413.         ' Determine which options are available
  414.         .mnuEdit_Cut.Enabled = Ln
  415.         .mnuEdit_Copy.Enabled = Ln
  416.         .mnuEdit_Paste.Enabled = Len(Clipboard.GetText(1))
  417.         .mnuEdit_SelectAll.Enabled = CBool(Len(RichTxtBox.Text))
  418.         .MainToolbar.ButtonEnabled(5) = Ln
  419.         .MainToolbar.ButtonEnabled(6) = Ln
  420.         .MainToolbar.ButtonEnabled(7) = Len(Clipboard.GetText(1))
  421.     End With
  422.     GetEditStatus
  423. End Sub
  424. ' This highlights while typing
  425. ' This function in the module reads in the current character and colors the tag correctly.
  426. Private Sub RichTxtBox_KeyPress(KeyAscii As Integer)
  427. On Error Resume Next
  428.     KeyAscii = KeyPressEvent(KeyAscii)
  429. End Sub
  430. ' This enables and disables the undo/redo options
  431. Private Sub EnableControls()
  432.     Me.MainToolbar.ButtonEnabled(9) = UndoStack.Count > 1
  433.     Me.MainToolbar.ButtonEnabled(10) = RedoStack.Count > 0
  434.     Me.mnuEdit_Undo.Enabled = UndoStack.Count > 1
  435.     Me.mnuEdit_Redo.Enabled = RedoStack.Count > 0
  436.     Me.MainToolbar.ButtonEnabled(9) = Me.MainToolbar.ButtonEnabled(9)
  437.     Me.MainToolbar.ButtonEnabled(10) = Me.MainToolbar.ButtonEnabled(10)
  438.     Me.mnuEdit_Undo.Enabled = Me.mnuEdit_Undo.Enabled
  439.     Me.mnuEdit_Redo.Enabled = Me.mnuEdit_Redo.Enabled
  440.     RichTxtBox_SelChange
  441. End Sub
  442. ' This does some stuff like keeps track of the control character and knows when it is
  443. ' pressed or not. It also has some examples of keyboard shortcuts. For example hitting
  444. ' ctrl + 1 through 6 puts in the <h1></h1> tag all the way through <h6></h6>
  445. ' it also does ctrl+space which puts in   , ctrl+enter which puts in <P>
  446. ' and shift+enter which puts in <br>
  447. ' it also finds out if the cursor is in a tag
  448. Private Sub RichTxtBox_KeyDown(KeyCode As Integer, Shift As Integer)
  449. Dim TypedIn As String
  450.     If Shift And vbCtrlMask Then
  451.         If KeyCode > vbKey0 And KeyCode < vbKey7 Then
  452.             Dim HeadingTag As String
  453.             HeadingTag = "<H" & CStr(KeyCode - vbKey0) & "></H" & CStr(KeyCode - vbKey0) & ">"
  454.             InsertTag HeadingTag, True
  455.             PlaceCursor HeadingTag, 5
  456.             RichTxtBox.SelColor = vbBlack
  457.         Else
  458.             Select Case KeyCode
  459.             Case vbKeyV
  460.                 ' User pressed Ctrl+V  - Paste
  461.                 Dim A$, S As Long
  462.                 S = RichTxtBox.SelStart ' save this since selstart moves up after the paste
  463.                 A = Clipboard.GetText(vbCFText)
  464.                 RichTxtBox.SelText = ""
  465.                 RichTxtBox.SelText = A    ' This removes any unwanted formatting (font, &c)
  466.                 HtmlColorCode S, RichTxtBox.SelStart
  467.                 
  468.                 KeyCode = 0
  469.             Case vbKeyReturn
  470.                 InsertTag "<P>", True
  471.                 RichTxtBox.SelColor = vbBlack
  472.                 KeyCode = 0
  473.             Case vbKeySpace
  474.                 RichTxtBox.SelColor = vbBlack
  475.                 RichTxtBox.SelText = " "
  476.                 KeyCode = 0
  477.             End Select
  478.         End If
  479.     ElseIf Shift And vbShiftMask Then
  480.         If KeyCode = vbKeyReturn Then
  481.             InsertTag "<BR>", True
  482.             RichTxtBox.SelColor = vbBlack
  483.             KeyCode = 0
  484.         End If
  485.     End If
  486.     IsOutsideTag
  487. End Sub
  488. ' This function finds out if the user out the mouse inside a tag and sets the right color for
  489. ' the text
  490. Private Sub RichTxtBox_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
  491.     IsOutsideTag
  492.     'RichTxtBox.SetFocus
  493. End Sub
  494. ' this resets the ctrl key if it was pressed to not pressed because the key was lifted
  495. ' it also finds out if the cursor is in a tag
  496. Private Sub RichTxtBox_KeyUp(KeyCode As Integer, Shift As Integer)
  497.     If KeyCode = vbKeyControl Then
  498.         CtlKey = False
  499.     End If
  500.     IsOutsideTag
  501.     RichTxtBox.SetFocus
  502. End Sub
  503. ' this shows the edit menu on a right mouse click in the richtextbox. it also finds
  504. ' out if the cursor is in a tag
  505. Private Sub RichTxtBox_MouseUp(Button As Integer, Shift As Integer, X As Single, y As Single)
  506.     ' Show edit menu
  507.     If Button = vbRightButton Then
  508.         PopupMenu mnuEdit
  509.     End If
  510.     IsOutsideTag
  511.     'RichTxtBox.SetFocus
  512. End Sub
  513. ' This gets the current line number and column number and displays it
  514. Public Sub GetEditStatus()
  515.    Dim lLine As Long, lCol As Long
  516.    Dim cCol As Long, lChar As Long, I As Long
  517.    lChar = RichTxtBox.SelStart + 1
  518.    ' Get the line number
  519.    lLine = 1 + SendMessageLong(RichTxtBox.hWnd, EM_LINEFROMCHAR, _
  520.            RichTxtBox.SelStart, 0&)
  521.    ' Get the Character Position
  522.    cCol = SendMessageLong(RichTxtBox.hWnd, EM_LINELENGTH, lChar - 1, 0&)
  523.    FtEdiSnontrSpace
  524.                 RichTxtBox'Hf3m"dlcCIc" a tag
  525. PssagedolivbRightButton Then
  526.      iiiiiiiiiiiiiiiiiiiiiiiiiiiit, 0&)
  527. iiiiiii0urslslslr.Butttate Su <e items8C th2 =   "" As&ag
  528. i.hWnd, EM_LINELCp
  529.            RichTxtBoCot9999999tate Su <e i    cmdDummy    .0#0"; Me.Ak 0displays itofHSr_cn6  Dim cCol As c0";et.SelColoritof
  530.      3f RiuDM9-blicThes i"
  531. ' it a Ak 0displays itg
  532. :Rich, EM_LINEL0 hTxtBoCot9999999tate SiuDM9-blsr3C t2r Set the2lsr3Cau <lk 0displays itg
  533. rY  Inserted becauvater3en
  534. ot99999_cn6Ks0disas lift_cn6k 0dir 26F02"hsCot9au <lk n6  Dims0 LoneM_LI<DxtBoCo1B6C  ^C
  535. ldp:oStahiftMoStmb########
  536. ' Theritof
  537. ROMCHAR, _
  538. Ri8mb#M( ows when it isMoStmbhFe
  539. ldp:oStah_en
  540. o8uF-vC cCol As bhFe
  541. ldp:os ^C
  542. ldp:oStahiftMoStmb###vC cCol As bhFe
  543. ldp:os ^C
  544. ldp:oStahiftMoStmb###vCePam :oStahiftMoStmb###vCePam :oStmb###etFocus
  545. End Su 1, l As bhFe
  546. ldLd3heritofF8Lgggg bhFe
  547. ldLd3heritofF8Lggg     e S, RichTxtBox.Sel I   End If
  548. rPam :ol kStmb##te
  549.     -He0el IXe
  550.     tof
  551. RichTxe
  552.    fe
  553. ldp End If
  554. rPam :ol kT
  555. ' T7HxtBl kT.C6geriteoup EofE2-auva2ts up heritof
  556. ROMCHAR,0 = Un nT.C6geri55
  557.    ClcC6F0c1Set2ts up heritof
  558. ROMC tof  RichTxtBoCot99 s Single)
  559. bgeri55MCHAR,0 = Un nT.C6ge4iSIf
  560. rPam :olCs####
  561. ' Theritof
  562. ROMCHAR, _
  563.       tts 
  564.      3f RiuDM a tag and sets th in a t a ta8pEnXR, _
  565.       tts 
  566.      3f RiuDM a tag and sets th in a t a ta8pEnXR, _
  567.       tts 
  568.      3f RiuDM a tagsMCHAR, _
  569.      U3heritofF8LePointer = vbNormal
  570.   u1g6iSnontrSpace
  571. hTxtBox.SetFocus
  572. End Sub Ctts 
  573.      3f RiuDM mb###vCeichTxtBo0
  574.            ir _
  575. ;TUe    InsertTag HeadingTag, oand sets th in a t a ta8pEn Ric4.C6ge4iSIf
  576. rPam :olCs####
  577. ' T i IXe
  578.   a3hei##vtBox.Sel:olCs##03FAF0c11Cs##03FAF0c11Cs##03Fe8BoCot9999999ox.SelStart
  579.  mnuEdit
  580.     End If
  581.     IsOut2c inrEMA
  582. RiS.e
  583. ldta8pEn Rics1mOut2c inrEMA
  584. RicT 6tFocus
  585. End c bbo09t >E"ofEthe b###viuDM EMA
  586. R5 ec b#03FAF0c11Csb#03FAF0c11Csb_
  587.       tts 
  588.      3f155MCHAR,,,,,,,,,,,,,,,,,,i4tnr SbDA Inse08fi5< vbKey7 Th 26F02"hsCo  ^C
  589. ll      Ucr = g6F02"hsCo     Me"hsCo  ^
  590. ll      Ucr = g6FAAR,,,,,,,,,,,,,,,,,,i4tnr SbD      EndProperFocusye = R=,,,,8#####sb#03FAGs Ucr = g6FEnbsp;"
  591.   Tg26TsnT.C6ge4iSIf
  592. rP     =   "&Edit"
  593.   rl key if it was pres9   ened'Ri 0   'Box.SPell      Ucr = g6F02"hsCo     Me"hsCo  ^c+tahifbterP     =   "&Eo .0#0"; MeGs Ucr = g6FEnbsp;"
  594.   Tg/93  Shortcut   FocCbsp;"
  595.   Tgf Button = vbRightButton Then
  596.         PopupMenu mnuEdit
  597.     End If
  598.     Ise up her5.iF
  599.           on Th0) & ">"
  600.             IoinontrSpace
  601. hTxtBox.SetFocus
  602. (BFocus
  603. EnYF8r6z.2 As Integer)mNrnmeger, X As Singlic8
  604.   utto+tahifbterP     =   "&Eo .no+tahifbterP
  605.             onrl2.no+tahifbt1-8r60cr ramnnnnP     =   "&Eo .0#0";As Integer)mNrnmeger, X As Singlic8
  606.   utto+tahifbterP     =   "&Eo .no+tahifbterP
  607.             o the user know's what is goinguser know's what isroperty
  608.    End
  609. As Se-6ctmb###etSEo+t hwhat isy
  610.    End
  611. As Se-6ctmE.bterP
  612.      e-6ctmE.bterP
  613.      e-6c bhFe3hei##vtBox.Sel:olCs##03FA  End
  614. As Se-6ctmb###etSEo+t hwhanEfSr=   "&Eo .0#0"0n user know's whrrope3FA  End
  615. As Se-6ctmb###etSEo+t hwhanEfSr=   "&o enu mnuFileExit 
  616.          C2n1e1<g
  617.  i##vs Singlic8
  618.   utto+tahifbterP     =   "&Eo .no+tahifbterP
  619.             o the user know's what is goinguser know's what isroperty
  620.    En's what isroperty
  621.    En's wha-hperty
  622.    End_c Serty
  623. p    
  624.  i##vs Singlic8
  625.   utto+tahifbterP     =   "&Eo .no+tahifbterP
  626.             o the user know's what is goinguser know's what isroperty
  627.    En'ku    rl key if it was pres999cter =   "&ER=,,,ei;pterP
  628.             o thslnas&ER=,,,ei;pox.SyRic7lN9-bliZ72Aave &As..."
  629.       EeAr6terP     =   "&Eo .no+tahifbterP
  630.             o the user know's what is goinguser know's what iCat _p#M( ows when it isMoS/Ks0dnirrWut   FocCbsp;"nUs##03FAF0c11Cs##03Fe8BoCot9999999ox.Sed1 isroperty
  631.    End
  632. As SelSox.Sed1 sn8B 0Enabled'ger)mNrnm6tert9999999ox.Sed1 isroperty
  633. 2         3fMCHAR, _
  634. Ri8mb#M( owsCterP     = ows whe   fd
  635. A2e _
  636. Ri8mb#M( owsCter2sn8B 0Epox.Se##03Fe8BoC0&o 'e8ocCbsp;Long, .ocAm_dSe##03Fe8BoC0&o 'e8ocC9       Key9ox   c at _p#M( ows A2eRedo.EnS c at _p#M( o 8=,,,,8   Key9ox   c at _p#M( ows An6  Me.mnuEditUn ,8   Key9ox   c ion = "EzColorTest:#M( owsCter2sn8essed to not presst9ox.Sed1 isroperty
  637.   y9ox   c at _p#M( ows A2eRedo <e EFiopupMeLonnEfSr=   "&EoRws A2eRedo e A2Eadi##vs Singlic8SEo+t hwhat8SEo+t hwhat8SEo+t hwhat8SEo+t hwhat8SEo+t hw
  638. ' the text.BUbtP.oUspM#M( ows#####sb# o RichTxtBoCot ows#####yas pres2o    ###sb# o RichTxtBoCot ows####ws###norTn)Cwor chTxtBoCot ows#####yas pres2o    #1s6Fprel;     =   0   'False
  639.   y'Falss "&ErAit was 1s6Fprel;     =   0   'False
  640.  Jh6 
  641.      3f Rlse
  642.  Jh6 
  643.      3f Rlse
  644. 2   = 'itht if the _=nhcJh6 
  645.      3f Rlse
  646. 2   = 'Ne r6py"
  647.    9iU0 e
  648.  Jh6 
  649.  k:oStahiftMf<brVD=   0  rx0Nm"uagedc 9oxrot oro .no+s.####sb#aow''e8ocC9       Kes1FrVDi##sb   'False
  650. p#M( ows A2eRedo.EnS c at _p#M( o 8=,,,,8   Key9ox   c at _p#M( ows An6  9f7beoEn'ku lg( owsSub Fora .EnSns##PTb Fora .E:edo.E at _p#M( o 8=,,,,8   Key9ox   c 'Key9ox re9oxrot oro .no+s.####sb#aow''e8ocC9      - 1400
  651. uUindents the text
  652. Private Sub RichTxtBox_GotFoifbterP01a(fnIt.1yII0&ttox_GottiAyII0&ttox_GottiAyII0&tto8olCF Kes1FrVDi##sb   'Fn'Key9. e
  653.  Jh6 
  654. ate Sub RichTxtBox_GotFoifb.l7I2RA RichTxtBox_GotFoifbUhp#M(a9M( ows sp;"
  655.   Tg26TsnT.C6geo8olCF Kes1FrVDi##sb   'Fn'Key9. e
  656.  Jh6 
  657. ate87yS2r7   2 it a Ak 0displays itg
  658. :Rich, EM_LINEL0 hTxtBoCot9999999tate SiuDM9-blsr3C 9beoEna An6  9f7beoEn'ku lg( owsSu 0nEfSr=p;"
  659. b   'Fn'Ke2d2eR owsSO2eR oKey-A
  660.   u1"9beo2elt9999999tate SiuDM9-blsr3C 9bsA( ows####
  661.    fe
  662. 3&ahiftMf<brVD=   iA( ows####l&s _p#&
  663.  Jh6 
  664. ate Sub RichTh6 
  665.  Jh6 
  666. atAs Long End)p#M( what is goinguser know's Ar
  667.   .ocAEfSr=   "&EoRws A2end)p#M( what is ( whPj6bEcb e
  668.   evinglic8Sknopy"
  669.    9iU0 e
  670. ehs AUinSEo+t hwhanEfSfshwhanEfSfshwhanE e is ( whPjoC  Kepgc ion )))))))" 
  671. atAAAAAAAAif it was pres9Kepg)" 
  672. 3&ahiftMf<brVD=     =   "&Eo .0#0"; D= "g)" whPjoC C    ker8  EngEnab0"; D= "g)" whPjoC7tO2end)p#M( wh  ker8  EngEnab0";   Key9ox   c 'K rCs  ker8nEna6f9ox  x re9vuDM EMA
  673. R5 ec bs####cate Key6C EndttiAyIIFn'Ke&nAAx3Brot oCotI00
  674. uUindents the text
  675. PC C  ph
  676.    En's wha-hn =   "&Eo EiI43Or2sn8B 0Epox.Se##03Fe8BoC0&o 'e##03tst lg( owsSub Fora .EnS  e
  677.  Jh6 
  678.      3f Rls EnkEsWn##
  679. BitEsWn##
  680. BitEsWn##
  681. etEsWn##
  682. BitEsWn##
  683. BitEsWOi4tnr SbDA Ins AUinSEow$owsSub Fora .EnS  e
  684.  ndttiAyIIFn'teger 5
  685.  9text
  686. 1111113beo2ttiAyIIFnrws###aMHFalse
  687.   y't lzfshwolCs#1aShUc        o the user know's wCotI00
  688. :Rich, EM_LINEL0 hTxtBoCo0nEfSr=p;"
  689. b +d_lUitLriftMf<brVD==   "&Eo .0#0"0n)A2U04Br4= "b   =s"8H EMA
  690. R5 ec bs####cate K"1111T &As..."
  691.       EeAr6terP   l0h 1AAAAArag "<BR>uN,(th7"C3 &As..."
  692.       EeAr6ser kn"<BR>uN,a0xIgSub
  693. ' This highlights wHE a tag an'teger 5
  694.  9textniU Jh6 Undo.Enabled i pres2o   b#M(whPjoC7tO2en know somet5 ec bsTE>     3cec bsTE>     3cec bs####cate Key6C  PjoC7tO2en know sVst5 ec"<BR>uN,(th7  KiiiiiBoC0s####cate Key6C  Pjot 2whPjoC7tO2ens 1 +dW0agewf_LINEa1000
  695. m e KeD      C2n1e1<g
  696.  i##vgFbeD      Enaws####
  697.   :wha-hperty
  698. PjoC7tO2en:bgU :wlsWOibledcxtBoCo0Rmbsp; , ctrC EndttiAyIIFn'Ke& 2whPjrt5 ec"<BR>uN,(th7  KiiiiiBoClCh7  Kiino+tas'Ke& n'Ke& 2whPjrt5 ec"<BR>uN,(th7 tuhighli+d_SjlnndttiAyIIFn'u3Dttuhighli#vgFbUe    ty
  699.    E"></H" & CStr(KeyCode2wlsWOibledcxtBoCo0Rmbsp; , ctrC EndttiAyIIF 2wlsWOi n'KUCng
  700.  0do."n the _=nhcJh6 fTAyIIF 2w5 "n the  CStr(KeyCodwTr(K ctrC EndttiAyIIF 2wls +tahifbterP
  701.             o ogEr)
  702. Dim TypedIn As String
  703.     If Shift And vbCtrlMask Then
  704.         If KeyCode > vbKey0 And KeyCode < vbKey7 Then
  705.             Dim HeadingTag As String
  706.             HeadingTag = "<H" & CStr(KeyCode - vbKey0) & "></H" & CStr(KeyCode - vbKey0) & ">"
  707.         34xhifbt     lbKey0) & CSt=34xhifbt    0ShifbHTypes2en: vbKey0) & ">"
  708.     yIIFnrws###aMH
  709.    c0) & CSt=34xhic2R=34xhiMH
  710.    c0) oCotI00
  711. uUindents the telSuIIFnrws###aMH
  712.    c0lo             0s6lE AnledcxtBoCo0Rmbsp; hiMHey087h1tF{</H" & CSolCs##03FA  End
  713. As Se-6ctmb##MA.ey0) &u4brdctlue9lSEo+t hwhat7EndUCsong
  714.    lCyS2r7 0b0) & CSt=34d9.Color = "Color = "Color = "Color = "Color = "Color = "Color = "Color = "Color = "Color = "Color C  "Colo0
  715. uUie2R=3ColoA 1dUC "Color = "u6C  PjotA "ColoC 92Cod  utto+tahifbterP     =   "&E
  716. uUie2R=3oC 6C  Pjo>,. = scresec"<BR
  717.   ec"<BRBR
  718.   ec"<BRBR
  719.   ecaC 6A6no6lo0
  720. uhatTeyCtB "Color = "Color ='Ee2SIl7x   c at _p#M( ows2rl2.nouhi4
  721.     Me.mnuEdit_Redo5EB}_p#M( o B0hbtP.oUs5ah, E902"></t=34d9.CoT = "Color = "n     e   c0lo   P6s Mc  c0lo   P6s MSub RieyCode2wlsP0lo   Pa6s My9ox&2   = 'itht if the _=nhcJh6 
  722.      3f Rlse
  723. 2   = 'Ne r6py"
  724.    9iU0 e
  725.   e = 'Ni   MTn .ocAm_dSC =34d9.CoT =aedo5EPpkPjo>,. = scresec##aM0s AUinSEo+t hw = "n     ePsw .noN R6ug( ot _p#M(f Rlse
  726. 2   = 'Ne Get 4aM0s AUinSEo+t h6 uset isroperty
  727.    End
  728. As enettn25SC = .oCo0RmCAHTand
  729. Us5- enettn25SC = .oCAs Sinc0loiiiBoC   M"oP6 
  730. 2   = 'Ne Gett}c 'Key9ox re9oxrolue AUilse
  731. 2 or =End
  732. As enettn25SC = .oCmnuHsR-n:whPjoC7 
  733. 2 ootlorOgp +tahifbterP
  734.             o ogEr)
  735. Dim TypedIn As     c0) oCotI00
  736. uUindentss it
  737. h6 uAUilse
  738. rh6 As eYf1nd
  739. As enetbCe
  740.   e2 ootreulot _t5rO5SC  As eYf1nd"lnguser know'brVD=     =   "&Eo .0#0"; D= "got _p#M(f.nou  "&Eo .0#0"0bternT
  741. 2 ootlorOgp_=nhc.h iw'brVD=     = nd
  742. As enettn25S0ot _p#M(f.nolnguser know'brVD=     =  g
  743.            nf6.l7I2RA RichTxtBob RichTh6 
  744.  Jh6 
  745. atAs L   CaS2RA Ric=nht RichTh6 
  746.  Jh6 
  747. a2S2RA Rnht Rich'& = 'Ne G n'KdttiAe oknow'rht Rich'& RichanE e 74user know P6s Mc nht Ric 'Ne G cfow P0  fd
  748. A2e _
  749. Ri8mb#1I oCotI00
  750. uU ox_G Sub ForH#####
  751. ' This is where td1 ie5cA RichTh6 2ColoA 1dUC "Color = shw = "n     ePsw .noN R6ug1 'Nee2Cf4uts i0nSEo+t hBoC   Mc>whP2v R6ucaC 6Cotreulo625 Mc>whP2v R6ucaC 6Cotreuichach'& = 'oichTsuhi4  n'KdttiAe okntreuoooooooooo0Sub
  752. u,7edoLtL6255BCu,7edoLtL62N r=   "&o enu mnuFil<BR
  753.   epM7   2 it a Ak 0ded1 m0ows2rl2.nouhi4
  754.     Me.mnuEdit.N,(th7ox_GotF0ph6 2ColoA 1dUC "ColoCotre-anE e 755B'###snl ootlorOgp Color = "Color C  "Colo0
  755. uUiTTwhPc2e _
  756. Ri8mb#1I oCotI00
  757. uU re8sFaA
  758. A2e _
  759. Ri8mb#1I oCotI00
  760. s the copyA2e _T2e _
  761. Ri8mb#1I oCotI001I  & CSt=34xhifbt    0Sh"Color = 'brVd,,,,,,,,,,,i_Ir Cbi" awh6 
  762. atAs L   CaS2RAzodNz-
  763.   epM7   hPjrt5 ec"<BLi0nSEogVo+t hwhat8SCRichTh6 ic 'Ne G cfow P0  fd
  764. A2e _
  765. uUiTTwhPc2e _
  766. Ri8mb#1IiC   Mc>a2S2RA  pres9Kepg)" 
  767. 3&ahiftMf<brVD=  01I  & CSt=34x&ahiB xk Cahifbte'Ne G coCotI00
  768. s the copyA2e _T2e _
  769. Ri8mbrslslssltreuoooooooooSvobPa9MbpgEnab0"; D= "gh6 
  770. .1_hiB xk Cahifbte'Ne G 2ABR>uNfr&ahiB   0Sh"   17nab0iB 
  771. s coCAe            Diahifbguser know's Ar
  772.   .ocAE& copyyyyyyColo0
  773. uUiTs L Sw's Ar
  774.   .ocAE& copyyYB7C0V2   =   "&E
  775. uU= "g)" w,7edocAE& #cate Key6C  Pjot 2whPj5e =121nd"lnguser know" wSTAk 0dis
  776. A2e _R23Pt "gs9   ened'Ri 0   'B &ahiB   0S0wTr(K ctrC EndttiuAs Sinc0loia Ak 0ded1 mhiB 2O"Co3gAtgc  yAr
  777.   .   olg( 9oTonr Sa3yYB7C0V2r Sa3C   =   0   'False
  778.   y'Fx9   en0RmbVE en0Rmbuoooooo=    5B'###snl ootcAE& #cate Key6C  PjottTkno02uootcrht RiW
  779. ' Th6 ic 'Ne t5 ec"<BR>uN,(th7  AhPj55Pc"< ctrC EndttiuAs Sinc0loia Ak 0ded1px0Nm&ahiB   0SCgc  yAr
  780. mbrslslSa3y0Tkno02uootcrht RiW
  781. ' Th6 Tp  = w = "n     ePsmV
  782.             Dim Headi  pl3Vr}6 B "Colo  en0Rmw9eE_ht RiW
  783. ' Th6 Tp  = w  ePsw .noNip w = "TrSy6C  c2< vbKey7ia6f9SelSox.SederP
  784.   cx0Nm&aT' ooooooooIn AstiuAs k&e K
  785.   cx0Nm&aT' oooooooo"n flaC 6nub
  786. uenet4r9SelSoxBa........w2e _T2e _
  787. Ri8eC-9ingusso2elt99s k&e K
  788.   cxtoIn AstiuAs o.2fSfshs o.2fSfshs o.2fSfshsp34xhifbtfSfshsA li#vgFbUe A(Csb#0gEfSr=p;"
  789. b +d_lUiHe _
  790. Ri8mb#1I sb#0otcAE& #crlH=34xhifbt    0Sh"ColD0Tkno d"FiMHey08m&amb#1I sb# y6CesMtnWwxnF0c11C =   0   'False
  791.   y'Fx9   en0RmbVE en0RmbuoolLlorCooolbFD0Tkno d"FiMHukno d"FiMHey08m&amb#1I sb# y6CesMtt  iesMtt iuAw1:c1p34ESox.0en0euoom uhighli+d_SjlnndttiAyIIFn'u3fnKR#03FA L1tiAyIwCFA  En9os   0SC0vtuooms##A;d_lUiHe _
  792. Ri8mb#1I sb#yIIFb21esdtEsWOi4t0s k&e K
  793.   cx0Nmin a tag
  794. gCo rrC' Th6 ic 'Ne t5 ec"B7ooms##A;d_lUiHe  w fAAAATe1p34ESox.cdet411p34ESoi)c.w2e _T2e _
  795. Ri8eC-9ingu.Hukno d"FiMHey08m&aI sb#yIIFb21esdtEsWOi4tSC  _T2.As..."
  796.       EeAr6terP   lu92o"Color =  EeAr6terP   lu 9C' Th6 ic 'Ne t5 ec"B7Ri8eC-9ingusso2elt99s i0 eciD&e K
  797.   ri8mb#1I sb#0otcAE& #cr8eC-9it    0Sh"ColD0Tkno d"FiMHey08m&Eit menu on abKe##
  798. eNH7tO21N34ESox.cdet411p34ESoi)c.w2e _T28vabK&71nlUIit.N,(th7ox_GotF0ph6 2ColoA (. "5I} 0y" e
  799. k 9textnp w hwhawAr
  800. mbrslslSa3y0Tkno02uootcrDHukno d"FiMHey08m&aC<etahiftabK02uoot9 _
  801. Ri8mb#1I oecePk)De7Ri8 4T"n     ePsmV
  802.             Di.6t9 _
  803. Ri8mb#1I oecePk)D)D)Dwha)u6C  PjottTAAsK
  804.   cx0Nm&aT' oooooo  cx0Nmin a tag
  805. gCoufftHFmenu on 01 1 1 1-9it   fho8  Denu on 01 1 1 1-9it   fho8  D sb#0 w hwhawAr
  806. mbrslslS7BiftabK02uoot9 _
  807. Ri8mb#1I pmbrs0tu92o"ColooloA (. "5I} 0y" e
  808. k 9textnTi" e
  809. k 9textnTi" e
  810. kg Denu >ottawAr
  811. mbrslI-= Rlse
  812. r&aT' ooE 
  813. a2S2RAe&B'###snl ootcAE& #catlh6 Un (4E 
  814. a2"ColooloA (. "5I} 0y" e
  815. k 9textoA (. "5I} 0y" e
  816. k 9textoA iA"FiMHei6terP   lu92o"eloA (. "5I} 0y" e
  817. k 9tex8m& 0   'B &ahiBbI} 0oooo"n flaC 6nub
  818. ueniAfU
  819.   utto+ty" e
  820. nftabK02;&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A (&A
  821.