Oct 23, 2006

SAUI episode 3: labels and symbols


Step by step, SAUI keeps going.
This time I implemented one new and basic widget: the label.
Label can have text and one image (I guess I'll create something different for a "multi image label"), and can have three possible layouts: center, left or right (wow! That's original!).
You can add a border to the label, the same way you do with TextField or CheckboxGroup.
I'm currently developing a label with multiple text lines and one font layout for each text line.

Going back to the Text field, I developed an "insert symbol" system that uses an horizontal scrollable strip where user can choose the symbol to insert into the text field. The selected symbol is highlighted with a border. The insert symbol strip inherits the focused text field layout and it's drawed immediatly before or after it. The problem is: I only support a limited set of characters, so I still have to work on it.

As I already imagined, first bugs show up.
The system that I use to handle the [0-9] keys characters insertion sometimes skips a character (ie: sometimes, when you press the "6" button it shows you the "m" character, the "o", "6" and then "n"), this can be annoying since it only happens every now and then.
Plus, the caret position sometimes is not very accurate, since it's calculated using Font.stringWidth(String str).

Click on the image and tell me if you like the first results of this new project!

0 commenti: