MenuPopDown
MenuPopDown is a list of menu choices similar to a listbox in appearance. MenuPopDown creates the pulldown directly underneath the top level choice and any cascading menu pulldown levels. The application does not fill in these window structures nor create the windows, but it does indirectly allocate storage space for MenuPopDowns when it allocates the LHAPIBLOCK structure. The LHAPI system initializes MenuPopDowns when a MENU key or ALT key press is intercepted.
Window Structure Details
- PLHCLASS Class: If Class = NULL, the window gets filled in by LHAPI. If Class is non-NULL, the PopDown's Class field remains untouched by LHAPI, allowing an application to provide subclasses of menus or popup menus.
- int x,y,w,h: The MenuPopUp handler automatically sets x,y,w,and h on a CREATE message.
- PLHRES Title: Not used.
- PLHDATA Data: Data points to the LHMENU structure that defines the menu items and the appropriate action for each menu item.
- UINT LogicalSize: LogicalSize is set during a window CREATE message.
- UINT Style: Style is set during a window CREATE message.
- PLHWINDOW Parent: Used by the Object handler.
- PLHFKEYS FKeys: Used by the Object handler.
- PLHMENU Menu: Not used.
- UINT Selection: Selection gives the currently selected item within the menu.
- UINT WindowTop: Not used.
Messages
- KEYSTROKE: The following keys are recognized:
- ENTER activates the current menu selection. If the selection is another menu--if the Style byte for that item has set MENU_POPUP-- and this is the first cascading pulldown menu, the MenuPopDown handler creates another (tertiary) pulldown menu. Otherwise, the MenuPopDown handler dispatches the routine pointed to by the handler, either through a direct function call, a message send, or an automatic window creation. See MENU_SENDMSG and MENU_CREATEWND in LHAPI.H.
- UpArrow or DownArrow moves the cursor to the next/prior submenu item.
- A letter moves the cursor to the menu item with the corresponding underscored letter (it's mnemonic), then "does" that item (creates a dialog or executes an action).
- ESC destroys the MenuPopUp window.
- MenuPopDown ignores the Menu key.
- DRAW: MenuPopDown draws the MenuPopUp with a shadow underneath and to the right. For details on the Styles interpreted by the MenuPopUp handler, see LHAPI.H.
- CREATE: MenuPopDown sets x,y,w,h to appear underneath the appropriate MenuBar choice and adjusted the variables to fit on the screen. MenuPopDown sets the STYLE_SAVEUNDER bit in the Style field and sets the Title field to NULL.
- SETFOCUS: Passed to the Object class handler.
- LOSEFOCUS: Passed to the Object class handler.
- NULLEVENT: Passed to the Object class handler.
- DESTROY: Passed to the Object class handler.
- TERMINATE: Passed to the Object class handler.
- ACTIVATE: Passed to the Object class handler.
- DEACTIVATE: Passed to the Object class handler.
- NOTIFY: Passed to the Object class handler.
- COMMAND: Passed to the Object class handler.
- APPEAR: Passed to the Object class handler.
- DISAPPEAR: Passed to the Object class handler.