freemint / tos.hyp

The tos.hyp tries to document all functions from TOS. It also has information about MagiC, N.AES, MyAES, Geneva, XaAES, oAESis and some emulators.
https://freemint.github.io/tos.hyp
GNU General Public License v2.0
13 stars 10 forks source link

Add additional information to menu_popup() #169

Open lpgb opened 1 month ago

lpgb commented 1 month ago

https://freemint.github.io/tos.hyp/en/menu.html#menu_popup I'd like to suggest menu_popup() availability be updated with more precise information. It's based on tests with Atari's AES 4.1 and Atari's AES4DEMO program and SUBMENU.CPX as well as tests with N.AES. Below this line:


Availability: This function is available only with AES versions 3.30 and above.

If _mnscroll of MENU is set to 0 when menu_popup is called, a non-scrollable popup menu will be displayed.

If _mnscroll of MENU is set to >0 when menu_popup is called, a scrolling popup menu will be displayed; height of MN_SET determines it's height in items (note that Atari's AES implements up/down arrows within the popup for scrolling to maintain the same look and feel of dropdown menus as they can be attached to menubar items, note that NAES mimics this exact behavior) See also menu_settings.

As of AES version 4.1, if _mnscroll of MENU is set to -1 when menu_popup is called, a dropdown list box instead of a popup menu will be displayed; this will have a scroll bar if eight entries or more exist.

mikrosk commented 1 month ago

Looks good to me. @th-otto @gokmase @skaftetryne any objections?

th-otto commented 1 month ago

I saw you already updated the comments in the menu structure, but not yet the description of menu_popup(). Are you going to update that, too? (remember that there is also a german description)

mikrosk commented 1 month ago

That was Lonny's patch, so yes, the idea is to commit this one as a follow-up. However I'm afraid I can't help with the german part.

lpgb commented 1 month ago

If anyone wants the items used for testing I can attach them (cpx/aes4demo).

th-otto commented 1 month ago

I can add the changes to menu_popup(), just didn't want to do duplicate work.

If anyone wants the items used for testing I can attach them (cpx/aes4demo).

Yes, that would be helpful. BTW, what AES version does N.AES report?

lpgb commented 1 month ago

N.AES reports version 4.1 The demo also works in plain tos 4.04 and the scrolling submenus behave the same.

aesdemo.zip submenu.zip

There's also an article in Atari's Developer's Resource newsletter titled "Popup Menus & Hierarchical Submenus Part 1" by Mike Fulton dated April 1993. Never seen part 2 as this was around the time frame Atari called it quits.

lpgb commented 1 month ago

Perhaps a small addition here as well. https://freemint.github.io/tos.hyp/en/aes_structures.html#MN_SET

typedef struct { int32_t display; / Submenu display delay / int32_t drag; / Submenu drag delay / int32_t delay; / Single-click scroll delay / int32_t speed; / Continuous scroll delay / int16_t height; / Popup scroll height (in items), / / applied when _mnscroll of MENU is >0 / } MN_SET;