Re: Loading of widgets from DML markup and DML Editor in DlangUI
On Friday, 10 April 2015 at 19:26:28 UTC, Jonas Drewsen wrote: Cool! I am not really that much into qml... but isn't much of the power of qml coming from using javascript to do logic and bindings? Can you do D code stuff in the DML markup to handle that part e.g. by mixin of the DML? Keep up the good work. /Jonas So far, I'm going to implement * automatic mapping of loaded widgets to member variables (based on matching of widget id and variable names, or, possible mixin adding of member variables for all of widgets with ids) * automatic mapping of loaded widget signals to handlers Mixing in handlers written in D from DML is possible, in some of future implementations. So far, I'm not sure that it's better than just having external signal handlers automatically mapped, e.g. by name. sample DML: { HorizontalLayout { TextWidget { text: Enter file name: } EditLine { id: edFileName } Button { id: btnOpen text: Open click = onBtnOpenClick } } } ... // class members EditLine _edFileName; bool onBtnOpenClick(Widget src) { window.showMessageBox(Opend, File name:d ~ _edFileName.text); return true; } Member variable `EditLine _edFileName;` could be added automatically by mixin, or at least it's value can be initialized on load Signal handler may be assigned either if explicitly defined in DML (`click = onBtnOpenClick` means widget click signal should be connected to member function onBtnOpenClick) or just found based on widget Id and signal name (e.g. if there is widget with id=btnOpen and class method onBtnOpenClick - loader mixin could automatically decide to assign this method as signal handler of widget (like it's dont in VB). I'm not sure if alternative definition is better Button { id: btnOpen text: Open click = { window.showMessageBox(Opend, File name:d ~ edFileName.text); } }
Re: Loading of widgets from DML markup and DML Editor in DlangUI
If you are interested, we are doing a GUI system inspired by QtQuick/QMLEngine : https://github.com/D-Quick/DQuick
Re: Loading of widgets from DML markup and DML Editor in DlangUI
On Thursday, 2 April 2015 at 13:40:49 UTC, Vadim Lopatin wrote: Useful feature is added to DlangUI. You can write UI layout as QML-like code, and load it in runtime from file, resource, or just string constant. Great job, Vadim! Thank you!
Re: Loading of widgets from DML markup and DML Editor in DlangUI
On Thursday, 2 April 2015 at 13:56:05 UTC, ketmar wrote: are there any plans to add cassowary solver[1] to DlangUI? i believe i seen D port of it (my own is not usable with DMD). [1] https://constraints.cs.washington.edu/cassowary/ How could it be useful for DlangUI? Some advanced kind of layout?
Re: Loading of widgets from DML markup and DML Editor in DlangUI
On Thu, 02 Apr 2015 14:09:14 +, Vadim Lopatin wrote: On Thursday, 2 April 2015 at 13:56:05 UTC, ketmar wrote: are there any plans to add cassowary solver[1] to DlangUI? i believe i seen D port of it (my own is not usable with DMD). [1] https://constraints.cs.washington.edu/cassowary/ How could it be useful for DlangUI? Some advanced kind of layout? yes, it's universal constraint solver that especially aimed to building GUI layouts. apple adapted it as layout engine for their macos x and ios, for example. signature.asc Description: PGP signature
Re: Loading of widgets from DML markup and DML Editor in DlangUI
are there any plans to add cassowary solver[1] to DlangUI? i believe i seen D port of it (my own is not usable with DMD). [1] https://constraints.cs.washington.edu/cassowary/ signature.asc Description: PGP signature