On Monday, 25 January 2016 at 20:00:57 UTC, Basile B. wrote:
On Tuesday, 8 December 2015 at 15:58:43 UTC, Vadim Lopatin
wrote:
- integration of DML GUI builder (Delphi like)
Can you explain me how do you think it can be done while there
is even no official object streaming for D ?
Just one thing: "@widget" is not enough.
I don't know how to explain you the problem. But let's say you
have an object inspector that displays the properties of an
object. The D way doesn't work (templates). You won't be able
to assign an untyped Object to an inspector if your object
doesn't store runtime informations. It's just impossible.
Furthemore properties are not just for the visual things...
You won't be able to make a good run-time designer "à la
Delphi" until the D standard library gets a serialization
library. And when this will happen, you won't be able to use
this serialization library because it won't work at run-time
(object inspectors, property bindings, etc.).
It won't work.
Currently it's being done by adding lines like following into
modules which contain widgets to publish:
import dlangui.widgets.metadata;
mixin(registerWidgets!(Widget, TextWidget, ScrollBar,
CanvasWidget)());
Unless widgets are registered, it's impossible to create them
from DML like this:
auto layout = parseDML!VerticalLayout(q{
VerticalLayout {
layoutWidth: fill; layoutHeight: fill; backgroundColor:
#FF8080
TextWidget { text: "Input text here" }
EditLine { id: edName }
}
});
Sample DML editor:
dub run dlangui:dmledit