dcsimg
Results 1 to 11 of 11

Thread: [2008] Very extensive MDI Text Editor (WIP)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    [2008] Very extensive MDI Text Editor (WIP)

    Hiya!

    I was bored and I have started to create a very extensive Multi-Document-Interface Text Editor (like Notepad, but much more features) as an 'example' text editor project.

    At this point it is still a work in progress (WIP) but I will add things to this when I find the time / inspiration.

    I have tried to make my code as neat as I could, even though it doesn't have very many comments. I have added a comment here and there to explain what a function does or why it's there, but not nearly everywhere. I have tried to keep the variables and function names as clear as I could so you should be able to follow the code without too much problems.

    Still, if you have any questions about a specific part of this program, feel free to ask me (in this thread) and I will be glad to explain.

    Also, I would be very thankful if you could view my code and point out the (probably) many mistakes or whatever... That would really help me out alot!



    Now, on to my program.

    The basics of my program are similar to Notepad, only then with a Multi-Document-Interface (MDI). However, my program has a lot more features and functions, many inspired by Visual Studios features.

    Here is a list of all the features (or at least those I could remember) with an occasional screenshot to clarify things.

    • Multi-Document-Interface text editor as shown in the screenshot:


    • Standard New, Open, Save, Save As features, plus additional Save All function and Recent Files list. (The Recent Files list is still a WIP and can contain errors. The printer functions are not working yet.)


    • Standard Edit menu with Undo/Redo/Cut/Copy/Paste/Select All/Find & Replace (in one dialog)/Go To and Insert Date functions:


    • Tools menu with Word Count and Options (only a few options exist yet). The Options window has a cool little Help feature I made up where you hover your mouse over the option and the help box below shows the help on that option.


    • Three Window Alignment options that align the windows in a specified way quickly. Minimized windows are only affected by this if specified in the Options.


    • Split Document feature, where the active document is split in two allowing you to edit the document in two separate places simultaneously.

    • Synchronized Scrolling feature (only for Split documents for now, but in the future I hope to realize this for every document). Synchronizes scrolling between the two textboxes in a Split document.

    • 'Windows' feature. Shows all the active windows in a neat little Listview, allowing you to Activate, Save or Close the selected documents quickly.
      (Image also shows a Split document)


    • The 'Save Changes?' window which shows when you try to close the program when there are unsaved (changed) documents. This window allows you to uncheck the documents you don't wish to save and save only the checked documents, or save none of them, or even cancel the closing.


      If you only close a single document instead of all documents at once (by closing the program or using the Close all documents menuitem) you will see a standard warning:


    • As a 'bonus', the Listview controls use the vista APIs to support the Vista explorer-like look.


    Unfortunately, it does not have a Tabbed MDI interface, the childwindows just float around. This is because I have never found a satisfying and free tabbed mdi control to use. I have however used professional versions before and with all of them you could simply drop the control on to the form and you're DONE, the control handles everything. However, for obvious reasons, I did not include these controls in this program.


    That's it for now (I think, I probably forget a bunch of things)...

    I hope you like it, and I hope you can use it!

    I have attached the entire source code (including images etc) in this post. Be aware that this is created with Visual Studio 2008 so I don't think any earlier versions can open this...

    (I had to delete the 'bin' and 'obj' folders to get the filesize below 500 kb, I hope this is not an issue, right?)


    See ya..
    Attached Files Attached Files

  2. #2
    Lively Member
    Join Date
    Oct 2007
    Posts
    118

    Re: [2008] Very extensive MDI Text Editor (WIP)

    Looks good, mate.

    Bug:

    1. In the word-count feature, it shows one less word then there actually is.

    2. Print Preview doesn't work (nothing in the code when the button is pushed)

    Also, is there a reason why the scrollbars are so 'large' like there's heaps of text in them?

    Very great program. I love the 'save changes' feature when you exit the program with multiple windows open.

    Cheers.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: [2008] Very extensive MDI Text Editor (WIP)

    Thanks.

    Yes, the word count is not completely right. I compared it to MS Word 2007's word count and it would sometimes not be the same, but sometimes it would...

    The printer functions don't work yet, as I've said in the first post.

    What do you mean about the large scrollbars..? I don't see anything odd about them. Do you perhaps mean the scrollbars in the pictures? They are so big because there is heaps of text in them lol...

  4. #4
    Lively Member
    Join Date
    Oct 2007
    Posts
    118

    Re: [2008] Very extensive MDI Text Editor (WIP)

    Sorry, I read your post on a computer that didn't have VB.NET on it then went on one that did and didn't bother re-reading it; forgetting about the printing bit.

    If I can suggest some features to be added:

    1) Sentence counter

    2) Selected text info (screenie (on the right-hand-side): http://i37.tinypic.com/2150qrk.jpg )

    3) A revert to last saved feature.

    4) Auto-text. Take a look at Microsoft Word's auto text examples.

    Are you still developing this application?

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: [2008] Very extensive MDI Text Editor (WIP)

    I am not developing this application actively but if I find some time and motivation to work on this I might add your features.

    The sentence counter is basically the same as the word counter, only using different characters to check for the end of a word / sentence.

    The selected text info is also basically the same as what it does now, only then instead of using RTB.Text, you use RTB.SelectedText. Won't be too hard to try that yourself no?

    A revert to last-saved feature is a good and easy to implement idea, thanks!

    I don't know what you mean by Auto-Text, nor can I find anything in the help section in Word 2007. Can you explain?

  6. #6
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,283

    Re: [2008] Very extensive MDI Text Editor (WIP)

    Quote Originally Posted by ebonez
    4) Auto-text. Take a look at Microsoft Word's auto text examples.
    Quote Originally Posted by NickThissen
    I don't know what you mean by Auto-Text, nor can I find anything in the help section in Word 2007. Can you explain?
    Auto-text controls are used in Word forms, as in locked documents with only certain spots where limited text can be typed in.

    Auto-text is actually a VBA control behind the scenes, I doubt NickThissen's little MDI app is anywhere near ready to implement that kind of feature.

  7. #7

  8. #8
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,283

    Re: [2008] Very extensive MDI Text Editor (WIP)

    Quote Originally Posted by NickThissen
    So it's basically a template where you are only allowed to change / type a few predefined words? That does sound too advanced for my text editor imo...
    Not quite, check these out:
    http://office.microsoft.com/en-us/wo...307461033.aspx
    http://word.mvps.org/FAQs/Customization/AutoText.htm

    That kind of stuff took MS years to develop and they've got a LOT of vba doing most of the real work behind the scenes.

    The Auto-text (and similar) stuff MS started working on it for Word 95/97 and they didn't really get it usable and user friendly till Word 2003.

  9. #9
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    524

    Re: [2008] Very extensive MDI Text Editor (WIP)

    can someone help me with thise search..
    i want when i press search button to select the word in the Document (Textbox) field like thise program MDI text editor

    here is mine code:
    Code:
    Dim re As String = ""
    Dim match As String = ""
    For Each a In TextBox2.Text.Split(" ")
                re = re & "(?=.*?" & a & ".*?)"
            Next
    
            match = Nothing
    
            For x As Integer = 0 To Document.Lines.Count - 1
                If Regex.IsMatch(Document.Lines(x), re, RegexOptions.IgnoreCase) Then
                    match += x + 1 & ", "
                End If
            Next
    
            If match.Length > 0 Then
                MsgBox("Match found at line " & match.Remove(match.Length - 2, 2))
            Else
                MsgBox("No match")
            End If

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: [2008] Very extensive MDI Text Editor (WIP)

    What you ask for is already there in the example; there's a Find & Replace dialog.

    What your code shows however looks much more involved than a simple Find feature. Can't you explain a little more what you are trying to do? It looks like you are 'forcing' the program to use regular expressions, even on normal word searches, is that right? If so, why? I can't see any reason to do that, as the Find feature of the RichTextBox (which I'm using in the example) works just fine.

    Furthermore, you didn't even tell me what the problem with your code is.

  11. #11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width