Page 2 of 2 FirstFirst 12
Results 41 to 62 of 62

Thread: Re: TextEditor

  1. #41
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    First thing to notice is that the default font is sans serif.
    Make it fixed width like Courier New.

    If you resize to small your resize code generates an error
    VB Code:
    1. Private Sub Form_Resize()
    2.     'Resize the txtDocument editing window to fit the form
    3.     txtDocument.Width = frmMain.ScaleWidth - 4
    4.     txtDocument.Height = frmMain.ScaleHeight - 4
    5. End Sub
    The -4 creates a negative Height and Width
    I think I have a resize module somewhere.
    I'll try and dig it out.

    For some reason the horizontal scroll bar is not working on the text box.
    If you hold down a key you cant tell whether it has wordwrapped or if it is a new word.

    An insert HTML outline would be good too.
    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
            "http://www.w3.org/TR/html4/loose.dtd">
    <HTML>
       <HEAD>
          <TITLE>HTML 4.01 Transitional</TITLE>
    	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
       </HEAD>
       <BODY>
          
       </BODY>
    </HTML>
    ConTEXT has a lot of useful features like this.
    It might be worth downloading it and picking out the best bits.
    One feature that is has is the autocomplete is based on external text files.
    This is useful as the user can add/modify/extend it as he wishes.

  2. #42
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    Here are 3 resize examples.
    2 API and one manual.

    The API examples have the advantage that they don't flicker.

    All of them need tweaking as I didn't write any of it myself

    The upload is a 7z inside a zip.
    I use 7zip for the greater compression ratios, but VBF doesn't support the extension.
    Download ZipGenius http://downloads.zipgenius.it/ if you cant open 7z files.

    7-Zip currently offers best compression ratio available http://www.7-zip.org/
    Attached Files Attached Files

  3. #43
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    Cool, thank you. I'll take a look at the "resizers" later, I just reformatted so I'm involved in reloading my life at the moment.

    Do you have any idea why the horizontal scrollbar isn't working? I think I've had this problem before and the fix was sending a message to the RichTextBox telling it to expand it's right margin.
    "I don't want to live alone until I'm married" - M.M.R.P

  4. #44

  5. #45
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    Aha! I had never seen the RightMargin property before, I had used the SendMessage API to set it.

    I haven't yet tried out the control resizers yet, I'll hopefully get to that this evening.
    "I don't want to live alone until I'm married" - M.M.R.P

  6. #46
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    arg, I'm very sorry. Haven't gotten around to testing the code yet...school, work, and life in general seem to want a shot at my attention all at once.
    "I don't want to live alone until I'm married" - M.M.R.P

  7. #47
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    I know what you mean.
    It doesn't help that my motherboard has died at home too
    Perhaps we should have a list in the first/second post identifying what needs doing next, new/proposed features, problems etc
    And maybe put a copy of the latest code there too?

    It might make the project a bit more structured.

  8. #48
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    Ouch, that isn't good. I'll update the 2nd post in the thread to hold that information. I may actually get around to testing the code today, but it's more likely to be done tomorow.
    "I don't want to live alone until I'm married" - M.M.R.P

  9. #49
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    Okay, I finally got to look at the code you posted. I think just adding an "On Error Resume Next" to the Form_Resize sub would be fine, unless you think there should be a minimum size.
    "I don't want to live alone until I'm married" - M.M.R.P

  10. #50
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    Have you seen moeur's RichTextBox Tricks and Tips?
    http://www.vbforums.com/showthread.php?t=355994

    Well worth a read

    I'm not sure how far you have got with the Intellisense but there is an interesting demo in C# here
    http://www.codeproject.com/csharp/DI...&select=971896

  11. #51
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    wiz126 put a small intellisense demo on his server
    http://www.scriptsorcodes.com/images..._Intellisense/

    It needs enhancing, for instance I reckon you need to load the keywords from a file so that it is easy to update/add new words/languages

    It also needs to use a popup and select with the keyboard instead of the mouse.
    But the general idea is there.

  12. #52
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    The main problem I forsee with the intellisense is how to load different languages...The common delimiter is ".", but PERL's is "->". There are many other differences between main languages and so the job right now is to create a system that will support a diverse language environment.
    "I don't want to live alone until I'm married" - M.M.R.P

  13. #53
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    What you could do is put the delimiter at the top of the language file.
    You then put that into a variable that gets looked for in the code.

    Or to start with you could just support languages that have a full stop as the delimiter.

  14. #54
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    I was thinking about how the insert form object could be trimmed.
    Each of the subs is the same apart from the line that looks like
    VB Code:
    1. ToAdd = "<input type=""textbox"">"
    This could be made generic and read the info from a setup file (ini / xml ?)
    Reading from a setup file means that you can extend the language without recompiling.

    Similarly for the HTML object (form/image/hyperlink) I was wondering if it would make the code smaller by creating the forms through code at runtime instead of manually at design time.
    Again the values could be read from a setup file making the program more easily extensible.

    What do you reckon?

  15. #55
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    DarkX_Greece created an interesting simple HTML Editor
    http://www.vbforums.com/showpost.php...2&postcount=17

    Does syntax highlighting.

  16. #56
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    I like the idea of dynamic menus and forms, but I'm not sure how feasible it is. I don't know how difficult it is to subclass a menu and then tell which item is clicked in it.

    I'll add this to the list of possibilities.
    "I don't want to live alone until I'm married" - M.M.R.P

  17. #57
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    Its late and I cant be bothered to reread the entire thread
    But I was looking at the KDE Advanced Text Editor and Code Folding is useful
    http://en.wikipedia.org/wiki/Code_folding

    I'm not sure how to go about implementing it though.....

  18. #58
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    That would require a complete rewrite of the input engine, unfortunately.
    "I don't want to live alone until I'm married" - M.M.R.P

  19. #59
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: TextEditor

    Is this project still continuing?
    Can you post the latest code?
    Preferably somewhere at the top of the thread.
    After I have finished my exams in the next couple of weeks I should have time to contribute if you need any input.

  20. #60
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: TextEditor

    It is currently in limbo,, there haven't been any major changes - life has been a bit too hectic recently, but it will cool down after Christmas. (Sister gets married Dec. 17th, huge project at work, etc). Any help would be appreciated, especially in brainstorming, don't want to do anything that limits future development and additions to the supported languages.
    "I don't want to live alone until I'm married" - M.M.R.P

  21. #61
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: TextEditor

    This is C# code using ICSharpCode.TextEditor.dll and WeifenLuo.WinFormsUI.Docking.dll. This may or may not help the project but I like to contribute if this is C#.

    Edit: This code is based on SharpDevelop and the solution is SharpDevelop-based (I guess VS2003 can open this solution file; even 2006VS can open this I guess, but there are some things not properly set because of incompatibility).
    Attached Files Attached Files
    Last edited by nebulom; Dec 5th, 2006 at 08:02 PM.

  22. #62
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: TextEditor

    DLLs are attached here.
    Attached Files Attached Files

Page 2 of 2 FirstFirst 12

Posting Permissions

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



Click Here to Expand Forum to Full Width