Archive for 2007

A developer asked on the forums why there wasn’t a Krypton version of the MaskedTextBox control when there was a Kryptonized TextBox and RichTextBox available in the CTP. Quite rightly they pointed out that it looked like hardly any extra work as I already had the other two in place. Well the answer is simple. I clean forgot there was a masked control in Win32. This omission has now been corrected. Here is the KryptonMaskedTextBox

If we switch the InputControlStyle to be Ribbon and set the AlwaysActive property to False then we get the following appearance instead…

As with the other input controls you can add ButtonSpec definitions so that extra buttons are added inside the border…

 

The button specs could be really handy for setting common values. You could have a button that is used to set the date to something appropriate such as ‘today’.  Another might be used clear the current value and a last one that brings up some help page information.

I have added support for adding the KryptonMaskedTextBox inside the KryptonRibbon as well…

I have never been entirely happy with the look of the application button in the KryptonRibbon. The border edges look a little too jagged and the colors are not quite right. Luckily for us a Krypton Toolkit developer created a better version and swapped the code for a free copy of the Krypton Suite.

Here you can see the current button…

And now the new version…

I’m sure you will agree it looks much better. It might seen a trivial issue but given how prominent the application button is in a ribbon based app I think it improves the whole feel of the application.

The last TODO item for the KryptonRibbon application menu is now completed. Showing the first level sub menus as a fixed size equal to the recent documents area…

Now I need to update all the samples and documentation to reflect the new ribbon features in the upcoming release.

One of the most useful innovations with the Ribbon app menu is positioning the recent documents list separately to the main menu items. It makes it must easier to find that document you were editing yesterday. You can now specify a collection of recent document entries for the KryptonRibbon by using the new RibbonAppButton -> AppButtonRecentDocs property…

Note that if you leave the list empty it does not show the recent documents column, so if this feature is not relevant to your application you can avoid having it displayed by just leaving that collection empty. You can also alter the Recent Documents title that appears at the top of the column. This allows you to repurpose the column, for example you could change the text to Recent Users and then provide a list of recent usernames for selection.

Also notice the provision of buttons at the bottom of the app menu. These are just ButtonSpec definitions specified using the new RibbonAppButton -> AppButtonSpecs property.

In case you missed it I will point out that the bottom half of the app button is now draw as part of the app menu so that it appears to be underneath the app button.

But there is still one last feature to implement. When you select a context menu that has a sub menu you currently get the following display…

This is incorrect as the sub menu should be forced to the same size and position as the recent documents column. You might not have noticed this when using the Office 2007 applications, give it a go now and notice how all the first level sub menus appear as an area that completely covers the recent documents area.

The most requested feature for the KryptonRibbon is an application menu that mimics Office 2007. The existing use of a standard ContextMenuStrip is functional but inadequate. It just looks wrong. I started work on the Krypton implementation of this feature last week. You can see below what I have implemented so far…

A new property called AppButtonMenuItems allows you to specify the set of items in the menu portion of the window. Anything that can be placed into a KryptonContextMenu can also go here, so you can have headers, separators, menu items and any other types added in the future.

Another new property AppButtonSpecs allows you to specify a set of ButtonSpec definitions. These are displayed on the bottom line of the window and can be seen above as Options and Exit buttons. These allow all the options of Toolkit ButtonSpec definitions, so you can specify an image, text and extra text values.

There are ribbon level events for the Opening, Opened, Closing and Closed actions on the application menu. These operate in the same way as the events on a KryptonContextMenu. They allow you to cancel the showing of the menu and also customize and update item state before the menu is shown.

TODO

1, I need to get the bottom half of the application button drawing in the popup window so it looks as if the window is placed underneath the application button.

2, Allow the definition of a ‘Recently Documents’ list of items. These items would be shown as a vertical list to the right of the menu items and mimic the ‘Recent Documents’ list of Office 2007. This feature would be optional so that applications that do not need this ability can provide no entries and so the list would not be shown.

3, Implement correct keyboard operation. At the moment only the menu items respond to the TAB and navigation keys. I need to get the button specs and the ‘Recent Document’ entries integrated into the keyboard actions.

4, Any other developer requests that seem reasonable!