|
|
UI: Become windowless
A windowless user-interface doesn't make use of the native Win32 controls. Instead it custom paints every control and widget on the screen - including labels, buttons, list control, etc. etc. Variations of this kind of interface is not new: "Skinning" has been widely accepted for its cool application-look, as seen in Nullsoft's WinAmp and the MS Media Player. But skinning is usually only feasible for small applications hosting a limited number of dialogs. If you're building a large database-driven application, you'll want to have a solid framework to back your dialog design up. So I was looking at the Microsoft CRM application. In my opinion, this is one of the most successful DHTML interfaces I've seen (I should know because I've previously been assigned on a large browser-based CRM product). The MS CRM interface looks very Windows XP-like, but it also has several cool features, such as a navigation bar, a highly flexible list control and several shaded/gradient tool panels. I thought this would be a nice look to build for my windowless framework. I've previously tested a DHTML interface with this look, but wasn't satisfied - mostly because integrating with the browser (IE) was painfully complicated.
The designMy Direct UI user-interface takes bits and pieces from other UI models. Specifically it borrows ideas of the "controls-inside-controls" design from the Java AWT framework, XML dialog-resources from .NET, event-bubbling from DHTML and C++ helper classes from MFC.
The code doesn't actually use the WTL library like most of my other user
interface samples on this website.
It's pure Win32 calls.
Using a Java-like design, such as the layout containers, make sure that your controls will rescale automatically when
the window is resized. But anyone who has done any Java development knows how limiting its control layout features
are and has wished to kick the authors of the
GridBagLayout
class in the nuts. So there's also room for a dialog layout-panel, which allows you to put controls at a fixed position,
but with the option of scaling based on various stretching rules.
Alluring textThe real benefits of this type of interface are the simple things. For instance, you can with one single swoop replace all occurences of Win32DrawText() with DrawPrettyHtmlFormattedText() - which
instantly gives you icons, customizable text-colors and clickable hyperlinks in the entire user-interface. With one single
line of code, you can now add HTML links in the statusbar panel.
Similar, you are not restricted to only put CToolButton controls inside the ToolBar. Any kind of control
can be added. This also goes for the list control, which quickly can be made cool by adding some group-labels, or just
by adding buttons or HTML links. Since the individual controls rarely erase the background, most of them will actually fit
transparently inside the other container controls, so once you've made a neat widget it can be reused in the
entire user interface.
3D AnimationsAnother cool effect that can be easily added is the ability to do 3D rendering directly on the canvas. Just throw in some DirectX calls and you'll be able to write cool page transitions, highlight a control with some cool sparkling particle-effect or just put some glow effect on the edit-box with focus.You can also read about how I integrated DirectX into the application. The sampleThis may all sound very nice. However, the sample presented here is just the initial stage of a windowless framework I'll use for further testing. The library will need to mature a bit and go through a few rewrite cycles before I'll attempt to actually incorporate it in a real application. Still, it's pretty functional already. Enjoy.The sample should be run with DirectX 9 installed and a modern 3D graphics card. Otherwise you will not be able to view the pretty 3D animations. Source Code DependenciesMicrosoft Visual C++ 6.0Microsoft DirectX 9 SDK Download Files
Article submitted 6/26/2005. To the top
|
|||