Announcement

Collapse
No announcement yet.

TSTE anyone?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • TSTE anyone?

    I'm looking for a Terribly Simple Text Editor to use in commercial applications. I expect I shall want to modify the code, so would prefer PB. I've tried Borje Hagsten's EDM32 which is impressive but too big. I want feature-poor! No file handling, fixed character fonts only, in fact only a step away from an edit control, though I shall need a simple, clean interface, and stable - I can add my own bugs later! If keyword highlighting and search and replace are included, all the better, but I don't mind adding them.

  • #2
    > in fact only a step away from an edit control....

    So superclass an edit control, adding the few additional features or behaviors you want?
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Chris,
      Have you looked at the pbnote2.bas in the samples\sdk\pbnote directory?
      Last edited by Scott Hauser; 20 Feb 2008, 04:07 PM.
      The most exasperating part of the "rat race" is how often the rats are in the lead!

      Comment


      • #4
        Scott,
        Thanks, I had a look but could not see how to use color syntax highlighting.

        MM,
        Thanks, I'm doing something of the sort with Richedit at the moment. If I don't bump into the TSTE then I can introduce features using code from messrs Hagsten, Marchildon, etc to guide me. Hate adding the dll, though it was good to dump 6,000 lines of code out of my project (modified EDM32).

        Comment


        • #5
          I think you may want to look into using the RichEdit control.
          It is very powerful and can control text color using RTF codes.

          To make it even better, I would superclass the RichEdit control so you can add your own custom messages or preprocess others.

          For example, you can support the WM_SETTEXT message and receive standard ascii text and the convert it on the fly to RTF internally and then using the EM_STREAMIN message pass the text to the control.

          Superclassing is a great way to build your own custom controls based on existing controls.
          Chris Boss
          Computer Workshop
          Developer of "EZGUI"
          http://cwsof.com
          http://twitter.com/EZGUIProGuy

          Comment


          • #6
            Originally posted by Chris Boss View Post
            ... you can support the WM_SETTEXT message and receive standard ascii text and the convert it on the fly to RTF internally and then using the EM_STREAMIN message pass the text to the control.
            At the moment I'm using the very simple alternative of putting text on the clipboard and %WM_PASTEing it in.

            Comment


            • #7
              Chris, If you want simple, I have a text editor that looks very similar to notepad, has find/find next, copy/paste with right click, fixed pitch font but nothing fancy. It probably won't handle large amounts of text as is but is
              fine for many things.

              You can see it in my client writeup demo, under the file>maintenance>File editor.
              Client Writeup for the CPA

              buffs.proboards2.com

              Links Page

              Comment


              • #8
                Thanks Fred, I took a look at it. Is it rich-text based? One feature I will need is to highlight keywords, I know it can be done without a lot of work in the RichText control, not sure about others. How's that for looking a gift horse in the mouth?

                Comment


                • #9
                  Chris, for another alternative, you might take a look at my website. I have two text editors, both based on rich text. MyEditor has file functions, but NoteKeeper does not. NoteKeeper is just an integrated maintenance program for text files kept in a single folder. It does high light text in its search routines. Anyway, it won't take long to rule it out if its not what you're looking for.

                  http://www.cgdsoftware.com

                  Comment


                  • #10
                    Originally posted by Charles Dietz View Post
                    ...NoteKeeper...
                    Thanks Charles, I have downloaded, shall take a close look and report back.

                    Comment


                    • #11
                      Charles

                      your site is great!! I love the "DDT Jumpstart"

                      Comment


                      • #12
                        Chris, it's not a RT control. It's actually just a textbox control. All done in DDT.

                        Im sure it could easily be modified.

                        Charles, DDT Jumpstart is great !
                        Last edited by Fred Buffington; 21 Feb 2008, 02:52 PM.
                        Client Writeup for the CPA

                        buffs.proboards2.com

                        Links Page

                        Comment


                        • #13
                          preliminary results with Charles's code are promising - I have stripped out all the input file handling and inserted color keyword code borrowed from Borje Hagsten, it sort of works... oh, the keywords are SQL ones in this code but the comments are PB. Much more to do, and needs the 32 bit RichEdit dll.

                          **** EDITED - please see later message for source code
                          Last edited by Chris Holbrook; 22 Feb 2008, 05:13 AM. Reason: removed source code

                          Comment


                          • #14
                            Nearly there!

                            After borrowing keyword coloring (for PB Win 7.0 code) and find/replace code from Messrs Hagsten and Christensen, discarding all file handling, spell checking and making most controls unnecessary, moving remaining functions to a right-click menu, I'm left with something approaching my original requirement, but needing refinement.It's still only 600-odd lines of code.

                            Problems. The caret should become a cursor when it strays outside the client area, and the comment coloring logic doesn't work properly if the comment line is wrapped. The keyword coloring is dreadfully slow and it makes the scrollbar jump around.

                            Any advice on how to fix these or any other obvious faults will be gratefully received.

                            Oh, and it compiles with PBWWin 8.04, you will need to import and export text via the clipboard.
                            Last edited by Chris Holbrook; 22 Feb 2008, 01:14 PM. Reason: withdrew code, will repost to source code forum...later

                            Comment


                            • #15
                              Notepad+ is free.
                              http://www.mypeecee.org/rogsoft/

                              Comment


                              • #16
                                Originally posted by BRENT GARDNER View Post
                                Notepad+ is free.
                                free but unsuitable - see post #1.

                                Comment


                                • #17
                                  In "SUB ScanLine" under "The characters we need to inlude in a word "
                                  You may want to include the apostrophy(39) in code on line 174, so it is not highlighted?

                                  Comment


                                  • #18
                                    sorted

                                    problems noted above have been fixed, thanks!

                                    Comment


                                    • #19
                                      Fix the keyword coloring slowness by using a hash table to look up words. This is extremely fast. Also, check how you are parsing the line of text in order to break the line into words/tokens. There may be speed improvements available there.
                                      Paul Squires
                                      FireFly Visual Designer (for PowerBASIC Windows 10+)
                                      Version 3 now available.
                                      http://www.planetsquires.com

                                      Comment


                                      • #20
                                        >by using a hash table to look up words.

                                        Or...Binary Search of an array February 14 2000, July 15 2003
                                        Michael Mattias
                                        Tal Systems (retired)
                                        Port Washington WI USA
                                        [email protected]
                                        http://www.talsystems.com

                                        Comment

                                        Working...
                                        X