gui2.rootwidget - ICE 0.1 API documentation

ICE 0.1 API documentation

# gui2.rootwidget

Root widget of a widget tree loadable from YAML.

struct WidgetAccess;

  Uses opDispatch to build widget name strings to access widgets in a RootWidget.

  template opDispatch(string childName) if (validWidgetName(childName))

    Access a subwidget.

    If a type is specified by the user, this is the last subwidget and we return that subwidget. In this case a Flag!"optional" can be use to specify that the subwidget is not required, and null might be returned instead of throwing an exception. If not optional, and the subwidget does not exist, WidgetNotFoundException is thrown. If the widget is of a different type than specified, WidgetTypeException is thrown.
    If a type is not specified we return a WidgetAccess for the subwidget, allowing to access its subwidgets.

class RootWidget: gui2.widget.Widget;

  Root widget of a widget tree loadable from YAML.

  Root widget is not the top of a widget hierarchy; it is the root of a group of widget loaded from YAML, and can be connected to a SlotWidget (such as the rootSlot widget in GUISystem). Widget tree under a RootWidget can also contain more SlotWidgets where other RootWidgets can be connected.
  A RootWidget is used to access all widgets in its tree; other widgets can't do this. opDispatch is used to do this so widget names used in YAML can be used directly in code.
  For example, if a widget tree contains a button widget called "bar" that has no named parent widget, it can be accessed as rootWidget.bar!ButtonWidget (where rootWidget is the RootWidget). If "bar" has a named parent "foo", change that to rootWidget.foo.bar!ButtonWidget .

  this(ref Node yaml);

    Load a RootWidget from YAML.

    Never call this directly; use GUISystem.loadWidgetTree instead.

  template opDispatch(string childName) if (validWidgetName(childName))

    Access a subwidget.

    This is copied from WidgetAccess as alias this doesn't work.
    The "optional" flag can be used as a template parameter to return null instead of throwing if the widget is not found.

    Throws:
    WidgetNotFoundException if the widget could not be found and optional is false (default). WidgetTypeException if the widget is not of type T.

    SeeAlso:
    WidgetAccess.opDispatch, RootWidget.get

  T get(T, Flag!("optional") optional = No.optional)(const string fullName);

    Get a subwidget with specified name.

    The "optional" flag can be used as a template parameter to return null instead of throwing if the widget is not found.

    Throws:
    WidgetNotFoundException if the widget could not be found and optional is false (default). WidgetTypeException if the widget is not of type T.
  package void mouseLeftTree();

    Force the widgets in the tree to react as if the mouse disappeared.

    Called when disconnected from a SlotWidget.

  package void checkMouseEnteredTree();

    Force the widgets in the tree to react as if the mouse just appeared.

    Called when connected to a SlotWidget.

Copyright © Ferdinand Majerech 2011. | Page generated by AutoDDoc and Ddoc.