SyntaxEditor - Move/Select to Matching Bracket

by Avatar Bill Henning (Actipro) - 5 comments
Friday, September 7, 2012 at 1:39pm


As seen in yesterday's post, delimiter (bracket) highlighting is coming to the WPF and Silverlight SyntaxEditor controls in the 2012.2 version (due very soon). 

A new language service that was described yesterday was a structure matcher service.  This allows delimiter sets to be located.  When one of these is registered on a language, SyntaxEditor automatically gains a new feature:  move/select to matching bracket.

UPDATE:  Version 2012.2 is live and available for download now.

Select to Matching Bracket Example

Let's take a look at how this all works.  Say we have this scenario in SyntaxEditor where the caret is next to a parenthesis. 


Notice that the bracket highlight is not visible because the caret is on the inside of the parenthesis and the highlights for this language are told to only show when the caret is on the outside of a parenthesis.

Now we press Ctrl+Shift+] and voila, the structure matcher returns the nearby delimiters to SyntaxEditor, and the full delimiter range is selected.


So you may be asking, how did that work, when delimiter highlighting didn't register the parenthesis as a valid delimiter?  We designed the structure matcher so that an option can be passed asking it to be more liberal in its matching algorithms.  So while the delimiter highlighting matching logic for a language may have very specific locations a match can occur, other features like move/select to matching bracket can find matches that are anywhere next to the caret.

On a side note, the hotkeys for moving (Ctrl+]) and selecting (Ctrl+Shift+]) to the matching bracket only work in WPF since Silverlight doesn't allow us to watch for that key sequence being pressed.  However you can still provide this functionality to customers via a menu item in Silverlight.


Move and select to matching bracket is some handy functionality when editing code blocks.  We're excited to offer it in the 2012.2 version.

TaskDownload TaskLiveDemo TaskBuyNow

SyntaxEditor - Delimiter Highlighting

by Avatar Bill Henning (Actipro) - 2 comments
Thursday, September 6, 2012 at 1:39pm


We're currently working on wrapping up the 2012.2 versions of our WPF and Silverlight controls and hope to have these out in the next several weeks.  Today I'd like to announce another new feature coming to SyntaxEditor in the 2012.2 version:  delimiter highlighting!

UPDATE:  Version 2012.2 is live and available for download now.

What is Delimiter Highlighting?

Delimiter highlighting, also called bracket highlighting, is a feature where highlights appear next to sets of delimiters when the caret is next to them.


