Tuesday, September 2, 2008

Hack Week: 1WPF

For Novell Hack week, instead of hacking on exert as I did in the past, I chose to spend some time on a MonoDevelop Gtk designer restructuring project I've been considering: one widget per design file.

The current designer architecture is based on project-level design files, saved in a special hidden directory along with generated source files needed to compile the designs. This design decision builds upon the existing stetic project-based file format. It complicates several common operations, however, some of which have open bug reports.

One problem is the ability to either copy or move widgets between projects. Another, is the ability to add existing widgets to new projects as "external files" so that a single design can be reused by multiple projects. When the design of the widget is saved as a child element of a project-level xml document, all of the above operations are considerably more complicated than if the widget design is contained in a standalone file.

I'm implementing this redesign as a new addin in MonoDevelop, so that I won't have to pay as much attention to feature parity with the existing designer. The hope is that at some point we can just switch the default designer to the new addin, once it reaches maturity. Based on the amount of work remaining, this will clearly be post-2.0.

Thus far, I've ported the existing addin extension code and begun the rework of the stetic WidgetDesigner. Currently supported features include:
  • SolutionPad display bindings and extensions
  • Grouping of related source, design, and codebehind files.
  • A CodeDom based project template to create Application projects in mulitple languages.
  • Project Compilation extensions to generate codebehind files, capable of compiling template projects.
  • CodeDom templates for ActionGroups, Dialogs, Widgets, and Windows.
  • Toolbox provider and loader.
  • WidgetEditor built on existing stetic wrappers and class descriptions, currently view-only.
Here's a screenshot of a template project in C#. The template also compiles already in VB.net.

Once I get the widget editor working, I'll probably go ahead and check in the addin for people to play around with. No current estimates on when that might be other than, "when it's ready."