Add -dialogColor and -buttonColor options
[xboard.git] / xgamelist.c
index ecdc915..5aa9201 100644 (file)
@@ -98,7 +98,8 @@ static char filterString[MSG_SIZ];
 static int listLength, wins, losses, draws, page;
 
 char gameListTranslations[] =
-  "<Btn1Up>(2): LoadSelectedProc(0) \n \
+  "<Btn1Down>: LoadSelectedProc(100) Set() \n \
+   <Btn1Up>(2): LoadSelectedProc(0) \n \
    <Key>Home: LoadSelectedProc(-2) \n \
    <Key>End: LoadSelectedProc(2) \n \
    Ctrl<Key>Up: LoadSelectedProc(-3) \n \
@@ -125,10 +126,7 @@ typedef struct {
 static GameListClosure *glc = NULL;
 
 Widget
-GameListCreate(name, callback, client_data)
-     char *name;
-     XtCallbackProc callback;
-     XtPointer client_data;
+GameListCreate (char *name, XtCallbackProc callback, XtPointer client_data)
 {
     Arg args[16];
     Widget shell, form, viewport, listwidg, layout, label;
@@ -180,7 +178,7 @@ GameListCreate(name, callback, client_data)
     listwidg =
       XtCreateManagedWidget("list", listWidgetClass, viewport, args, j);
     XawListHighlight(listwidg, 0);
-    XtAugmentTranslations(listwidg,
+    XtOverrideTranslations(listwidg,
                          XtParseTranslationTable(gameListTranslations));
 
     j = 0;
@@ -330,7 +328,7 @@ extern int soughtCounts[];
 extern Board soughtBoard;
 
 static int
-GameListPrepare(int byPos)
+GameListPrepare (int byPos)
 {   // [HGM] filter: put in separate routine, to make callable from call-back
     int nstrings;
     ListGame *lg;
@@ -373,7 +371,7 @@ static char *list[1003];
 int listEnd;
 
 static void
-GameListReplace(int page)
+GameListReplace (int page)
 {
   // filter: put in separate routine, to make callable from call-back
   Widget listwidg;
@@ -398,9 +396,7 @@ GameListReplace(int page)
 }
 
 void
-GameListCallback(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data, call_data;
+GameListCallback (Widget w, XtPointer client_data, XtPointer call_data)
 {
     String name;
     Arg args[16];
@@ -468,9 +464,7 @@ GameListCallback(w, client_data, call_data)
 }
 
 void
-GameListPopUp(fp, filename)
-     FILE *fp;
-     char *filename;
+GameListPopUp (FILE *fp, char *filename)
 {
     Arg args[16];
     int j;
@@ -510,7 +504,7 @@ GameListPopUp(fp, filename)
 }
 
 void
-GameListDestroy()
+GameListDestroy ()
 {
     if (glc == NULL) return;
     GameListPopDown();
@@ -527,11 +521,7 @@ GameListDestroy()
 }
 
 void
-ShowGameListProc(w, event, prms, nprms)
-     Widget w;
-     XEvent *event;
-     String *prms;
-     Cardinal *nprms;
+ShowGameListProc ()
 {
     Arg args[16];
     int j;
@@ -554,18 +544,15 @@ ShowGameListProc(w, event, prms, nprms)
 }
 
 void
-LoadSelectedProc(w, event, prms, nprms)
-     Widget w;
-     XEvent *event;
-     String *prms;
-     Cardinal *nprms;
+LoadSelectedProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
 {
     Widget listwidg;
     XawListReturnStruct *rs;
     int index, direction = atoi(prms[0]);
-
+printf("action(%d)\n",direction);
     if (glc == NULL || listLength == 0) return;
     listwidg = XtNameToWidget(glc->shell, "*form.viewport.list");
+    if(direction == 100) { XtSetKeyboardFocus(glc->shell, listwidg); return; }
     rs = XawListShowCurrent(listwidg);
     index = rs->list_index;
     if (index < 0) return;
@@ -602,11 +589,7 @@ LoadSelectedProc(w, event, prms, nprms)
 }
 
 void
-SetFilterProc(w, event, prms, nprms)
-     Widget w;
-     XEvent *event;
-     String *prms;
-     Cardinal *nprms;
+SetFilterProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
 {
        Arg args[16];
         String name;
@@ -625,7 +608,7 @@ SetFilterProc(w, event, prms, nprms)
 }
 
 void
-GameListPopDown()
+GameListPopDown ()
 {
     Arg args[16];
     int j;
@@ -651,8 +634,7 @@ GameListPopDown()
 }
 
 void
-GameListHighlight(index)
-     int index;
+GameListHighlight (int index)
 {
     Widget listwidg;
     int i=0; char **st;
@@ -664,12 +646,13 @@ GameListHighlight(index)
 }
 
 Boolean
-GameListIsUp()
+GameListIsUp ()
 {
     return glc && glc->up;
 }
 
-int SaveGameListAsText(FILE *f)
+int
+SaveGameListAsText (FILE *f)
 {
     ListGame * lg = (ListGame *) gameList.head;
     int nItem;
@@ -705,32 +688,36 @@ Widget gameListOptShell, listwidg;
 char *strings[20];
 int stringPtr;
 
-void GLT_ClearList()
+void
+GLT_ClearList ()
 {
     strings[0] = NULL;
     stringPtr = 0;
 }
 
-void GLT_AddToList(char *name)
+void
+GLT_AddToList (char *name)
 {
     strings[stringPtr++] = name;
     strings[stringPtr] = NULL;
 }
 
-Boolean GLT_GetFromList(int index, char *name)
+Boolean
+GLT_GetFromList (int index, char *name)
 {
   safeStrCpy(name, strings[index], MSG_SIZ);
   return TRUE;
 }
 
-void GLT_DeSelectList()
+void
+GLT_DeSelectList ()
 {
     XawListChange(listwidg, strings, 0, 0, True);
     XawListHighlight(listwidg, 0);
 }
 
 void
-GameListOptionsPopDown()
+GameListOptionsPopDown ()
 {
   if (gameListOptShell == NULL) return;
 
@@ -741,9 +728,7 @@ GameListOptionsPopDown()
 }
 
 void
-GameListOptionsCallback(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data, call_data;
+GameListOptionsCallback (Widget w, XtPointer client_data, XtPointer call_data)
 {
     String name;
     Arg args[16];
@@ -794,7 +779,7 @@ GameListOptionsCallback(w, client_data, call_data)
 }
 
 Widget
-GameListOptionsCreate()
+GameListOptionsCreate ()
 {
     Arg args[16];
     Widget shell, form, viewport, layout;
@@ -895,7 +880,7 @@ GameListOptionsCreate()
 }
 
 void
-GameListOptionsPopUp(Widget w, XEvent *event, String *prms, Cardinal *nprms)
+GameListOptionsPopUp (Widget w, XEvent *event, String *prms, Cardinal *nprms)
 {
   if (gameListOptShell == NULL)
     gameListOptShell = GameListOptionsCreate();