Didgets Project Didgets is another Open Source project from http:/sourceforge.net/projects/didgets. Figure 12-3 shows the GDI+ application for drawing and modifying shapes using GDI+. [View full size image] Didgets provides much more functionality than System.Drawing.Drawing2D. The project has a fairly sophisticated architecture, with Workspaces, Widgets, Tools, Properties, Connections, and Commands. This allows Didgets to have its own Shapes and Commands in addition to the ones provided by GDI+. For instance, the Primitive Widgets (rectangles, circles, etc.) know how to size and draw themselves, and the Primitive Tools allow rotation and stretching of the Primitive Widgets using a rubber-band style interface. The Properties allows a Widget to change the Lineweight and color, as well as many other properties like background and foreground colors. Didgets also allows for plug-ins so that additional assemblies can create their own custom Shapes and Widgets that can even be added to the toolbar. There are extension examples included with the Didgets distributions for Parallelogram Shapes. These assemblies inherit from a normal Didget's Widget class and extend the properties like Brushstyles and Lineweights. Didgets also uses the [Tool("Parallelogram","base.101","graphics.ToolParallelogram.ico")] custom attribute to mark the class (in this case, the ParallelogramTool class) that contains the code to put up on a toolbar. The custom attribute contains the icon to be displayed on the toolbar, thus creating a very extendable toolbar. By putting these custom assemblies into a specified directory, Didgets creates a very extendable Shape plug-in architecture using System.Reflection and custom attribute tags. |