Floating (dockable?) menus

Started by
4 comments, last by Colin Jeanne 18 years, 9 months ago
I need to re-write my level editor at some point, it's currently in pure Win32API and very ugly! I plan to use MFC but while I've done a lot of work in this area I'm used only to dialog-based applications, wheras a heightmap editor should probably be window-based... One thing I definitely need is floating menus - how are these achieved in MFC? Is this a MDI thing or is it better to have some modal dialogs floating about? Dockable menus are I suppose advantageous but hardly a requirement! Basically I want D3D running in some window, with menus and toolbars etc - it's just getting the main infrastructure set up to get the different windows working so I can re-implement existing functionality!
Advertisement
Floating windows can be implemented using just a dialog or window but dockable windows are a bit difficult. Win32 does not have them natively. Catch-22 has two tutorials on creating dockable windows in Win32. They are here and here. MFC, however, has them natively. Their functionality is implemented in CControlBar.
When I implemented a flaoting toolbar dialog in Win32, I had problems in that whenever you used it, the focus was lost from the main application window, meaning you had to get it back somehow which seemed un-professional! Is there a standard way round this other than me just hacking in some SetFocus() calls?

As for MDI, what is an example of a standard program which uses this? I don't know if I need it or not...
Photoshop uses MDI. Office 97 uses MDI (later versions do not). AOL and Opera use MDI (unless Opera has changed its interface since I last used it).

As for the focus problems, were you using WS_EX_TOOLWINDOW to create your floating windows? The tutorial in the link I gave you before does and his tutorials generally give programs that look and act professionally.
Ah, probably not. I'm definitely going to use MFC when I redo the application; you'd recommend using CControlBar instead of basing by own classes on CDialog then I presume?

Thanks for the advice by the way.
I would since CControlBar already has the docking functions built in.

You're welcome

This topic is closed to new replies.

Advertisement