Fix Shogi promotion popup
authorH.G. Muller <h.g.muller@hccnet.nl>
Sat, 27 Nov 2010 13:38:14 +0000 (14:38 +0100)
committerArun Persaud <arun@nubati.net>
Fri, 3 Dec 2010 07:14:23 +0000 (23:14 -0800)
The texts were adapted to shogi by printing new text items over the
Queen and Knight buttons, but these did not alwys cover it. Now the text
on the buttons is changed as it should be. Also the window title is
adapted.

winboard/winboard.c
winboard/winboard.rc

index 08cafb9..f05e680 100644 (file)
@@ -4307,12 +4307,11 @@ Promotion(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     ShowWindow(GetDlgItem(hDlg, PB_Bishop), \r
        gameInfo.variant != VariantShogi ?\r
               SW_SHOW : SW_HIDE);\r
-    ShowWindow(GetDlgItem(hDlg, IDC_Yes), \r
-       gameInfo.variant == VariantShogi ?\r
-              SW_SHOW : SW_HIDE);\r
-    ShowWindow(GetDlgItem(hDlg, IDC_No), \r
-       gameInfo.variant == VariantShogi ?\r
-              SW_SHOW : SW_HIDE);\r
+    if(gameInfo.variant == VariantShogi) {\r
+        SetDlgItemText(hDlg, PB_Queen, "YES");\r
+        SetDlgItemText(hDlg, PB_Knight, "NO");\r
+        SetWindowText(hDlg, "Promote?");\r
+    }\r
     ShowWindow(GetDlgItem(hDlg, IDC_Centaur), \r
        gameInfo.variant == VariantSuper ?\r
               SW_SHOW : SW_HIDE);\r
index b679327..2390a52 100644 (file)
@@ -212,8 +212,6 @@ BEGIN
     PUSHBUTTON      "K&night",PB_Knight,139,23,40,14,NOT WS_TABSTOP\r
     PUSHBUTTON      "&King",PB_King,4,4,40,14,NOT WS_TABSTOP\r
     PUSHBUTTON      "&Cancel",IDCANCEL,139,4,40,14,WS_GROUP\r
-    LTEXT           "      YES",IDC_Yes,6,25,36,10\r
-    LTEXT           "       NO",IDC_No,141,25,36,10\r
     LTEXT           "C&entaur",IDC_Centaur,12,6,25,10\r
 END\r
 \r