You know the famous saying, ‘The King is dead, long live the King!’. Well my version would be ‘The Renderer is dead, long live the Renderer!’.

In version 1.1 of the toolkit there are properties on each krypton control for specifying the renderer to be used. At the moment there is only a single renderer and so I doubt anyone has actually needed to use the properties.

You could create your own renderer by implementing the IRenderer interface or a new component or extend the existing renderer by deriving from the RenderStandard class. As not a single developer has contacted me about creating a custom renderer I assume that either no one has needed to do so, the most likely reason, or the process is so simple they just have not needed any help.

As well as having per-control properties there are global properties exposed on the KryptonManager so that you can alter the rendering of all krypton controls in one go. This mirrors exactly the same mechanism used to specify per-control and global palettes.

Although it seemed a go idea at the time I no longer believe this is the best approach. In reality the renderer is going to be closely associated with a palette. The professional palette will want to use the professional renderer, the Office2007 palette will want the Office2007 renderer.

Note: There is currently no Office2007 palette or renderer but I have plans of creating these additions in the future. I expect to add the Office2007 look and feel in version 1.4 of krypton.

So the RenderMode and Renderer properties have been removed from the individual krypton control and the GlobalRenderer and GlobalRenderMode have been removed from the KryptonManager. Now the actual palette instance provides the renderer that should be used for drawing.

This is much more logical because as you select a different palette you will automatically also switch to using the appropriate renderer for that palette.

If you create your own custom palette by using the KryptonPalette component then you have the chance to use the new properties that it exposes. These allow you to define the renderer you want used for the custom palette.

Althought it sounds like a lot of changes, in reality it should not impact your existing krypton based applications, a simple recompile is all that is required.

Leave a Reply