USR Panels - GiuseppeChillemi/VID-Extension-Kit GitHub Wiki

VID Extension Kit - Panels (unfinished)

Introduction

This document is not yet finished.

The VID Extension Kit supports various types of panels. All of them are derived through the PANEL style.

A panel is typically a loose grouping of faces for the purpose of allowing the use of SET-FACE and GET-FACE on all the faces combined, such as for forms.

Some types use a tight grouping of faces, meaning the intent is for the panel to appear as one single item in the layout, such as a date field. Those are known as compound styles.

Some panels allow scrolling their contents, while others allow easy replacement of the contents or switching between multiple sub-panels of contents.

Standard Panel

The standard panel is the PANEL type. A panel may contain several sub-panels in the FACE/PANELS block. This is useful for switching between different types of content in the same area, which can be done in one line of code.

For example, if you connect the panel to a list, you may display a boilerplate, asking you to select an item in the list, when nothing is selected. When something is selected, the panel switches to a sub-panel with detailed items from the list.

Defining Sub-Panels

Multiple sub-panels are defined using SETUP, by a word/block pair:

panel setup [
	panel1 [
		...layout code...
	]
	panel2 [
		...layout code...
	]
]

You can have as many panels as you like.

Switching Sub-Panels

To switch to a different sub-panel, use:

set-face my-panel 'panel2

As an example, you can use the states or the actors of a face to switch between panels.

Scroll Panels

There are three variants of the scroll-panel: A vertically, a horizontally and a both vertically and horizontally scrolling panel.

Inside each type of scroll panel, is embedded a standard PANEL.

Tab Panel

The tab panel consists of a row of tabs and a standard PANEL below it.

Defining a Tab Panel

The tab panel uses a word, a name and a layout block:

view make-window [
	tab-panel setup [
		tab1 "Tab 1" [origin 4 text-area fill 1x1]
		tab2 "Tab 2" [origin 4 data-list fill 1x1]
	]
]

By standard, the layout block is "tight", i.e. used with an offset and origin of 0x0, hence the use of the origin word to define the spacing between the layout and the tab panel frame.

Caveats

The tab panel can currently only support a number of tabs that are visible within the width of the tab panel.

Compound Styles

Compound styles are tightly grouped faces inside a panel. The idea is that compound styles act and appears like a single face. Examples of compound styles can be a text-area with an attached scroller.

Usually, compound styles consist of styles that don't work on their own.

......incomplete

⚠️ **GitHub.com Fallback** ⚠️