Commit graph

25 commits

Author SHA1 Message Date
Tim Culverhouse
207103e652 window!: use nullable width and height
Use a nullable width and height when creating a child window

Fixes: #84
2024-10-21 11:51:25 -05:00
Tim Culverhouse
70238897bc all!: reduce usage of usize 2024-10-21 11:21:12 -05:00
Tim Culverhouse
313096c277 window: make print infallible
Print and PrintSegment are now infallible due to gwidth also being
infallible. The previous error was only error.OutOfMemory if a temporary
buffer was too small to encode text in gwidth. This has been removed in
favor or a for loop
2024-10-14 19:24:48 -05:00
00JCIV00
ac9839c71d widgets(table): implemented header and column borders
- Added the `header_border` and `col_border` to `TableContext`. Note, row borders don't work as well due to borders taking up an entire cell.
- Updated the `table.zig` example.
2024-10-04 20:13:54 -05:00
00JCIV00
46ecd65c0c widgets(table): implemented header and column alignment
- Added the `header_align` and `col_align` to `TableContext` along with the corresponding `HorizontalAlignment` and `ColumnAlignment` Types.
- Updated the `table.zig` example.
2024-10-04 20:13:54 -05:00
00JCIV00
c89b75ebe3 widgets(table): added ability to reorder and duplicate columns
- Changed the behavior of `ColumnIndexes.by_idx` (used f/ `TableContext.col_indexes`) to allow valid field indexes in any order. Indexes can also be removed or added multiple times to affect the table generation accordingly.
2024-09-12 21:07:41 -05:00
00JCIV00
2580a8fc12 widgets(table): improved type and bounds checks
- Improved the Type checks for MultiArrayList child Types.
- Improved the bounds checking for printing rows.
2024-09-12 21:07:41 -05:00
00JCIV00
dbeef72630 widgets(table): implemented customizable foreground colors
- Added `active_fg` and `selected_fg` to allow changing the Foreground Color of Active and Selected rows (and Headers) respectively.
2024-09-12 21:07:41 -05:00
00JCIV00
500488f728 widgets(table): implemented more header and column options
- Added the `HeaderNames` Type and `header_names` field to `TableContext` to let users choose between automatically getting header names from fields or setting custom names.
- Removed the `headers` parameter from `drawTable()`.
- Added the `ColumnIndexes` Type and `col_indexes` field to `TableContext` to let users choose which columns/fields they actually want to display.
2024-08-15 19:37:16 -05:00
Tim Culverhouse
54e15764c4 example(table): fix text_input api 2024-08-13 07:42:14 -05:00
00JCIV00
999b0f4f00 widgets(table): implemented optional active row contents callback & context
- Added `active_content_fn` as an optional callback function that can be provided to `TableContext` to vertically expand the active row with additional info.
- Added `active_ctx` and `active_y_off` to support the `active_content_fn`.
- Updated the Table Widget example with
2024-08-13 07:42:14 -05:00
00JCIV00
a99fd3c29f widgets(table): implemented customizable column widths
- Added the `WidthStyle` union to the Table Widget. This allows users to choose from 4 different options for Column Widths.
- Updated the Table Example with demos of the various styles (via comments).
2024-08-13 07:42:14 -05:00
00JCIV00
bbbfbaffbb widgets(table): implemented selectable rows
- Implemented `TableContext.sel_rows`, allowing users to specify which rows have been 'selected' (similar to ctrl+clicking items in a GUI file browser).
- Changed previous 'selected' verbiage to 'active' in all cases.
2024-08-13 07:42:14 -05:00
00JCIV00
5972da8ee3 examples(table): updated the table example w/ latest vaxis changes
- Added `loop.init()` to regain dynamic resizing. (Thanks @rockorager!)
- Used the TTY's Buffered Writer where applicable.
- Updated `win.initChild()` to `win.child()` in all cases.
- Improved ArenaAllocator usage.
2024-08-13 07:42:14 -05:00
00JCIV00
9487916406 widgets(table): add support for Slices and MultiArrayLists
- Updated the Table Widget to support Slices and MultiArrayLists (in addtion to ArrayLists) for the `data_list` parameter of `drawTable()`.
2024-08-13 07:42:14 -05:00
Tim Culverhouse
2f46eb9172 examples(table): add intrusive init on Loop 2024-07-30 18:24:37 -05:00
ippsav
09a4de63e5 fix: missing tty.deinit calls 2024-07-05 04:52:33 -07:00
Tim Culverhouse
5f41978054 refactor(vaxis): require an io.AnyWriter for writes
All vaxis functions that write to the terminal now require an
io.AnyWriter as a parameter
2024-05-29 13:13:54 -05:00
Tim Culverhouse
1b957ec84e fix examples, update readme features 2024-05-22 14:09:15 -05:00
CJ van den Berg
d48826c0b1 vaxis: add osc52 copy/paste support 2024-05-22 13:51:19 -05:00
00JCIV00
a07d4f19a7 Reorganized Namespaces
- Consolidated `main.zig` into `vaxis.zig` as the new library entry point.
- Exposed more Types throughout the library for more transparent doc navigation.
- Reorganized certain Modules and Types to be more coherent and readable.
- Re-generated docs to reflect these changes.
2024-05-12 20:25:51 -05:00
00JCIV00
f8544be262 Added the table.zig example
- Created a basic user management example for the Table widget.
2024-05-12 20:25:51 -05:00
forgoty
019669d2f0 Fix examples: main, pathological, table. 2024-04-29 17:51:33 -05:00
Tim Culverhouse
e7915b5dd7 examples: fix api for main, pathological, table 2024-04-29 12:35:02 -05:00
00JCIV00
e87d64a2b3 Added the table.zig example
- Created a basic user management example for the Table widget.
2024-02-26 19:27:56 -06:00