home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
colour
/
modesel_1
/
!ModeSel
/
c
/
ShowMenu
< prev
next >
Wrap
Text File
|
1994-06-20
|
977b
|
49 lines
/*
Conversion from DeskLib by Andrew Campbell
File: Menu.AddSubMenu.c
Author: Copyright © 1993 Shaun Blackmore and Jason Williams
Version: 1.00 (30 Apr 1993)
Purpose: Adds one menu to another as a submenu
*/
#include "Wimp.h"
#include "ShowMenu.h"
int Menu_CalcHeight(wimp_menu *menu);
int Menu_CalcHeight(wimp_menu *menu)
{
int itemheight, count = 0;
wimp_menu_entry *item;
item = menu-> entries;
itemheight = menu->height + menu->gap;
while(TRUE)
{
if ((item->menu_flags) & wimp_MENU_SEPARATE) /* Count height of dotted line */
count += 24;
count += itemheight; /* Plus the height of each item */
if ((item->menu_flags) & wimp_MENU_LAST)
break;
item++;
}
return(count);
}
void Menu_Show(wimp_menu *menu, int x, int y)
{
x -= 64;
if (y < 0)
y = 96 + Menu_CalcHeight(menu); /* Calculate iconbar position */
wimp_create_menu(menu, x, y);
}