Page 1 of 7

wxIFM 1.0.5 - docking library for wxWidgets

Posted: Wed Dec 15, 2004 8:45 am
by SnakeChomp
If you are looking for information about 1.0.5, please jump to this post:

If you are not looking for informationa bout 1.0.5, you can find a history of wxIFM anouncements within this thread.

Hello all. I am making this post to basically raise awareness in regards to the project I am working on. I call it...


wxIFM? What the heck is that?
wxIFM is what I call an "Interface Management System", or IFM for short. Its basically a docking library. Think wxFL, only bigger (and better)

wxIFM is really comprised of two elements: an interface management framework, and an implementation which programs can use. The framework is a set of events and base classes used for plugins whih implement the interface functionality.

General overview of wxIFM
At its core, wxIFM revolves around the framework it defines. This framework is based around a plugin architecture in which functionality is implemented in event handlers. The framework defines many events which are used to actually implement functionality within an interface. Being a plugin based system allows for layers of functionality without having to override virtual functions or derive countless classes. It also allows two different plugins which implement two different things to be used in the same application without changing any code within either plugin, or the wxIFM library. It also provides for run time connecting and disconnecting of plugins to switch features on and off. It would be nice to eventually see plugin from DLL support, but I hear c++ dll's are a pain to deal with. DLLs are the goal however.

wxIFM strives to be easy to use and relatively transparent to the application programmer. Similar to wxFL, all the program needs to do is create a wxInterfaceManager object (congruent to wxFrameLayout), optionally tell it what (extra) plugins you wish to use, and tell it what children it should manage. The rest is taken care of by the wxInterfaceManager object and the interface plugins.

One word, why?
Short version: wxFL sucks, so I'm replacing it.
Longer version: I wanted a cool interface for my html editor that supported docking and all that fun stuff you see in many modern IDE's, but I was unhappy with wxFL. The code was a mess, it was slightly glitchy, and hadn't been worked on in a while. I wanted something better, and I wanted something that I made myself (of course :)). So I began work on this system. Almost three months later, and after having started over twice, I am ready to present a pre-release for the community to see what I have been doing.

The current state of wxIFM
While I may be posting to anounce the fact that wxIFM exists, I am not posting the fact that wxIFM is ready to replace wxFL. In fact, it is not. Currently, resizing and moving of children after they have been added to an interface is not implemented. You can hide and show them however.

This does not mean that I am having trouble implementing this, or that I won't be. I just haven't started work on it yet. I fully expect that at least resizing will be ready within a week. The main purpose of this announcement is to simply let people know that this exists, and give them a chance to view the API.

For those of you who are curious, below are links to the current code of wxIFM, including a demo application, and a screenshot of said demo application. Note that I do not have makefiles, because I am a win32 person, and have never used makefiles. If anybody would be so kind as to make some, please contact me. The MSVC6 project is included for both wxIFM and the demo app.

Some random notes
wxIFM is currently built against the 2.5.3 snapshot.

Compilation under any port other than win32 is untested. If you can't compile it on a particular port, please let me know, or better yet try to fix it. :)

The current interface implementation will eventually be an almost complete clone of the interface of Microsoft Visual C++ 8 beta.

The code provided in the zip file is to be considered beta. Future releases of the wxIFM system may not remain backwards compatible with this code. Use it in real applications at your own risk. ;) Although I highly doubt I would change anything so drastically as to create a serious incompatability, I will be adding on as I develop wxIFM and some things may be tweaked in the process.

Most of the code is documented with doxygen docs, check the header files.

While doxygen comments exist, documentation does not (yet). The library will be documented in its entirity before release.

Check changes.txt and todo.txt if you care about how things have progressed.

Feel free to find any bugs in the frame work and let me know. I try to think of as much as I can, but I can't think of everything. Also please feel free to comment on the current implementation. If something works one way but you think it should work another, tell me!

Compiling notes
Building the wxIFM project will generate wxmsw25d_ifm.lib and wxmsw25_ifm.lib in debug and release modes within "lib/vc_lib/" if compiling using the provided MSVC6 project.

