aboutsummaryrefslogtreecommitdiff
path: root/TUI/module.jai
diff options
context:
space:
mode:
authordam <dam@gudinoff>2024-01-01 19:15:55 +0000
committerdam <dam@gudinoff>2024-01-01 19:15:55 +0000
commitac9e0033f39a9f2feaa024024a7c443d4e6df77f (patch)
treee9061746899389665f487a8b57dc3d6b83858963 /TUI/module.jai
parent6dd12d2c8b81cd5719fb0ecdcbf678e08460fbeb (diff)
downloadtask-time-tracker-ac9e0033f39a9f2feaa024024a7c443d4e6df77f.tar.zst
task-time-tracker-ac9e0033f39a9f2feaa024024a7c443d4e6df77f.zip
Added some TODO items and fixed show_processing procedure.
Diffstat (limited to 'TUI/module.jai')
-rw-r--r--TUI/module.jai17
1 files changed, 14 insertions, 3 deletions
diff --git a/TUI/module.jai b/TUI/module.jai
index 95ab8dc..8c1d7ed 100644
--- a/TUI/module.jai
+++ b/TUI/module.jai
@@ -542,7 +542,8 @@ get_key :: (timeout_milliseconds: s32 = -1) -> Key {
return xx Keys.None;
}
-get_str :: (count_limit: int = -1) -> string {
+// TODO Maybe rename!? Or replace with read_string... or read_input... or something else?!
+get_string :: (count_limit: int = -1) -> string {
assert_is_initialized();
if count_limit < 0 {
@@ -565,6 +566,16 @@ get_str :: (count_limit: int = -1) -> string {
}
}
+read_string :: (count_limit: int = -1) -> string, Key {
+ // TODO WIP FIXME WIP
+ /*
+ Use the get_key to read user input and show it on screen... should allow to move the cursor left and right and to delete/backspace.
+ Enter should be used to end the input.
+ Escape should discard the input returning an empty string and a Enter key.
+ Resize should discard the input returning an empty string and a Resize key.
+ */
+}
+
start :: () {
if initialized == true return;
@@ -658,7 +669,7 @@ get_terminal_size :: () -> rows: int, columns: int {
flush_input();
write_string(Commands.QueryWindowSizeInChars);
- input := get_str(64,, temporary_allocator);
+ input := get_string(64,, temporary_allocator);
// Expected response format: \e[8;<r>;<c>t
// where <r> is the number of rows and <c> of columns.
@@ -699,7 +710,7 @@ get_cursor_position :: () -> row: int, column: int {
flush_input();
write_string(Commands.QueryCursorPosition);
- input := get_str(64,, temporary_allocator);
+ input := get_string(64,, temporary_allocator);
// Expected response format: \e[<r>;<c>R
// where <r> is the number of rows and <c> of columns.