wxIFM

From WxWiki
Jump to navigation Jump to search

wxIFM is a docking library. The name is an abbreviation of "Interface Management System".

Features

  • Sophistocated docking: wxIFM provides HUD docking and tearable tabs out-of-the-box.
  • Simple: The code required to use wxIFM is simple.
  • Extensible: Look and feel is implemented through plugins, and thus possible to change.

Sophistocated docking

wxIFM clones the interface facilities of MS Visual Studio 2005 (Widbey). It provides sophistocated docking facilities not restricting itself to to the typical "Theres a top, left, right, and bottom container and there are some windows inside of them" methodology. Some of the fancier things provided by the default implementation include:

  • Docking into and out of existing floating windows
  • The ability to dock (or float) entire groups (containers, rows, ...) of windows just as you would a singular window
  • Docking is accomplished by "dropping" a component onto a dock button, meaning you don't have to rely on jumpy XOR hint lines to know where a component will go; you explicitly say "Go here".
  • (Eventually, not implemented at this moment) There is also a preview hint drawn to indicate the exact size and position that the window will occupy should you drop it on that given button.

Simple

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.

Extensible

The fact that wxIFM is a plugin based system means that if you don't like part of the default implementation, you can change it by writing a plugin. Other people can use your plugin without changing their applications. Your plugin could even create brand new functionality on top of what is already provided.

wxIFM is really comprised of two elements:

  • An interface management framework, defined as a set of events and base classes used for plugins which implement the interface functionality.
  • A default implementation of an interface manager, which provide sophistocated docking facilities similar to MS Visual C++ 8 Beta 1 (Widbey).

History

wxIFM was created late 2004 by Robin McNeill aka SnakeChomp. He had at least two reasons for starting wxIFM:

  • He found wxFL code was difficult to modify.
  • He wanted Head-Up-Display Docking in the HTML editor he was coding, similar to the interface facilities of MS Visual C++ 8 Beta 1 (Widbey).

July 2006, wxIFM changed name to IFM and moved to sourceforge. The sourceforge repository contains code for IFM 2.0.

Links

Notes

When executing an application that includes wxIFM you may get several errors at startup of the form: "GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use g_type_init() prior to this function." This is due to two static objects (m_caption_config & m_caption_config) defined in definterface.h. To eliminate the error messages, use a singleton pattern. For example,replace the code

static wxIFMCaptionConfig m_caption_config;
static wxIFMTabConfig m_tab_config;

with:

static wxIFMCaptionConfig& m_caption_config() {
    static wxIFMCaptionConfig s_caption_config;
    return s_caption_config;
}
static wxIFMTabConfig& m_tab_config() {
    static wxIFMTabConfig s_tab_config;
    return s_tab_config;
}

Be sure to changing all references to m_caption_config to m_caption_config() as well as all references to m_tab_config to m_tab_config(). Hope this helps anyone else who is trying to eliminate these error messages.