X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=6eca9146697da188b443e97ddb88d086192cb60c;hb=f5d26e9d980c67de39d3525802afb9d99f6fb5e8;hp=e0a6969061741f7972b626e7dd530e418fa2712e;hpb=0e642a2b9658ccaef62bf668f9d51598ee3a7deb;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index e0a6969..6eca914 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -1906,6 +1906,7 @@ ResizeBoard(int newSizeX, int newSizeY, int flags) } +extern Boolean twoBoards, partnerUp; // [HGM] dual VOID InitDrawingSizes(BoardSize boardSize, int flags) @@ -2041,6 +2042,7 @@ InitDrawingSizes(BoardSize boardSize, int flags) winW = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN; winH = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CYCAPTION) + boardRect.bottom + OUTER_MARGIN; + winW *= 1 + twoBoards; if(suppressVisibleEffects) return; // [HGM] when called for filling sizeInfo only wpMain.width = winW; // [HGM] placement: set through temporary which can used by initial sizing choice wpMain.height = winH; // without disturbing window attachments @@ -3181,6 +3183,7 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) if( DrawPositionNeedsFullRepaint() ) { fullrepaint = TRUE; } + if(twoBoards) fullrepaint = TRUE; // [HGM] dual: our memory of last-drawn will be all wrong if (board == NULL) { if (!lastReqValid) { @@ -3486,7 +3489,7 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) * This way we avoid any flickering */ oldBitmap = SelectObject(tmphdc, bufferBitmap); - BitBlt(hdc, boardRect.left, boardRect.top, + BitBlt(hdc, boardRect.left + twoBoards*partnerUp*wpMain.width/2, boardRect.top, // [HGM] dual boardRect.right - boardRect.left, boardRect.bottom - boardRect.top, tmphdc, boardRect.left, boardRect.top, SRCCOPY); @@ -5855,6 +5858,7 @@ CommentDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) sizeY = newSizeY; } } + SendDlgItemMessage( hDlg, OPT_CommentText, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS ); return FALSE; case WM_COMMAND: /* message: received a command */ @@ -5899,6 +5903,36 @@ CommentDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } break; + case WM_NOTIFY: // [HGM] vari: cloned from whistory.c + if( wParam == OPT_CommentText ) { + MSGFILTER * lpMF = (MSGFILTER *) lParam; + + if( lpMF->msg == WM_RBUTTONDOWN && (lpMF->wParam & (MK_CONTROL | MK_SHIFT)) == 0 ) { + POINTL pt; + LRESULT index; + + pt.x = LOWORD( lpMF->lParam ); + pt.y = HIWORD( lpMF->lParam ); + + index = SendDlgItemMessage( hDlg, OPT_CommentText, EM_CHARFROMPOS, 0, (LPARAM) &pt ); + + hwndText = GetDlgItem(hDlg, OPT_CommentText); // cloned from above + len = GetWindowTextLength(hwndText); + str = (char *) malloc(len + 1); + GetWindowText(hwndText, str, len + 1); + ReplaceComment(commentIndex, str); + if(commentIndex != currentMove) ToNrEvent(commentIndex); + LoadVariation( index, str ); // [HGM] also does the actual moving to it, now + free(str); + + /* Zap the message for good: apparently, returning non-zero is not enough */ + lpMF->msg = WM_USER; + + return TRUE; + } + } + break; + case WM_SIZE: newSizeX = LOWORD(lParam); newSizeY = HIWORD(lParam); @@ -8090,7 +8124,7 @@ VOID CommentPopUp(char *title, char *str) { HWND hwnd = GetActiveWindow(); - EitherCommentPopUp(0, title, str, FALSE); + EitherCommentPopUp(currentMove, title, str, FALSE); // [HGM] vari: fake move index, rather than 0 SAY(str); SetActiveWindow(hwnd); }