/* for DrawSetupScreen(), HandleSetupScreen() */
#define SETUP_SCREEN_POS_START 2
/* for DrawSetupScreen(), HandleSetupScreen() */
#define SETUP_SCREEN_POS_START 2
#define SETUP_SCREEN_POS_EMPTY1 (SETUP_SCREEN_POS_END - 2)
#define SETUP_SCREEN_POS_EMPTY2 (SETUP_SCREEN_POS_END - 2)
/* for HandleSetupInputScreen() */
#define SETUPINPUT_SCREEN_POS_START 2
#define SETUP_SCREEN_POS_EMPTY1 (SETUP_SCREEN_POS_END - 2)
#define SETUP_SCREEN_POS_EMPTY2 (SETUP_SCREEN_POS_END - 2)
/* for HandleSetupInputScreen() */
#define SETUPINPUT_SCREEN_POS_START 2
#define SETUPINPUT_SCREEN_POS_EMPTY1 (SETUPINPUT_SCREEN_POS_START + 3)
#define SETUPINPUT_SCREEN_POS_EMPTY2 (SETUPINPUT_SCREEN_POS_END - 1)
/* for HandleChooseLevel() */
#define SETUPINPUT_SCREEN_POS_EMPTY1 (SETUPINPUT_SCREEN_POS_START + 3)
#define SETUPINPUT_SCREEN_POS_EMPTY2 (SETUPINPUT_SCREEN_POS_END - 1)
/* for HandleChooseLevel() */
}
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
}
void HandleMainMenu(int mx, int my, int dx, int dy, int button)
buffer[SCR_FIELDX - 1] = '\0';
DrawText(SX + 32, SY + (i + 2) * 32, buffer,
FS_BIG, leveldir[first_entry + i].color);
buffer[SCR_FIELDX - 1] = '\0';
DrawText(SX + 32, SY + (i + 2) * 32, buffer,
FS_BIG, leveldir[first_entry + i].color);
void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
{
static int choice = 3;
void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
{
static int choice = 3;
static unsigned long choose_delay = 0;
static int redraw = TRUE;
int x = (mx + 32 - SX) / 32, y = (my + 32 - SY) / 32;
static unsigned long choose_delay = 0;
static int redraw = TRUE;
int x = (mx + 32 - SX) / 32, y = (my + 32 - SY) / 32;
}
drawChooseLevelList(first_entry, num_page_entries);
drawChooseLevelInfo(leveldir_nr);
}
drawChooseLevelList(first_entry, num_page_entries);
drawChooseLevelInfo(leveldir_nr);
+ x = y = 0; /* no action */
+
+ if (ABS(dy) == SCR_FIELDY) /* handle XK_Page_Up, XK_Page_Down */
+ {
+ dy = SIGN(dy);
+ step = num_page_entries - 1;
+ x = 1;
+ y = (dy < 0 ? 2 : num_page_entries + 3);
+ }
drawChooseLevelList(first_entry, num_page_entries);
drawChooseLevelInfo(first_entry);
DrawGraphic(0, choice - 1, GFX_KUGEL_ROT);
drawChooseLevelList(first_entry, num_page_entries);
drawChooseLevelInfo(first_entry);
DrawGraphic(0, choice - 1, GFX_KUGEL_ROT);
if (first_entry + num_page_entries < num_leveldirs &&
(dy || DelayReached(&choose_delay, GADGET_FRAME_DELAY)))
{
if (first_entry + num_page_entries < num_leveldirs &&
(dy || DelayReached(&choose_delay, GADGET_FRAME_DELAY)))
{
drawChooseLevelList(first_entry, num_page_entries);
drawChooseLevelInfo(first_entry + num_page_entries - 1);
DrawGraphic(0, choice - 1, GFX_KUGEL_ROT);
drawChooseLevelList(first_entry, num_page_entries);
drawChooseLevelInfo(first_entry + num_page_entries - 1);
DrawGraphic(0, choice - 1, GFX_KUGEL_ROT);