}\r
\r
\r
+extern Boolean twoBoards, partnerUp; // [HGM] dual\r
\r
VOID\r
InitDrawingSizes(BoardSize boardSize, int flags)\r
winW = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN;\r
winH = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) +\r
GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN;\r
+ winW *= 1 + twoBoards;\r
if(suppressVisibleEffects) return; // [HGM] when called for filling sizeInfo only\r
wpMain.width = winW; // [HGM] placement: set through temporary which can used by initial sizing choice\r
wpMain.height = winH; // without disturbing window attachments\r
if( DrawPositionNeedsFullRepaint() ) {\r
fullrepaint = TRUE;\r
}\r
+ if(twoBoards) fullrepaint = TRUE; // [HGM] dual: our memory of last-drawn will be all wrong\r
\r
if (board == NULL) {\r
if (!lastReqValid) {\r
* This way we avoid any flickering\r
*/\r
oldBitmap = SelectObject(tmphdc, bufferBitmap);\r
- BitBlt(hdc, boardRect.left, boardRect.top,\r
+ BitBlt(hdc, boardRect.left + twoBoards*partnerUp*wpMain.width/2, boardRect.top, // [HGM] dual\r
boardRect.right - boardRect.left,\r
boardRect.bottom - boardRect.top,\r
tmphdc, boardRect.left, boardRect.top, SRCCOPY);\r
sizeY = newSizeY;\r
}\r
}\r
+ SendDlgItemMessage( hDlg, OPT_CommentText, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS );\r
return FALSE;\r
\r
case WM_COMMAND: /* message: received a command */\r
}\r
break;\r
\r
+ case WM_NOTIFY: // [HGM] vari: cloned from whistory.c\r
+ if( wParam == OPT_CommentText ) {\r
+ MSGFILTER * lpMF = (MSGFILTER *) lParam;\r
+\r
+ if( lpMF->msg == WM_RBUTTONDOWN && (lpMF->wParam & (MK_CONTROL | MK_SHIFT)) == 0 ) {\r
+ POINTL pt;\r
+ LRESULT index;\r
+\r
+ pt.x = LOWORD( lpMF->lParam );\r
+ pt.y = HIWORD( lpMF->lParam );\r
+\r
+ index = SendDlgItemMessage( hDlg, OPT_CommentText, EM_CHARFROMPOS, 0, (LPARAM) &pt );\r
+\r
+ hwndText = GetDlgItem(hDlg, OPT_CommentText); // cloned from above\r
+ len = GetWindowTextLength(hwndText);\r
+ str = (char *) malloc(len + 1);\r
+ GetWindowText(hwndText, str, len + 1);\r
+ ReplaceComment(commentIndex, str);\r
+ if(commentIndex != currentMove) ToNrEvent(commentIndex);\r
+ LoadVariation( index, str ); // [HGM] also does the actual moving to it, now\r
+ free(str);\r
+\r
+ /* Zap the message for good: apparently, returning non-zero is not enough */\r
+ lpMF->msg = WM_USER;\r
+\r
+ return TRUE;\r
+ }\r
+ }\r
+ break;\r
+\r
case WM_SIZE:\r
newSizeX = LOWORD(lParam);\r
newSizeY = HIWORD(lParam);\r
CommentPopUp(char *title, char *str)\r
{\r
HWND hwnd = GetActiveWindow();\r
- EitherCommentPopUp(0, title, str, FALSE);\r
+ EitherCommentPopUp(currentMove, title, str, FALSE); // [HGM] vari: fake move index, rather than 0\r
SAY(str);\r
SetActiveWindow(hwnd);\r
}\r