The Actipro Blog

All the latest UI control development news from Actipro

SyntaxEditor for WPF - Mouse wheel zooming - Part 2

In the blog, we recently discussed a new feature added to SyntaxEditor for WPF:  mouse wheel zooming.  Following the initial post on the feature we’ve done a few more enhancements.

Animated zooming effects

We added the ability for you to specify a Duration over which a zooming animation takes place.  So as you rotate your mouse wheel (while holding Ctrl) to change the zoom level, each zoom level change will smoothly animate over this duration. 

You can optionally set this Duration to 0ms to prevent animation and instead, jump directly to zoom levels.  However the animation is a very classy effect.  We’re sure you’ll love it.

The animation also takes place, even if you zoom the control via an external control, such as a Slider that may be in a StatusBar.

Zooming affects scrollable area only

In the previous post’s screenshot, you’ll notice that the entire control was scaled up, including scrollbars.  Based on feedback we received, we altered our code to only zoom the scrollable area of the editor. 

Zooming

SyntaxEditor zoomed in at 300% using the mouse wheel… note the zoom level adornment is in the process of fading out and the scrollbars remain at 100% zoom level 

This means that the text area and any margins that scroll will be scaled when zooming.  The scrollbars, buttons next to the scrollbars, and fixed margins (more on margins in a future post) will remain a constant size and will not scale.

Imagine the difference this feature will make when using the zoom feature while doing live code-oriented presentations, etc.

Zoom level indicator templates

As you can see in the screenshot above, we added a magnifying lens icon in the default zoom level indicator template to spruce things up.

Not only that, we also made the indicator DataTemplate-based, so you can create your own custom zoom level indicators.

Zooming2

Our Zooming Quickstart, showing a custom zoom level indicator DataTemplate in action

Thanks to everyone who provided feedback, your comments made a difference!

Filed under: Actipro, In development, WPF

Comments (1) -

January 6, 2009 at 14:26  

KB

Funny, I was trying to do this in Visual Studio the other day by holding down the ctrl key and mouse wheeling.  Needless to say, it didn't work.  Nice feature.

Comments are closed