There are two MSVC specific #pragma's contained within ifm.h. You might want to comment them out if not compiling in MSVC. ;) (I tried a quick #ifdef __VISUALC__ but it didn't seem to work so I am not changing the zip file)

[some edits to fix grammar]
[edit to remove old downlink link]

Posted: Wed Dec 15, 2004 9:56 am
by Jorg
Hi SnakeChomp,

This looks truly amazing and can be very handy! I have one question. Could you post a snippet example of code of what is needed to create e.g. a simple frame with dockable windows on both sides? Looking at what's behind the picture can be just as appealing as the picture itself, because it shows the developers how elegant it can be done... :-)

Thanks for your effort!
- Jorgen

Posted: Wed Dec 15, 2004 6:51 pm
by SnakeChomp
Included within is a sample application which shows exactly how one would create a frame that supports docking and how to add children to dock to it. Currently you cannot specify what "sides" of the application you wish to allow windows to dock into, although I can add this feature to my todo list, as it seems rather useful. However, I can also post a little piece of code as well:

Code: Select all

    // ...

    // create the interface management object
    // we would also tell the interface object what our "content" window is here
    // but this simple demo app has no content window, so the second argument
    // is ommited
    m_ifm = new wxInterfaceManager(this);
    m_ifm->Initialize(); // adds default plugins to the object

    // create the data object used to "create" dockable children
    wxIFMDefaultChildData *data = new wxIFMDefaultChildData;

    // add a text box docked on the right of the frame
    data->m_child = new wxTextCtrl(this, -1, "text R");
    data->m_type = IFM_CHILDTYPE_GENERIC; // this is just a regular child window
    data->m_orientation = IFM_ORIENTATION_RIGHT; // right side of the frame
    data->m_size.Set(100,100); // we want this child to have a size of (100,100)

    // tell the interface object to manage this child for us

    // add a text box docked on the left of the frame
    data->m_child = new wxTextCtrl(this, -1, "text L");
    data->m_type = IFM_CHILDTYPE_GENERIC; // this is just a regular child window
    data->m_orientation = IFM_ORIENTATION_LEFT; // left side of the frame
    data->m_size.Set(100,100); // we want this child to have a size of (100,100)

    // tell the interface object to manage this child for us

    delete data;

    // ...

    // ...

    // clean up the interface managment object

    // it is now safe to delete it
    delete m_ifm;

    // ...
No other code is necessary. These textboxes can now be docked by the user onto different sides of the frame, resized, or floated (well, once wxIFM is finished that is. :)) The textboxes will be stretched to fill the height of the client area of the frame and will be 100 pixels wide. Note that if you want, you can manually tell the interface object how large of an area it has to place children into instead of letting it use the entire client area.

Posted: Wed Dec 15, 2004 6:55 pm
by Jorg
This looks pretty slick and very compact. That is a must for other developers to make it usable. Lots of code is simply a no-go because it will always be complex ;-)

Good work! I will play with it soon when I have some free time on my hands...

- Jorgen

Posted: Wed Dec 15, 2004 7:03 pm
by SnakeChomp
Jorg wrote:Lots of code is simply a no-go because it will always be complex ;-)
Heh, well, theres alot of code in the library source files if you actually look, and I won't try to say its not a complex system. Just because the source has lots of code doesn't mean that code is obfuscated or hard to understand though. I made lots of fairly obvious comments throughout the source so that random people looking at it can have some idea of whats going on. But as far as someone just using the library and the default implementation it provides, the code necessary to enable the system is relatively minimal.

Posted: Wed Dec 15, 2004 8:16 pm
by Jorg
Hehe well I meant the code that the developers have to write to get it going ... once it is too complex, people are hesitant to use it. Your example looks retty straight forward that is always important to get the 'masses' to accept it.

- Jorgen

Posted: Fri Jan 14, 2005 4:06 pm
by arucard
Hello SnakeChomp, when I have read your first post 1 month ago, I was very pleased, because I definitely need some kind of interface manager which make me possible showing, resizing and docking windows by the way that modern applications (such as MS Visual C++ 8 beta) do. But after a month I still have only these sources which are linked from this page and nothing more. On your website isn't any allusion to wxIFM. What is the current state of wxIFM? Did you make any additional progress?

