TOPIC: Right/left allign of lables
#1369
Right/left allign of lables 1 Year, 2 Months ago
In case I have some fields lined up for the user to edit, the fields lable always is right alligned. Can this be change? Make all lables left align? I can not find in documentation.
 
 
#1370
Re:Right/left allign of lables 1 Year, 2 Months ago
That alignment is quite "built-in". It is possible to do other styles of alignment but it will require more work.

The user interface framework has the concept of "top" and "bottom" which allow alignment of different sizes of text to the same baseline. It also has "left" and "right" which are used to align labels and fields.

A key part is PairControl. When you specify just a field name in a user interface layout, Control.construct gets the Prompt and Control from the Field_ definition and wraps them in a PairControl.

VertControl (which relies on Group for most of the work) and FormControl are also involved in layout.

I think you could probably modify PairControl to give different alignment. It might take some experimentation. If you decide to give this a try and run into problems, feel free to post more questions. If you do come up with something, please post it - I am sure other people would be interested.

Note: The best way to "modify" stdlib code is to redefine records (e.g. PairControl) in your own library, not to actually modify stdlib. This makes it a lot easier to upgrade in the future because you can take a new stdlib without worrying about losing your changes.
 
 
andrew
 
#1373
Re:Right/left allign of lables 1 Year, 2 Months ago
Thanks for the information. I have been away for some time, but last night play with it a bit. Seems it is no need to change the paircontrol or other control. I found that gridcontrol solves the problem very easily. Just group (prompt_description field_definition) and they get lined up nicely in 2 left alligned columns.
 
 
#1374
Re:Right/left allign of lables 1 Year, 2 Months ago
I am glad you found a solution.

Sometimes I miss the obvious answers!
 
 
andrew