Tessalator Posted December 17, 2022 Share Posted December 17, 2022 (edited) I asked about this, it's not supported. With String Literals released now in C#, I'd like to make this a feature request.; This would be a powerful addition and would make dynamic UIs easier. Using Concept. Not code... List<(string WidgetXml, WidgetHandler handler)> widgetParts = new(init()); // WidgetParts are combinations of WidgetXml and a C# support objects. // For example, a group of buttons (xml) and event listeners(C#). // They can be used to create libraries or "sub-components". List used = widgetParts.Select(the ones I want... WidgetContainer vBox = new(); WidgetController wc = new(); // Build the XML string NotAFile = $$""" <?xml version="1.0" encoding="utf-8"?> <ui version="1.0"> {{ foreach used.Widget add XML }} </ui> """; // Build the "Driver" GroupController GuiPort = new(); foreach used.Widget(){ GuiPort.add(widgetHandler) } // Deploy and Bind var ui = UserInterface(NotAFile); GuiPort.Bind(ui); GuiPort.UsedWidget1.Read; GuiPort.UsedWidget1.Write; A use example is an object inspector pop-up. A World Object or Node can have any number of dynamically added Components. I want to R-Click to get details. I can design my components with "Gui Fragments" - some XML and (optionally) backing code. One fragment could be a "pop-up Line" of XML. This can be templated against Component fields. Clicking an object walks through the components and joins the "pop-up lines" into an XML string - "MountedComponentStates". Building and displaying a dynamic pop-up is a few short steps away if I can: UserInterface ui = new(MountedComponentStates). UD: An advantage of dynamic builds is that current values can be baked into the XML, saving some build/populate cycles. Edited December 17, 2022 by Tessalator Link to comment
silent Posted December 19, 2022 Share Posted December 19, 2022 Tessalator Thanks for the suggestion, I've added it to our internal tickets list. However, can't give you any exact ETA on this. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Tessalator Posted August 24, 2023 Author Share Posted August 24, 2023 Any progress on this? The XML support in node data lets me build/cache `.ui` widget elements from within my sim. But to use them I need to do two trips to the hardware. Any chance of getting this moved up on the priorities? Link to comment
silent Posted August 25, 2023 Share Posted August 25, 2023 I'm afraid it's not in the priority list atm. Maybe after full GUI refactoring we would have a bit more spare time to implement this feature. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts