diff options
| author | H.G. Muller <h.g.muller@hccnet.nl> | 2009-09-27 10:35:58 -0700 |
|---|---|---|
| committer | Arun Persaud <arun@nubati.net> | 2009-09-29 22:17:57 -0700 |
| commit | fa8be4a3fc5d81e9ec1f6c218fcf55c95d34fd10 (patch) | |
| tree | b67849a18ee23a90299d35f5249d0b7501c0267b | |
| parent | 924a68f5e5420337060d666bef65ef5917cce4de (diff) | |
| download | xboard-fa8be4a3fc5d81e9ec1f6c218fcf55c95d34fd10.tar.gz | |
allow the result comment as a display item in the game list
| -rw-r--r-- | common.h | 3 | ||||
| -rw-r--r-- | gamelist.c | 21 | ||||
| -rw-r--r-- | winboard/winboard.c | 3 | ||||
| -rw-r--r-- | winboard/winboard.rc | 37 |
4 files changed, 45 insertions, 19 deletions
@@ -615,10 +615,11 @@ typedef struct { #define GLT_TIME_CONTROL 't' #define GLT_VARIANT 'v' #define GLT_OUT_OF_BOOK 'a' +#define GLT_RESULT_COMMENT 'c' /* [HGM] rescom */ #define GLT_DEFAULT_TAGS "eprd" /* Event, players, result, date */ -#define GLT_ALL_TAGS "esdoprwbtva" +#define GLT_ALL_TAGS "esdoprwbtvac" #define PGN_OUT_OF_BOOK "Annotator" @@ -111,6 +111,7 @@ void GameListInitGameInfo(gameInfo) gameInfo->blackRating = -1; /* unknown */ gameInfo->variant = VariantNormal; gameInfo->outOfBook = NULL; + gameInfo->resultDetails = NULL; } @@ -155,6 +156,7 @@ int GameListBuild(f) ListGame *currentListGame = NULL; int error; int offset; + char lastComment[MSG_SIZ]; GameListFree(&gameList); yynewfile(f); @@ -240,6 +242,19 @@ int GameListBuild(f) lastStart = MoveNumberOne; } break; + case WhiteWins: // [HGM] rescom: save last comment as result details + case BlackWins: + case GameIsDrawn: + case GameUnfinished: + if (currentListGame->gameInfo.resultDetails != NULL) { + free(currentListGame->gameInfo.resultDetails); + } + if(yy_text[0] == '{') { char *p; + strcpy(lastComment, yy_text+1); + if(p = strchr(lastComment, '}')) *p = 0; + currentListGame->gameInfo.resultDetails = StrSave(lastComment); + } + break; default: break; } @@ -302,6 +317,9 @@ void ClearGameInfo(gameInfo) if (gameInfo->outOfBook != NULL) { free(gameInfo->outOfBook); } + if (gameInfo->resultDetails != NULL) { + free(gameInfo->resultDetails); + } GameListInitGameInfo(gameInfo); } @@ -381,6 +399,9 @@ char * GameListLine( int number, GameInfo * gameInfo ) case GLT_OUT_OF_BOOK: strncpy( buf, gameInfo->outOfBook ? gameInfo->outOfBook : "?", MAX_FIELD_LEN ); break; + case GLT_RESULT_COMMENT: + strncpy( buf, gameInfo->resultDetails ? gameInfo->resultDetails : "res?", MAX_FIELD_LEN ); + break; default: break; } diff --git a/winboard/winboard.c b/winboard/winboard.c index 4cb6ef4..e270565 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -497,6 +497,7 @@ static int fromX = -1, fromY = -1, toX, toY; // [HGM] moved upstream, so JAWS ca #include "jaws.c"
#else
#define JAWS_INIT
+#define JAWS_ARGS
#define JAWS_ALT_INTERCEPT
#define JAWS_KB_NAVIGATION
#define JAWS_MENU_ITEMS
@@ -919,6 +920,7 @@ ArgDescriptor argDescriptors[] = { { "loadGameFile", ArgFilename, (LPVOID) &appData.loadGameFile, FALSE },
{ "", ArgNone, NULL },
/* keyword arguments */
+ JAWS_ARGS
{ "whitePieceColor", ArgColor, (LPVOID) &whitePieceColor, TRUE },
{ "wpc", ArgColor, (LPVOID) &whitePieceColor, FALSE },
{ "blackPieceColor", ArgColor, (LPVOID) &blackPieceColor, TRUE },
@@ -9408,6 +9410,7 @@ static GLT_Item GLT_ItemInfo[] = { { GLT_TIME_CONTROL,"Time Control" },
{ GLT_VARIANT, "Variant" },
{ GLT_OUT_OF_BOOK,PGN_OUT_OF_BOOK },
+ { GLT_RESULT_COMMENT, "Result Comment" }, // [HGM] rescom
{ 0, 0 }
};
diff --git a/winboard/winboard.rc b/winboard/winboard.rc index bb0927d..ba85b6f 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -393,25 +393,26 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Sounds"
FONT 8, "MS Sans Serif"
BEGIN
- DEFPUSHBUTTON "OK",IDOK,132,86,50,14
- PUSHBUTTON "Cancel",IDCANCEL,188,86,50,14
- LTEXT "Event:",IDC_STATIC,4,7,26,9
+ LTEXT "&Event:",IDC_STATIC,4,7,26,9
COMBOBOX CBO_Sounds,30,4,208,110,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
- CONTROL "No sound",OPT_NoSound,"Button",BS_AUTORADIOBUTTON |
+// GROUPBOX "sound type",IDC_STATIC,8,18,66,62
+ CONTROL "&No sound",OPT_NoSound,"Button",BS_AUTORADIOBUTTON |
WS_GROUP | WS_TABSTOP,12,22,47,10
- CONTROL "Default beep",OPT_DefaultBeep,"Button",
+ CONTROL "&Default beep",OPT_DefaultBeep,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,12,36,57,10
- CONTROL "Built-in sound:",OPT_BuiltInSound,"Button",
+ CONTROL "&Built-in sound:",OPT_BuiltInSound,"Button",
BS_AUTORADIOBUTTON | WS_TABSTOP,12,51,60,10
- COMBOBOX OPT_BuiltInSoundName,76,48,103,109,CBS_DROPDOWNLIST |
- CBS_SORT | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Play",OPT_PlaySound,188,47,50,14
- CONTROL "WAV file:",OPT_WavFile,"Button",BS_AUTORADIOBUTTON |
+ CONTROL "&WAV file:",OPT_WavFile,"Button",BS_AUTORADIOBUTTON |
WS_TABSTOP,12,66,45,10
+ COMBOBOX OPT_BuiltInSoundName,76,48,103,109,CBS_DROPDOWNLIST |
+ CBS_SORT | WS_VSCROLL | WS_TABSTOP | WS_GROUP
EDITTEXT OPT_WavFileName,76,65,103,12,ES_AUTOHSCROLL
- PUSHBUTTON "Browse...",OPT_BrowseSound,188,64,50,14
+ PUSHBUTTON "B&rowse...",OPT_BrowseSound,188,64,50,14
PUSHBUTTON "Defaults",OPT_DefaultSounds,6,86,50,14
+ DEFPUSHBUTTON "OK",IDOK,132,86,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,188,86,50,14
+ PUSHBUTTON "&Play",OPT_PlaySound,188,47,50,14
END
DLG_GeneralOptions DIALOG DISCARDABLE 0, 0, 250, 183
@@ -756,21 +757,21 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,122,28,50,14
END
-DLG_GameListOptions DIALOG DISCARDABLE 0, 0, 206, 140
+DLG_GameListOptions DIALOG DISCARDABLE 0, 0, 206, 150
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Game List Options"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "PGN &Tags:",IDC_GLT,2,2,36,8
- LISTBOX IDC_GameListTags,2,12,158,102,LBS_USETABSTOPS |
+ LISTBOX IDC_GameListTags,2,12,158,112,LBS_USETABSTOPS |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Up",IDC_GLT_Up,164,12,38,14
PUSHBUTTON "&Down",IDC_GLT_Down,164,30,38,14
- PUSHBUTTON "Default",IDC_GLT_Restore,164,82,38,14
- PUSHBUTTON "Factory",IDC_GLT_Default,164,100,38,14
- DEFPUSHBUTTON "OK",IDOK,96,122,50,14
- PUSHBUTTON "Cancel",IDCANCEL,152,122,50,14
- LTEXT "Restore to:",IDC_GLT_RestoreTo,164,70,36,8
+ PUSHBUTTON "Default",IDC_GLT_Restore,164,92,38,14
+ PUSHBUTTON "Factory",IDC_GLT_Default,164,110,38,14
+ DEFPUSHBUTTON "OK",IDOK,96,132,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,152,132,50,14
+ LTEXT "Restore to:",IDC_GLT_RestoreTo,164,80,36,8
END
DLG_MoveHistory DIALOGEX 0, 0, 225, 130
|
