DataControllerWidget

The data controller widget is created by reflecting over the given data type. You can use ControlledBy as a UDA on a struct or just let it create things automatically.

Unlike dialog, this uses real-time updating of the data and you add it to another window yourself.

struct Test {
	int x;
	int y;
}

auto window = new Window();
auto dcw = new DataControllerWidget!Test(new Test, window);

The way it works is any public members are given a widget based on their data type, and public methods trigger an action button if no relevant parameters or a dialog action if it does have parameters, similar to the menu facility.

If you change data programmatically, without going through the DataControllerWidget methods, you will have to tell it something has changed and it needs to redraw. This is done with the invalidate method.

class DataControllerWidget : WidgetContainer (
T
) {
Tref datum;
}

Constructors

this
this(Tref datum, Widget parent)

Members

Functions

notifyDataUpdated
void notifyDataUpdated()

If you modify the data in the structure directly, you need to call this to update the UI and propagate any change messages.

See Also

Meta

History

Added Oct 28, 2020