I can change gui draw as above, but I like to know your opinion about it
Main reason of two mode of need_redraw everywhere is not battery saving but avoid blink on redraw. This is uncomfortable.
cursor_to_redraw is just state of cursor.
I do not understand popup, that is displayed after using OK or CANCEL. Is this for confirmation? I think it's not good idea.
Now tbox is standalone module with only one purpose - test and demo. This is test/demo of callback. That everything works ok. In real usage tbox will be hidden module which only code could run it.
And in this implementation DISP and MENU keys are used for the same thing. Maybe one of them could be used as spacebar?
This was just intermediary to say . I like your idea about space by 'DISP'
What does FUNC do? In my case it causes to repeat previous character and avoids usage of other keys...
Looks like so. I'm think we could give more valuable function to it. And it surely should break last enter sequence.
Funny, but zeroing c[] array removes problems with strange symbols
Yes. That help.
Also I noticed that currently buttons a little overlay entered text so I moved it 5px down in gui_tbox_draw()
You are right. But also vertical size of box should be fixed.
And one more thing - instead of '|' we can use \06 as separator - it's a vertical line but it's better visible. We could also use an arrows, but they should be different for each key.
Arrows will break direct correspondence visual index to tbox_chars. \06 is good.
Sometimes write code is faster way to say something than write full description of ideas.
In attachment updated version.
Improvements:
- strange symbols are fixed [you found reason, i fix in more simple way]
- better handling of keyscheme(disp,menu,jogdial). Note: "todo" entries should be implemented and rewrote FUNC/SET
- buttons and keyboard better aligned
- arrow keys use universal function to enter + better handling incomplete charmaps
- need_redraw refactored in common way
- special color case for space
- any visual separator could be added (\06 now)
- edited field is visually obvious.
opened issue:
- fix vertical size of tbox
- fix bugs with moving cursor, correspondence cursor, forget to clean i
- insert mode instead of replace mode
- implement "todo" entries of keyscheme and rewrites FUNC/SET
- better handling default value (only initial changes now)
- process large strings ( maxsize (> MAX_WIDTH) - horizontal scrollable.