From: H.G. Muller Date: Tue, 16 Feb 2010 18:44:46 +0000 (+0100) Subject: Make Chat Windows pseudo-tabbed X-Git-Tag: master-20100221~15 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=b42a7598bf84b00ff82160234839d7b1c9f3f329 Make Chat Windows pseudo-tabbed By adding buttons in every Chat Box to navigate directly to every other Chat Box, a stacked set of Chat Windows behaves like a single tabbed window, but can still be unstacked. The buttons turn grey to warn that new text appeared in hidden boxes (i.e. not the one last brought to top). --- diff --git a/common.h b/common.h index 745ceac..35c04c8 100644 --- a/common.h +++ b/common.h @@ -717,7 +717,7 @@ extern WindowPlacement wpGameList; extern WindowPlacement wpTags; // [HGM] chat -#define MAX_CHAT 3 +#define MAX_CHAT 5 extern int chatCount; extern char chatPartner[MAX_CHAT][MSG_SIZ]; diff --git a/winboard/resource.h b/winboard/resource.h index 9092c29..f6a1f5f 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -507,6 +507,10 @@ #define IDC_Clear 1725 #define IDC_Send 1726 #define IDM_NewChat 1727 +#define IDC_Focus1 1730 +#define IDC_Focus2 1731 +#define IDC_Focus3 1732 +#define IDC_Focus4 1733 #define IDC_SPECIFY_ENG_STATIC 1814 #define IDC_SPECIFY_SERVER_STATIC 1815 #define OPT_MESS 1818 diff --git a/winboard/wchat.c b/winboard/wchat.c index 8d53d7c..3b90b2c 100644 --- a/winboard/wchat.c +++ b/winboard/wchat.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "common.h" #include "frontend.h" @@ -41,6 +42,7 @@ #include "wsnap.h" int chatCount; +static int onTop; extern char chatPartner[MAX_CHAT][MSG_SIZ]; HANDLE chatHandle[MAX_CHAT]; static WNDPROC chatInputWindowProc; @@ -62,6 +64,7 @@ extern HINSTANCE hInst; extern HWND hwndMain; extern WindowPlacement wpChat[MAX_CHAT]; +extern WindowPlacement wpConsole; extern BoardSize boardSize; @@ -192,7 +195,15 @@ LRESULT CALLBACK ChatProc( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam sprintf(buf, "Chat Window %s", first.tidy); SetWindowText(hDlg, buf); } -// chatPartner[partner][0] = 0; + for(i=0; ipartner), chatPartner[i]); + } else EnableWindow( GetDlgItem(hDlg, IDC_Focus1+i-(i>partner)), 1 ); + for(i=0; i= partner) i++; + onTop = i; + SetFocus(GetDlgItem(hDlg, IDC_Send)); + if(chatHandle[i]) { + int j; + for(j=0; j