(I apologize for my terrible english, it isn't my native language)

Posted: Sat Jan 15, 2005 5:07 pm
by gunnar
I also would like to know, when this wxIFM stuff will be ready.

Posted: Sat Jan 15, 2005 11:30 pm
by SnakeChomp
I must apologize. I seem to say every other day that my website will get updated with stuff but it hasn't happened. yet.

Just to clarify, when I say "plugin", I simply mean a class (indirectly) derived from wxEvtHandler that implements something. wxIFM has a default implementation of MSVC++8 Beta1's interface, done via these plugins, but those plugins are really just classes contained within wxIFM source. They aren't external dll's or anything, they are compiled into the (static for now) library along with the rest of wxIFM.

wxIFM - Project Status

Work is still proceeding at a more or less steady pace. The framework has matured a little more since my original post, and many of the things I am claiming to achieve are now possible, including a few newly realized ones. As it stands, the resizing part I was talking about is 80% done. Its been alot more than a week, I know. Sorry. :) You can often hear me blather on about wxIFM in the #wxwidgets irc channel at

New and cool stuff

Dynamic libraries
The coolest thing (I believe) that has come about within the last month is the realization that plugins can be loaded at run time from shared dll's. Before wxIFM is released, this functionality will be realized, but as of right now it is merely on the todo list. The short version of how this can work, is that all wxIFM shared libraries will have a common "init" function with C linkage. That means: extern "C" init() { ... }. The extern "C" bit compiles the function with C style linkage avoiding name mangling and allowing it to be used in shared libraries loaded at run time. Entire interfaces will be able to be loaded at run time in this fashion. I admit it will be one of the later things that comes about. I am the only person working on this after all.

Restructered plugin hierarchy
There are now "Interface" and "Extension" plugins. In short, "Interface" plugins implement a specific interface, such as MSVC++8 Beta, or Adobe Photoshops. "Extension" plugins are plugged into "interface" plugins to extend them by changing how they operate or possibly adding new features. "Extension" plugins can be written to only function with a given "interface" plugin.

One of the things this allows me to do is allow plugins to "plug in" their own configuration panels into preferences dialogs. This allows the user to configure any options an interface plugin or extension plugin may have without the application programmer adding any additional code (aside from the basic code required to support this feature).

Then, Now, and the Future
I currently plan to stop working on resizing for the moment as I've spent far too long on it and wish to move onto more important things, like...

Now - Drag and Drop Docking
I will be working on this feature next. I don't anticipate any large problems, as many problems I would have encountered were solved when implementing resizing. Once I am done with this, I will post an updated snapshot of the source code for anybody interested.

The Future
I have many goals still in mind, and I'll ramble on about a few here:
-"Tabbed" docking like MSVC++8 Beta1
-"Tearable tabs", again like MSVC++8 Beta1
-Automatic saving and loading of interface states, as well as manual saving and loading to allow the user to create more than one state and switch between them quickly.
-Automatic management of a "Window" menu (or submenu) to allow interface and extension plugins to add commands to the menu bar.
-And of course, loading plugins from shared libraries.

The screenshot linked in the first post has been updated.

You can usually find me on #wxwidgets @ if you would like more up to the minute information.

wxIFM Beta 1 Released

Posted: Fri Jan 21, 2005 8:35 pm
by SnakeChomp
I am proud to announce the immediate availablility of wxIFM (Version 0.5.0) as the first public beta of the library.

Whats new
The VC2k5 docking format has been fully replicated and implemented. However, tabulated docking and much of the floating functionality is not yet implemented.

Notes for this release
-wxIFM is currently distributed under the wxWindow license (for now).
-wxIFM is built against the 2.5.3 dev snapshot
-No make files are provided with this release, only MSVC++6 project files. I may create make files and update the release to include them later, but I would also accept contributed make files.
-wxIFM will not compile if your compiler does not support dynamic_cast, std::vector, std::list, or std::map
-There is a known crash issue caused by attempting to drag and drop a component ontop of the drop target buttons displayed when hovering over itself.
-Documentation is included with this release. Note that it is rather barebones documentation. There are no topic overviews yet, and no explanations on how to properly write plugins for the library. The best resource for this is to look at the source as it is (usually) well commented. Also note that the documentation doesn't include a section on how to use the library either. :wink: Please consult the sample program for that information.

