"<Btn1Up>(2): LoadSelectedProc(0) \n \
<Key>Home: LoadSelectedProc(-2) \n \
<Key>End: LoadSelectedProc(2) \n \
+ Ctrl<Key>Up: LoadSelectedProc(-3) \n \
+ Ctrl<Key>Down: LoadSelectedProc(3) \n \
<Key>Up: LoadSelectedProc(-1) \n \
<Key>Down: LoadSelectedProc(1) \n \
<Key>Left: LoadSelectedProc(-1) \n \
}
static char *list[1003];
+int listEnd;
static void
GameListReplace(int page)
int i;
if(page) *st++ = _("previous page"); else if(listLength > 1000) *st++ = "";
- for(i=0; i<1000; i++) if( !(*st++ = glc->strings[page+i]) ) break;
+ for(i=0; i<1000; i++) if( !(*st++ = glc->strings[page+i]) ) { st--; break; }
+ listEnd = st - list;
if(page + 1000 <= listLength) *st++ = _("next page");
*st = NULL;
}
if(direction != 0) {
+ int doLoad = abs(direction) > 2;
+ if(doLoad) direction /= 3;
index += direction;
if(direction == -2) index = 0;
- if(direction == 2) index = listLength-1;
- if(index < 0 || index >= listLength) return;
+ if(direction == 2) index = listEnd-1;
+ if(index < 0 || index >= listEnd) return;
XawListHighlight(listwidg, index);
- return;
+ if(!doLoad) return;
}
index = atoi(list[index])-1; // [HGM] filter: read true index from sequence nr of line
if (cmailMsgLoaded) {
CmailLoadGame(glc->fp, index + 1, glc->filename, True);
} else {
LoadGame(glc->fp, index + 1, glc->filename, True);
+ XSync(xDisplay, False);
+ XSetInputFocus(xDisplay, XtWindow(boardWidget), RevertToPointerRoot, CurrentTime);
}
}