-
Notifications
You must be signed in to change notification settings - Fork 73
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
[RFC] Layout helper classes #1610
Comments
Would be cool to have something like that. That would ease up a lot. |
I also like that especially with the similar structure to other GUI frameworks. What bothers me a bit is the duplication (of the IDs) but I guess splitting the layout from the control-adding also has its benefits. I'm not sure about the |
Working on the Addon Settings window, I'm really fed up with the task of manually laying out controls. Is there interest in a set of helper classes to simplify building GUI layouts?
I envision a two-step process, first, defining the layout using a builder pattern API, that computes a bunch of rectangles, then adding the controls using those rectangles in order. The builder API would require some redundancy, to spot certain errors early in the build phase and not later in the use phase, where they may be more difficult to locate.
Every node in the layout would be named, auto-generated from the associated control ID using a macro, if applicable. Again, this is to provide meaningful error messages.
Here's what I've come up with so far (this is based on
iwAddons.cpp
and uses the IDs defined there):I'm using strong typing for things like widths, heights, etc. to provide more concise overloads. Would probably rely on some TMP to not repeat myself.
No strings would be stored in Release builds and error checking would only be active in Debug builds.
This is just a start. I've put more thought into some aspects and implementation details. Just let me know if I should pursue this or spend my time elsewhere. (I really want this – or something like it – for more UI work I'd like to do.)
The text was updated successfully, but these errors were encountered: