Draw based widgets for Red
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hiiamboris 98cf10e28e FIX: layout bug fixes 3 days ago
programs FEAT: add header 1 week ago
tests FIX: minor hello improvement 1 week ago
LICENSE Add LICENSE 1 year ago
README.md DOC: mention of vids.md 1 week ago
actors.red FIX: more dynamic/reliable scrollable sizing and some 1 month ago
auxi.red FEAT: half function 2 weeks ago
comments FEAT: automatic `update` 1 week ago
console.red FEAT: (broken) global render caching, removing 90% of load 3 months ago
creators.md FEAT: (broken) first work on sizing 3 months ago
debug-helpers.red FEAT: automatic `update` 1 week ago
events.red FIX: delist wasnt working 2 weeks ago
everything.red FEAT: automatic `update` 1 week ago
focus.red FIX: no error on no previously valid focus 4 days ago
hittest.red FIX: styles are copied now 1 month ago
hovering.red FEAT: new timer architecture that doesn't eat 100% CPU 1 month ago
layouts.red FIX: layout bug fixes 3 days ago
popups.red FIX: popups were broken after event refactor 2 weeks ago
quickstart.md DOC: minor quickstart update 1 week ago
reference.md DOC: formatting fix 4 months ago
rendering.red FEAT: automatic `update` 1 week ago
run.bat FIX: don't force CLI in run.bat 1 month ago
single-click.red FIX: single click 'stop' flag fix 3 weeks ago
standard-handlers.red FEAT: dragging selection & some improvements 5 days ago
styles.red FIX: better default field margin 3 weeks ago
tabbing.red FIX: tabbing was broken 2 months ago
templates.red FIX: let cell clip it's content 3 days ago
timers.red FIX: renamed index to offset (more to the point) 5 days ago
traversal.red FIX: shouldn't error on empty layout 4 days ago
vid.red FIX: much more reliable focus keyword 4 days ago
vids.md DOC: on weight 7 days ago

README.md

Table of Contents

RED SPACES - DRAW-BASED WIDGET LIBRARY FOR RED

Official URL of this project: https://codeberg.org/hiiamboris/red-spaces

Examples (clickable)

Spiral editable field Table
Infinite list of items of varying size Self-containing grid

>> MORE DEMOS IN /TESTS <<

Spiral Field demo reuses the normal rectangular field space (that contains all the keyboard logic and everything) by transforming hittest coordinates in a spiral way. Rendering logic of course had to be rewritten because such complex transformations are far beyond Draw capabilities. That's why it's a bit laggy: it renders each character individually.

Table demo demonstrates how events are handled naturally even on a rotated layout.

Infinite List's trick is that when items vary in height, it's hard to provide uniform scrolling (naive desings would scroll at item granularity) and at the same time make it respond in real time to user actions.

Self-containing grid shows that there are no limitations: every space can contain any other space, or even itself (but then one has to manually limit the rendering depth or stack will overflow ☻).

Docs

Quickstart - if you just wanna use one in your program

VID/S manual - description of the layout dialect

Widget Reference - if you're interested in what Spaces are available and how they work

Creators Guide - description of the architecture that will help you write your own Spaces

Status

Alpha stage. Some design changes possible, risk of breaking changes. Not very high-level yet.

Good enough to experiment with, and to propose design enhancements and feature requests.

By component State
Widget architecture Mostly stable
Events Mostly stable
Timers Stable
Styling Mostly stable
Focus model Mostly stable
Tabbing Mostly stable
Spatial navigation Not implemented
Resize model Need a powerful simple design idea, ideally that would apply to faces too
Layout Embedded into View layout seamlessly, but very basic: only accepts space names and with
Grid/Table Requires interactivity: columns dragging, sorting, filtering
Reactivity Waiting for PR #4529 (reactivity has to be scalable for Spaces scope)
User's guide Written
Widget reference Written
Creator's guide Written
Templates None made so far

Goals

  • make complex widgets portable and accessible
  • make it possible to create custom widgets easily
  • implement a set of complex widgets in their basic form, to serve as templates
  • test various UI framework ideas, see how they work and if they could improve View
  • make styling of UI an easy and fun undertaking
  • provide a basis for dynamic animated UIs (animation dialects and 2D game engines may be based upon this project)

Help & feedback

If you find it too complex to achieve some task, you can ask my advice on Gittard.
When you spot bugs or other issues you can report them also on Gittard or by creating an issue report or wish request in this repository. Improvement ideas are also welcome :)