Move MarkMenuItem to xoptions.c
[xboard.git] / xboard.c
index c6f0c80..6bc77cc 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -1582,18 +1582,6 @@ ReadBitmap (Pixmap *pm, String name, unsigned char bits[], u_int wreq, u_int hre
 }
 
 void
-MarkMenuItem (char *menuRef, int state)
-{
-    MenuItem *item = MenuNameToItem(menuRef);
-
-    if(item) {
-       Arg args[2];
-       XtSetArg(args[0], XtNleftBitmap, state ? xMarkPixmap : None);
-       XtSetValues(item->handle, args, 1);
-    }
-}
-
-void
 EnableNamedMenuItem (char *menuRef, int state)
 {
     MenuItem *item = MenuNameToItem(menuRef);
@@ -1724,7 +1712,7 @@ CoDrag (Widget sh, WindowPlacement *wp)
 void
 ReSize (WindowPlacement *wp)
 {
-       int sqx, sqy;
+       int sqx, sqy, w, h;
        if(wp->width == wpMain.width && wp->height == wpMain.height) return; // not sized
        sqx = (wp->width  - lineGap - marginW) / BOARD_WIDTH - lineGap;
        sqy = (wp->height - lineGap - marginH) / BOARD_HEIGHT - lineGap;
@@ -1734,6 +1722,10 @@ ReSize (WindowPlacement *wp)
            CreatePNGPieces(); // make newly scaled pieces
            InitDrawingSizes(0, 0); // creates grid etc.
        } else ResizeBoardWindow(BOARD_WIDTH * (squareSize + lineGap) + lineGap, BOARD_HEIGHT * (squareSize + lineGap) + lineGap, 0);
+       w = BOARD_WIDTH * (squareSize + lineGap) + lineGap;
+       h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap;
+       if(optList[W_BOARD].max   > w) optList[W_BOARD].max = w;
+       if(optList[W_BOARD].value > h) optList[W_BOARD].value = h;
 }
 
 static XtIntervalId delayedDragID = 0;