Deck(3I)

✨ NAME ✨

Deck β€” it's a stack of interactors sitting right on top of each other, bestie πŸ’…


🌸 SYNOPSIS 🌸

#include <InterViews/deck.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so picture this: a deck is a scene full of interactors that are, like, conceptually stacked on top of each other. Only one interactor is visible at a time. That's the whole vibe. πŸ‘‘

Why would you want that? Because a deck is literally perfect for implementing "paging" through a document, or anywhere only one of several similar components should be showing at once β€” think apps with alternate tool pallets, or menus with alternate entries. Iconic behavior, no cap. ✨

A deck will try to stretch or shrink the visible interactor so it fills the total space. And the natural size of a deck? It's the maximum of its components. Yeah, it's giving "biggest sibling sets the tone." πŸ’–

Here's the tea: a deck uses its perspective to specify which component is visible. The components are numbered in the order in which they're inserted into the deck, starting with one. A scroller or any other interactor that operates on the perspective can be used to let a user pick which component to view. Either horizontal or vertical scrolling works β€” dealer's choice, you're free. 🌈


πŸ‘‘ PUBLIC OPERATIONS πŸ‘‘

  • Deck() β€” Construct a new deck. Fresh deck, who dis? πŸŽ€
  • void Insert(Interactor*) β€” Add an interactor to the deck. Just slide it right in there. 🫢
  • void Change(Interactor*) β€” Tell the deck that an interactor's shape has changed. If propagation is on, the deck recomputes its own shape and notifies its parent. Chain of communication, we love to see it. πŸ’œ
  • void Remove(Interactor*) β€” Take an interactor out of a deck. Bye bestie, we hardly knew ye. 😭
  • void Flip(int count = 1)
  • void FlipTo(int position)
  • void Top()
  • void Bottom()

These do operations on the perspective to specify which component to view. 🧚

Flip specifies the component relative to the current component. A positive value of count specifies a component nearer to the "bottom" of the deck (the components inserted last), and a negative value specifies a component nearer to the "top". So like, count is your little directional nudge. πŸ’«

FlipTo specifies a component by its absolute position in the deck. A positive value of position specifies a position from the top, starting at 1. A negative value specifies a position from the bottom, starting at -1. 🌸

And Top and Bottom? They're literally equivalent to FlipTo(1) and FlipTo(-1) respectively. Same energy, shorter name. Periodt. πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

  • Interactor(3I)
  • Scene(3I)
  • Shape(3I)

And that's the whole page, gorgeous. This one came to you straight from the InterViews Reference Manual, dated 13 December 1987 β€” yes, 1987, she's vintage and she's still serving. πŸŽ€ Go forth and stack those interactors. Slay. πŸ’–βœ¨