Fix disabling of Chat Box navigation buttons
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 26 Mar 2010 17:26:04 +0000 (18:26 +0100)
committerArun Persaud <arun@nubati.net>
Sat, 27 Mar 2010 18:37:05 +0000 (11:37 -0700)
The buttons for non-open boxes were enabed, rather than disabled.

winboard/wchat.c

index 81e190d..a387466 100644 (file)
@@ -195,13 +195,14 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
                sprintf(buf, "Chat Window %s", first.tidy);\r
                SetWindowText(hDlg, buf);\r
         }\r
-       for(i=0; i<MAX_CHAT; i++) if(chatHandle[i] && i != partner) {\r
+       for(i=0; i<MAX_CHAT; i++) if(chatHandle[i]) {
+           if(i == partner) continue;\r
            // set our button in other open chats\r
            SetDlgItemText(chatHandle[i], IDC_Focus1+partner-(i<partner), chatPartner[partner]);\r
            EnableWindow( GetDlgItem(chatHandle[i], IDC_Focus1+partner-(i<partner)), 1 );\r
            // and buttons for other chats in ours\r
            SetDlgItemText(hDlg, IDC_Focus1+i-(i>partner), chatPartner[i]);\r
-       } else EnableWindow( GetDlgItem(hDlg, IDC_Focus1+i-(i>partner)), 1 );\r
+       } else EnableWindow( GetDlgItem(hDlg, IDC_Focus1+i-(i>partner)), 0 );\r
        for(i=0; i<MAX_CHAT-1; i++) { Button_SetStyle(GetDlgItem(hDlg, IDC_Focus1+i), BS_PUSHBUTTON|BS_LEFT, TRUE); }\r
         SetWindowPos(hDlg, NULL, wpConsole.x, wpConsole.y, 0, 0, SWP_NOZORDER|SWP_NOSIZE);\r
        SendMessage( GetDlgItem(hDlg, IDC_ChatPartner), // [HGM] clickbox: initialize with requested handle\r