Divelements
Because everything starts with the presentation layer
SandRibbon for Windows Forms
 Friday, October 19, 2007, 3:33 AM   Home Products How to Buy Store Support Corporate  

SandRibbon

Our implementation of the Microsoft Office 2007 Ribbon user interface is lightweight, easy to use, and provides all the features necessary to implement the new user interface paradigm in your own applications.
Unparalleled design-time support means that your application can be up-and-running with a ribbon-based look and feel in minutes.

Download Purchase
Home / Products / SandRibbon for Windows Forms
SandRibbon Release Notes

Version 1.6

This version is a very significant new release, with a number of new features. Every once in a while we introduce a new feature that is so great that we feel it justifies a breaking change from previous versions, as long as the change is very easy for our customers to make. This release has such a change.

Grouping

The way items are grouped has been made easier in this release. Previously, in menus you had the BeginGroup property to cause a menu item to draw a separator above it. In other areas, you could manually add a Separator control before another control if you wanted to. In order to have multiple groups of buttons (e.g. multiple ButtonGroups) you would create a StripLayout and place many ButtonGroup controls within it. All this is no longer necessary.

All items now have a GroupName property. This is a string property that causes the layout engine to become aware when one item should be placed in a new group from the item preceding it. The beauty of this is that no individual item is designated as the beginning of the group. For example, in a menu you may have several items whose visibility changes dynamically. Determining which item in that logical group is the first visible, then setting its BeginGroup property, was a pain. Now you can give them all the same GroupName (e.g. "clipboard") and they will be automatically grouped together. There will be a separator between the last item and the first in the group, and one after the last in the group too (assuming another items follows).

The benefits of this new system for menuing are obvious, but we have extended the behaviour to ButtonGroup controls too. Whereas before you could create a StripLayout with multiple ButtonGroup controls inside to achieve groups of button groups, now you just need one ButtonGroup control and you can use the GroupName property of items within to control the visual separation of items. The best way to understand this is to give it a try, or look at the demonstration application which has been simplified to take advantage of this new property.

Galleries

Previously, there was the Gallery control, which could be included on a ribbon or a popup. In this release we have added considerably to the features of in-ribbon galleries, and we had to take the decision to separate this into its own class, called RibbonGallery. Therefore, a gallery situated in a popup (Gallery) is now a distinct control from a gallery situated in a ribbon (RibbonGallery).

This is a breaking change. Any Gallery controls you have used on a ribbon (but not in a popup) need to be changed to RibbonGallery. When you first open Visual Studio after upgrading, close any designers that were left open without saving. Then, open the designer-generated file accompanying the form, for instance frmMain.designer.cs. You need to change two lines of code - the declaration of the gallery and the instantiation. Use the Find tool to locate these lines based on the name of the gallery, and change Gallery to RibbonGallery. For instance:

private Divelements.SandRibbon.Gallery gallery1;
this.gallery1 = new Divelements.SandRibbon.Gallery();

Becomes:

private Divelements.SandRibbon.RibbonGallery gallery1;
this.gallery1 = new Divelements.SandRibbon.RibbonGallery();

Note that these two lines will not follow each other like they do in this example. That is all you need to do - save the file and re-open your designer.

In versions prior to this one, if you wanted the user to be able to expand an in-ribbon gallery you had to create a separate popup associated with it. This popup would inevitably contain a good deal of duplication from the in-ribbon gallery itself, normally in the form of another gallery containing similar items. The new gallery architecture has meant we can now automatically drop down an in-ribbon gallery in a popup without you doing any more work. As long as there is no popup associated with your in-ribbon gallery, this will just work.

But what about if you wanted to show the in-ribbon gallery in full, but add some more items to it? Well, the story gets even better. If you have associated a popup with your in-ribbon gallery you can choose to turn on the MergeIntoPopup property. This means that your regular popup will be shown, with the gallery inserted at the beginning automatically. It's therefore very easy to exactly copy any of the galleries seen in Office 2007.

Along with the automatic popup, galleries also respect the new GroupName property on their child items. Unlike other parent controls, though, galleries actually use this to display group headings before items. Each change of group name results in a new line, and a heading with the name displayed. Following items are then laid out below the heading. Best of all, these group names are ignored in in-ribbon galleries but honoured when shown in full (as a popup) thereby automatically saving you from creating a duplicate gallery.

Toolbars

We have added a standalone ToolBar class in this release. The quick access toolbar now derives from this basic toolbar implementation, in fact, which automatically provides chevron support for accessing items that have been clipped due to screen space. This also paves the way for the Mini ToolBar, which will follow in a future build.

Toolbars can host the same type of controls you would normally put on a ribbon, from buttons to sliders to combo boxes. They also respect the new GroupName property and draw proper separators between groups.

Design and content Copyright © 2003 - 2007 Divelements Limited. Content may not be reproduced without permission.