A small extension module to arsd.minigui that adds functions for creating widgets and windows from short XML descriptions.

If you choose to use this, it will require arsd.dom to be compiled into your project too.

import arsd.minigui_xml;
Window window = createWindowFromXml(`
		<Button label="Hi!" />

Public Imports

public import arsd.minigui;
Undocumented in source.



Event (from arsd.minigui)
class Event via public import arsd.minigui : Event;

Represents an event that is currently being processed.


Window createWindowFromXml(string xml)
Window createWindowFromXml(Document document)
Widget makeWidgetFromString(string xml, Widget parent)
Widget miniguiWidgetFromXml(Element element, Widget parent)
ParseContinue miniguiWidgetFromXml(Element element, Widget parent, Widget w)

Detailed Description

To add custom widgets to the minigui_xml factory, you need to register them with FIXME.

You can attach some events right in the XML using attributes. The attribute names are onEVENTNAME or ondirectEVENTNAME and the values are one of the following three value types:

$(LIST * If it starts with &, it is a delegate you need to register using the FIXME function.

* If it starts with (, it is a string passed to the arsd.dom.querySelector function to get an element reference

* Otherwise, it tries to call a script function (if scripting is available). )

Keep in mind For example, to make a page widget that changes based on a drop down selection, you may:

<DropDownSelection onchange="$(+PageWidget).setCurrentTab">
<PageWidget name="mypage">
	<!-- contents elided -->

That will create a select widget that when it changes, it will look for the next PageWidget sibling (that's the meaning of +PageWidget, see css selector syntax for more) and call its setCurrentTab method.

Since the function knows setCurrentTab takes an integer, it will automatically pull the intValue member out of the event and pass it to the method.

The given XML is the same as the following D:

auto select = new DropDownSelection(parent);
auto page = new PageWidget(parent); = "mypage";

select.addEventListener("change", (Event event)
Suggestion Box / Bug Report