Extensible User Interface Component

From user's Wiki!
Jump to: navigation, search

This component allows registering new windows for user interface.

It's possible to extend the framework with these window interfaces:

  • RenderWindowBase: Base render window that will be used by the WorkingArea to render DataEntities
  • DataInformationWidgetBase: Show information about a concrete DataEntity implementation
  • RenderWindowConfigBase: Configuration of MultiRenderWindow
  • VisualPropertiesBase: Visual properties for a concrete DataEntity implementation
  • ProcessingWidget: Processing tool
  • SelectionToolWidget: Selection tool

How to extend this component?

All user interface widgets are deriving from the same base class BaseWindow. A plugin can register new window factories to the framework that will allow the framework to create new instances. Together with the factory, there's a set of parameters that allow configuring the appearance of the window, like the size or position in the main layout.

When registering a new window, a type attribute specifies how the framework will use the window:

  • WIDGET_TYPE_COMMAND_PANEL: Standard command panel widget
  • WIDGET_TYPE_PROCESSING_TOOL: Processing tool. Should be derived from class ProcessingWidget.
  • WIDGET_TYPE_SELECTION_TOOL: Selection tool. Should be derived from class SelectionToolWidget.
  • WIDGET_TYPE_READER_HEADER_WINDOW: Window that will show up when a new file is opened. It uses an extension to check if it needs to be opened. You can see the example SignalReaderWidget.
  • WIDGET_TYPE_RENDER_WINDOW: A render window that can be added to a customizable working area. Should be derived from class RenderWindowBase.
  • WIDGET_TYPE_DATA_INFORMATION: Provides information about data objects, like number of points or dimensions. Should be derived from DataInformationWidgetBase.
  • WIDGET_TYPE_VISUAL_PROPS: Allows to change visual properties (rendering properties). Should be derived from VisualPropertiesBase.
  • WIDGET_TYPE_RENDER_WINDOW_CONFIG: Configuration of a render window. Should be derived from RenderWindowConfigBase.
  • WIDGET_TYPE_PREFERENCES: Preferences window that will appear in the preferences menu option. Should be derived from PreferencesPage.


  • All these windows need to derive from class BaseWindow.
  • You can use the appropriate function of the class WindowConfig to set these window types.

Processing widgets

The user can search a processing tool using the name. You can also see the history of last used tools.

Typing a word in the search box, you can find easily the processsing tool you need
The two buttons at the left allow you to see all processing tools by category or see the history of last used filters

Selection widgets

This kind of widgets are used for interacting with rendering windows, like landmark selection or bounding box selection.


BaseWindow can be configured for managing child windows. This feature is used in the following widgets:

  • DataEntityInformation
  • RenderWindowConfig
  • ToolboxWidget
  • VisualProperties

To configure this feature, you need to call the function BaseWindow::SetIsContainerWindow( true ). This will add an observer to the registered factories. With the function SetChildWindowType( ) you can configure the type of windows you want to create as a child.

When new factories are registered/unregistered, the following functions allow creating and destroying child windows and you need to override them in your widget class:

//! Create a child window. To be redefined for container windows
virtual BaseWindow* CreateChild( const std::string &factoryName );

//! Destroy a child window. To be redefined for container windows
virtual void DestroyChild( BaseWindow* win );

UML class diagrams and examples

You can read more details in GmWidgets and see some example code in MITK Plugin or CMGUI Plugin.

Go back to GIMIAS Architecture