Robert Wood

Fixed an EGUI bug with menu scrolling

Discussion created by Robert Wood on May 25, 2013
Latest reply on Jun 25, 2013 by Monica Arvizu

There is a bug in the EGUI source code I have fixed. If you scroll through a screen, when you get to the bottom and have to move all the entries up one, because the user's pressed the down key, the focus menu entry goes from the bottom of the screen back to the top. This bug is fixed in the d4d_menu.c file as follows:


void D4D_MenuScrollBarsFeedBack(D4D_OBJECT* pThis, D4D_INDEX old_position, D4D_INDEX new_position)


  D4D_MENU* pMenu = D4D_GET_MENU((D4D_OBJECT*)(pThis->userPointer));




  pMenu->pData->focus_pos = (D4D_MENU_INDEX)new_position;


// This line in an attempt to stop incorrect focus when menu hits bottom of screen 

  if (pMenu->pData->ix < (D4D_MENU_INDEX)new_position)

      pMenu->pData->ix = (D4D_MENU_INDEX)new_position;

  pMenu->pData->item_select = -2;


  ((D4D_OBJECT*)(pThis->userPointer))->flags->bits.bRedraw = 1; 




Just compare it with what's in yours. It might help you if you're having the same issues.