[WISH] Designer generating source code

EduardoElias

Well-Known Member
Licensed User
Longtime User
The problem:

Views created on libraries needing to have layouts loaded. In order to be reusable and not bother on the main activity about that.

The Solution:

If the designer could generate a source code to reproduce the same drawing.

The source will be used to be placed on the libraries.

It is interesting that for the main activity also, there are applications that the layout is variable and could be handy.

Thanks!
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
It would be really cool if the designer could generate code. Usually it has to be in a strong framework though that keeps things a certain way. Visual Studio has designer files that are generated off of the GUI design that you can even modify and have it reflected in the GUI design (Harder to process these though and if you mess up your code or it can't parse what you add then the GUI design won't show). PowerBASIC has a designer called PB Forms that it keeps separate and generates code from your design that you can modify, but only certain parts of it because changes in other parts are overwrote when you export your design to source again.

It is usually easier when controls are created and placed with as few of lines as possible. In may last few libraries and classes I have either one line that places and sets up the view in one call or I split it to 1-3 lines to setup location/size/padding then another line to setup/place the control. Sort of reminds me of the old Turtle Graphics stuff in some languages. It would then be easy to generate and parse commands for design. This would allow for other layout types too other than than X/Y coordinate style used now that is difficult to have dynamically sizing controls.
 
Top