OK, next question - you'll be getting sick of me soon
I can't find any alignment attached to editbox or savingdatabox. Is it only in listbox?
Number alignment
Re: Number alignment
Feel free to ask questions, this is what these forums are for, and we realize the documentation is lacking. By the way, we're hoping to address that very soon, but we're awaiting switching over to a text format for the .eCdoc files that store the API documentation, so that it is easier to collaborate and track documentation changes with Git. This is being worked on right now.
DataField used by DropBox/ListBox have an alignment property.
That alignment defaults to a type's defaultAlignment, which is something I realize we never use anywhere anymore. To set it would require directly accessing the class object (class(MyType).defaultAlignment = right) at initialization. This should work with a DataBox
as well.
EditBox does not have any alignment property at this point.
DataField used by DropBox/ListBox have an alignment property.
That alignment defaults to a type's defaultAlignment, which is something I realize we never use anywhere anymore. To set it would require directly accessing the class object (class(MyType).defaultAlignment = right) at initialization. This should work with a DataBox
as well.
EditBox does not have any alignment property at this point.
Re: Number alignment
Hi again,
After testing it out, turns out that defaultAlignment doesn't help much with anything at all regarding DataBox, probably why it isn't used anywhere
What does work to edit right-aligned numbers (e.g. currency, see extras/types/Currency.ec) or text, is creating a DataBox with 'autoSize' set to true, and anchor it to the right (anchor = { right = XX }).
With this it might be desirable to set the background color of the DataBox to the same as its background, and set borderStyle to none, so that it looks as though it is right aligned in a parent control (you may want to define an extra parent window with a deep border for it).
Cheers,
Jerome
After testing it out, turns out that defaultAlignment doesn't help much with anything at all regarding DataBox, probably why it isn't used anywhere
What does work to edit right-aligned numbers (e.g. currency, see extras/types/Currency.ec) or text, is creating a DataBox with 'autoSize' set to true, and anchor it to the right (anchor = { right = XX }).
With this it might be desirable to set the background color of the DataBox to the same as its background, and set borderStyle to none, so that it looks as though it is right aligned in a parent control (you may want to define an extra parent window with a deep border for it).
Cheers,
Jerome