Skip to content

Index Tab selected feedback, no-op guard, page-zero block, and auto-page creation#370

Merged
No0ne558 merged 1 commit into
ViewTouch:masterfrom
No0ne558:master
May 28, 2026
Merged

Index Tab selected feedback, no-op guard, page-zero block, and auto-page creation#370
No0ne558 merged 1 commit into
ViewTouch:masterfrom
No0ne558:master

Conversation

@No0ne558
Copy link
Copy Markdown
Contributor

Description:

This PR implements three quality-of-life improvements to Index Tab buttons that together make it dramatically easier to build and navigate multi-page interfaces.


What changed

Visual feedback — active tab highlights automatically

IndexTabZone::State() is overridden to return the selected state (1) whenever the terminal's current page matches the tab's jump_id. Because Zone::Draw() already uses the State() result to pick frame[state], texture[state], and color[state], the tab for the page you're on renders automatically in its configured selected appearance (edge, texture, font color). No new fields on Terminal are needed.

No-op guard — tapping your current tab does nothing

IndexTabZone::Touch() returns SIGNAL_IGNORED when the terminal is already on the tab's target page. This prevents a pointless re-jump and a screen flash when a user taps the tab for the page they're already viewing.

Block page number zero

ZoneDB::Add(Page*) — the single authoritative insertion point for all pages — now rejects any page with id == 0 with a ReportError. No page numbered zero can be created through any code path.

Auto-create a menu page when a new Index Tab button is saved

ZoneDB::NextAvailablePageID(int start_id, int page_size) is a new helper that walks up from start_id until it finds an unused page ID.

In Terminal::ReadZone(), when a brand-new ZONE_INDEX_TAB is saved with no jump target yet (JUMP_NONE), the system automatically:

  1. Finds the first available page ID ≥ 60.
  2. Creates a PAGE_ITEM menu page named after the button.
  3. Registers it in the zone database.
  4. Sets the button's jump to JUMP_NORMAL targeting the new page.

Editing an existing Index Tab that already has a configured jump is completely unaffected.


Files changed

File Change
button_zone.hh Add State() and Touch() overrides to IndexTabZone
button_zone.cc Implement both overrides
zone.hh Declare ZoneDB::NextAvailablePageID()
zone.cc Page-zero guard in ZoneDB::Add(); implement NextAvailablePageID()
terminal.cc Auto-page-creation block in Terminal::ReadZone()
changelog.md Entry under [Unreleased] → Added

6 files changed, 73 insertions(+), 1 deletion(-)

…-page creation

- IndexTabZone::State() returns selected state (1) when the terminal's
  current page matches the tab's jump_id, giving automatic visual feedback
  using the tab's configured selected-state edge, texture, and font color.

- IndexTabZone::Touch() returns SIGNAL_IGNORED when already on the target
  page, preventing a redundant jump.

- ZoneDB::Add() now rejects page id == 0 with a ReportError.

- ZoneDB::NextAvailablePageID(start_id, page_size) added: returns the first
  unused page ID >= start_id for the given screen size.

- Terminal::ReadZone(): when a brand-new ZONE_INDEX_TAB is saved with no
  jump target (JUMP_NONE), a PAGE_ITEM menu page is automatically created
  from the button name at the first available ID >= 60, and the button is
  wired to JUMP_NORMAL pointing at it.
@No0ne558 No0ne558 merged commit ac44a39 into ViewTouch:master May 28, 2026
6 checks passed
@GeneMosher
Copy link
Copy Markdown
Member

Building and using any hospitality menu begins with the Index Page because it lists the Food and Beverage categories, or Families, which are the framework of the menu.

ViewTouch provides special buttons for the Index Page - Index Tabs, which are repeated on every Menu Item Page. The Index Page and Index Tab buttons make it possible for users to navigate to any Page in the Menu with a single touch, no matter where the user might be in the Menu.

There are also 'time of day' Index Pages and Index Tabs which allow Menu Pages to be either restricted to certain times of the day or, to put it another way, to be allowed to be available at certain times of the day.

The strength of ViewTouch is the versatility of tools available to ViewTouch Editors for building Menu interfaces that perfectly match the thoughts and words which guests use to express their menu selections. This is a unique requirement of point of sale software which I recognized even in 1979 when I first began developing my order entry program for my restaurant, Gene Mosher's Old Canal Cafe in Syracuse, New York, using the Apple II computer I had purchased in the Summer of 1977.

I must mention that Ariel has used AI to extend and modify the code to implement these newly integrated Editing features. Anyone is invited to follow his example to similarly improve the usability and value of the ViewTouch point of sale code base !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants