MENUDEMO.BAS This is a set of menu routines that have two different types of dialog boxes along with a popup menu and pulldown menu. There is a bar along the bottom of the screen that give the shortcut keys that are used. They form the basis of a reasonably good menu system that is easy to use, attractive and offers a programmer and user friendly style. The menus are set up using TYPE statements and loading the choices into arrays. The "hotkey" choices in the TYPE statements indicate the number of characters from the left for the hotkey. All of the menus and dialogs are very simple to call and use. The dialogs and pulldown menu are FUNCTIONS and return values used to make SELECT CASE choices. Included as well are some attribute constants (CONSTANT.BI) that are used to set the attributes for the menu routines. The screen routines (including Erik's QPRINT and QFILL) are in the SCRNSUBS.BI file. The menu routines themselves are in MENUS.BAS with the necessary DECLARE and DIM statements located in the MENUS.BI file. It is necessary to do some DIMing and the actual loading of the choices in the actual program. If you follow the MENUDEMO.BAS skeleton, you should have no problem integrating these routines into your programs. These routines are placed in the Public Domain for use with your programs on a royalty-free basis. Feel free to use them, but if you make improvements please send a disk with the code to: Duff Hale 8610 King George Drive Dallas, TX 75235 Some of the improvements I would particularly like to see made are separator bars on the menu choices, mouse capability, a good help system, etc. What follows is a brief description of some of the routines and what they do. FUNCTION DIALOG (ROW, COL, DMENU() AS DIALOGMENU, TITLE$()) The DIALOG FUNCTION displays a dialog box menu by centering it at the location defined by ROW, COL. The Titles passed to it in the array TITLE$ are displayed above the menu items passed in DMENU(). Selection of a menu item is accomplished by pressing the indicated hotkey or highlighting the selection with a double-line box. The box is moved from one to the other using the left or right arrow keys. ESCAPE cancels the menu. The FUNCTION returns a numeric value which is determined by the menu item's position in MENU(). FUNCTION POPUPMENU (ROW, COL1, PMENU() AS POPMENU) This FUNCTION displays a popup menu starting at ROW, COL1 and a selection is made by pressing the indicated hotkey (shown by a different color) or by placing the highlight over the choice and pressing the enter key. Move the highlight by use of the up or down arrow keys. ESCAPE cancels the menu. The FUNCTION returns a numeric value based on the menu choice's position in PMENU(). FUNCTION DIALOGPOPUP (ROW, COL, DPMENU() AS DIALOGPOPUPMENU, TITLE$()) This FUNCTION is a combination of the above two in that it has Titles passed to it in TITLE$ centered above the menu. The menu choices are highlighted by moving the highlight bar up or down with the up or down arrow key. Pressing ENTER makes the choice. Choice can also be made by pressing the appropriate hotkey. FUNCTION PULLDOWN(ROW, HEAD() AS MENUHEAD, MENU() AS MENU, IKEY) This FUNCTION is used to implement several pulldown menus as passed to it in HEAD(). The following keys are recoginzed in PULLDOWN: ALT + HEADING HOTKEY Pulls down selected menu. ESC Removes current menu from screen. LEFT ARROW Removes current menu and selects next menu to the left. RIGHT ARROW Removes current menu and selects next menu to the right. MENU HOTKEY Selects the menu item. ENTER Selects the highlighted menu item. UP ARROW Moves highlight bar up one selection unless it is on top in which case, it moves to the last selection. DOWN ARROW Moves highlight bar down one selection unless it is on bottom in which case it moves to the first selection. PULLDOWN returns a numeric value based on the choices' location in MENU() + 512. Therefore, the first choice would return a value of 513, the second item 514, etc. SUB PULLDOWNBAR(ROW, HEAD() AS MENUHEAD) The SUB PULLDOWNBAR is used to display a pulldown menu bar on the line defined by ROW. SUB FOOTERBAR(FOOTER() AS FOOTERSTRING) The SUB FOOTERBAR is used to display a line across the bottom of the screen showing any Shortcut Keys you may want to use. The number of characters to highlight are shown as an integer value. Example, "Alt-X Exit", 5 will highlight the first five keys (Alt-X); "F2 - Print", 2 will highlight the first two keys (F2). SUB SETMENUDEFAULTS This SUB is used to evaluate whether or not any attribute choices have been made for the menus, and if not, assign default choices. SUB SETMENUATT (ATT) This sets the attribute for the menu and pulldown menus. SUB SETMENUHIGHLIGHT (ATT) Sets the color of the highlight for the menu choices SUB SETMENUHOTKEY (ATT) Sets color for the hotkey choice on the menu. SUB SETMENUBORDER (ATT) Sets the color for the border of the pulldown, popup and dialog box menus. SUB SETMENUSHADOW (ATT) Sets the color of the shadow and the background items on the screen that show through. SUB SETFOOTERATT (ATT) Sets the color of the Footer across the bottom of the screen. SUB SETFOOTERHILITE (ATT) Sets the color of the highlight used on the footer.