Post Reply 
HP48G soft menu toggle: How?
10-02-2023, 09:55 PM (This post was last modified: 10-02-2023 10:00 PM by johnb.)
Post: #21
RE: HP48G soft menu toggle: How?
Quote:John, do you have a much simpler (less of it) program that can show how this works in practice?

Apologies for not responding sooner. I'm recuperating from hip surgery and my rising energy levels are competing with my gradually reducing pain levels. I don't have an example, but maybe I can find some time to work one up for you.

In the meantime, I'll give some guidance here and it may turn out you won't need the example program. (Easier to write English than RPL!)

Quote:Does this method rely on having other menus already created?
No. My example sort of does because it's part of a whole suite of programs that let me shift between menus for 16c-type programmer operations and 2-3 other things: an interval arithmetic mode, some quick shortcuts for display mode (just press all|fix|sci|eng and it remembers the last precision you had set), and (I forget) maybe one other group of things.

The only gripe I have about RPL is that it's hard to read -- even your own code (after a while).

My example contains its own menu. That first list in {} is the menu; you could strip out everything but hex/dec/oct/bin for an example. It's just the raw menu without any block indicators.

Those sub-lists within it are each a label and a program. So, if you press the button labeled "Hex" it runs « HEX SETB », i.e. stick the text Hex on the stack and call SETB. Notice that the example program is SETB: it indirectly calls itself via the button press.

I don't remember how SETB actually sets the base, but it's buried in the lines DUP BASEN... through SWAP PUT MENU...

What most of that is about, though, is just editing the raw menu to add the block to the end of the label you want (for example, you pressed HEX so you want the button label to change to "HEX▪"). Then it just installs that list as a menu.

So, to answer your question, something else somewhere has to initially call SETB with the appropriate HEX/DEC/OCT/BIN string on the stack... from there, SETB always starts over with a raw copy of the list then edits it and installs it as a soft menu.

AFAICR, the line
Code:
IF 'CSMNU' VTYPE -1 ≠ THEN CSMNU + END
is just checking for the existence of an auxiliary menu, which gets appended to the menu that's about to be installed. You don't need this.
 
(10-02-2023 09:00 PM)DM48 Wrote:  Maybe a more specific question would be better. Once I press the soft-key and the flag status is changed, how do I refresh the soft-key menu to reflect the change?

Perhaps now it will make more sense. You'd need a little program (or a set of them, if it makes more sense to split up functionality) that is just for building and installing the menu. The soft key either runs the very program that it's in, or, in your case, more likely your soft ENGL button runs a little program that sets flag 60 and then tells the menu updater "hey, update to show ENGL active." And your SI button might run a different little program that clears flag 60 and then runs the menu updater program "hey, update to show SI active."

Or maybe both buttons run just one little program but they include a parameter on the stack to indicate which state they want to set up.

Daily drivers: 15c, 32sII, 35s, 41cx, 48g, WP 34s/31s. Favorite: 16c.
Latest: 15ce, 48s, 50g. Gateway drug: 28s found in yard sale ~2009.
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: 2 Guest(s)