fix: https://github.com/ArthurSonzogni/FTXUI/issues/296#issue-1092343846
When the list in Radiobox/Menu/Toggle is resized, clamp the |selected_| values so that it stays within bounds.
Clamping is executed in Render() and in OnEvent()
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
1. the default window size should be 80x24 rather than 80x25 in VT100.
2. the ioctl return value result should be checked. Some operating systems don't support TIOCGWINSZ this command.
Use std::string by default for the implementation of FTXUI's input
component.
Along the way:
- Give a correct implementation for fullwidth characters.
- Add tests
- Modify the way the cursor is drawn.
This implement the flexbox elements, following the HTML one.
Built from them, there is also the following elements:
- `paragraph`
- `paragraphAlignLeft`
- `paragraphAlignRight`
- `paragraphAlignCenter`
- `paragraphAlignJustify`
This is a breaking change.
In case of embedded systems, the terminal size may not
always be detectable (e.g. in case of serial output).
Allow application to set up the default size in case
autodetection fails. On platform such as Emscripten,
there is only "fallback" size.
Signed-off-by: Jarosław Pelczar <jarek@jpelczar.com>
Msvc defined its own (lowercase) macros for min/max. Because of this, the std::min and std::max functions need to be explicitly included or otherwise are not availible.
In the msvc 2019 compiler this issue seems fixed. However, on msvc 2017 not including <algorithm> causes compilation errors. Adding the include is a simple fix that does not hurt the other platforms and enables compilation on msvc 2017.
- Let the global `BUILD_SHARED_LIBS` dictates whether the library should
be built statically or dynamically. The cmake's default is statically.
- Add library version and symlink.
This lead to the following install tree.
.
├── include
│ └── ftxui
│ ├── component [...]
│ ├── dom [...]
│ ├── screen [...]
│ └── util [...]
└── lib
├── cmake
│ └── ftxui
│ ├── ftxui-config.cmake
│ ├── ftxui-config-version.cmake
│ └── ftxui-config-version-noconfig.cmake
├── ftxui-component.so -> ftxui-component.so.0.10.369
├── ftxui-component.so.0.10.369
├── ftxui-dom.so -> ftxui-dom.so.0.10.369
├── ftxui-dom.so.0.10.369
├── ftxui-screen.so -> ftxui-screen.so.0.10.369
└── ftxui-screen.so.0.10.369
Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/223
This can happen for example in embedded linux, in case
the application is started via serial terminal.
Signed-off-by: Jarosław Pelczar <jarek@jpelczar.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>