In the screenshot above, we have the current line highlighting feature active along with delimiter highlighting.  The caret is next to a { character which the C# language implementation recognizes as a bracket that should receive highlighting.  Thus its background is highlighted, along with the matching } bracket's background.

Language-Specific Delimiters

Each syntax language has complete control over which delimiter sets are supported.  The language simply creates a new IStructureMatcher service that is able to locate matching delimiters.

Plus we include a built-in implementation of that service that makes it easy to provide matching for curly brace, square brace, angle brace, and parenthesis pairs.

Multiple Delimiter Support

One feature request we had for the WinForms version (which already has bracket highlighting features) was a good way to support more than two delimiters in a matched set.  This is useful in scenarios where perhaps you want to highlight #if#else#endif.  I'm pleased to say that our delimiter matching feature fully supports and will highlight any number of matches in a delimiter set!

Performance Optimizations

One issue with delimiter highlighting in general is that it updates very frequently, basically with every text or selection change.  In large documents, it can take time to scan forward/backward to find a matching delimiter. 

What we did was to design this feature in such a way that the scanning work is completely offloaded into a worker thread.  It actually piggybacks onto our multi-threaded parsing framework to accomplish this.  Thus in the end, the highlights still show up fast and even when the match scanning takes a relatively long time, there is no detriment to typing or scrolling performance.


Delimiter highlighting is a visually subtle, yet extremely useful feature when editing code.  It's been highly requested and we're very happy to deliver it in 2012.2.  We think you're really going to like what we've come up with.

In our next post, we'll talk about the related move/select to matching bracket functionality, also coming in 2012.2.

TaskDownload TaskLiveDemo TaskBuyNow

Bullet Graphs Part 3 - Other Features

by Avatar Bill Henning (Actipro)
Wednesday, September 5, 2012 at 4:04pm


In the previous post for our Micro Charts product (currently available for WPF, Silverlight, and WinRT XAML), we showed appearance features off for the MicroBulletGraph control that is coming to Micro Charts' 2012.2 version (already available for WinRT XAML). In today's post, we'll showcase several other special features of the control.

UPDATE:  Version 2012.2 is live and available for download now.

Minimum and Maximum Values

The minimum and maximum values displayed on a MicroBulletGraph are automatically calculated if they are not given a value. The maximum value is then set to the largest part value, and the minimum is set to zero, or the smallest part less than zero, if one exists. 


If the minimum is given a value greater that zero then the featured and projected values will display as ellipses centered on their value. An example of a graph with its minimum greater than zero is displayed above.

Negative Values

The MicroBulletGraph also supports negative values. If the featured or projected bar are given a negative value they will start at zero and extend in the opposite direction (left for horizontal orientation and down for vertical orientation). The comparative bar and ranges will function the same for negative and positive values.

Tool Tips

Tool tips can also be used on MicroBulletGraph controls. They can be custom formatted and can display all the part values and the minimum and maximum properties. An example of this is in the screenshot above.


The MicroBulletGraph control is an excellent and versatile tool for displaying data. It has numerous customization options for function and appearance that allow it to make a comprehensive and engaging graph that maximizes the end-user's understanding of the data in a small area.

It will be included in the 2012.2 versions of our Micro Charts product.

TaskDownload TaskLiveDemo TaskBuyNow

Bullet Graphs Part 2 - Appearance Customization

by Avatar Bill Henning (Actipro)
Tuesday, September 4, 2012 at 10:25am


In the previous post for our Micro Charts product (currently available for WPF, Silverlight, and WinRT XAML), we revealed the MicroBulletGraph control that is coming to Micro Charts' 2012.2 version (already available for WinRT XAML). In today's post, we'll talk about how you can customize the appearance of the MicroBulletGraph to create visually stimulating graphs.

UPDATE:  Version 2012.2 is live and available for download now.

Customization Options

There are many ways to customize the look of a MicroBulletGraph, including customizable color schemes, changing part sizes, and graph orientation. The color of the graph can be set with a single base color that applies to all the parts to quickly create a unified color scheme, or the brush on each part can be set to create custom color schemes. A combination of the methods can also be used to efficiently create a graph that has a base color with highlighted parts.


Various examples of MicroBulletGraph appearance customizations, from the upcoming WPF demo

In addition to a different color, the featured bar, comparative bar, and projected bar can also be set to a different size. The height of bars can be set to a specific number of pixels, or to a percentage of the graph to fill. The width of the comparative bar can also be set to a different number of pixels to alter how large of a range it covers.


The same bullet graph demo as above, displayed in our Windows 8 WinRT XAML controls demo - available now!


The many customization options provided by the MicroBulletGraph control allow for virtually unlimited opportunities to create a unique and engaging graph. Using the appearance customization abilities graphs can be color-coded and highlight key data points while being visually appealing and easy to understand.

In our final post of this series, we'll look at some other features of the control.

TaskDownload TaskLiveDemo TaskBuyNow

Bullet Graphs Part 1 - Introduction

by Avatar Bill Henning (Actipro) - 1 comment
Thursday, August 30, 2012 at 10:42pm


In the previous post for our Micro Charts product (currently available for WPF, Silverlight, and WinRT XAML), we finished looking at our heat map control that is able to generate heat map markers that change both in size and color.  This allows for representations of two distinct data sets in the same heat map.

In today's post, we'll take a look at a new control called MicroBulletGraph coming to Micro Charts in the WPF and Silverlight controls in their 2012.2 versions.  This control is already available in the WinRT XAML 2012.2 version of Micro Charts.

UPDATE:  Version 2012.2 is live and available for download now.

What Are Bullet Graphs?

Bullet graphs were originally designed to replace meters and gauges in a more compact way while still being informative.  They are best suited to display a value that has other related values to be compared to, such as last year's mark, a goal or target, or a projected future value.  With the MicroBulletGraph's many parts, it is easy to provide contextual information about the data being displayed.

The actual value is represented by a featured measure bar, which is juxtaposed with a comparative value displayed as a bar perpendicular to it. The featured and comparative values are then placed in the context of specific ranges such as poor, average, and excellent. To give further meaning a projected bar can be used to display a future expected value of the featured bar.


In the example above all the parts of the MicroBulletGraph are displayed and labeled. Note that the only required value is the featured value, all others can be omitted, hiding the bar from view. An unlimited number of ranges can be used, or none at all, but bullet graphs most commonly utilize three qualitative ranges.


Bullet graphs are incredible tools to help the viewer grasp multiple points of information quickly without seeming cluttered or confusing.

In our next post of this series, we'll take a look at appearance customization features.

TaskDownload TaskLiveDemo TaskBuyNow