Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to save and load layouts #33

Open
al2950 opened this issue Feb 11, 2021 · 2 comments
Open

Add ability to save and load layouts #33

al2950 opened this issue Feb 11, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@al2950
Copy link

al2950 commented Feb 11, 2021

I have been looking for an opportunity to integrate this into my project. It appears currently, layouts have be generated at runtime from C++, it would be really great to be able to save layouts and load them as an asset.

@darksylinc
Copy link
Owner

darksylinc commented Feb 11, 2021

I'm not sure how would that work (I'm not saying it's impossible), as layouts work with pointers from C++, thus it would need to somehow serialize.

For what is worth, the layout system heavily borrows layouts from wxWidgets, and the best way (IMHO) to operate with it is to use wxFormBuilder to generate the widgets and layouts inside the editor, and the editor generates a piece of C++ (or XRC file) to generate the same widgets with that layout in your code.

For more advanced uses (e.g. where the UI is procedurally genrated), I still use wxFormBuilder as a template to cut and paste the original code into the real one.

As for Colibri, I still use wxFormBuilder to sketch the layouts and then I finally type the Colibri layout code by hand. Since the behavior is almost 1:1 (but not exactly) it is a very efficient method to quickly create new UIs.

Serializing both widgets and layouts together is much easier, than just layouts alone.

@darksylinc darksylinc added the enhancement New feature or request label Feb 11, 2021
@al2950
Copy link
Author

al2950 commented Feb 11, 2021

Ok, thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants