I've revised it, but I don't know how you can retrieve the button number on a panel.
Here's my
Code:
#define OFF 0
...
int button_num,dummy;
...
void scroll_menu_down(PANEL* _pan)
{
for(_pan.scale_y= 0.1,_pan.flags|= VISIBLE; _pan.scale_y < 0.9; _pan.scale_y+= 0.1 * time_step) wait(1);
}
void scroll_menu_up(PANEL* _pan)
{
for(_pan.scale_y; _pan.scale_y > 0.1; _pan.scale_y-= 0.1 * time_step) wait(1);
}
void menu()
{
dummy= (dummy== OFF);
switch(button_num)
{
case 1:
if(dummy== 0)
{
scroll_menu_down(gui_dropdown1);
}
else
{
scroll_menu_up(gui_dropdown1);
}
case 2:
if(dummy== 0)
{
scroll_menu_down(gui_dropdown2);
}
else
{
scroll_menu_up(gui_dropdown2);
}
case 3:
if(dummy== 0)
{
scroll_menu_down(gui_dropdown3);
}
else
{
scroll_menu_up(gui_dropdown3);
}
case 4:
if(dummy== 0)
{
scroll_menu_down(gui_dropdown4);
}
else
{
scroll_menu_up(gui_dropdown4);
}
}
}
I have no idea how to set this all up to work with the buttons.
I guess I should just give up trying to make my programming sleeker, if it's going to be more difficult than doing it the long way.

EDIT: Yay! with a little
more revision, it works! Well, sort of. You have to click on one button at least once before you can open the menus. And the behavior of it is odd when you have multiple things open at one time (not that you'll need to

).