Other important stuff
Please be aware that all text files in this release use dos line terminators. If you're editor can't cope with that, convert them to unix or mac line terminators first.

Officially supported ports

Ports it "should" work on

Reporting bugs, feature requests, and other inquieries
Please look for me on #wxwidgets @ If I am not there, you can email me at snakeb[at]optonline[dot]net.

You can download this distro here:
You can also find an online copy of the documentation here:
My website for wxIFM is here:

Posted: Fri Jan 21, 2005 10:39 pm
by eco
Very cool stuff. I had to add some paths to the project files after they were converted to VC7 Here is a solution and project files to build it with Visual C++ .NET 2003 (straight workspace file conversion didn't work for some reason).

There are some redraw bugs and I managed to get it to crash in Release build but it's a nice beginnings of a very cool docking system.

Posted: Fri Jan 21, 2005 11:27 pm
by SnakeChomp
Unix make files submitted by AkiraDev_ (from irc) can be found here: [download removed as the file is no longer provided]. They contain a readme file with usage instructions.

[Edit: removed download link]

wxIFM Beta 2 Released

Posted: Tue Feb 15, 2005 9:58 pm
by SnakeChomp
I am writing to announce the availability of the second beta release of the wxIFM library

Whats New
  • Floating is now fully (and by that I mean 95%) implemented. This means docking into and out of existing floating windows is now supported.
  • Resizing has also seen some work, and while not finished, works more correctly than it did before. It also works within floaing windows.
  • Unicode builds are now supported
  • I have also updated the documentation with some overviews about the wxIFM library.
Much more detailed information can be found within the changelog.

Notes for this release
  • Released under the wxWindows lisence (for now)
  • The use of dynamic_cast is enabled by default over the wx RTTI system. If you cannot use dynamic_cast, change IFM_USE_WX_RTTI to 1 inside ifmdefs.h
  • wxIFM currently only builds against wx 2.5.3. If you dont have it already, shame on you.
  • All files contain windows line terminators again
Officially supported ports
  • wxMSW
  • wxGTK
The wxMAC port is somewhat supported, although the only test of wxIFM on wxMAC revealed that most of drag'n'drop docking was non functional and that some things did not paint properly. If you use wxIFM on a mac, let me know whats wrong on irc://

Whats coming next
The next release of wxIFM will be the first official release intended for use in real applications. Not that there is anything stopping you from using it in an application right now. :wink: Please be warned that the lisence that wil be used by the next release of wxIFM has not yet been decided. If you are developing a commercial app, be aware that I may chose to charge a lisencing fee for the use of this library.

The link to download beta 2, including *nix makefiles, MSVC6 project files, and updated documentation in .html and .chm format is here:

Posted: Sun Feb 27, 2005 1:38 am
by SnakeChomp
Just a little update on the general state of things

Whats new with wxIFM
Lots of wxIFM was internally refactored, see below.
I recently added captions to panels, got rid of flickering, and implemented real time drag'n'drop feedback instead of the iffy XOR hint rectangle drawing.

Its official...
wxIFM will officially be contributed somewhere into the wx source tree at a presumably soon date. If it takes too long, I may make the first official release a standalone distro. If the contribbing happens soon, you will be able to get the latest copy of wxIFM via CVS, and the first official release will "officially happen" with the next release of wx, either 2.5.5, or 2.6

Current screenshots (alternate version of wxifm_1 with different graphics) (added close / min / max buttons to the captions)

Also, if anybody is interested, a UML class diagram for wxIFM can be found here:
Before refactor: (not all classes shown)
Midway: (not al shown again)
After: (this has everything)

Posted: Sun Feb 27, 2005 8:23 am
by Ryan Norton
Does this support dockable menus in the default distribution?