bug fix 1009

Arrow keys to select items were flipped for button type MENU.
This commit is contained in:
2004-04-06 20:31:11 +00:00
parent c8fadc65dc
commit d2f95ea72e

View File

@@ -813,7 +813,8 @@ static void ui_warp_pointer(short x, short y)
static int ui_do_but_MENU(uiBut *but)
{
uiBlock *block;
ListBase listb={NULL, NULL};
uiBut *bt;
ListBase listb={NULL, NULL}, lb;
double fvalue;
int width, height=0, a, xmax, starty;
short startx;
@@ -906,6 +907,20 @@ static int ui_do_but_MENU(uiBut *but)
}
}
/* the code up here has flipped locations, because of change of preferred order */
/* thats why we have to switch list order too, to make arrowkeys work */
lb.first= lb.last= NULL;
bt= block->buttons.first;
while(bt) {
uiBut *next= bt->next;
BLI_remlink(&block->buttons, bt);
BLI_addhead(&lb, bt);
bt= next;
}
block->buttons= lb;
/* and lets go */
block->direction= UI_TOP;
ui_positionblock(block, but);
block->win= G.curscreen->mainwin;
@@ -4029,6 +4044,7 @@ void uiBlockSetDirection(uiBlock *block, int direction)
{
block->direction= direction;
}
void uiBlockFlipOrder(uiBlock *block)
{
ListBase lb;