Monday, February 19th, 2007
There have been four bugs reported for the KryptonForm custom chrome feature since the last release. Investigating them has led to mixed results.
Classic Mode Appearance
This bug is only apparent when using Windows 2003 Server or when using the classic appearance under XP/Vista. With Windows 2003 Server not having anything except the classic appearance it effectively means the bug is in the drawing in classic mode. The issue is that sometimes when moving the mouse over the window border you get the following min/max/close drawing artifact.

After much investigation I found a way to prevent this artifact from ever appearing. But there is a nasty side effect from the fix that prevents correct drawing when not using form level custom chrome. So this partial solution would only be usable if the custom chrome painting is always turned on. I cannot guarantee this because although the majority of developers will be sticking to the Office 2007 palettes all the time, some may not.
Therefore I have decided to remove the ability to have custom chrome when in the classic mode, thus preventing the artifact drawing problem. I can understand this will annoy some users of the library because they want the custom chrome in classic mode ability but I cannot release code that I know is not drawing correctly.
I have not given up on trying to fix it, I will be trying to contact Microsoft support to get some additional help on this but I wouldn’t hold your breath for a speedy resolution.
TextBox in MDI Child
This is serious problem where an MDI child form has a TextBox. Both the child and parent are using custom chrome painting and at runtime the TextBox becomes unusable. Given the prevalent use of the TextBox control this bug is going to kill the majority of MDI applications. This bug was fixed as a side effect of the using the above partial solution to the min/max/close problem. This is another reason to go with using the partial solution, it fixes this high priority issue.
Opacity
I guess not many people are using the Opacity property on a custom chrome drawing form but a couple must be because they reported this problem. When the property is less than 100% it would not draw the entire border in the expected semi-transparent manner. A minor change to the painting code fixed up this one.
RightToLeftLayout
When defining this property for the form the custom chrome does not paint correctly. It almost gets it right but the right hand edge of the form is not painted at all and other parts just look wrong. I spent quite some time trying to figure out what is wrong with the painting code that prevents the correct drawing. So far I have had no luck at all in resolving it and this is a shame because I want to fully support right to left systems. This is another issue I will be trying to get Microsoft to help resolve.
Conclusion
So the score card is mixed. Two bugs completely fixed, one bug resolved by removing the feature that makes the bug apparent and one bug not resolved at all.
If anyone has example code of a top level window that correctly paints RightToLeftLayout then I would love to debug through it. Maybe seeing a form that does work will offer enough clues to resolve this problem. I tried looking on codeproject.com but could not find anything useful.
Posted in Krypton Toolkit | 1 Comment »
Saturday, February 17th, 2007
Group buttons can now be displayed in a vertical stack.
You might have noticed in previous posts that the group button is shown in groups of three. This is not an accident. In order to show buttons inside a group you must first create a container. At the moment I have added just a single type of container called the GroupTriple. As the name suggests this is capable of having three child items. We only have a single type of child item which is the GroupButton.
The GroupTriple is capable of instructing its children to size and draw in either Large, Medium or Small. Here is a picture of some triple containers that each have button items and where all the triples are defined to show using Large.

I have now updated the button object so it can draw as a Medium size which means that instead of taking up the whole height of the group it becomes 1/3 of the height. The triple container in the Medium mode will stack these items.

Finally I added the Small size for the button which is the same as the previous Medium size but does not show any of the text.

You are not limited to having exactly three items in the triple container. You might have just one or two items. Also you can begin to see how the automatic shrinking of groups is going to work. Once the user resizes the form and there is not enough space to show everything the ribbon will be able to ask a triple container to shift from Large to Medium in order to use up less space. Before getting to this chunk of functionality I need to add some more types of container and group items.
Posted in Krypton Ribbon | No Comments »
Friday, February 16th, 2007
Our button has now been taken to a whole new level.
You can alter the bahavior of the button by using the ButtonType property. A simple push button, which we had yesterday, is the default type. Our first addition is the Check enumeration value that toggles the Checked property each time you click the button.
Here you have the starting state of our ribbon. The first three buttons are defined as Check type buttons.

Once you have pressed the second button it shows as checked.

Our second new type is DropDown and is intended to be used in combination with the ContextMenuStrip property. To indicate the button is going to show a popup it draws the drop arrow on the second line of button text. When pressed it will show the defined context strip as you can see here.

Actually this button type generates an event DropDown before showing the context menu in order to allow the developer a chance to create a context strip and/or update the contents of the strip ready for showing.
Posted in Krypton Ribbon | No Comments »
Thursday, February 15th, 2007
I’ve added a simple button as the next group content. It only does the very minimum possible at the moment, but it will grow.
You can define the ImageLarge, TextLine1 and TextLine2 properties to setup the three visual elements of the button. You can see some examples here.

It also has Enabled and Visible properties as you may want the enabled and visible state to depend on the state of your application. Here is an example with the first button disabled and the mouse pressing down the selected button.

And for those that prefer the black scheme…

Posted in Krypton Ribbon | No Comments »
Tuesday, February 13th, 2007
The first group content has been added and in the tradition of Vista marketing, get ready to go WOW
Yes the first content, and at the moment the only content, you can add to the ribbon group is a group separator. Here it is in all its glory.

In an effort to make this look even more interesting, here are the two other color schemes as well.


Posted in Krypton Ribbon | No Comments »