Retrieve desired size of SyntaxEditor

SyntaxEditor for WPF Forum

Posted 9 years ago by Rick Fleuren
Version: 10.2.0533
Avatar
We are trying to write our own panel and wish to give the SyntaxEditor as much height as needed to render all the Text in the panel. However, the DesiredSize is always zero if we try to get the SyntaxEditors desized size.

Is there any way to get the DesiredSize of the SyntaxEditor when it has rendered the text (with wrapping on), so that we can retrieve the desired height for a given width for our panel?

Thanks in advance,

Rick Fleuren
Everest b.v.

Comments (5)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Rick,

Unfortunately all the view lines are virtualized for performance in large documents right now so we don't have anything built-in at the moment to do full desired measurement.


Actipro Software Support

Posted 9 years ago by Rick Fleuren
Avatar
Hmm that is too bad.

What if we measure with an infinite height, would it be possible to retrieve the visible/rendered view lines and measure their height?
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Rick,

We would have to alter a decent amount of code to support this feature. I've written it down on our TODO list. One of the top features we plan on implementing following the .NET Languages Add-on completion is a single-line edit mode. In that we would need to do measuring. I added a note to that TODO item to also look into adding measurement (perhaps as an option) for the multi-line version too. We'll let you know once it's added.

Right now though there isn't much you can really do. You might be able to do editor.ActiveView.GetViewLine and iterate through the lines to add up height. Then account for borders and splits, etc.


Actipro Software Support

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rick,

We have been working on this a bit as a possible feature addition for the upcoming 2014.1 version.  If you would like to help test this with us, please write our support address and reference this thread.  Thanks!


Actipro Software Support

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

We've announced this feature on our blog as being included for the 2014.1 version:

http://blog.actiprosoftware.com/post/2014/02/26/SyntaxEditor-Auto-Sizing


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.