SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Extending/replacing/modifying selection behavior of AvalonEdit's TextEditor?

Last post 01-10-2012 7:26 PM by Will Sullivan. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-04-2012 10:18 PM

    Extending/replacing/modifying selection behavior of AvalonEdit's TextEditor?

    I'm trying to modify how text selection behavior occurs in the TextEditor control, but I'm not sure how I should do it.  For example, I'd like to force rectangular selections, enable virtual lines (like virtual space, but extending below the last line of the document), etc, that aren't available through the current option set.

    My first instinct was to create an implementation of ITextAreaInputHandler that is based off of SelectionMouseHandler, but as I examine the code for that class it appears that I'm going down the rabbit hole.  It (and classes it relies upon) doesn't appear to be written with extension in mind.  

    Am I going in the right direction?  Is there an easier way to control selection?  Are there any guides about implementing this type of customization?

    Filed under: , ,
  • 01-07-2012 2:29 AM In reply to

    Re: Extending/replacing/modifying selection behavior of AvalonEdit's TextEditor?

    For what you are doing, you will probably have to completely replace the SelectionMouseHandler with your own implementation.

    Virtual lines are not supported by AvalonEdit, there isn't any way to represent those with the existing Selection classes. And even if you create a custom selection class, you would have to write a custom selection renderer.

  • 01-10-2012 7:26 PM In reply to

    Re: Extending/replacing/modifying selection behavior of AvalonEdit's TextEditor?

    Thanks for the reply (email notification is on, but nothing is in my various boxes?).

    That's what I've done.  Its a bit irritating that much of the editor's functionality is wrapped up in internal classes that I can't access without playing dirty with the source (such as CaretNavigationCommandHandler).  I've handled virtual lines by appending newlines as needed.  Works in my situation, anyhow.

     

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.