X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=nhistory.c;h=9d6a073219f7fdd2da2b8f307c6a9d60d26aa2da;hb=0aa6203676d6c3e1bfb8fb6a17d801ebecf4c317;hp=2cddab6b5dc087bf79f5506555c195ecd10a83b4;hpb=21a44c336aa8cd16a38f3c682386528c8f112650;p=xboard.git diff --git a/nhistory.c b/nhistory.c index 2cddab6..9d6a073 100644 --- a/nhistory.c +++ b/nhistory.c @@ -62,10 +62,24 @@ AppendToHistoryMemo (char * text, int bold, int colorNr) return AppendText(&historyOptions[0], text); // for now ignore bold & color stuff, as Xaw cannot handle that } +void +HighlightMove (int from, int to, Boolean highlight) +{ + HighlightText (&historyOptions[0], from, to, highlight); +} + char *historyText; +int +SelectMove (Option *opt, int n, int x, int y, char *text, int index) +{ + if(n != 3 && n != 1) return FALSE; // only on button-1 and 3 press + FindMoveByCharIndex( index ); // [HGM] also does the actual moving to it, now + return (n == 3); // suppress context menu for button 3, but allow selection with button 1 +} + Option historyOptions[] = { -{ 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 400, NULL, (void*) &historyText, "", NULL, TextBox, "" }, +{ 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 400, NULL, (void*) &historyText, NULL, (char**) &SelectMove, TextBox, "" }, { 0, NO_OK, 0, NULL, (void*) NULL, "", NULL, EndMark , "" } };