X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=311d7f1736163acbcb3f410831694187a887dd01;hb=ad44a402a550a5697a8124b6307235a5d6188a96;hp=dc74e22fd422ec6050b141fac3b0c81875ed8b57;hpb=4e062d14429ed3a3a251c971690bade4c8cba946;p=xboard.git diff --git a/xboard.c b/xboard.c index dc74e22..311d7f1 100644 --- a/xboard.c +++ b/xboard.c @@ -540,6 +540,7 @@ int squareSize, smallLayout = 0, tinyLayout = 0, ICSInputBoxUp = False, askQuestionUp = False, filenameUp = False, promotionUp = False, pmFromX = -1, pmFromY = -1, errorUp = False, errorExitStatus = -1, lineGap, defaultLineGap; +Dimension textHeight; Pixel timerForegroundPixel, timerBackgroundPixel; Pixel buttonForegroundPixel, buttonBackgroundPixel; char *chessDir, *programName, *programVersion, @@ -960,7 +961,7 @@ XtActionsRec boardActions[] = { { "EvalGraphProc", EvalGraphProc}, // [HGM] Winboard_x avaluation graph window { "ShowGameListProc", ShowGameListProc }, { "ShowMoveListProc", HistoryShowProc}, - { "EditTagsProc", EditCommentProc }, + { "EditTagsProc", EditTagsProc }, { "EditBookProc", EditBookProc }, { "EditCommentProc", EditCommentProc }, { "IcsInputBoxProc", IcsInputBoxProc }, @@ -1116,11 +1117,7 @@ char globalTranslations[] = :F1: ManProc() \n \ :F2: FlipViewProc() \n \ :Return: TempBackwardProc() \n \ - :Return: TempForwardProc() \n \ - :Ctrl1: AskQuestionProc(\"Direct command\",\ - \"Send to chess program:\",,1) \n \ - :Ctrl2: AskQuestionProc(\"Direct command\",\ - \"Send to second chess program:\",,2) \n"; + :Return: TempForwardProc() \n"; char boardTranslations[] = ": HandleUserMove(0) \n \ @@ -1821,7 +1818,7 @@ InitDrawingSizes (BoardSize boardSize, int flags) } } #if HAVE_LIBXPM - if(appData.monoMode == oldMono) + if(appData.monoMode != oldMono) CreateAnimVars(); #endif oldMono = appData.monoMode; @@ -2318,6 +2315,8 @@ XBoard square size (hint): %d\n\ XtSetArg(args[0], XtNtop, XtChainTop); XtSetArg(args[1], XtNbottom, XtChainTop); XtSetValues(messageWidget, args, 2); + XtSetArg(args[0], XtNheight, &textHeight); // [HGM] get height for use in generic popup + XtGetValues(messageWidget, args, 1); widgetList[j++] = boardWidget = XtCreateWidget("board", widgetClass, formWidget, boardArgs, @@ -4217,6 +4216,8 @@ SetHighlights (int fromX, int fromY, int toX, int toY) drawHighlight(toX, toY, highlineGC); } } + if(toX<0) // clearing the highlights must have damaged arrow + DrawArrowHighlight(hi1X, hi1Y, hi2X, hi2Y); // for now, redraw it (should really be cleared!) hi1X = fromX; hi1Y = fromY; hi2X = toX; @@ -8594,11 +8595,25 @@ DrawArrowBetweenPoints (int s_x, int s_y, int d_x, int d_y) // Polygon( hdc, arrow, 7 ); } +void +ArrowDamage (int s_col, int s_row, int d_col, int d_row) +{ + int hor, vert, i; + hor = 64*s_col + 32; vert = 64*s_row + 32; + for(i=0; i<= 64; i++) { + damage[0][vert+6>>6][hor+6>>6] = True; + damage[0][vert-6>>6][hor+6>>6] = True; + damage[0][vert+6>>6][hor-6>>6] = True; + damage[0][vert-6>>6][hor-6>>6] = True; + hor += d_col - s_col; vert += d_row - s_row; + } +} + /* [AS] Draw an arrow between two squares */ void DrawArrowBetweenSquares (int s_col, int s_row, int d_col, int d_row) { - int s_x, s_y, d_x, d_y, hor, vert, i; + int s_x, s_y, d_x, d_y; if( s_col == d_col && s_row == d_row ) { return; @@ -8635,15 +8650,7 @@ DrawArrowBetweenSquares (int s_col, int s_row, int d_col, int d_row) A_WIDTH = squareSize / 14.; //[HGM] make float DrawArrowBetweenPoints( s_x, s_y, d_x, d_y ); - - hor = 64*s_col + 32; vert = 64*s_row + 32; - for(i=0; i<= 64; i++) { - damage[0][vert+6>>6][hor+6>>6] = True; - damage[0][vert-6>>6][hor+6>>6] = True; - damage[0][vert+6>>6][hor-6>>6] = True; - damage[0][vert-6>>6][hor-6>>6] = True; - hor += d_col - s_col; vert += d_row - s_row; - } + ArrowDamage(s_col, s_row, d_col, d_row); } Boolean