Here is a quick preview of a chemical drawing app written entirely in C#, with WPF rendering all the graphics - both the UI and the molecule. Still a bit of work required, but any of your thoughts would be welcome.
Enjoy...
[Full picture is on Flickr :
http://www.flickr.com/photos/35569810@N00/167260515/ ]
Forum Read Only
This forum has been made read only by the site admins. No new threads or comments can be added.
-
-
Did you have to build the Office 2007 look yourself?
-
Neato, O-Chem is fun enough. How rigidly do you check for proper structure and the like?
-
jonorossi: Yes, the Office 2007 style UI is written by me. It's nearly all done with WPF styling which means that means that the application code only neads to write something like,
<rib:RibbonWindow.RibbonTabs>
</rib:RibbonTab>
<rib:RibbonTab Header="Home">
<rib:RibbonGroup Header="Clipboard">
<Button Command="ApplicationCommands.Paste" rib:Ribbon.Icon="{StaticResource PasteIcon}" rib:Ribbon.Size="Large"/>
<Button Command="ApplicationCommands.Cut" rib:Ribbon.Icon="{StaticResource CutIcon}" rib:Ribbon.ShowLabel="False"/>
<Button Command="ApplicationCommands.Copy" rib:Ribbon.Icon="{StaticResource CopyIcon}" rib:Ribbon.ShowLabel="False"/>
<Button Command="ApplicationCommands.Delete" rib:Ribbon.Icon="{StaticResource DeleteIcon}" rib:Ribbon.ShowLabel="False"/>
</rib:RibbonGroup>
</rib:RibbonWindow.RibbonTabs>
From this the styling and layout are all done for you. The layout code is about the only real bit that required writing C# (the rest is XAML). In the future I'm looking to implement automatic resizing to screen size as in Office too. A second point of interest, the colour scheme is defined in a separate resource that can be switched at runtime, just like Office. -
DoomBringer: It depends what you mean by "proper structure". The application renders the molecule based upon a Molecule datastructure that has Atoms and Bonds, etc. Hence, the molecule will be correct in the sense that it will consist of bonds (these can be single, double, bold, wedged, etc.) joining up between atoms.
Alternatively there is what I like to think of as "chemical intelligence". For example, carbon atoms can only have four bonds - a "chemically inteligent" application would notice if you try to draw a fifth bond from a carbon atom and respond in some way. Although a set of rules like this are relatively easy to write with the data structures I have, I've not implemented it yet. In the future I forsee this available in the chemical framework itself (so addins can programatically determine possible errors, and maybe plugin their own). For the chemical drawing app itself, in some cases the user may want to draw an "incorrect" molecule, so you have to allow for this. Commonly therefore such errors are indicated to the user overlaying the structure similar to the red squiggly lines under spelling mistakes in Word. -
So you wrote the styling by hand in XAML?
-
Moshe: Yes. All the styling is hand-written XAML. I avoided using Expression Interactive Designer as I wanted to understand the XAML behind the designer (also I think that editing styles in Expression can only be done in source view anyway? Anyone else know different?). Everything is attached as resources in the relevant parent control (so that Buttons in the ribbon are styled as ribbon buttons, whilst anywhere else in the app they appear as normal).
-
is this available for download?
-
rstat1: Sorry, but the app isn't currently available. It needs a lot more work before it is stable enough even for a beta release. Hopefully at some point I will be able to get a beta out there though.
-
the topic is solved
-
Just FYI, for anyone looking for an Office 2007-like Ribbon control suite for WPF, we released ours to the public yesterday:
http://www.actiprosoftware.com/Products/DotNet/WPF/Ribbon/
It conforms to all the core Microsoft ribbon UI requirements, uses XAML and the WPF command model, and is XBAP compatible.