Not hard to learn. Hard to do what you want.
When I was doing CAD in High School I found Inventor. It offered constraint based modeling-- one of the best things ever (AutoCAD feels silly afterwards). It let me know if my system was over constrained or under-constrained, which is great for a new designer. It also lets you take the least measurements needed (just sketch things up, constrain the shape, then start doings specifying some lengths!).
I haven't found a GUI that does something similar.
You could have constraints like "Text size must be readable"... which means different things to different people.
You could have constraints like absolute positioning or this box must contain some other box.
This would only be good for structure, not content or styling!
Best of all you can detect over/under constrained problems... before it looks ugly! I suppose it could warn you on the minimum screen size needed as well (maybe switch skins based on constraints)!
Non-exhaustive list of possible constraints:
contains all of _
is contained by _
does not overlap
does not rotate
southwest of _
east of _
is _ degrees/radians from _
's center is _ degrees/radians from center of _
always shows
attached to _
cannot be resized
takes up the maximum size
takes up the minimum size
takes up _
is bounded by a rectangle [_ by _]
is bounded by a circle [with radius/diameter _]
has a buffer of _ [[around it]/[inside it]]
has a readable color
smallest readable by user
bigger than _ by _
repeats _ by _ (infinity is valid)
may repeat _
Example:
BlogPost contains Menu, EditBox, Buttons, and ReturnLink
BlogPost takes up maximum screen
Menu at top
EditBox south of MenuBox
Buttons south of EditBox
ReturnLink south of Buttons
Menu,EditBox,Buttons,ReturnLink want to be West, want to take up the minimum size, and do not overlap.
So on and so forth.
For the style, you'd have to uniquely name everything. I suppose I left out repeating blocks.
This could be really interesting as something modeled this way could literally have a image floating around the screen as the text moves around it. It would also make it much easier for moving of components from somewhere else.
I'd probably copy the syntax of this from haml, the most beautiful of the sgml producing formatting languages.
No comments:
Post a Comment