-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement text range selection in TextView #30
Comments
Yup, I think we'll need to spice that control up pretty heavily in the future:
When i was doing my boomerang/exetoc assembly view experiments i did it like this:
|
thats the same approach I'm taking with reko. The drawback is I don't want to add a dependecy on Qt or Gtk. It strikes me, however, that adding tooltips for registers and instructions shouldn't be that bad, it's just that there is no selection visible. Let me mull on this for a while I'll create a separate issue to track the notion of annotations in the TextView. |
Agreed, no need to pull in gtk or qt |
Better to make TextView text-selection aware. However, all annotatable things, like registers, instructions, and identifiers, can indicate their annotatedness very easily. The class |
Yes, I can see that having a proper per-character selection would be helpful when getting assembly out of reko.
that would return the 'root' objects in current selection |
Each |
I just checked into Next step is to provide an API to select the objects embedded in the selected text, so that relevant tool tips and context menus can be displayed. |
Maybe you can use http:https://www.scintilla.org/Steps.html as edit control. It is used for example in Notepad++ |
@xor2003: thanks for the suggestion! However, a fullblown text editor with undo, at this time, is a bit overkill for Reko's needs. |
Recall that the RichEdit Control was unsuitable for reko, and Windows Forms has no other way of displaying rich text. TextView is a poor man's version of GtkTextView which seems to serve adequately. The problem is that there is no way for users to mark a text selection. This precludes copying snippets of code, which is a fairly reasonable expectation. Today reko cheeses out by providing a "Copy All" verb, but it certainly could be better.
To implement this, TextView needs the usual assortment of Selection range plumbing: where the selection starts (the anchor), where it ends. A TextSpan must be able to perform hit-detection based on an X-coordinate and return the index position within the span that was selected. TextView needs a CurrentSelection that returns a TextSelection object consisting of all the TextSpans, both partially and fully selected. TextSpans, when rendering, must know what portion of them is selected and what is not so that they render colors correctly.
The text was updated successfully, but these errors were encountered: