Posted 16 years ago by Matt Whitfield
Avatar
Hi - you asked for new feature requests so you knew that I was going to come up with some! :)

1 thing I had to do recently was to create a comparison text box, such that you have two rich text boxes, one on the left and one on the right, to compare text. What I needed was the ability to keep the scroll state of two syntax editors in lockstep - i.e. applying the exact scroll state of one syntax editor to the other.

I ended up doing it with rich text boxes in the end, which wasn't ideal, but sort of worked.

Only trouble with this feature is that I don't think it would be very useful to a wider audience, unless they are writing diff / comparison functions into their apps.

Will try to come up with some more useful ones!

Comments (4)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Matt,

I think you can sync up scrolling right now. I believe there are events on SyntaxEditor that fire when scrolling occurs.


Actipro Software Support

Posted 16 years ago by Matt Whitfield
Avatar
Yep - for sure you can get the position - I just didn't find any neat ways of applying that to the other syntax editor.

There's a lot of methods in editor view to do with scrolling to a known document position, but none that really would allow you do so something like this:

private void editorControl_Scroll(object sender, EventArgs e)
{
otherEditorControl.SelectedView.ScrollTo(editorControl.SelectedView.ScrollPosition);
}

(edit - implied is the scrolling horizontally to match too, by the way! :) )

[Modified at 07/25/2008 04:52 PM]
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Check these out... SyntaxEditor.ViewHorizontalScroll and ViewVerticalScroll events. Then the scrollbar values are EditorView.FirstVisibleX and FirstVisibleDisplayLineIndex respectively.


Actipro Software Support

Posted 16 years ago by Matt Whitfield
Avatar
Aha! Lovely Jubbly!