Post Reply 
HP48G soft menu toggle: How?
10-01-2023, 06:24 PM
Post: #18
RE: HP48G soft menu toggle: How?
(07-23-2023 10:09 PM)johnb Wrote:  There's also a block character in "chars" (right-shift PRG).

I've built self-referential functions that move the character from menu item to menu item as an indicator. For example, in the menu below, it moves it between Hex, Dec, Oct, and Bin. Ignore all the other menu items here (it's a general purpose / 16c set of menus). I'm showing the exact code so you can see how it might be used in practice. This is function SETB:

Code:
«
{ S→U  U→S  BDISP STWS RCWS 
   { "»FMT" SETF }
   { "HEX" « HEX SETB » }
   { "DEC" « DEC SETB » }
   { "OCT" « OCT SETB » }
   { "BIN" « BIN SETB » }
R→B  B→R  }
IF 'CSMNU' VTYPE -1 ≠ THEN CSMNU + END
DUP BASEN 6 +
GET DUP 1 GET "▀" + 1 
SWAP PUT BASEN ^ +
SWAP PUT MENU 1.02 MENU
»

The first bit (between the external set of braces {}) is the menu.

The first row of button assignments are just signed/unsigned conversions, a function that shows 'x' in all 4 major bases, set/recall word size, and "switch to format menu. Ignore this part.

The CSMNU stuff adds on additional rows to the menu shown, and can also be safely ignored.

The interesting part are the Hex/Dec/Oct/Bin buttons (which fall on the next page of the softbutton menu), and their assigned function calls. The bottom few steps of the program get the 3-character name, append the block character, assign it as the button label while assigning the default labels to the rest, and install it all as a menu. Every time you press one of the hotkeys assigned to Hex/Dec/Oct/Bin, SETB edits the menu and replaces it in place.

Hope this helps!

John, do you have a much simpler (less of it) program that can show how this works in practice?

Does this method rely on having other menus already created?

HP48GX, HP42s and DM42.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP48G soft menu toggle: How? - DM48 - 07-23-2023, 02:11 AM
RE: HP48G soft menu toggle: How? - DM48 - 07-23-2023, 12:13 PM
RE: HP48G soft menu toggle: How? - DM48 - 07-23-2023, 05:56 PM
RE: HP48G soft menu toggle: How? - BruceH - 07-23-2023, 08:42 PM
RE: HP48G soft menu toggle: How? - DM48 - 10-01-2023, 05:55 PM
RE: HP48G soft menu toggle: How? - johnb - 07-23-2023, 10:09 PM
RE: HP48G soft menu toggle: How? - DM48 - 10-01-2023 06:24 PM
RE: HP48G soft menu toggle: How? - DM48 - 07-24-2023, 02:11 AM
RE: HP48G soft menu toggle: How? - DM48 - 07-25-2023, 01:31 AM
RE: HP48G soft menu toggle: How? - DM48 - 07-25-2023, 04:57 PM
RE: HP48G soft menu toggle: How? - DavidM - 07-27-2023, 03:41 PM
RE: HP48G soft menu toggle: How? - DM48 - 10-01-2023, 09:39 PM
RE: HP48G soft menu toggle: How? - DM48 - 10-02-2023, 09:00 PM
RE: HP48G soft menu toggle: How? - johnb - 10-02-2023, 09:55 PM
RE: HP48G soft menu toggle: How? - johnb - 10-02-2023, 10:02 PM
RE: HP48G soft menu toggle: How? - DM48 - 10-02-2023, 10:23 PM
RE: HP48G soft menu toggle: How? - johnb - 10-02-2023, 11:09 PM
RE: HP48G soft menu toggle: How? - DM48 - 10-03-2023, 12:42 AM



User(s) browsing this thread: 6 Guest(s)