Win32 API Menu Demo 30 Aug, 2002
R5 introduced nice cascading action bar buttons. But did you know you can have cascading menu items everywhere courtesy of the Win32 API?
The attached database, in zip format, is a simple demonstration of this functionality. A combination of Win32 API calls are used to provide cascading menus in any Notes client application. See the screenshot below for more of an idea of what this application does:
Note that the example database uses action bar buttons stored in a "placeholder" page to demonstrate the menu items, but they could be triggered by all kinds of click events in the Notes client. The code has also been tinkered with in the R4.x client, so cascading action bars in R4 here we come!
All this code makes use of a number of Win32 functions, and these are…
Then, for building the menu itself…
Structuring your menus
The code is the simple bit; by far the most complex issue is structuring your cascading menus. Which option should be greyed-out and when? How many levels could / should a menu go to? All such questions need to be addressed. The database code contains some sample guidelines with regards menu construction.
The example database is coded so that via a messagebox, it prompts the user with the name of the menu item selected — it does nothing more than that. Effectively this code provide you with a model for generating menus and performing an — albeit crude — system of event handling.
The rest is up to you!