Archive for 2006

Context tabs are those that only appear when a selection has occured in your application. These have now been added.

I have added a collection for handling KryptonRibbonContext instances. This allows the developer to define the names of different contexts along with a color they would like to use for drawing.

The KryptonRibbonTab now has a field called ContextName that prevents the tab being shown until that context is selected. This allows you to associate particular tabs with a particular context.

Once you define the KryptonRibbon.SelectedContext to the name of a valid context it will show the tabs associated with that name. These contextual tabs always appear at the end of the list of standard tabs.

Here I have defined a context with a green highlight color.

And now a red context.

Next I need to allow the specification of a list of different context names to the KryptonRibbon.SelectedContext property. So if the developers application allows multiple selection of different objects then they will want to show multiple sets of context tabs at once.

The application button is the name for the large button at the top left of the new Office applications.

As you can see in the two pictures below I have now added the button which operates by showing a ContextMenuStrip when pressed. The Office Guidelines indicate that when possible the application button should be merged into the window caption area. When that is not possible there should be an area above the ribbon tabs that acts as the location for merging.

At the moment I have not implemented the merging into the KryptonForm caption area and so you can see the alternative appearance here. Once I have added the ability to have context tabs and context titles I will then look at the merging functionality.

The control is starting to look more like a real Ribbon now that we have the groups area background and border drawn.

Still not a very exciting control as there is nothing inside the groups area but we have to move forward a step at a time. Here is the blue, silver and then black color schemes.

As I already have code to add button specifications to a display element it was pretty simple to add ButtonSpec definitions to the tab bar.

You will almost certainly want to use this ability to add your own additional buttons to the ribbon. Office 2007 applications already do this by having a help button on the right hand side of the tabs area.

Here is a ribbon where I have defined a button spec for the right hand side that has an image and some text. There is also a button spec defined for the left hand side that is just an image.

When using with an MDI application the pendant buttons appear on the right hand side of any buttons that you define. In the same way as Excel 2007 works.

Finally to prove the left hand button is really working, here it is highlighted.

I am now signing off for a couple of days to celebrate Xmas and eat too much!

I hope you have a good holiday season and I will be back with more ribbon posts as soon as I get back into the daily grind of coding.