Fix multi-leg promotions
[xboard.git] / winboard / jaws.c
index ce056ef..aa843ad 100644 (file)
@@ -5,7 +5,8 @@
  * Massachusetts.\r
  *\r
  * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,\r
- * 2007, 2008, 2009, 2010 Free Software Foundation, Inc.\r
+ * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free\r
+ * Software Foundation, Inc.\r
  *\r
  * XBoard borrows its colors and the bitmaps.xchess bitmap set from XChess,\r
  * which was written and is copyrighted by Wayne Christopher.\r
@@ -166,7 +167,7 @@ VOID SayString(char *mess, BOOL flag)
         int l = strlen(buf);\r
        if(appData.debugMode) fprintf(debugFP, "SAY '%s'\n", mess);\r
         if(l) buf[l++] = ' '; // separate by space from previous\r
-       safeStrCpy(buf+l, mess, 8000-1-l); // buffer\r
+       safeStrCpy(buf+l, _(mess), 8000-1-l); // buffer\r
         if(!flag) return; // wait for flush\r
        if(p = StrCaseStr(buf, "Xboard adjudication:")) {\r
                int i;\r
@@ -240,7 +241,7 @@ AdaptMenu()
            if(menuItemJAWS[i].name[0] == '-')\r
                 AppendMenu(menuJAWS, MF_SEPARATOR, (UINT_PTR) 0, NULL);\r
            else AppendMenu(menuJAWS, MF_ENABLED|MF_STRING,\r
-                       (UINT_PTR) menuItemJAWS[i].code, (LPCTSTR) menuItemJAWS[i].name);\r
+                       (UINT_PTR) menuItemJAWS[i].code, (LPCTSTR) _(menuItemJAWS[i].name));\r
        }\r
        InsertMenu(menuMain, 7, MF_BYPOSITION|MF_POPUP|MF_ENABLED|MF_STRING,\r
                (UINT_PTR) menuJAWS, "&JAWS");\r
@@ -270,7 +271,7 @@ InitJAWS()
 \r
                AdaptMenu();\r
                menuBarText[0][8] = menuBarText[0][7]; menuBarText[0][7] = "&JAWS";\r
-               for(i=0; i<9; i++) menuBarText[1][i] = menuBarText[0][i];\r
+               for(i=0; i<9; i++) menuBarText[2][i] = menuBarText[1][i] = menuBarText[0][i];\r
        }\r
 \r
        hAccelJAWS = CreateAcceleratorTable(acceleratorsJAWS, 14);\r
@@ -1240,9 +1241,8 @@ NiceTime(int x)
       }\\r
       return 0;\\r
 \r
-#define JAWS_KB_NAVIGATION \\r
+#define JAWS_KBDOWN_NAVIGATION \\r
 \\r
-       case WM_KEYDOWN:\\r
 \\r
                if(GetKeyState(VK_MENU) < 0 && GetKeyState(VK_CONTROL) < 0) {\\r
                    /* Control + Alt + letter used for speaking piece positions */\\r
@@ -1275,17 +1275,17 @@ NiceTime(int x)
                        KeyboardEvent(hwnd, message, wParam, lParam);\\r
                        break;\\r
                case VK_SPACE:\\r
+                        shiftKey = GetKeyState(VK_SHIFT) < 0;\\r
                        KeyboardMove(hwnd, message, wParam, lParam);\\r
                        break;\\r
                }\\r
-               break;\\r
-       case WM_KEYUP:\\r
+\r
+#define JAWS_KBUP_NAVIGATION \\r
                switch (wParam) {\\r
                case VK_SPACE:\\r
                        KeyboardMove(hwnd, message, wParam, lParam);\\r
                        break;\\r
                }\\r
-               break;\\r
 \r
 #define JAWS_MENU_ITEMS \\r
                case IDM_PossibleAttackMove:  /*What can I possible attack from here */\\r