Semi-automatic serialization and UI form?

107 views
Skip to first unread message

ardi

unread,
May 17, 2023, 2:24:00 PM5/17/23
to wx-users
Hi!

Is there any solution, either within wxWidgets, or as a external project, for defining the member types of objects, their default and min/max values, and then getting automatically a form-like scrolled window with all the widgets needed for editing such data (a la AntTweakBar, but even more automatic)? And then, of course, being able to serialize the data for file I/O.

I've read about XTI in the wiki, but I feel XTI doesn't do this and was for another purpose...

Kind regards,

Ardi

Jorge Moraleda

unread,
May 17, 2023, 6:53:26 PM5/17/23
to wx-users
I don't know of anything that does exactly what you want but these are some thoughts:

You can add controls programmatically to any window and if the layout is straightforward and the types of values you want to edit in your form is limited, this is not hard and may be the best way to go.

An alternative to defining the controls programmatically in C++ could be to use an XRC definition (https://docs.wxwidgets.org/latest/overview_xrc.html) In your case, you could create the XRC file programmatically based on what controls you want to add. Easier would be to modify an existing XRC. You could create a baseline XRC for your panel with a tool such as wxFormBuilder (https://github.com/wxFormBuilder/wxFormBuilder) and then you could modify it programmatically. Of course rather than modify the xml directly you would use some XML parser editor (https://stackoverflow.com/questions/9387610/what-xml-parser-should-i-use-in-c)
Reply all
Reply to author
Forward
0 new messages