Commit Graph

249 Commits

Author SHA1 Message Date
Arthur Sonzogni
7b88656e25 Add option to have button without border. (#101) 2021-05-18 17:49:53 +02:00
Arthur Sonzogni
30a85c4c5b Clear terminal on resize. (#99) 2021-05-17 00:44:37 +02:00
Arthur Sonzogni
a574a6c3ee Pass -Wshadow (#97)
Requested from:
https://github.com/robinlinden/hastur/pull/12
2021-05-16 17:18:11 +02:00
Arthur Sonzogni
ca0d74ac01 Warn for deprecated. (#94) 2021-05-16 09:57:55 +02:00
Arthur Sonzogni
69047ac1e4 Add warning for sign comparison. (#93) 2021-05-16 09:38:24 +02:00
Arthur Sonzogni
7daeac25c0 Modify signature of Container::Tab(...) (#92)
Take selector at the end to get more pleasing results with clang-format.
2021-05-15 02:32:42 +02:00
ArthurSonzogni
fcc49fdce7 Format using iwyu. 2021-05-15 00:19:19 +02:00
ArthurSonzogni
048efb6912 Add {Const,}StringRef to simplify components. 2021-05-14 21:47:51 +02:00
ArthurSonzogni
9fdf235836 Improve the documentation. 2021-05-14 20:56:37 +02:00
ArthurSonzogni
c9aa1805eb Add the Renderer component. 2021-05-13 11:44:47 +02:00
ArthurSonzogni
6d75cb2748 Make component more functionnal 2021-05-09 22:35:34 +02:00
ArthurSonzogni
be219633e3 Merge remote-tracking branch 'origin' into feature/mouse-support 2021-05-01 23:45:13 +02:00
ArthurSonzogni
155758c073 Use IWYU. 2021-05-01 23:19:07 +02:00
ArthurSonzogni
eb399d20c5 Capture mouse for the slider component. 2021-05-01 18:13:56 +02:00
ArthurSonzogni
0af8201023 Add the slider component. 2021-04-29 00:18:58 +02:00
ArthurSonzogni
a27c878a3f Mouse support. Fix & verify Webassembly support.
There was some undefined behavior to be fixed in the terminal input
parser.

The behavior of flush seems to have change. The fix was to invert '\0'
and std::flush.
2021-04-25 16:58:16 +02:00
ArthurSonzogni
0b9b6c692a Improve mouse support 2021-04-25 15:22:38 +02:00
ArthurSonzogni
8037a5fa5f Improve mouse support for menu and toggle. 2021-04-24 18:16:13 +02:00
ArthurSonzogni
890a41a64c Add mouse implementation of most components. 2021-04-18 22:33:41 +02:00
ArthurSonzogni
d685a8655e Parse mouse middle 2021-04-18 18:42:42 +02:00
ArthurSonzogni
cbd13499ae Parse mouse events. 2021-04-18 18:32:38 +02:00
ArthurSonzogni
476b9deaf8 Enable mouse tracking.
Request terminal to send mouse position.

See:
https://github.com/ArthurSonzogni/FTXUI/issues/7
2021-04-05 22:03:37 +02:00
ArthurSonzogni
386a0f9eac Add tests for the input component. 2021-03-28 18:25:16 +02:00
d
160b1c8bbc Added Home, End, PageUp, PageDown events.
Added handling for Home and End for input component
2021-03-28 18:25:16 +02:00
Arthur Sonzogni
373b016ca9 Add webassembly support (#79) 2021-03-22 00:26:52 +01:00
ArthurSonzogni
cac94439ff Add webassembly support 2021-03-21 23:30:46 +01:00
Arthur Sonzogni
a6a7f0a354 Add CI on github action. (#76) 2021-03-20 22:45:21 +01:00
jdfa
af4bf379bc Swapped order of hidding cursor and setting alternative screen (#75)
On some terminal, going to the alternative screen disable cursor hiding.
 Swap of those commands fixed that issue.

Co-authored-by: d <d>
2021-03-16 09:46:02 +01:00
jdfa
9cc3779145 [Win] Fixed usage of ReadConsoleInput (#74)
ReadConsoleInput params: |nLength| is the size in array elements, not in byte.

Co-authored-by: d <d>
2021-03-13 21:02:01 +01:00
Arthur Sonzogni
406355df8c Fix parsing of keys that are prefix of others. (#58)
The ESC key generates sequences that are prefix of others. For instance:
- ESC => [27]
- F1 =>  [27, 79, 8]

As a result, we can't generate the ESC event when receiving [27],
because it might be the start of the [27, 79, 8] sequence (or not).

Application usually applies a timeout to help detecting the ESC key.
This patch introduce a timeout. It is set to 50ms.

Bug: https://github.com/ArthurSonzogni/FTXUI/issues/55
2020-10-25 01:57:56 +02:00
Mike Wallio
1cb08fd606 Fix event const correctness (#56) 2020-10-24 16:47:03 +02:00
ArthurSonzogni
606e0efdfe Implement Input::on_change. 2020-09-20 11:47:06 +02:00
ArthurSonzogni
5291f660ca Automatically fix style. 2020-09-07 11:25:50 +02:00
ArthurSonzogni
5a8ed208da Add the Button component. 2020-08-28 23:54:25 +02:00
ArthurSonzogni
81d79d311d Add TakeFocus and SetActiveChild.
This allows developers to set child children component must be the
currently active/focused one.

This can be used to "control" where the focus is, without user
interactions.
2020-08-28 23:54:25 +02:00
ArthurSonzogni
114ab4ae2a Add more documentation. 2020-08-28 23:54:25 +02:00
ArthurSonzogni
f2dc080a35 Variou details:
- Put the MIT copyright at the end.
- Move the directory /other -> tools
- Various improvements.
2020-08-28 23:54:25 +02:00
ArthurSonzogni
20b9a0f0f5 Add a doxygen documentation. 2020-08-15 10:38:14 +02:00
ArthurSonzogni
75c424cea9 Update document WIP. 2020-08-09 10:49:06 +02:00
vedantparanjape
177df31d41 Added tests for toggle component, OnEnter event 2020-08-05 01:34:46 +02:00
vedantparanjape
33a970530b Added on_enter() method to toggle
component
2020-08-05 01:34:46 +02:00
ArthurSonzogni
a4d72c4d50 Fix on_change() not called for Toggle.
Fix bug 35 and add some tests for the toggle component.

Bug:https://github.com/ArthurSonzogni/FTXUI/issues/35
2020-08-02 22:22:27 +02:00
ArthurSonzogni
8f87fc96ac Add regression test for issue 31.
See https://github.com/ArthurSonzogni/FTXUI/issues/31

Due to a bug fixed by:
https://github.com/ArthurSonzogni/FTXUI/pull/32
the character 'P' was not correctly converted into event.
2020-07-23 21:05:21 +02:00
Giuseppe Cesarano
d1d7a73b2d Fixed P conversion 2020-07-23 20:41:44 +02:00
ArthurSonzogni
5f624431f1 Set the correct key for "return" on Window.
This is related to:
https://github.com/ArthurSonzogni/FTXUI/issues/27
2020-07-21 21:50:03 +02:00
ArthurSonzogni
454b14c5c6 Improve support to mingw 2020-07-16 23:40:15 +02:00
ArthurSonzogni
7f7775ba62 Simplify the requirement struct. 2020-06-01 16:24:22 +02:00
ArthurSonzogni
3490d56662 Improve performance.
Read all the input before drawing anything on the screen.
2020-06-01 16:16:08 +02:00
ArthurSonzogni
823e0906da Fix OnEvent being called on Empty containers. 2020-05-25 02:14:58 +02:00
ArthurSonzogni
e34f051f7a Simplify the Render(screen, document) function. 2020-05-20 21:23:59 +02:00