Adjusted alternative joining method to obey keepLineBreaksICS
[xboard.git] / xoptions.c
index 342246c..969a97d 100644 (file)
@@ -80,7 +80,6 @@ extern char *getenv();
 
 extern void SendToProgram P((char *message, ChessProgramState *cps));
 
-
 extern Widget formWidget, shellWidget, boardWidget, menuBarWidget;
 extern Display *xDisplay;
 extern int squareSize;
@@ -1082,7 +1081,7 @@ void NewVariantPopUp()
                                  "for missing bitmaps. (See manual.)")); j++;
     XtCreateManagedWidget("warning", labelWidgetClass, form, args, j);
 
-    XtRealizeWidget(popup);
+           XtRealizeWidget(popup);
     CatchDeleteWindow(popup, "NewVariantPopDown");
     
     XQueryPointer(xDisplay, xBoardWindow, &root, &child,
@@ -1476,7 +1475,7 @@ void CreateComboPopup(parent, name, n, mb)
 void SettingsPopUp(ChessProgramState *cps)
 {
     Arg args[16];
-    Widget popup, layout, dialog, edit, form, oldform, last, b_ok, b_cancel, leftMargin = NULL;
+    Widget popup, layout, dialog, edit=NULL, form, oldform, last, b_ok, b_cancel, leftMargin = NULL;
     Window root, child;
     int x, y, i, j, height, width, h, c;
     int win_x, win_y;
@@ -1490,7 +1489,7 @@ void SettingsPopUp(ChessProgramState *cps)
 
     if(cps->nrOptions > 50) width = 4; else if(cps->nrOptions>24) width = 2; else width = 1;
     height = cps->nrOptions / width + 1;
-    i = 0;
+     i = 0;
     XtSetArg(args[i], XtNresizable, True); i++;
     SettingsShell = popup =
       XtCreatePopupShell(_("Settings Menu"), transientShellWidgetClass,
@@ -1508,7 +1507,7 @@ void SettingsPopUp(ChessProgramState *cps)
     XtSetArg(args[j], XtNfromHoriz, leftMargin);  j++;
     XtSetValues(form, args, j);
     leftMargin = form;
-
     last = NULL;
     for(h=0; h<height; h++) {
        i = h + c*height;
@@ -1628,7 +1627,7 @@ void SettingsPopUp(ChessProgramState *cps)
     SettingsUp = True;
 
     previous = NULL;
-    SetFocus(edit, popup, (XEvent*) NULL, False);
+    if(edit)SetFocus(edit, popup, (XEvent*) NULL, False);
 }
 
 void FirstSettingsProc(w, event, prms, nprms)
@@ -1649,107 +1648,10 @@ void SecondSettingsProc(w, event, prms, nprms)
    SettingsPopUp(&second);
 }
 
-//--------------------------- General Popup for Cloning ----------------------------------
-#if 0
-int XXXUp;
-Widget XXXShell;
+//---------------------------- Chat Windows ----------------------------------------------
 
-void XXXPopDown()
+void OutputChatMessage(int partner, char *mess)
 {
-    if (!XXXUp) return;
-    XtPopdown(XXXShell);
-    XtDestroyWidget(XXXShell);
-    XXXUp = False;
-    ModeHighlight();
+    return; // dummy
 }
 
-void XXXCallback(w, client_data, call_data)
-     Widget w;
-     XtPointer client_data, call_data;
-{
-    String name;
-    Widget w2;
-    Arg args[16];
-    char buf[80];
-    
-    XtSetArg(args[0], XtNlabel, &name);
-    XtGetValues(w, args, 1);
-    
-    if (strcmp(name, _("cancel")) == 0) {
-        XXXPopDown();
-        return;
-    }
-    if (strcmp(name, _("ok")) == 0) {
-       int nr; String name;
-        name = XawDialogGetValueString(w2 = XtParent(w));
-       if(sscanf(name ,"%d",&nr) != 1) {
-           sprintf(buf, "%d", appData.defaultFrcPosition);
-           XtSetArg(args[0],XtNvalue, buf); // erase bad (non-numeric) value
-           XtSetValues(w2, args, 1);
-           return;
-       }
-        XXXPopDown();
-        return;
-    }
-}
-
-void XXXPopUp()
-{
-    Arg args[16];
-    Widget popup, layout, dialog, edit;
-    Window root, child;
-    int x, y, i;
-    int win_x, win_y;
-    unsigned int mask;
-    char def[80];
-    
-    i = 0;
-    XtSetArg(args[i], XtNresizable, True); i++;
-    XtSetArg(args[i], XtNwidth, DIALOG_SIZE); i++;
-    XXXShell = popup =
-      XtCreatePopupShell(_("XXX Menu"), transientShellWidgetClass,
-                        shellWidget, args, i);
-    
-    layout =
-      XtCreateManagedWidget(layoutName, formWidgetClass, popup,
-                           layoutArgs, XtNumber(layoutArgs));
-  
-    sprintf(def, "%d\n", appData.defaultFrcPosition);
-    i = 0;
-    XtSetArg(args[i], XtNlabel, ""); i++;
-    XtSetArg(args[i], XtNvalue, def); i++;
-    XtSetArg(args[i], XtNborderWidth, 0); i++;
-    dialog = XtCreateManagedWidget("XXX", dialogWidgetClass,
-                                  layout, args, i);
-    
-    XawDialogAddButton(dialog, _("ok"), XXXCallback, (XtPointer) dialog);
-    XawDialogAddButton(dialog, _("cancel"), XXXCallback, (XtPointer) dialog);
-    
-    XtRealizeWidget(popup);
-    CatchDeleteWindow(popup, "XXXPopDown");
-    
-    XQueryPointer(xDisplay, xBoardWindow, &root, &child,
-                 &x, &y, &win_x, &win_y, &mask);
-    
-    XtSetArg(args[0], XtNx, x - 10);
-    XtSetArg(args[1], XtNy, y - 30);
-    XtSetValues(popup, args, 2);
-    
-    XtPopup(popup, XtGrabExclusive);
-    XXXUp = True;
-    
-    edit = XtNameToWidget(dialog, "*value");
-
-    previous = NULL;
-    SetFocus(engThreshold, popup, (XEvent*) NULL, False);
-}
-
-void XXXMenuProc(w, event, prms, nprms)
-     Widget w;
-     XEvent *event;
-     String *prms;
-     Cardinal *nprms;
-{
-   XXXPopUp();
-}
-#endif