From a6ecdd0f9ee3edcf74752582404036094b2f4ea0 Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 9 May 2009 16:01:44 +0000 Subject: [PATCH] merge revisions 2443 2446 2447 2450 2451 2452 2454 2456 2469 2498 2499 2509 2513 2514 2515 2516 2517 2518 2519 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 and 2544 from trunk with the goal of adding localization support to this branch so that it can be released before all the networking stuff on trunk is debugged. --- xwords4/common/board.c | 8 +- xwords4/common/comms.c | 51 +- xwords4/common/engine.c | 2 +- xwords4/common/mempool.c | 4 +- xwords4/common/memstream.c | 4 +- xwords4/common/model.c | 2 +- xwords4/common/model.h | 10 +- xwords4/common/mscore.c | 58 +- xwords4/common/scorebdp.c | 34 +- xwords4/common/server.c | 46 +- xwords4/common/xwstream.h | 6 +- xwords4/linux/Makefile | 4 +- xwords4/linux/gtkmain.c | 4 +- xwords4/linux/linuxmain.c | 4 +- xwords4/linux/linuxutl.c | 4 +- xwords4/relay/Makefile | 3 +- xwords4/wince/Makefile | 29 +- xwords4/wince/ceaskpwd.c | 21 +- xwords4/wince/ceclrsel.c | 13 +- xwords4/wince/cecondlg.c | 2 +- xwords4/wince/cedict.c | 28 +- xwords4/wince/cedraw.c | 39 +- xwords4/wince/cefonts.c | 2 +- xwords4/wince/ceginfo.c | 19 +- xwords4/wince/cemain.c | 456 ++++++++---- xwords4/wince/cemain.h | 9 +- xwords4/wince/ceprefs.c | 23 +- xwords4/wince/ceresstr.c | 341 +++++++++ xwords4/wince/ceresstr.h | 38 + xwords4/wince/cestrbx.h | 2 +- xwords4/wince/cesvdgms.c | 44 +- xwords4/wince/ceutil.c | 92 ++- xwords4/wince/ceutil.h | 3 + xwords4/wince/l10n/xwords4_caps.rc | 993 +++++++++++++++++++++++++ xwords4/wince/l10n/xwords4_french.rc | 1005 ++++++++++++++++++++++++++ xwords4/wince/rc_incs.h | 24 + xwords4/wince/resource.h | 35 +- xwords4/wince/scripts/makezip.sh | 2 +- xwords4/wince/strids.h | 127 ++++ xwords4/wince/xptypes.h | 2 + xwords4/wince/xwords4.rc | 301 +++++--- 41 files changed, 3409 insertions(+), 485 deletions(-) create mode 100644 xwords4/wince/ceresstr.c create mode 100644 xwords4/wince/ceresstr.h create mode 100644 xwords4/wince/l10n/xwords4_caps.rc create mode 100644 xwords4/wince/l10n/xwords4_french.rc create mode 100644 xwords4/wince/rc_incs.h create mode 100644 xwords4/wince/strids.h diff --git a/xwords4/common/board.c b/xwords4/common/board.c index b47448d9a..facd6f548 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -1,4 +1,4 @@ -/* -*- fill-column: 78; compile-command: "cd ../linux && make -j MEMDEBUG=TRUE"; -*- */ +/* -*- fill-column: 78; compile-command: "cd ../linux && make -j3 MEMDEBUG=TRUE"; -*- */ /* * Copyright 1997 - 2008 by Eric House (xwords@eehouse.org). All rights * reserved. @@ -599,10 +599,8 @@ board_commitTurn( BoardCtxt* board ) const XP_UCHAR* str = util_getUserString(board->util, STR_COMMIT_CONFIRM); - - stream_putBytes( stream, (void*)str, - (XP_U16)XP_STRLEN((const char*)str) ); - + stream_catString( stream, str ); + warn = board->util->gameInfo->phoniesAction == PHONIES_WARN; board->badWordRejected = XP_FALSE; diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index cddb1fcf4..1ed04895b 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -744,7 +744,7 @@ addToQueue( CommsCtxt* comms, MsgQueueElem* newMsgElem ) #ifdef DEBUG static void -printQueue( CommsCtxt* comms ) +printQueue( const CommsCtxt* comms ) { MsgQueueElem* elem; short i; @@ -755,6 +755,22 @@ printQueue( CommsCtxt* comms ) i+1, elem->channelNo, elem->msgID ); } } + +static void +assertQueueOk( const CommsCtxt* comms ) +{ + XP_U16 count = 0; + MsgQueueElem* elem; + + for ( elem = comms->msgQueueHead; !!elem; elem = elem->next ) { + ++count; + if ( elem == comms->msgQueueTail ) { + XP_ASSERT( !elem->next ); + break; + } + } + XP_ASSERT( count == comms->queueLen ); +} #endif static void @@ -777,12 +793,15 @@ removeFromQueue( CommsCtxt* comms, XP_PlayerAddr channelNo, MsgID msgID ) __func__, msgID, channelNo, comms->queueLen ); if ( (channelNo == 0) || !!getRecordFor(comms, NULL, channelNo) ) { - MsgQueueElem dummy; - MsgQueueElem* keep = &dummy; - MsgQueueElem* elem; + + MsgQueueElem* elem = comms->msgQueueHead; MsgQueueElem* next; - for ( elem = comms->msgQueueHead; !!elem; elem = next ) { + /* empty the queue so we can add all back again */ + comms->msgQueueHead = comms->msgQueueTail = NULL; + comms->queueLen = 0; + + for ( ; !!elem; elem = next ) { XP_Bool knownGood = XP_FALSE; next = elem->next; @@ -800,15 +819,10 @@ removeFromQueue( CommsCtxt* comms, XP_PlayerAddr channelNo, MsgID msgID ) if ( !knownGood && (elem->msgID <= msgID) ) { freeElem( comms, elem ); - --comms->queueLen; } else { - keep->next = elem; - keep = elem; + addToQueue( comms, elem ); } } - - keep->next = NULL; - comms->msgQueueHead = dummy.next; } XP_STATUSF( "%s: queueLen now %d", __func__, comms->queueLen ); @@ -816,6 +830,7 @@ removeFromQueue( CommsCtxt* comms, XP_PlayerAddr channelNo, MsgID msgID ) XP_ASSERT( comms->queueLen > 0 || comms->msgQueueHead == NULL ); #ifdef DEBUG + assertQueueOk( comms ); printQueue( comms ); #endif } /* removeFromQueue */ @@ -1371,41 +1386,41 @@ comms_getStats( CommsCtxt* comms, XWStreamCtxt* stream ) XP_SNPRINTF( (XP_UCHAR*)buf, sizeof(buf), (XP_UCHAR*)"msg queue len: %d\n", comms->queueLen ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); for ( elem = comms->msgQueueHead; !!elem; elem = elem->next ) { XP_SNPRINTF( buf, sizeof(buf), " - channelNo=%d; msgID=" XP_LD "; len=%d\n", elem->channelNo, elem->msgID, elem->len ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); } XP_SNPRINTF( (XP_UCHAR*)buf, sizeof(buf), (XP_UCHAR*)"channel-less bytes sent: %d\n", comms->nUniqueBytes ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); now = util_getCurSeconds( comms->util ); for ( rec = comms->recs; !!rec; rec = rec->next ) { XP_SNPRINTF( (XP_UCHAR*)buf, sizeof(buf), (XP_UCHAR*)" Stats for channel: %d\n", rec->channelNo ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); XP_SNPRINTF( (XP_UCHAR*)buf, sizeof(buf), (XP_UCHAR*)"Last msg sent: " XP_LD "\n", rec->nextMsgID ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); XP_SNPRINTF( (XP_UCHAR*)buf, sizeof(buf), (XP_UCHAR*)"Unique bytes sent: %d\n", rec->nUniqueBytes ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); XP_SNPRINTF( (XP_UCHAR*)buf, sizeof(buf), (XP_UCHAR*)"Last message acknowledged: %d\n", rec->lastACK); - stream_putString( stream, buf ); + stream_catString( stream, buf ); } } /* comms_getStats */ diff --git a/xwords4/common/engine.c b/xwords4/common/engine.c index aa337e53c..04ea36e3f 100644 --- a/xwords4/common/engine.c +++ b/xwords4/common/engine.c @@ -1,4 +1,4 @@ -/* -*- fill-column: 78; compile-command: "cd ../linux && make -j MEMDEBUG=TRUE"; -*- */ +/* -*- fill-column: 78; compile-command: "cd ../linux && make -j3 MEMDEBUG=TRUE"; -*- */ /* * Copyright 1997 - 2006 by Eric House (xwords@eehouse.org). All rights * reserved. diff --git a/xwords4/common/mempool.c b/xwords4/common/mempool.c index a122fb515..d3b287862 100644 --- a/xwords4/common/mempool.c +++ b/xwords4/common/mempool.c @@ -246,7 +246,7 @@ mpool_stats( MemPoolCtx* mpool, XWStreamCtxt* stream ) "Total number of blocks allocated: %d\n", mpool->nUsed, mpool->nFree, mpool->nAllocs ); if ( !!stream ) { - stream_putString( stream, buf ); + stream_catString( stream, buf ); } else { XP_LOGF( "%s", buf ); } @@ -256,7 +256,7 @@ mpool_stats( MemPoolCtx* mpool, XWStreamCtxt* stream ) (XP_UCHAR*)"%ld byte block allocated at %p, %s: line %ld\n", entry->size, entry->ptr, entry->fileName, entry->lineNo ); if ( !!stream ) { - stream_putString( stream, buf ); + stream_catString( stream, buf ); } else { XP_LOGF( "%s", buf ); } diff --git a/xwords4/common/memstream.c b/xwords4/common/memstream.c index 1e5e59bde..5d8c915fb 100644 --- a/xwords4/common/memstream.c +++ b/xwords4/common/memstream.c @@ -215,7 +215,7 @@ mem_stream_putBytes( XWStreamCtxt* p_sctx, const void* whence, } /* mem_stream_putBytes */ static void -mem_stream_putString( XWStreamCtxt* p_sctx, const char* whence ) +mem_stream_catString( XWStreamCtxt* p_sctx, const char* whence ) { XP_U16 len = XP_STRLEN( whence ); mem_stream_putBytes( p_sctx, (void*)whence, len ); @@ -438,7 +438,7 @@ make_vtable( MemStreamCtxt* stream ) SET_VTABLE_ENTRY( vtable, stream_putU8, mem ); SET_VTABLE_ENTRY( vtable, stream_putBytes, mem ); - SET_VTABLE_ENTRY( vtable, stream_putString, mem ); + SET_VTABLE_ENTRY( vtable, stream_catString, mem ); SET_VTABLE_ENTRY( vtable, stream_putU16, mem ); SET_VTABLE_ENTRY( vtable, stream_putU32, mem ); SET_VTABLE_ENTRY( vtable, stream_putBits, mem ); diff --git a/xwords4/common/model.c b/xwords4/common/model.c index 62f6919ec..754270214 100644 --- a/xwords4/common/model.c +++ b/xwords4/common/model.c @@ -1446,7 +1446,7 @@ notifyDictListeners( ModelCtxt* model, DictionaryCtxt* oldDict, static void printString( XWStreamCtxt* stream, const XP_UCHAR* str ) { - stream_putString( stream, str ); + stream_catString( stream, str ); } /* printString */ static XP_UCHAR* diff --git a/xwords4/common/model.h b/xwords4/common/model.h index 178d77ade..935c818b2 100644 --- a/xwords4/common/model.h +++ b/xwords4/common/model.h @@ -1,6 +1,7 @@ -/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */ +/* -*- fill-column: 78; compile-command: "cd ../linux && make -j3 MEMDEBUG=TRUE"; -*- */ /* - * Copyright 1997 - 2000 by Eric House (xwords@eehouse.org). All rights reserved. + * Copyright 1997 - 2009 by Eric House (xwords@eehouse.org). All rights + * reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -231,8 +232,9 @@ XP_Bool model_checkMoveLegal( ModelCtxt* model, XP_S16 player, XWStreamCtxt* stream, WordNotifierInfo* notifyInfo ); -void model_figureFinalScores( ModelCtxt* model, XP_S16* scores, - XP_S16* tilePenalties ); +typedef struct _ScoresArray { XP_S16 arr[MAX_NUM_PLAYERS]; } ScoresArray; +void model_figureFinalScores( ModelCtxt* model, ScoresArray* scores, + ScoresArray* tilePenalties ); /* figureMoveScore is meant only for the engine's use */ XP_U16 figureMoveScore( const ModelCtxt* model, MoveInfo* moveInfo, diff --git a/xwords4/common/mscore.c b/xwords4/common/mscore.c index 03e254d97..1e4361322 100644 --- a/xwords4/common/mscore.c +++ b/xwords4/common/mscore.c @@ -149,10 +149,10 @@ model_getPlayerScore( ModelCtxt* model, XP_S16 player ) * player. */ void -model_figureFinalScores( ModelCtxt* model, XP_S16* finalScoresP, - XP_S16* tilePenalties ) +model_figureFinalScores( ModelCtxt* model, ScoresArray* finalScoresP, + ScoresArray* tilePenaltiesP ) { - XP_S16 i, j; + XP_S16 ii, jj; XP_S16 penalties[MAX_NUM_PLAYERS]; XP_S16 totalPenalty; XP_U16 nPlayers = model->nPlayers; @@ -162,49 +162,51 @@ model_figureFinalScores( ModelCtxt* model, XP_S16* finalScoresP, DictionaryCtxt* dict = model_getDictionary( model ); CurGameInfo* gi = model->vol.gi; - XP_MEMSET( finalScoresP, 0, sizeof(*finalScoresP) * MAX_NUM_PLAYERS ); + if ( !!finalScoresP ) { + XP_MEMSET( finalScoresP, 0, sizeof(*finalScoresP) ); + } totalPenalty = 0; - for ( player = model->players, i = 0; i < nPlayers; ++player, ++i ) { - tray = model_getPlayerTiles( model, i ); + for ( player = model->players, ii = 0; ii < nPlayers; ++player, ++ii ) { + tray = model_getPlayerTiles( model, ii ); - penalties[i] = 0; + penalties[ii] = 0; /* if there are no tiles left and this guy's the first done, make a note of it in case he's to get a bonus. Note that this assumes only one player can be out of tiles. */ if ( (tray->nTiles == 0) && (firstDoneIndex == -1) ) { - firstDoneIndex = i; + firstDoneIndex = ii; } else { - for ( j = tray->nTiles-1; j >= 0; --j ) { - penalties[i] += dict_getTileValue( dict, tray->tiles[j] ); + for ( jj = tray->nTiles-1; jj >= 0; --jj ) { + penalties[ii] += dict_getTileValue( dict, tray->tiles[jj] ); } } /* include tiles in pending move too for the player whose turn it is. */ - for ( j = player->nPending - 1; j >= 0; --j ) { - Tile tile = player->pendingTiles[j].tile; - penalties[i] += dict_getTileValue(dict, (Tile)(tile & TILE_VALUE_MASK)); + for ( jj = player->nPending - 1; jj >= 0; --jj ) { + Tile tile = player->pendingTiles[jj].tile; + penalties[ii] += dict_getTileValue(dict, + (Tile)(tile & TILE_VALUE_MASK)); } - totalPenalty += penalties[i]; + totalPenalty += penalties[ii]; } /* now total everybody's scores */ - for ( i = 0; i < nPlayers; ++i ) { - XP_S16 score = model_getPlayerScore( model, i ); - XP_S16 penalty; + for ( ii = 0; ii < nPlayers; ++ii ) { + XP_S16 penalty = (ii == firstDoneIndex)? totalPenalty: -penalties[ii]; - penalty = (i == firstDoneIndex)? totalPenalty: -penalties[i]; - finalScoresP[i] = score + penalty; - - if ( !!tilePenalties ) { - tilePenalties[i] = penalty; + if ( !!finalScoresP ) { + XP_S16 score = model_getPlayerScore( model, ii ); + if ( gi->timerEnabled ) { + score -= player_timePenalty( gi, ii ); + } + finalScoresP->arr[ii] = score + penalty; } - if ( gi->timerEnabled ) { - penalty = player_timePenalty( gi, i ); - finalScoresP[i] -= penalty; + if ( !!tilePenaltiesP ) { + tilePenaltiesP->arr[ii] = penalty; } } } /* model_figureFinalScores */ @@ -512,7 +514,7 @@ figureMoveScore( const ModelCtxt* model, MoveInfo* moveInfo, if ( !!stream ) { const XP_UCHAR* bstr = util_getUserString( model->vol.util, STR_BONUS_ALL ); - stream_putString( stream, bstr ); + stream_catString( stream, bstr ); } } @@ -830,7 +832,7 @@ formatWordScore( XWStreamCtxt* stream, XP_U16 wordScore, } XP_ASSERT( XP_STRLEN(tmpBuf) < sizeof(tmpBuf) ); - stream_putString( stream, tmpBuf ); + stream_catString( stream, tmpBuf ); } } /* formatWordScore */ @@ -842,7 +844,7 @@ formatSummary( XWStreamCtxt* stream, const ModelCtxt* model, XP_U16 score ) util_getUserString(model->vol.util, STRD_TURN_SCORE), score); XP_ASSERT( XP_STRLEN(buf) < sizeof(buf) ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); } /* formatSummary */ #ifdef CPLUS diff --git a/xwords4/common/scorebdp.c b/xwords4/common/scorebdp.c index df1c1af3f..b44af103b 100644 --- a/xwords4/common/scorebdp.c +++ b/xwords4/common/scorebdp.c @@ -47,7 +47,7 @@ void drawScoreBoard( BoardCtxt* board ) { if ( board->scoreBoardInvalid ) { - short i; + short ii; XP_U16 nPlayers = board->gi->nPlayers; @@ -62,7 +62,7 @@ drawScoreBoard( BoardCtxt* board ) XP_U16 totalDim, extra, nShares, remWidth, remHeight, remDim; DrawScoreData* dp; DrawScoreData datum[MAX_NUM_PLAYERS]; - XP_S16 scores[MAX_NUM_PLAYERS]; + ScoresArray scores; XP_Bool isVertical = !board->scoreSplitHor; #ifdef KEYBOARD_NAV XP_Rect cursorRect; @@ -103,10 +103,10 @@ drawScoreBoard( BoardCtxt* board ) /* Get the scores from the model or by calculating them based on the end-of-game state. */ if ( board->gameOver ) { - model_figureFinalScores( model, scores, (XP_S16*)NULL ); + model_figureFinalScores( model, &scores, NULL ); } else { - for ( i = 0; i < nPlayers; ++i ) { - scores[i] = model_getPlayerScore( model, i ); + for ( ii = 0; ii < nPlayers; ++ii ) { + scores.arr[ii] = model_getPlayerScore( model, ii ); } } @@ -114,27 +114,27 @@ drawScoreBoard( BoardCtxt* board ) /* figure spacing for each scoreboard entry */ XP_MEMSET( &datum, 0, sizeof(datum) ); - for ( dp = datum, i = 0; i < nPlayers; ++i, ++dp ) { - LocalPlayer* lp = &board->gi->players[i]; + for ( dp = datum, ii = 0; ii < nPlayers; ++ii, ++dp ) { + LocalPlayer* lp = &board->gi->players[ii]; /* This is a hack! */ dp->dsi.lsc = board_ScoreCallback; dp->dsi.lscClosure = model; #ifdef KEYBOARD_NAV - if ( (i == cursorIndex) || focusAll ) { + if ( (ii == cursorIndex) || focusAll ) { dp->dsi.flags |= CELL_ISCURSOR; } #endif - dp->dsi.playerNum = i; - dp->dsi.totalScore = scores[i]; - dp->dsi.isTurn = (i == curTurn); + dp->dsi.playerNum = ii; + dp->dsi.totalScore = scores.arr[ii]; + dp->dsi.isTurn = (ii == curTurn); dp->dsi.name = emptyStringIfNull(lp->name); dp->dsi.selected = board->trayVisState != TRAY_HIDDEN - && i==selPlayer; + && ii==selPlayer; dp->dsi.isRobot = lp->isRobot; dp->dsi.isRemote = !lp->isLocal; dp->dsi.nTilesLeft = (nTilesInPool > 0)? -1: - model_getNumTilesTotal( model, i ); + model_getNumTilesTotal( model, ii ); draw_measureScoreText( board->draw, &scoreRect, &dp->dsi, &dp->width, &dp->height ); XP_ASSERT( dp->width <= scoreRect.width ); @@ -171,10 +171,10 @@ drawScoreBoard( BoardCtxt* board ) board->remDim = remDim; - for ( dp = datum, i = 0; i < nPlayers; ++dp, ++i ) { + for ( dp = datum, ii = 0; ii < nPlayers; ++dp, ++ii ) { XP_Rect innerRect; XP_U16 dim = isVertical? dp->height:dp->width; - *adjustDim = board->pti[i].scoreDims = dim + extra; + *adjustDim = board->pti[ii].scoreDims = dim + extra; innerRect.width = dp->width; innerRect.height = dp->height; @@ -186,9 +186,9 @@ drawScoreBoard( BoardCtxt* board ) draw_score_drawPlayer( board->draw, &innerRect, &scoreRect, &dp->dsi ); #ifdef KEYBOARD_NAV - XP_MEMCPY( &board->pti[i].scoreRects, &scoreRect, + XP_MEMCPY( &board->pti[ii].scoreRects, &scoreRect, sizeof(scoreRect) ); - if ( i == cursorIndex ) { + if ( ii == cursorIndex ) { cursorRect = scoreRect; cursorRectP = &cursorRect; } diff --git a/xwords4/common/server.c b/xwords4/common/server.c index 63cd58d43..4b044493a 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -662,7 +662,7 @@ makeRobotMove( ServerCtxt* server ) str = util_getUserString(util, STRD_ROBOT_TRADED); XP_SNPRINTF( buf, sizeof(buf), str, MAX_TRAY_TILES ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); XP_ASSERT( !server->vol.prevMoveStream ); server->vol.prevMoveStream = stream; } @@ -737,7 +737,7 @@ showPrevScore( ServerCtxt* server ) stream = mkServerStream( server ); str = util_getUserString( util, strCode ); - stream_putString( stream, str ); + stream_catString( stream, str ); if ( !!server->vol.prevMoveStream ) { XWStreamCtxt* prevStream = server->vol.prevMoveStream; @@ -1737,7 +1737,7 @@ makeTradeReportIf( ServerCtxt* server, const TrayTileSet* tradedTiles ) XP_SNPRINTF( tradeBuf, sizeof(tradeBuf), tradeStr, tradedTiles->nTiles ); stream = mkServerStream( server ); - stream_putString( stream, tradeBuf ); + stream_catString( stream, tradeBuf ); } return stream; } /* makeTradeReportIf */ @@ -2391,7 +2391,7 @@ server_formatDictCounts( ServerCtxt* server, XWStreamCtxt* stream, dict = model_getDictionary( server->vol.model ); dname = dict_getShortName( dict ); XP_SNPRINTF( buf, sizeof(buf), fmt, dname ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); nChars = dict_numTileFaces( dict ); @@ -2408,16 +2408,16 @@ server_formatDictCounts( ServerCtxt* server, XWStreamCtxt* stream, XP_SNPRINTF( buf, sizeof(buf), (XP_UCHAR*)"%s: %d/%d", face, count, value ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); } if ( ++tile >= nChars ) { break; } else if ( count > 0 ) { if ( ++nPrinted % nCols == 0 ) { - stream_putString( stream, XP_CR ); + stream_catString( stream, XP_CR ); } else { - stream_putString( stream, (void*)" " ); + stream_catString( stream, (void*)" " ); } } } @@ -2458,18 +2458,18 @@ server_formatRemainingTiles( ServerCtxt* server, XWStreamCtxt* stream, dict_tilesToString( dict, &tile, 1, face, sizeof(face) ); for ( ; ; ) { - stream_putString( stream, face ); + stream_catString( stream, face ); if ( --count == 0 ) { break; } - stream_putString( stream, "." ); + stream_catString( stream, "." ); } } if ( ++tile >= nChars ) { break; } else if ( hasCount ) { - stream_putString( stream, (void*)" " ); + stream_catString( stream, (void*)" " ); } } } /* server_formatRemainingTiles */ @@ -2478,11 +2478,11 @@ server_formatRemainingTiles( ServerCtxt* server, XWStreamCtxt* stream, void server_writeFinalScores( ServerCtxt* server, XWStreamCtxt* stream ) { - XP_S16 scores[MAX_NUM_PLAYERS]; - XP_S16 tilePenalties[MAX_NUM_PLAYERS]; + ScoresArray scores; + ScoresArray tilePenalties; XP_S16 highestIndex; XP_S16 highestScore; - XP_U16 place, nPlayers, i; + XP_U16 place, nPlayers, ii; XP_S16 curScore; ModelCtxt* model = server->vol.model; const XP_UCHAR* addString = util_getUserString( server->vol.util, @@ -2495,7 +2495,7 @@ server_writeFinalScores( ServerCtxt* server, XWStreamCtxt* stream ) XP_ASSERT( server->nv.gameState == XWSTATE_GAMEOVER ); - model_figureFinalScores( model, scores, tilePenalties ); + model_figureFinalScores( model, &scores, &tilePenalties ); nPlayers = gi->nPlayers; @@ -2507,19 +2507,19 @@ server_writeFinalScores( ServerCtxt* server, XWStreamCtxt* stream ) highestScore = IMPOSSIBLY_LOW_SCORE; highestIndex = -1; - for ( i = 0; i < nPlayers; ++i ) { - if ( scores[i] > highestScore ) { - highestIndex = i; - highestScore = scores[i]; + for ( ii = 0; ii < nPlayers; ++ii ) { + if ( scores.arr[ii] > highestScore ) { + highestIndex = ii; + highestScore = scores.arr[ii]; } } if ( highestIndex == -1 ) { break; /* we're done */ } else if ( place > 1 ) { - stream_putString( stream, XP_CR ); + stream_catString( stream, XP_CR ); } - scores[highestIndex] = IMPOSSIBLY_LOW_SCORE; + scores.arr[highestIndex] = IMPOSSIBLY_LOW_SCORE; curScore = model_getPlayerScore( model, highestIndex ); @@ -2540,15 +2540,15 @@ server_writeFinalScores( ServerCtxt* server, XWStreamCtxt* stream ) XP_SNPRINTF( tmpbuf, sizeof(tmpbuf), (firstDone? addString:subString), firstDone? - tilePenalties[highestIndex]: - -tilePenalties[highestIndex] ); + tilePenalties.arr[highestIndex]: + -tilePenalties.arr[highestIndex] ); XP_SNPRINTF( buf, sizeof(buf), (XP_UCHAR*)"[%d] %s: %d" XP_CR " (%d %s%s)", place, emptyStringIfNull(gi->players[highestIndex].name), highestScore, curScore, tmpbuf, timeStr ); - stream_putString( stream, buf ); + stream_catString( stream, buf ); } } /* server_writeFinalScores */ diff --git a/xwords4/common/xwstream.h b/xwords4/common/xwstream.h index bb9a603cc..8cfbaf86d 100644 --- a/xwords4/common/xwstream.h +++ b/xwords4/common/xwstream.h @@ -52,7 +52,7 @@ typedef struct StreamCtxVTable { void (*m_stream_putU8)( XWStreamCtxt* dctx, XP_U8 byt ); void (*m_stream_putBytes)( XWStreamCtxt* dctx, const void* whence, XP_U16 count ); - void (*m_stream_putString)( XWStreamCtxt* dctx, const char* whence ); + void (*m_stream_catString)( XWStreamCtxt* dctx, const char* whence ); void (*m_stream_putU16)( XWStreamCtxt* dctx, XP_U16 data ); void (*m_stream_putU32)( XWStreamCtxt* dctx, XP_U32 data ); void (*m_stream_putBits)( XWStreamCtxt* dctx, XP_U16 nBits, XP_U32 bits @@ -113,8 +113,8 @@ struct XWStreamCtxt { #define stream_putBytes( sc, w, c ) \ (sc)->vtable->m_stream_putBytes((sc), (w), (c)) -#define stream_putString( sc, w ) \ - (sc)->vtable->m_stream_putString((sc), (w)) +#define stream_catString( sc, w ) \ + (sc)->vtable->m_stream_catString((sc), (w)) #define stream_putU16(sc, d) \ (sc)->vtable->m_stream_putU16((sc), (d)) diff --git a/xwords4/linux/Makefile b/xwords4/linux/Makefile index 6c989e39a..671463df8 100644 --- a/xwords4/linux/Makefile +++ b/xwords4/linux/Makefile @@ -1,4 +1,4 @@ -# -*- mode: makefile; compile-command: "make -j MEMDEBUG=TRUE"; -*- +# -*- mode: makefile; compile-command: "make -j3 MEMDEBUG=TRUE"; -*- # Copyright 2002-2007 by Eric House (xwords@eehouse.org). All rights # reserved. # @@ -155,7 +155,7 @@ endif CFLAGS += $(POINTER_SUPPORT) ifneq (,$(findstring DPLATFORM_NCURSES,$(DEFINES))) - LIBS += $(OE_LIBDIR) -lncurses + LIBS += $(OE_LIBDIR) -lncursesw endif # provides an all: target diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index dbe57822d..4bbb61d8d 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -554,9 +554,7 @@ quit( void* XP_UNUSED(dunno), GtkAppGlobals* globals ) #endif vtmgr_destroy( MEMPOOL globals->cGlobals.params->vtMgr ); - mpool_destroy( globals->cGlobals.params->util->mpool ); - - gtk_exit( 0 ); + gtk_main_quit(); } /* quit */ GtkWidget* diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index 6bba12dff..bad18c64f 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -997,8 +997,10 @@ main( int argc, char** argv ) /* run server as faceless process? */ } - dict_destroy( mainParams.dict ); linux_util_vt_destroy( mainParams.util ); + + mpool_destroy( mainParams.util->mpool ); + XP_LOGF( "exiting main" ); return 0; } /* main */ diff --git a/xwords4/linux/linuxutl.c b/xwords4/linux/linuxutl.c index 135d0e4f0..644958fe1 100644 --- a/xwords4/linux/linuxutl.c +++ b/xwords4/linux/linuxutl.c @@ -33,16 +33,14 @@ linux_debugf( const char* format, ... ) { char buf[1000]; va_list ap; - // time_t tim; struct tm* timp; struct timeval tv; struct timezone tz; -/* pthread_t me = pthread_self(); */ gettimeofday( &tv, &tz ); timp = localtime( &tv.tv_sec ); - sprintf( buf, /* "<%p>" */ "%d:%d:%d: ", /* (void*)me, */ + sprintf( buf, "<%d>%d:%d:%d: ", getpid(), timp->tm_hour, timp->tm_min, timp->tm_sec ); va_start(ap, format); diff --git a/xwords4/relay/Makefile b/xwords4/relay/Makefile index 8b2ffbe6a..7e586b6ac 100644 --- a/xwords4/relay/Makefile +++ b/xwords4/relay/Makefile @@ -53,4 +53,5 @@ tarball: ../relay/xwrelay.conf help: - @echo $(MAKE) [STATIC=\"-static\"] \ No newline at end of file + @echo $(MAKE) [STATIC=\"-static\"] + @echo $(MAKE) tarball diff --git a/xwords4/wince/Makefile b/xwords4/wince/Makefile index 8c2e6b7fb..2e8f46578 100644 --- a/xwords4/wince/Makefile +++ b/xwords4/wince/Makefile @@ -30,7 +30,7 @@ TARGET_OS ?= win32 # possible. # USE_RAW_MINGW = -DUSE_RAW_MINGW -# arm-wince-mingw32ce for cegcc, arm-wince-pe for pocketpc-gcc +# arm-wince-mingw32ce for cegcc ifdef USE_RAW_MINGW MINGW_INC_PATH ?= -I/usr/i586-mingw32msvc/include CE_ARCH = arm-wince-pe @@ -122,7 +122,13 @@ CFLAGS += -Os OBJDIR = obj_$(TARGET_OS)_rel endif -TARGET = $(OBJDIR)/xwords4_$(SVNREV).exe +BUILTDIR=$(OBJDIR)/built +TARGET = $(BUILTDIR)/xwords4_$(SVNREV).exe +DLL_SRCS = $(shell ls ./l10n/*.rc) +#DLLS = $(patsubst %.rc,%.dll,$(addprefix $(OBJDIR)/l10n/,$(notdir $(DLL_SRCS)))) +DLLS = \ + $(BUILTDIR)/xwords4_french.dll \ + $(BUILTDIR)/xwords4_caps.dll \ RESOBJS = \ $(OBJDIR)/xwords4.rc.o \ @@ -143,6 +149,7 @@ WINCESRC = \ cestrbx.c \ cedraw.c \ cefonts.c \ + ceresstr.c \ debhacks.c \ cedebug.c \ @@ -170,6 +177,7 @@ XW_BOTH_DEFINES = \ -DXWFEATURE_HINT_CONFIG \ -DPOINTER_SUPPORT -DKEY_SUPPORT -D__LITTLE_ENDIAN \ -DCEFEATURE_CANSCROLL -DUNICODE \ + -DLOADSTRING_BROKEN \ $(DEBUG_FLAG) $(MEM_DEBUG_FLAG) $(LOGGING_FLAG) \ CFLAGS += $(XW_BOTH_DEFINES) -DARM @@ -180,12 +188,13 @@ RESFLAGS += $(XW_BOTH_DEFINES) $(STANDALONE) $(BLUETOOTH) $(RELAY) \ # Rules start here #################################################################### -all : $(TARGET) +all : $(TARGET) $(DLLS) memdebug: $(MAKE) DEBUG=TRUE all $(TARGET) : $(OBJS) $(RESOBJS) + mkdir -p $(dir $@) $(CC) $(CFLAGS) $(LFLAGS) -mwindows $^ $(CELIBS) -o $@ $(STRIP) $@ @@ -200,6 +209,17 @@ $(OBJDIR)/%.o : ../common/%.c $(INCLUDES) $(OBJDIR)/xwords4.rc.o : xwords4.rc $(INCLUDES) xwords4.ico $(WINDRES) -v $(MINGW_INC_PATH) $(RESFLAGS) -o $@ $< +$(OBJDIR)/l10n/%.rc.o : l10n/%.rc $(WINCE_INCLUDES) + mkdir -p $(dir $@) + UTF8=x$(shell file -b -n -i $< | grep 'utf-8'); \ + if [ x != $$UTF8 ]; then ENC="-c 65001"; fi; \ + $(WINDRES) $$ENC -v $(MINGW_INC_PATH) $(RESFLAGS) $< -o $@ + +$(BUILTDIR)/%.dll: $(OBJDIR)/l10n/%.rc.o + mkdir -p $(dir $@) + $(CC) -shared -o $@ $< + $(STRIP) $@ + # Checking in xwords4.ico for now. Hand-built using GIMP and layers # it's 1/4 the size (because it has only two colors). Should figure # out how to script GIMP and replace the below. @@ -222,8 +242,9 @@ test: echo $(COMMONOBJ) clean : - rm -rf $(OBJDIR) $(TARGET) + rm -rf $(OBJDIR) $(TARGET) help: @echo "try 'make TARGET_OS=wince [DEBUG=TRUE]'" @echo "or 'make TARGET_OS=win32 [DEBUG=TRUE]'" + diff --git a/xwords4/wince/ceaskpwd.c b/xwords4/wince/ceaskpwd.c index 7a209a513..1b7e317f5 100755 --- a/xwords4/wince/ceaskpwd.c +++ b/xwords4/wince/ceaskpwd.c @@ -21,23 +21,24 @@ #include "cemain.h" #include "ceutil.h" #include "debhacks.h" -//##include /* swprintf */ +#include "ceresstr.h" #include static void -nameToLabel( HWND hDlg, const XP_UCHAR* name, XP_U16 labelID ) +nameToLabel( PasswdDialogState* pState, const XP_UCHAR* name, XP_U16 labelID ) { - wchar_t wideName[128]; + wchar_t wideName[64]; wchar_t wBuf[128]; - XP_U16 len; + const wchar_t* fmt; - len = (XP_U16)XP_STRLEN( name ); - MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, name, len + 1, - wideName, len + 1 ); + MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, name, -1, wideName, + VSIZE(wideName) ); - swprintf( wBuf, L"Enter password for %s:", wideName ); + fmt = ceGetResStringL( pState->dlgHdr.globals, IDS_PASSWDFMT_L ); + swprintf( wBuf, fmt, wideName ); - SendDlgItemMessage( hDlg, labelID, WM_SETTEXT, 0, (long)wBuf ); + SendDlgItemMessage( pState->dlgHdr.hDlg, labelID, WM_SETTEXT, + 0, (long)wBuf ); } /* nameToLabel */ LRESULT CALLBACK @@ -52,7 +53,7 @@ PasswdDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) ceDlgSetup( &pState->dlgHdr, hDlg, DLG_STATE_TRAPBACK ); - nameToLabel( hDlg, pState->name, IDC_PWDLABEL ); + nameToLabel( pState, pState->name, IDC_PWDLABEL ); return TRUE; } else { diff --git a/xwords4/wince/ceclrsel.c b/xwords4/wince/ceclrsel.c index 692fbd122..e54d4c27d 100644 --- a/xwords4/wince/ceclrsel.c +++ b/xwords4/wince/ceclrsel.c @@ -25,6 +25,7 @@ #include "ceutil.h" #include "cedebug.h" #include "debhacks.h" +#include "ceresstr.h" static void colorButton( DRAWITEMSTRUCT* dis, HBRUSH brush ); @@ -154,7 +155,9 @@ EditColorsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) label[len-1] = 0; /* hack: overwrite ':' */ } wchar_t buf[64]; - swprintf( buf, L"Edit color for %s", label ); + swprintf( buf, ceGetResStringL( eState->dlgHdr.globals, + IDS_EDITCOLOR_FORMAT ), label ); + SendMessage( hDlg, WM_SETTEXT, 0, (LPARAM)buf ); eState->sampleButton = GetDlgItem( hDlg, CLSAMPLE_BUTTON_ID ); @@ -239,8 +242,10 @@ myChooseColor( CeDlgHdr* dlgHdr, XP_U16 labelID, COLORREF* cref ) XP_LOGF( "setting up IDD_COLOREDITDLG" ); - result = DialogBoxParam( dlgHdr->globals->hInst, (LPCTSTR)IDD_COLOREDITDLG, - dlgHdr->hDlg, (DLGPROC)EditColorsDlg, (long)&state ); + result = DialogBoxParam( dlgHdr->globals->locInst, + (LPCTSTR)IDD_COLOREDITDLG, + dlgHdr->hDlg, (DLGPROC)EditColorsDlg, + (long)&state ); XP_LOGF( "DialogBoxParam=>%d", result ); @@ -454,7 +459,7 @@ ceDoColorsEdit( HWND hwnd, CEAppGlobals* globals, COLORREF* colors ) state.dlgHdr.globals = globals; state.inColors = colors; - (void)DialogBoxParam( globals->hInst, (LPCTSTR)IDD_COLORSDLG, hwnd, + (void)DialogBoxParam( globals->locInst, (LPCTSTR)IDD_COLORSDLG, hwnd, (DLGPROC)ColorsDlg, (long)&state ); if ( !state.cancelled ) { diff --git a/xwords4/wince/cecondlg.c b/xwords4/wince/cecondlg.c index a6bc3c9e5..b0f0a1ae6 100755 --- a/xwords4/wince/cecondlg.c +++ b/xwords4/wince/cecondlg.c @@ -229,7 +229,7 @@ WrapConnsDlg( HWND hDlg, CEAppGlobals* globals, const CommsAddrRec* addrRec, state->role = role; XP_MEMCPY( &state->addrRec, addrRec, sizeof(state->addrRec) ); - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_CONNSSDLG, hDlg, + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_CONNSSDLG, hDlg, (DLGPROC)ConnsDlg, (long)state ); result = !state->userCancelled; diff --git a/xwords4/wince/cedict.c b/xwords4/wince/cedict.c index 3f5a25ec5..f1b2c6953 100755 --- a/xwords4/wince/cedict.c +++ b/xwords4/wince/cedict.c @@ -625,32 +625,6 @@ locateOneDir( MPFORMAL wchar_t* path, OnePathCB cb, void* ctxt, XP_U16 nSought, return done; } /* locateOneDir */ -static XP_Bool -getDictDir( wchar_t* buf, XP_U16 bufLen ) -{ - /* I wanted to use SHGetKnownFolderPath to search in \\Program - Files\\Crosswords, but perhaps it's better to search in the directory - in which the app is located. If I get CAB files working for - Smartphone, then that directory will be \\Program Files\\Crosswords. - But if users have to install files using the File Explorer it'll be - easier for them if all that's required is that the app and dictionaries - be in the same place. GetModuleFileName() supports both. - */ - - DWORD nChars = GetModuleFileName( NULL, buf, bufLen ); - XP_Bool success = nChars < bufLen; - if ( success ) { - wchar_t* lastSlash = wcsrchr( buf, '\\' ); - if ( !!lastSlash ) { - *lastSlash = 0; - } - } - -/* SHGetSpecialFolderPath(NULL,NULL,0,FALSE); */ - - return success; -} /* getDictDir */ - XP_U16 ceLocateNDicts( CEAppGlobals* globals, XP_U16 nSought, OnePathCB cb, void* ctxt ) @@ -658,7 +632,7 @@ ceLocateNDicts( CEAppGlobals* globals, XP_U16 nSought, OnePathCB cb, XP_U16 nFound = 0; wchar_t path[CE_MAX_PATH_LEN+1]; - if ( getDictDir( path, VSIZE(path) ) ) { + if ( ceGetExeDir( path, VSIZE(path) ) ) { locateOneDir( MPPARM(globals->mpool) path, cb, ctxt, nSought, &nFound ); } diff --git a/xwords4/wince/cedraw.c b/xwords4/wince/cedraw.c index 02dad5dfd..32becaba1 100755 --- a/xwords4/wince/cedraw.c +++ b/xwords4/wince/cedraw.c @@ -34,6 +34,7 @@ #include "cedict.h" #include "cedefines.h" #include "cedebug.h" +#include "ceresstr.h" #include "debhacks.h" #include "strutils.h" @@ -141,10 +142,12 @@ RFI2Str( RFIndex rfi ) CASE_STR( RFONTS_TRAYVAL ); CASE_STR( RFONTS_CELL ); CASE_STR( RFONTS_REM ); + CASE_STR( RFONTS_PTS ); CASE_STR( RFONTS_SCORE ); CASE_STR( RFONTS_SCORE_BOLD ); - default: - str = ""; + case N_RESIZE_FONTS: + XP_ASSERT(0); + return ""; } # undef CASE_STR return str; @@ -1386,13 +1389,14 @@ DRAW_FUNC_NAME(scoreBegin)( DrawCtx* p_dctx, const XP_Rect* xprect, } /* ce_draw_scoreBegin */ static void -formatRemText( XP_S16 nTilesLeft, XP_Bool isVertical, XP_UCHAR* buf ) +formatRemText( const CEDrawCtx* dctx, XP_S16 nTilesLeft, XP_Bool isVertical, + XP_UCHAR* buf ) { - const char* fmt = "Rem%s%d"; + const char* rem = ceGetResString( dctx->globals, IDS_REM ); const char* sep = isVertical? XP_CR : ":"; XP_ASSERT( nTilesLeft > 0 ); - sprintf( buf, fmt, sep, nTilesLeft ); + sprintf( buf, "%s%s%d", rem, sep, nTilesLeft ); } /* formatRemText */ DLSTATIC void @@ -1411,7 +1415,7 @@ DRAW_FUNC_NAME(measureRemText)( DrawCtx* p_dctx, const XP_Rect* xprect, XP_ASSERT( !!hdc ); - formatRemText( nTilesLeft, dctx->scoreIsVertical, buf ); + formatRemText( dctx, nTilesLeft, dctx->scoreIsVertical, buf ); height = xprect->height - 2; /* space for border */ if ( height > globals->cellHt - CELL_BORDER ) { @@ -1445,7 +1449,7 @@ DRAW_FUNC_NAME(drawRemText)( DrawCtx* p_dctx, const XP_Rect* rInner, const FontCacheEntry* fce; RECT rt; - formatRemText( nTilesLeft, dctx->scoreIsVertical, buf ); + formatRemText( dctx, nTilesLeft, dctx->scoreIsVertical, buf ); XPRtoRECT( &rt, rInner ); if ( focussed ) { @@ -1680,33 +1684,38 @@ DRAW_FUNC_NAME(drawTimer)( DrawCtx* p_dctx, const XP_Rect* rInner, } /* ce_draw_drawTimer */ DLSTATIC const XP_UCHAR* -DRAW_FUNC_NAME(getMiniWText)( DrawCtx* XP_UNUSED(p_dctx), +DRAW_FUNC_NAME(getMiniWText)( DrawCtx* p_dctx, XWMiniTextType whichText ) { - XP_UCHAR* str; + const XP_UCHAR* str = NULL; + XP_U16 resID = 0; switch( whichText ) { case BONUS_DOUBLE_LETTER: - str = "Double letter"; + resID = IDS_DOUBLE_LETTER; break; case BONUS_DOUBLE_WORD: - str = "Double word"; + resID = IDS_DOUBLE_WORD; break; case BONUS_TRIPLE_LETTER: - str = "Triple letter"; + resID = IDS_TRIPLE_LETTER; break; case BONUS_TRIPLE_WORD: - str = "Triple word"; + resID = IDS_TRIPLE_WORD; break; case INTRADE_MW_TEXT: - str = "Trading tiles." XP_CR "Select 'Turn done' when ready"; + resID = IDS_INTRADE_MW; break; default: XP_ASSERT( XP_FALSE ); - str = NULL; break; } + + if ( resID != 0 ) { + CEDrawCtx* dctx = (CEDrawCtx*)p_dctx; + str = ceGetResString( dctx->globals, resID ); + } return str; } /* ce_draw_getMiniWText */ diff --git a/xwords4/wince/cefonts.c b/xwords4/wince/cefonts.c index d1bb4b763..6e00c3c45 100644 --- a/xwords4/wince/cefonts.c +++ b/xwords4/wince/cefonts.c @@ -258,7 +258,7 @@ ceShowFonts( HWND hDlg, CEAppGlobals* globals ) state.textRect.right = 300; state.textRect.bottom = state.textRect.top + (4*MAX_FONT_SHOWN); - (void)DialogBoxParam( globals->hInst, (LPCTSTR)IDD_FONTSSDLG, hDlg, + (void)DialogBoxParam( globals->locInst, (LPCTSTR)IDD_FONTSSDLG, hDlg, (DLGPROC)FontsDlgProc, (long)&state ); } diff --git a/xwords4/wince/ceginfo.c b/xwords4/wince/ceginfo.c index 543f8aa6d..a097e940b 100755 --- a/xwords4/wince/ceginfo.c +++ b/xwords4/wince/ceginfo.c @@ -27,6 +27,7 @@ #include "strutils.h" #include "cedebug.h" #include "strutils.h" +#include "ceresstr.h" #define NUM_COLS 4 #define MENUDICTS_INCR 16 @@ -167,10 +168,11 @@ loadFromGameInfo( GameInfoState* giState ) CurGameInfo* gi = &globals->gameInfo; #if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH - wchar_t* roles[] = { L"Standalone", L"Host", L"Guest" }; - for ( i = 0; i < VSIZE(roles); ++i ) { - SendDlgItemMessage( hDlg, IDC_ROLECOMBO, CB_ADDSTRING, 0, - (long)roles[i] ); + XP_U16 role_ids[] = { IDS_ROLE_STANDALONE, IDS_ROLE_HOST, IDS_ROLE_GUEST }; + for ( i = 0; i < VSIZE(role_ids); ++i ) { + const wchar_t* wstr = ceGetResStringL( globals, role_ids[i] ); + SendDlgItemMessage( state->dlgHdr.hDlg, state->roleComboId, + ADDSTRING(globals), 0, (long)wstr ); } #endif @@ -462,7 +464,7 @@ ceSetColProc( void* closure, XP_U16 player, NewGameColumn col, GameInfoState* giState = (GameInfoState*)closure; XP_U16 resID = resIDForCol( player, col ); const XP_UCHAR* cp; - XP_UCHAR buf[16]; + XP_UCHAR buf[32]; switch( col ) { case NG_COL_PASSWD: @@ -470,8 +472,10 @@ ceSetColProc( void* closure, XP_U16 player, NewGameColumn col, if ( NULL != value.ng_cp ) { cp = value.ng_cp; } else if ( col == NG_COL_NAME ) { + const XP_UCHAR* str = ceGetResString( giState->dlgHdr.globals, + IDS_PLAYER_FORMAT ); + snprintf( buf, sizeof(buf), str, player + 1 ); cp = buf; - snprintf( cp, sizeof(buf), "Player %d", player + 1 ); } else { cp = ""; } @@ -609,7 +613,8 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) &giState->prefsPrefs ); if ( giState->isNewGame ) { - (void)SetWindowText( hDlg, L"New game" ); + (void)SetWindowText( hDlg, ceGetResStringL( globals, + IDS_NEW_GAME ) ); } result = TRUE; diff --git a/xwords4/wince/cemain.c b/xwords4/wince/cemain.c index b9b70d02b..bb68ca822 100755 --- a/xwords4/wince/cemain.c +++ b/xwords4/wince/cemain.c @@ -52,6 +52,7 @@ #include "debhacks.h" #include "cesvdgms.h" #include "cedraw.h" +#include "ceresstr.h" #include "dbgutil.h" @@ -142,7 +143,7 @@ static void ce_util_engineStopping( XW_UtilCtxt* uc ); #endif static XP_Bool ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream, - wchar_t* title, XP_U16 buttons, + const wchar_t* title, XP_U16 buttons, XP_Bool destroy ); static void RECTtoXPR( XP_Rect* dest, const RECT* src ); static XP_Bool ceDoNewGame( CEAppGlobals* globals ); @@ -156,7 +157,7 @@ static void ce_send_on_close( XWStreamCtxt* stream, void* closure ); #endif static XP_Bool ceSetDictName( const wchar_t* wPath, XP_U16 index, void* ctxt ); static int messageBoxStream( CEAppGlobals* globals, XWStreamCtxt* stream, - wchar_t* title, XP_U16 buttons ); + const wchar_t* title, XP_U16 buttons ); static XP_Bool ceQueryFromStream( CEAppGlobals* globals, XWStreamCtxt* stream); static XP_Bool isDefaultName( CEAppGlobals* globals, const XP_UCHAR* name ); static void ceSetTitleFromName( CEAppGlobals* globals ); @@ -180,8 +181,25 @@ tryIntParam( const char* buf, const char* param, XP_U16* value ) return found; } +static XP_Bool +tryCharParam( const char* buf, const char* param, char* out ) +{ + XP_U16 len = strlen( param ); + XP_Bool found = 0 == strncmp( buf, param, len ); + if ( found ) { + int ii; + for ( ii = len; buf[ii] != ' ' && buf[ii] != 0 ; ++ii ) { + } + memcpy( out, &buf[len], ii - len ); + out[ii-len] = 0; + XP_LOGF( "%s: \"%s\"", __func__, out ); + } + return found; +} + static void -parseCmdLine( const char* cmdline, XP_U16* width, XP_U16* height ) +parseCmdLine( const char* cmdline, XP_U16* width, XP_U16* height, + char* dll ) { XP_U16 ii; for ( ii = 0; ; ++ii ) { @@ -202,6 +220,7 @@ parseCmdLine( const char* cmdline, XP_U16* width, XP_U16* height ) if ( ii > 0 ) { /* skip argv[0] */ if ( tryIntParam( buf, "width=", width ) ) { } else if ( tryIntParam( buf, "height=", height ) ) { + } else if ( tryCharParam( buf, "dll=", dll ) ) { } else { XP_LOGF( "failed to match cmdline arg \"%s\"", buf ); } @@ -219,7 +238,7 @@ parseCmdLine( const char* cmdline, XP_U16* width, XP_U16* height ) ATOM MyRegisterClass (HINSTANCE, LPTSTR); BOOL InitInstance (HINSTANCE, int #ifndef _WIN32_WCE - , XP_U16, XP_U16 + , XP_U16, XP_U16, const char* #endif ); LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM); @@ -240,13 +259,14 @@ WinMain( HINSTANCE hInstance, #ifndef _WIN32_WCE XP_U16 width = 320, height = 320; - parseCmdLine( lpCmdLine, &width, &height ); + char dll[MAX_PATH] = {0}; + parseCmdLine( lpCmdLine, &width, &height, dll ); #endif // Perform application initialization: if (!InitInstance (hInstance, nCmdShow #ifndef _WIN32_WCE - , width, height + , width, height, dll #endif )) { return FALSE; @@ -309,9 +329,6 @@ MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) wc.hInstance = hInstance; wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_XWORDS4)); wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); -#ifndef _WIN32_WCE - wc.lpszMenuName = (LPCTSTR)IDM_MENU; -#endif wc.lpszClassName = szWindowClass; return RegisterClass(&wc); @@ -777,7 +794,7 @@ ceSetTitleFromName( CEAppGlobals* globals ) /* if default name, remove any current name */ if ( !gameName || isDefaultName( globals, gameName ) ) { - LoadString( globals->hInst, IDS_APP_TITLE, widebuf, VSIZE(widebuf) ); + LoadString( globals->locInst, IDS_APP_TITLE, widebuf, VSIZE(widebuf) ); } else { wchar_t* dotPos; XP_UCHAR* baseStart = 1 + strrchr( gameName, '\\' ); @@ -881,6 +898,34 @@ ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, } } /* ceInitAndStartBoard */ +static XP_UCHAR* +ceReadString( const CEAppGlobals* globals, HANDLE fileH ) +{ + XP_U16 nameLen; + XP_UCHAR* name = NULL; + XP_U32 nRead; + + if ( ReadFile( fileH, &nameLen, sizeof(nameLen), &nRead, NULL ) + && nameLen > 0 ) { + name = XP_MALLOC( globals->mpool, nameLen + 1 ); + ReadFile( fileH, name, nameLen, &nRead, NULL ); + name[nameLen] = '\0'; + } + + return name; +} /* ceReadString */ + +static void +ceWriteString( const XP_UCHAR* str, HANDLE fileH ) +{ + XP_U32 nWritten; + XP_U16 len = !!str? XP_STRLEN( str ) : 0; + WriteFile( fileH, &len, sizeof(len), &nWritten, NULL ); + if ( 0 < len ) { + WriteFile( fileH, str, len, &nWritten, NULL ); + } +} + static void ceSavePrefs( CEAppGlobals* globals ) { @@ -892,24 +937,19 @@ ceSavePrefs( CEAppGlobals* globals ) OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL ); if ( fileH != INVALID_HANDLE_VALUE ) { XP_U32 nWritten; - XP_U16 nameLen = 0; - XP_UCHAR* name = globals->curGameName; - - if ( name != NULL ) { - nameLen = (XP_U16)XP_STRLEN( name ); - } SetFilePointer( fileH, 0, 0, FILE_BEGIN ); /* write prefs, including version num */ WriteFile( fileH, &globals->appPrefs, sizeof(globals->appPrefs), &nWritten, NULL ); - WriteFile( fileH, &nameLen, sizeof(nameLen), &nWritten, NULL ); - WriteFile( fileH, name, nameLen, &nWritten, NULL ); + ceWriteString( globals->curGameName, fileH ); WriteFile( fileH, &globals->flags, sizeof(globals->flags), &nWritten, NULL ); + ceWriteString( globals->langFileName, fileH ); + SetEndOfFile( fileH ); /* truncate anything previously there */ CloseHandle( fileH ); /* am I not supposed to do this? PENDING */ @@ -999,19 +1039,12 @@ ceLoadPrefs( CEAppGlobals* globals ) if ( result ) { XP_U16 flags; - XP_U16 nameLen; - XP_UCHAR* name; XP_U32 nRead; XP_MEMCPY( &globals->appPrefs, &tmpPrefs, sizeof(globals->appPrefs) ); - ReadFile( fileH, &nameLen, sizeof(nameLen), &nRead, - NULL ); - name = XP_MALLOC( globals->mpool, nameLen + 1 ); - ReadFile( fileH, name, nameLen, &nRead, NULL ); - name[nameLen] = '\0'; - globals->curGameName = name; + globals->curGameName = ceReadString( globals, fileH ); if ( ReadFile( fileH, &flags, sizeof(flags), &nRead, NULL ) @@ -1020,6 +1053,8 @@ ceLoadPrefs( CEAppGlobals* globals ) flags = 0; } globals->flags = flags; + + globals->langFileName = ceReadString( globals, fileH ); } } CloseHandle( fileH ); @@ -1098,7 +1133,8 @@ ceLoadSavedGame( CEAppGlobals* globals ) success = dict != NULL; if ( !success ) { XP_UCHAR buf[128]; - snprintf( buf, VSIZE(buf), "Unable to open dictionary: %s", + snprintf( buf, VSIZE(buf), + ceGetResString( globals, IDS_CANNOTOPEN_DICT ), dictName ); buf[VSIZE(buf)-1] = '\0'; ceOops( globals, buf ); @@ -1128,7 +1164,8 @@ ceLoadSavedGame( CEAppGlobals* globals ) if ( !!dict ) { dict_destroy( dict ); } - ceOops( globals, "Saved game cannot be opened." ); + ceOops( globals, + ceGetResString( globals, IDS_CANNOTOPEN_GAME ) ); } } @@ -1239,7 +1276,7 @@ getOSInfo( CEAppGlobals* globals ) BOOL InitInstance(HINSTANCE hInstance, int nCmdShow #ifndef _WIN32_WCE - ,XP_U16 width, XP_U16 height + ,XP_U16 width, XP_U16 height, const char* dll #endif ) { @@ -1247,7 +1284,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow TCHAR szTitle[MAX_LOADSTRING]; // The title bar text TCHAR szWindowClass[MAX_LOADSTRING]; // The window class name CEAppGlobals* globals; - BOOL result = TRUE; + BOOL result = FALSE; XP_Bool oldGameLoaded; XP_Bool prevStateExists; XP_Bool newDone = XP_FALSE; @@ -1277,9 +1314,8 @@ InitInstance(HINSTANCE hInstance, int nCmdShow hWnd = FindWindow( szWindowClass, NULL ); if ( hWnd ) { SetForegroundWindow( (HWND)((ULONG) hWnd | 0x00000001) ); - result = FALSE; goto exit; - } + } #ifdef MEM_DEBUG mpool = mpool_make(); @@ -1289,7 +1325,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow XP_DEBUGF( "globals created: 0x%p", globals ); XP_MEMSET( globals, 0, sizeof(*globals) ); MPASSIGN( globals->mpool, mpool ); - + #ifndef _WIN32_WCE globals->dbWidth = width; globals->dbHeight = height; @@ -1306,15 +1342,42 @@ InitInstance(HINSTANCE hInstance, int nCmdShow // Initialize global strings MyRegisterClass(hInstance, szWindowClass); - hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, NULL, NULL, hInstance, globals); - globals->hWnd = hWnd; + prevStateExists = ceLoadPrefs( globals ); + if ( !prevStateExists ) { + ceInitPrefs( globals, &globals->appPrefs ); + } +#ifndef _WIN32_WCE + srand( time(NULL) ); + + /* Was a language file named in preferences? If so, and if none was + provided on the cmdline, load it (if it exists; if it doesn't, act as + if none set). */ + if ( !!dll && !!dll[0] ) { + replaceStringIfDifferent( globals->mpool, &globals->langFileName, dll ); + } +#endif + + if ( !!globals->langFileName && !globals->locInst ) { + HINSTANCE inst = ceLoadResFile( globals->langFileName ); + if ( !!inst ) { + globals->locInst = inst; + } else { + XP_FREE( globals->mpool, globals->langFileName ); + globals->langFileName = NULL; + } + } + if ( !globals->locInst ) { + globals->locInst = globals->hInst; + } + + hWnd = CreateWindow( szWindowClass, szTitle, WS_VISIBLE, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, NULL, NULL, hInstance, globals ); if (!hWnd) { - result = FALSE; goto exit; } + globals->hWnd = hWnd; #ifdef _WIN32_WCE if ( globals->hwndCB && !IS_SMARTPHONE(globals) ) { @@ -1329,35 +1392,33 @@ InitInstance(HINSTANCE hInstance, int nCmdShow } #endif -#ifndef _WIN32_WCE - srand( time(NULL) ); -#endif - ceInitUtilFuncs( globals ); gi_initPlayerInfo( MPPARM(mpool) &globals->gameInfo, NULL ); + +#ifndef _WIN32_WCE + SetMenu( hWnd, LoadMenu( globals->locInst, MAKEINTRESOURCE(IDM_MENU) ) ); +#endif + /* choose one. If none found it's an error. */ #ifndef STUBBED_DICT result = 1 == ceLocateNDicts( globals, 1, ceSetDictName, globals ); if ( !result ) { wchar_t buf[512]; - (void)LoadString( globals->hInst, (UINT)IDS_DICTLOC, buf, VSIZE(buf) ); + (void)LoadString( globals->locInst, (UINT)IDS_DICTLOC, buf, VSIZE(buf) ); assertOnTop( globals->hWnd ); - MessageBox( globals->hWnd, buf, L"Dictionary Not Found", + MessageBox( globals->hWnd, buf, + ceGetResStringL( globals, IDS_NODICT_L ), MB_OK | MB_ICONHAND ); - result = FALSE; goto exit; } +#else + result = TRUE; #endif - /* here's where we want to behave differently if there's saved state. - But that's a long ways off. */ - prevStateExists = ceLoadPrefs( globals ); - if ( !prevStateExists ) { - ceInitPrefs( globals, &globals->appPrefs ); - } + /* must load prefs before creating draw ctxt */ globals->draw = ce_drawctxt_make( MPPARM(globals->mpool) hWnd, globals ); @@ -1480,7 +1541,8 @@ ceCountsAndValues( CEAppGlobals* globals ) server_formatDictCounts( globals->game.server, stream, 3 ); - (void)ceMsgFromStream( globals, stream, L"Tile Counts and Values", + (void)ceMsgFromStream( globals, stream, + ceGetResStringL( globals, IDS_COUNTSVALS_L ), MB_OK | MB_ICONINFORMATION, XP_TRUE ); } } /* ceCountsAndValues */ @@ -1492,7 +1554,8 @@ ceTilesLeft( CEAppGlobals* globals ) XWStreamCtxt* stream = make_generic_stream( globals ); board_formatRemainingTiles( globals->game.board, stream ); - (void)ceMsgFromStream( globals, stream, L"Remaining tiles", + (void)ceMsgFromStream( globals, stream, + ceGetResStringL( globals, IDS_REMTILES_L ), MB_OK | MB_ICONINFORMATION, XP_TRUE ); } } /* ceTilesLeft */ @@ -1507,7 +1570,8 @@ ceDoHistory( CEAppGlobals* globals ) model_writeGameHistory( globals->game.model, stream, globals->game.server, gameOver ); - (void)ceMsgFromStream( globals, stream, L"Game history", + (void)ceMsgFromStream( globals, stream, + ceGetResStringL( globals, IDS_GAMEHIST_L ), MB_OK | MB_ICONINFORMATION, XP_TRUE ); } /* ceDoHistory */ @@ -1563,7 +1627,8 @@ ceDisplayFinalScores( CEAppGlobals* globals ) server_writeFinalScores( globals->game.server, stream ); stream_putU8( stream, '\0' ); - (void)ceMsgFromStream( globals, stream, L"Final scores", + (void)ceMsgFromStream( globals, stream, + ceGetResStringL( globals, IDS_FINALSCORE_L), MB_OK | MB_ICONINFORMATION, XP_TRUE ); } /* ceDisplayFinalScores */ @@ -1579,7 +1644,7 @@ ceDoNewGame( CEAppGlobals* globals ) giState.isNewGame = XP_TRUE; assertOnTop( globals->hWnd ); - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_GAMEINFO, globals->hWnd, + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_GAMEINFO, globals->hWnd, (DLGPROC)GameInfo, (long)&giState ); if ( !giState.userCancelled @@ -1897,6 +1962,15 @@ freeGlobals( CEAppGlobals* globals ) } } + ceFreeResStrings( globals ); + if ( globals->locInst != globals->hInst ) { + ceCloseResFile( globals->locInst ); + } + if ( globals->langFileName != NULL ) { + XP_FREE( globals->mpool, globals->langFileName ); + globals->langFileName = NULL; + } + XP_FREE( globals->mpool, globals ); mpool_destroy( mpool ); } /* freeGlobals */ @@ -1906,6 +1980,7 @@ static HWND makeCommandBar( HWND hwnd, HINSTANCE hInst ) { SHMENUBARINFO mbi; + HWND result = NULL; XP_MEMSET( &mbi, 0, sizeof(mbi) ); mbi.cbSize = sizeof(mbi); @@ -1917,13 +1992,14 @@ makeCommandBar( HWND hwnd, HINSTANCE hInst ) //mbi.dwFlags = SHCMBF_HIDESIPBUTTON; /* eeh added. Why??? */ - if (!SHCreateMenuBar(&mbi)) { + if ( SHCreateMenuBar(&mbi) ) { + result = mbi.hwndMB; + } else { /* will want to use this to change menubar: SHEnableSoftkey? */ XP_LOGF( "SHCreateMenuBar failed" ); - return NULL; } - return mbi.hwndMB; + return result; } /* makeCommandBar */ #endif @@ -2190,12 +2266,46 @@ static void doAbout( CEAppGlobals* globals ) { wchar_t buf[1024]; - (void)LoadString( globals->hInst, (UINT)IDS_ABOUT, buf, VSIZE(buf) ); + (void)LoadString( globals->locInst, (UINT)IDS_ABOUT, buf, VSIZE(buf) ); assertOnTop( globals->hWnd ); - MessageBox( globals->hWnd, buf, L"About " LCROSSWORDS_DIR, + MessageBox( globals->hWnd, buf, ceGetResStringL( globals, IDS_ABOUT_L ), MB_OK | MB_ICONINFORMATION ); } +static void +chooseChangeResFile( CEAppGlobals* globals ) +{ + XP_UCHAR newFile[MAX_PATH] = { 0 }; + if ( ceChooseResFile( globals, newFile, VSIZE(newFile) ) ) { + if ( !globals->langFileName + || 0 != XP_STRCMP( newFile, globals->langFileName ) ) { + if ( globals->locInst != globals->hInst ) { + ceCloseResFile( globals->locInst ); + } + ceFreeResStrings( globals ); + if ( 0 != newFile[0] ) { + globals->locInst = ceLoadResFile( newFile ); + } else { + globals->locInst = globals->hInst; + } + replaceStringIfDifferent( globals->mpool, &globals->langFileName, + newFile ); + +#ifdef _WIN32_WCE + CommandBar_Destroy( globals->hwndCB ); + globals->hwndCB = makeCommandBar( globals->hWnd, globals->locInst ); +#else + SetMenu( globals->hWnd, LoadMenu( globals->locInst, + MAKEINTRESOURCE(IDM_MENU) ) ); +#endif + + /* Need to force user to restart unless we can inval everything + to force redraw */ +/* board_invalAll( globals->game.board ); */ + } + } +} + LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { @@ -2211,7 +2321,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) globals = ((CREATESTRUCT*)lParam)->lpCreateParams; SetWindowLongPtr( hWnd, GWL_USERDATA, (long)globals ); #ifdef _WIN32_WCE - globals->hwndCB = makeCommandBar( hWnd, globals->hInst ); + globals->hwndCB = makeCommandBar( hWnd, globals->locInst ); #endif #ifdef _WIN32_WCE @@ -2269,14 +2379,19 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case ID_FILE_ABOUT: doAbout( globals ); break; + + case ID_FILE_LOCALES: + chooseChangeResFile( globals ); + break; + case ID_GAME_GAMEINFO: { GameInfoState state; XP_MEMSET( &state, 0, sizeof(state) ); state.dlgHdr.globals = globals; - DialogBoxParam(globals->hInst, (LPCTSTR)IDD_GAMEINFO, hWnd, - (DLGPROC)GameInfo, (long)&state ); + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_GAMEINFO, hWnd, + (DLGPROC)GameInfo, (long)&state ); if ( !state.userCancelled ) { if ( state.prefsChanged ) { @@ -2290,8 +2405,9 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case ID_FILE_NEWGAME: XP_LOGF( "ID_FILE_NEWGAME" ); if ( ceSaveCurGame( globals, XP_FALSE ) - || queryBoxChar( hWnd, "Do you really want to " - "overwrite the current game?" ) ) { + || queryBoxChar( globals, hWnd, + ceGetResString( globals, + IDS_OVERWRITE ) ) ) { draw = ceDoNewGame( globals ); } break; @@ -2309,8 +2425,9 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case ID_GAME_FINALSCORES: if ( server_getGameIsOver( globals->game.server ) ) { ceDisplayFinalScores( globals ); - } else if ( queryBoxChar( hWnd, "Are you sure you want to end " - "the game now?" ) ) { + } else if ( queryBoxChar( globals, hWnd, + ceGetResString( globals, + IDS_ENDNOW ) ) ) { server_endGame( globals->game.server ); draw = TRUE; } @@ -2600,7 +2717,7 @@ ceAbout(HWND hDlg, UINT message, WPARAM wParam, LPARAM XP_UNUSED(lParam)) static XP_Bool ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream, - wchar_t* title, XP_U16 buttons, XP_Bool destroy ) + const wchar_t* title, XP_U16 buttons, XP_Bool destroy ) { /* It seems we want to use messagebox for everything on smartphone and Windows, but not on PPC since it doesn't scroll and doesn't use @@ -2627,7 +2744,7 @@ ceMsgFromStream( CEAppGlobals* globals, XWStreamCtxt* stream, state.dlgHdr.globals = globals; assertOnTop( globals->hWnd ); - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_STRBOX, globals->hWnd, + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_STRBOX, globals->hWnd, (DLGPROC)StrBox, (long)&state ); saidYes = state.result == IDOK; } @@ -2651,8 +2768,8 @@ ceStreamToStrBuf( MPFORMAL XWStreamCtxt* stream ) } /* ceStreamToStrBuf */ static int -messageBoxStream( CEAppGlobals* globals, XWStreamCtxt* stream, wchar_t* title, - XP_U16 buttons ) +messageBoxStream( CEAppGlobals* globals, XWStreamCtxt* stream, + const wchar_t* title, XP_U16 buttons ) { XP_UCHAR* buf = ceStreamToStrBuf( MPPARM(globals->mpool) stream ); int result; @@ -2665,7 +2782,7 @@ messageBoxStream( CEAppGlobals* globals, XWStreamCtxt* stream, wchar_t* title, } /* messageBoxStream */ XP_Bool -queryBoxChar( HWND hWnd, const XP_UCHAR* msg ) +queryBoxChar( CEAppGlobals* globals, HWND hWnd, const XP_UCHAR* msg ) { wchar_t widebuf[128]; XP_U16 answer; @@ -2674,7 +2791,8 @@ queryBoxChar( HWND hWnd, const XP_UCHAR* msg ) widebuf, VSIZE(widebuf) ); widebuf[len] = 0; - answer = MessageBox( hWnd, widebuf, L"Question", + answer = MessageBox( hWnd, widebuf, + ceGetResStringL( globals, IDS_QUESTION_L ), MB_YESNO | MB_ICONQUESTION ); return answer == IDOK || answer == IDYES; } /* queryBoxChar */ @@ -2682,7 +2800,8 @@ queryBoxChar( HWND hWnd, const XP_UCHAR* msg ) static XP_Bool ceQueryFromStream( CEAppGlobals* globals, XWStreamCtxt* stream ) { - return ceMsgFromStream( globals, stream, L"Question", + return ceMsgFromStream( globals, stream, + ceGetResStringL( globals, IDS_QUESTION_L ), MB_OKCANCEL | MB_ICONQUESTION, XP_FALSE ); } /* ceQueryFromStream */ @@ -2882,90 +3001,89 @@ ce_util_getVTManager( XW_UtilCtxt* uc ) static void ce_util_userError( XW_UtilCtxt* uc, UtilErrID id ) { - XP_UCHAR* message; - CEAppGlobals* globals = (CEAppGlobals*)uc->closure; + XP_U16 resID = 0; switch( id ) { case ERR_TILES_NOT_IN_LINE: - message = "All tiles played must be in a line."; + resID = IDS_TILES_NOT_IN_LINE; break; case ERR_NO_EMPTIES_IN_TURN: - message = "Empty squares cannot separate tiles played."; + resID = IDS_NO_EMPTIES_IN_TURN; break; case ERR_TWO_TILES_FIRST_MOVE: - message = "Must play two or more pieces on the first move."; + resID = IDS_TWO_TILES_FIRST_MOVE; break; case ERR_TILES_MUST_CONTACT: - message = "New pieces must contact others already in place (or " - "the middle square on the first move)."; + resID = IDS_TILES_MUST_CONTACT; break; case ERR_NOT_YOUR_TURN: - message = "You can't do that; it's not your turn!"; + resID = IDS_NOT_YOUR_TURN; break; case ERR_NO_PEEK_ROBOT_TILES: - message = "No peeking at the robot's tiles!"; + resID = IDS_NO_PEEK_ROBOT_TILES; break; case ERR_CANT_TRADE_MID_MOVE: - message = "Remove played tiles before trading."; + resID = IDS_CANT_TRADE_MID_MOVE; break; case ERR_TOO_FEW_TILES_LEFT_TO_TRADE: - message = "Too few tiles left to trade."; + resID = IDS_TOO_FEW_TILES_LEFT_TO_TRADE; break; case ERR_CANT_UNDO_TILEASSIGN: - message = "Tile assignment can't be undone."; + resID = IDS_CANT_UNDO_TILEASSIGN; break; case ERR_CANT_HINT_WHILE_DISABLED: - message = "The hint feature is disabled for this game. Enable " - "it for a new game using the Preferences dialog."; + resID = IDS_CANT_HINT_WHILE_DISABLED; break; #ifndef XWFEATURE_STANDALONE_ONLY case ERR_NO_PEEK_REMOTE_TILES: - message = "No peeking at remote players' tiles!"; + resID = IDS_NO_PEEK_REMOTE_TILES; break; case ERR_REG_UNEXPECTED_USER: - message = "Refused attempt to register unexpected user[s]."; + resID = IDS_REG_UNEXPECTED_USER; break; case ERR_SERVER_DICT_WINS: - message = "Conflict between Host and Guest dictionaries; Host wins."; - XP_WARNF( "GTK may have problems here." ); + resID = IDS_SERVER_DICT_WINS; break; case ERR_REG_SERVER_SANS_REMOTE: - message = "At least one player must be marked remote for a game " - "started as Host."; + resID = IDS_REG_SERVER_SANS_REMOTE; break; #endif #ifdef XWFEATURE_RELAY case ERR_RELAY_BASE + XWRELAY_ERROR_TIMEOUT: - message = "The relay timed you out; usually that means " - "the other players didn't show."; + resID = IDS_XWRELAY_ERROR_TIMEOUT; break; case ERR_RELAY_BASE + XWRELAY_ERROR_HEART_YOU: - message = "You were disconnected from relay because it didn't " - "hear from you in too long."; + resID = IDS_ERROR_HEART_YOU; break; case ERR_RELAY_BASE + XWRELAY_ERROR_HEART_OTHER: case ERR_RELAY_BASE + XWRELAY_ERROR_LOST_OTHER: - message = "The relay has lost contact with a device in this game."; + resID = IDS_XWRELAY_ERROR_HEART_OTHER; break; + /* Same string as above for now */ +/* resID = IDS_XWRELAY_ERROR_LOST_OTHER; */ +/* break; */ #endif default: - XP_LOGF( "%s(%d)", __func__, id ); - message = "unknown errorcode ID!!!"; + XP_WARNF( "unknown error code: %d", id ); break; } - ceOops( globals, message ); + if ( 0 != resID ) { + CEAppGlobals* globals = (CEAppGlobals*)uc->closure; + const XP_UCHAR* message = ceGetResString( globals, resID ); + ceOops( globals, message ); + } } /* ce_util_userError */ static XP_Bool ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream ) { - char* query = NULL; + const char* query = NULL; CEAppGlobals* globals = (CEAppGlobals*)uc->closure; switch( id ) { @@ -2973,16 +3091,19 @@ ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, XWStreamCtxt* stream ) return ceQueryFromStream( globals, stream ); case QUERY_COMMIT_TRADE: - query = "Are you sure you want to trade the selected tiles?"; + query = ceGetResString( globals, IDS_QUERY_TRADE ); assertOnTop( globals->hWnd ); - return queryBoxChar( globals->hWnd, query ); + return queryBoxChar( globals, globals->hWnd, query ); case QUERY_ROBOT_MOVE: - return ceMsgFromStream( globals, stream, L"FYI", + return ceMsgFromStream( globals, stream, + ceGetResStringL( globals, IDS_FYI_L), MB_OK | MB_ICONINFORMATION, XP_FALSE ); case QUERY_ROBOT_TRADE: - messageBoxStream( globals, stream, L"FYI", MB_OK | MB_ICONINFORMATION); + messageBoxStream( globals, stream, + ceGetResStringL( globals, IDS_FYI_L), + MB_OK | MB_ICONINFORMATION); break; default: @@ -3051,7 +3172,7 @@ ce_util_userPickTile( XW_UtilCtxt* uc, const PickInfo* pi, state.pi = pi; assertOnTop( globals->hWnd ); - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_ASKBLANK, globals->hWnd, + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_ASKBLANK, globals->hWnd, (DLGPROC)BlankDlg, (long)&state ); return state.result; } /* ce_util_userPickTile */ @@ -3070,7 +3191,7 @@ ce_util_askPassword( XW_UtilCtxt* uc, const XP_UCHAR* name, state.lenp = len; assertOnTop( globals->hWnd ); - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_ASKPASS, globals->hWnd, + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_ASKPASS, globals->hWnd, (DLGPROC)PasswdDlg, (long)&state ); return !state.userCancelled; @@ -3227,75 +3348,113 @@ ce_util_makeStreamFromAddr( XW_UtilCtxt* uc, XP_PlayerAddr channelNo ) } /* ce_util_makeStreamFromAddr */ #endif -static const XP_UCHAR* -ce_util_getUserString( XW_UtilCtxt* XP_UNUSED(uc), XP_U16 stringCode ) + static const XP_UCHAR* +ce_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode ) { + CEAppGlobals* globals = (CEAppGlobals*)uc->closure; + XP_U16 resID = 0; + const XP_UCHAR* result = NULL; + switch( stringCode ) { case STRD_REMAINING_TILES_ADD: - return (XP_UCHAR*)"+ %d [all remaining tiles]"; + resID = IDS_REMAINING_TILES_ADD; + break; case STRD_UNUSED_TILES_SUB: - return (XP_UCHAR*)"- %d [unused tiles]"; + resID = IDS_UNUSED_TILES_SUB; + break; case STR_BONUS_ALL: - return (XP_UCHAR*)"Bonus for using all tiles: 50" XP_CR; + resID = IDS_BONUS_ALL; + break; case STRD_TURN_SCORE: - return (XP_UCHAR*)"Score for turn: %d" XP_CR; + resID = IDS_TURN_SCORE; + break; case STR_COMMIT_CONFIRM: - return (XP_UCHAR*)"Commit the current move?" XP_CR; + resID = IDS_COMMIT_CONFIRM; + break; case STR_LOCAL_NAME: - return (XP_UCHAR*)"%s"; + resID = IDS_LOCAL_NAME; + break; case STR_NONLOCAL_NAME: - return (XP_UCHAR*)"%s (remote)"; + resID = IDS_NONLOCAL_NAME; + break; case STRD_TIME_PENALTY_SUB: - return (XP_UCHAR*)" - %d [time]"; + resID = IDS_TIME_PENALTY_SUB; + break; case STRD_CUMULATIVE_SCORE: - return (XP_UCHAR*)"Cumulative score: %d" XP_CR; + resID = IDS_CUMULATIVE_SCORE; + break; case STRS_MOVE_ACROSS: - return (XP_UCHAR*)"move (from %s across)" XP_CR; + resID = IDS_MOVE_ACROSS; + break; case STRS_MOVE_DOWN: - return (XP_UCHAR*)"move (from %s down)" XP_CR; + resID = IDS_MOVE_DOWN; + break; case STRS_TRAY_AT_START: - return (XP_UCHAR*)"Tray at start: %s" XP_CR; + resID = IDS_TRAY_AT_START; + break; case STRS_NEW_TILES: - return (XP_UCHAR*)"New tiles: %s" XP_CR; + resID = IDS_NEW_TILES; + break; case STRSS_TRADED_FOR: - return (XP_UCHAR*)"Traded %s for %s."; + resID = IDS_TRADED_FOR; + break; case STR_PASS: - return (XP_UCHAR*)"pass" XP_CR; + resID = IDS_PASS; + break; case STR_PHONY_REJECTED: - return (XP_UCHAR*)"Illegal word in move; turn lost!" XP_CR; + resID = IDS_PHONY_REJECTED; + break; case STRD_ROBOT_TRADED: - return (XP_UCHAR*)"Robot traded tiles %d this turn."; + resID = IDS_ROBOT_TRADED; + break; case STR_ROBOT_MOVED: - return (XP_UCHAR*)"The robot made this move:" XP_CR; + resID = IDS_ROBOT_MOVED; + break; case STR_REMOTE_MOVED: - return (XP_UCHAR*)"Remote player made this move:" XP_CR; + resID = IDS_REMOTE_MOVED; + break; case STR_PASSED: - return (XP_UCHAR*)"Passed"; + resID = IDS_PASSED; + break; case STRSD_SUMMARYSCORED: - return (XP_UCHAR*)"%s:%d"; + resID = IDS_SUMMARYSCORED; + break; case STRD_TRADED: - return (XP_UCHAR*)"Traded %d"; + resID = IDS_TRADED; + break; case STR_LOSTTURN: - return (XP_UCHAR*)"Lost turn"; + resID = IDS_LOSTTURN; + break; #ifndef XWFEATURE_STANDALONE_ONLY case STR_LOCALPLAYERS: - return (XP_UCHAR*)"Locl playrs:"; + resID = IDS_LOCALPLAYERS; + break; #endif case STR_TOTALPLAYERS: - return (XP_UCHAR*)"Player count:"; + resID = IDS_TOTALPLAYERS; + break; case STRS_VALUES_HEADER: - return (XP_UCHAR*)"%s counts/values:" XP_CR; + resID = IDS_VALUES_HEADER; + break; default: - XP_LOGF( "stringCode=%d", stringCode ); - return (XP_UCHAR*)"unknown code"; + XP_WARNF( "id for stringCode %d not found", stringCode ); + break; } + + if ( 0 != resID ) { + result = ceGetResString( globals, resID ); + } else { + XP_WARNF( "%s: no resource for id %d", __func__, stringCode ); + result = ""; + } + return result; } /* ce_util_getUserString */ static void @@ -3304,7 +3463,7 @@ ce_formatBadWords( BadWordInfo* bwi, XP_UCHAR buf[], XP_U16 bufsiz ) XP_U16 i; for ( i = 0, buf[0] = '\0'; ; ) { - XP_UCHAR wordBuf[18]; + XP_UCHAR wordBuf[24]; sprintf( wordBuf, "\"%s\"", bwi->words[i] ); XP_ASSERT( strlen(wordBuf) < sizeof(wordBuf)-1 ); strncat( buf, wordBuf, bufsiz - 1 ); @@ -3324,19 +3483,24 @@ ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi, CEAppGlobals* globals = (CEAppGlobals*)uc->closure; XP_UCHAR wordsBuf[256]; XP_UCHAR msgBuf[256]; + const XP_UCHAR* fmt; XP_Bool isOk; ce_formatBadWords( bwi, wordsBuf, sizeof(wordsBuf) ); - sprintf( msgBuf, "Word[s] %s not found in dictionary.", wordsBuf ); + fmt = ceGetResString( globals, IDS_WRDNOTFOUND ); + snprintf( msgBuf, VSIZE(msgBuf), fmt, wordsBuf ); if ( turnLost ) { - ceMessageBoxChar( globals, msgBuf, L"Illegal word", + ceMessageBoxChar( globals, msgBuf, + ceGetResStringL( globals, IDS_ILLEGALWRD_L ), MB_OK | MB_ICONHAND ); isOk = XP_TRUE; } else { - strcat( msgBuf, " Use it anyway?" ); + const XP_UCHAR* str = ceGetResString( globals, IDS_USEANYWAY ); + XP_U16 len = strlen( msgBuf ); + XP_SNPRINTF( &msgBuf[len], VSIZE(msgBuf)-len, " %s", str ); assertOnTop( globals->hWnd ); - isOk = queryBoxChar( globals->hWnd, msgBuf ); + isOk = queryBoxChar( globals, globals->hWnd, msgBuf ); } return isOk; @@ -3373,7 +3537,7 @@ ce_util_getTraySearchLimits( XW_UtilCtxt* uc, XP_U16* min, XP_U16* max ) hls.max = *max; assertOnTop( globals->hWnd ); - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_ASKHINTLIMTS, globals->hWnd, + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_ASKHINTLIMTS, globals->hWnd, (DLGPROC)HintLimitsDlg, (long)&hls ); if ( !hls.cancelled ) { diff --git a/xwords4/wince/cemain.h b/xwords4/wince/cemain.h index 885c2b71b..00ba06613 100755 --- a/xwords4/wince/cemain.h +++ b/xwords4/wince/cemain.h @@ -112,6 +112,7 @@ enum { typedef struct CEAppGlobals { HINSTANCE hInst; + HINSTANCE locInst; /* same as hInst if no l10n DLL in use */ HDC hdc; /* to pass drawing ctxt to draw code */ HWND hWnd; #ifdef _WIN32_WCE @@ -133,6 +134,7 @@ typedef struct CEAppGlobals { XWGame game; CurGameInfo gameInfo; XP_UCHAR* curGameName; /* path to storage for current game */ + XP_UCHAR* langFileName; /* language file currently loaded or chosen */ XW_UtilCtxt util; VTableMgr* vtMgr; XP_U16* bonusInfo; @@ -171,6 +173,10 @@ typedef struct CEAppGlobals { XP_U16 dbWidth, dbHeight; #endif +#ifdef LOADSTRING_BROKEN + void* resStrStorage; /* used in ceresstr.c */ +#endif + wchar_t* specialDirs[N_CACHED_PATHS]; /* reserved for ceGetPath() */ #ifdef XWFEATURE_SEARCHLIMIT @@ -195,7 +201,8 @@ enum { #define CE_NUM_EDITABLE_COLORS CE_BLACK_COLOR -XP_Bool queryBoxChar( HWND hWnd, const XP_UCHAR* msg ); +XP_Bool queryBoxChar( CEAppGlobals* globals, HWND hWnd, + const XP_UCHAR* msg ); /* These allow LISTBOX and COMBOBOX to be used by the same code */ diff --git a/xwords4/wince/ceprefs.c b/xwords4/wince/ceprefs.c index 0e01c0c17..274718fa8 100755 --- a/xwords4/wince/ceprefs.c +++ b/xwords4/wince/ceprefs.c @@ -26,6 +26,7 @@ #include "debhacks.h" #include "cedebug.h" #include "cefonts.h" +#include "ceresstr.h" /* Stuff the strings for phonies. Why can't I put this in the resource? */ @@ -35,15 +36,12 @@ stuffPhoniesList( CePrefsDlgState* state ) HWND hDlg = state->dlgHdr.hDlg; CEAppGlobals* globals = state->dlgHdr.globals; XP_U16 ii; - wchar_t* strings[] = { - L"Ignore", - L"Warn", - L"Disallow" - }; + XP_U16 resIDs[] = { IDS_IGNORE_L,IDS_WARN_L, IDS_DISALLOW_L }; - for ( ii = 0; ii < 3; ++ii ) { + for ( ii = 0; ii < VSIZE(resIDs); ++ii ) { + const wchar_t* str = ceGetResStringL( globals, resIDs[ii] ); SendDlgItemMessage( hDlg, state->phonComboId, - ADDSTRING(globals), ii, (long)strings[ii] ); + ADDSTRING(globals), ii, (long)str ); } } /* stuffPhoniesList */ @@ -333,9 +331,12 @@ PrefsDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) break; case IDC_CHECKHINTSLIMITS: if ( IS_SMARTPHONE(globals) ) { - ceMessageBoxChar( globals, "This feature " - "requires a touch screen.", - L"Sorry", MB_OK | MB_ICONHAND ); + ceMessageBoxChar( globals, + ceGetResString( globals, + IDS_NEED_TOUCH ), + ceGetResStringL( globals, + IDS_FYI_L ), + MB_OK | MB_ICONHAND ); ceSetChecked( hDlg, IDC_CHECKHINTSLIMITS, XP_FALSE ); } break; @@ -370,7 +371,7 @@ WrapPrefsDialog( HWND hDlg, CEAppGlobals* globals, CePrefsDlgState* state, state->isNewGame = isNewGame; XP_MEMCPY( &state->prefsPrefs, prefsPrefs, sizeof( state->prefsPrefs ) ); - DialogBoxParam( globals->hInst, (LPCTSTR)IDD_OPTIONSDLG, hDlg, + DialogBoxParam( globals->locInst, (LPCTSTR)IDD_OPTIONSDLG, hDlg, (DLGPROC)PrefsDlg, (long)state ); result = !state->userCancelled; diff --git a/xwords4/wince/ceresstr.c b/xwords4/wince/ceresstr.c new file mode 100644 index 000000000..c94096c26 --- /dev/null +++ b/xwords4/wince/ceresstr.c @@ -0,0 +1,341 @@ +/* -*- compile-command: "make -j3 TARGET_OS=wince DEBUG=TRUE RELAY_NAME_DEFAULT=localhost" -*- */ +/* + * Copyright 2009 by Eric House (xwords@eehouse.org). All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "ceresstr.h" +#include "ceutil.h" +#include "cedebug.h" + +HINSTANCE +ceLoadResFile( const XP_UCHAR* file ) +{ + HINSTANCE hinst = NULL; + wchar_t widebuf[128]; + XP_U16 len = MultiByteToWideChar( CP_ACP, 0, file, -1, widebuf, VSIZE(widebuf) ); + widebuf[len] = 0; + hinst = LoadLibrary( widebuf ); + return hinst; +} + +void +ceCloseResFile( HINSTANCE inst ) +{ + XP_ASSERT( !!inst ); + FreeLibrary( inst ); +} + +#ifdef LOADSTRING_BROKEN +typedef struct _ResStrEntry { + union { + XP_UCHAR nstr[1]; + wchar_t wstr[1]; + } u; +} ResStrEntry; + +typedef struct _ResStrStorage { + ResStrEntry* entries[CE_LAST_RES_ID - CE_FIRST_RES_ID + 1]; +} ResStrStorage; + +static const ResStrEntry* +getEntry( CEAppGlobals* globals, XP_U16 resID, XP_Bool isWide ) +{ + ResStrStorage* storage = (ResStrStorage*)globals->resStrStorage; + ResStrEntry* entry; + XP_U16 index; + + XP_ASSERT( resID >= CE_FIRST_RES_ID && resID <= CE_LAST_RES_ID ); + index = CE_LAST_RES_ID - resID; + XP_ASSERT( index < VSIZE(storage->entries) ); + + if ( !storage ) { + storage = XP_MALLOC( globals->mpool, sizeof( *storage ) ); + XP_MEMSET( storage, 0, sizeof(*storage) ); + globals->resStrStorage = storage; + } + + entry = storage->entries[index]; + if ( !entry ) { + wchar_t wbuf[265]; + XP_U16 len; + LoadString( globals->locInst, resID, wbuf, VSIZE(wbuf) ); + if ( isWide ) { + len = wcslen( wbuf ); + entry = (ResStrEntry*)XP_MALLOC( globals->mpool, + (len*sizeof(wchar_t)) + + sizeof(*entry) ); + wcscpy( entry->u.wstr, wbuf ); + } else { + XP_UCHAR nbuf[265]; + (void)WideCharToMultiByte( CP_ACP, 0, wbuf, -1, + nbuf, VSIZE(nbuf), NULL, NULL ); + len = XP_STRLEN( nbuf ); + entry = (ResStrEntry*)XP_MALLOC( globals->mpool, + len + sizeof(*entry) ); + XP_STRNCPY( entry->u.nstr, nbuf, len + 1 ); + } + + storage->entries[index] = entry; + } + + return entry; +} /* getEntry */ +#endif + +const XP_UCHAR* +ceGetResString( CEAppGlobals* globals, XP_U16 resID ) +{ +#ifdef LOADSTRING_BROKEN + const ResStrEntry* entry = getEntry( globals, resID, XP_FALSE ); + return entry->u.nstr; +#else + /* Docs say that you can call LoadString with 0 as the length and it'll + return a read-only ptr to the text within the resource, but I'm getting + a ptr to wide chars back the resource text being multibyte. I swear + I've seen it work, though, so might be a res file formatting thing or a + param to the res compiler. Need to investigate. Until I do, the above + caches local multibyte copies of the resources so the API can stay the + same. */ + const XP_UCHAR* str = NULL; + LoadString( globals->locInst, resID, (LPSTR)&str, 0 ); + return str; +#endif +} + +const wchar_t* +ceGetResStringL( CEAppGlobals* globals, XP_U16 resID ) +{ +#ifdef LOADSTRING_BROKEN + const ResStrEntry* entry = getEntry( globals, resID, XP_TRUE ); + return entry->u.wstr; +#else + /* Docs say that you can call LoadString with 0 as the length and it'll + return a read-only ptr to the text within the resource, but I'm getting + a ptr to wide chars back the resource text being multibyte. I swear + I've seen it work, though, so might be a res file formatting thing or a + param to the res compiler. Need to investigate. Until I do, the above + caches local multibyte copies of the resources so the API can stay the + same. */ + const XP_UCHAR* str = NULL; + LoadString( globals->locInst, resID, (LPSTR)&str, 0 ); + return str; +#endif +} + +#ifdef LOADSTRING_BROKEN +void +ceFreeResStrings( CEAppGlobals* globals ) +{ + ResStrStorage* storage = (ResStrStorage*)globals->resStrStorage; + if ( !!storage ) { + XP_U16 ii; + for ( ii = 0; ii < VSIZE(storage->entries); ++ii ) { + ResStrEntry* entry = storage->entries[ii]; + if ( !!entry ) { + XP_FREE( globals->mpool, entry ); + } + } + + XP_FREE( globals->mpool, storage ); + globals->resStrStorage = NULL; + } +} +#endif + +typedef struct _DllSelState { + CeDlgHdr dlgHdr; + wchar_t wbuf[MAX_PATH]; + + wchar_t* names[8]; + wchar_t* files[8]; + XP_U16 nItems; + + XP_U16 dllListID; + XP_Bool inited; + XP_Bool cancelled; +} DllSelState; + +static void +copyWideStr( CEAppGlobals* globals, const wchar_t* str, wchar_t** loc ) +{ + XP_U16 len = 1 + wcslen( str ); + *loc = XP_MALLOC( globals->mpool, len * sizeof(**loc) ); + wcscpy( *loc, str ); + } + +/* Iterate through .dll files listing the name of any that has one. Pair with + * file from which it came since that's what we'll return. + */ +static void +listDlls( DllSelState* state ) +{ + LOG_FUNC(); + HANDLE fileH; + HWND hDlg = state->dlgHdr.hDlg; + WIN32_FIND_DATA data; + CEAppGlobals* globals = state->dlgHdr.globals; + XP_U16 nItems = 0; + wchar_t name[64]; + + LoadString( globals->hInst, IDS_LANGUAGE_NAME, name, VSIZE(name) ); + copyWideStr( globals, name, &state->names[nItems++] ); + (void)SendDlgItemMessage( hDlg, state->dllListID, ADDSTRING(globals), + 0, (LPARAM)name ); + + wchar_t path[MAX_PATH]; + ceGetExeDir( path, VSIZE(path) ); + wcscat( path, L"\\xwords4*.dll" ); + + XP_MEMSET( &data, 0, sizeof(data) ); + fileH = FindFirstFile( path, &data ); + while ( fileH != INVALID_HANDLE_VALUE ) { + + HINSTANCE hinst = LoadLibrary( data.cFileName ); + if ( !!hinst ) { + if ( LoadString( hinst, IDS_LANGUAGE_NAME, + name, VSIZE(name) ) ) { + (void)SendDlgItemMessage( hDlg, state->dllListID, ADDSTRING(globals), + 0, (LPARAM)name ); + copyWideStr( globals, name, &state->names[nItems] ); + copyWideStr( globals, data.cFileName, &state->files[nItems] ); + + ++nItems; + } else { + XP_LOGF( "IDS_LANGUAGE_NAME not found in %ls", data.cFileName ); + } + FreeLibrary( hinst ); + } else { + logLastError("LoadLibrary"); + XP_LOGF( "Unable to open" ); + } + + if ( nItems >= VSIZE(state->names) ) { + break; + } else if ( !FindNextFile( fileH, &data ) ) { + XP_ASSERT( GetLastError() == ERROR_NO_MORE_FILES ); + break; + } + } + SendDlgItemMessage( hDlg, state->dllListID, SETCURSEL(globals), 0, 0 ); + + state->nItems = nItems; + LOG_RETURN_VOID(); +} /* listDlls */ + +static void +unlistDlls( DllSelState* state ) +{ + XP_U16 ii; + CEAppGlobals* globals = state->dlgHdr.globals; + for ( ii = 0; ii < state->nItems; ++ii ) { + XP_ASSERT( ii == 0 || !!state->files[ii] ); + if ( ii > 0 ) { + XP_FREE( globals->mpool, state->files[ii] ); + } + XP_FREE( globals->mpool, state->names[ii] ); + } +} + +static XP_Bool +getSelText( DllSelState* state ) +{ + XP_Bool gotIt = XP_FALSE; + HWND hDlg = state->dlgHdr.hDlg; + CEAppGlobals* globals = state->dlgHdr.globals; + + XP_S16 sel = SendDlgItemMessage( hDlg, state->dllListID, + GETCURSEL(globals), 0, 0 ); + if ( sel >= 0 ) { + gotIt = XP_TRUE; + if ( sel > 0 ) { + wcscpy( state->wbuf, state->files[sel] ); + } + } + return gotIt; +} /* getSelText */ + +LRESULT CALLBACK +DllSelDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) +{ + DllSelState* state; + BOOL result = FALSE; + + if ( message == WM_INITDIALOG ) { + SetWindowLongPtr( hDlg, GWL_USERDATA, lParam ); + + state = (DllSelState*)lParam; + state->cancelled = XP_TRUE; + + state->dllListID = LB_IF_PPC( state->dlgHdr.globals, LOCALES_COMBO ); + + ceDlgSetup( &state->dlgHdr, hDlg, DLG_STATE_NONE ); + + ceDlgComboShowHide( &state->dlgHdr, LOCALES_COMBO ); + + result = TRUE; + } else { + state = (DllSelState*)GetWindowLongPtr( hDlg, GWL_USERDATA ); + if ( !!state ) { + if ( !state->inited ) { + state->inited = XP_TRUE; + listDlls( state ); + } + + if ( ceDoDlgHandle( &state->dlgHdr, message, wParam, lParam) ) { + result = TRUE; + } else if ( (WM_COMMAND == message) + && (BN_CLICKED == HIWORD(wParam)) ) { + switch( LOWORD(wParam) ) { + case IDOK: + state->cancelled = XP_FALSE; + getSelText( state ); + /* fallthrough */ + case IDCANCEL: + unlistDlls( state ); + EndDialog( hDlg, LOWORD(wParam) ); + result = TRUE; + break; + } + } + } + } + + return result; +} /* DllSelDlg */ + +/* ceChooseResFile: List all the available .rc files and return if user + * chooses one. + */ +XP_Bool +ceChooseResFile( CEAppGlobals* globals, XP_UCHAR* buf, XP_U16 bufLen ) +{ + DllSelState state; + XP_MEMSET( &state, 0, sizeof(state) ); + + state.dlgHdr.globals = globals; + + (void)DialogBoxParam( globals->locInst, (LPCTSTR)IDD_LOCALESDLG, globals->hWnd, + (DLGPROC)DllSelDlg, (long)&state ); + + if ( !state.cancelled ) { + (void)WideCharToMultiByte( CP_ACP, 0, state.wbuf, -1, + buf, bufLen, NULL, NULL ); + } + + LOG_RETURNF( "%s", buf ); + return !state.cancelled; +} diff --git a/xwords4/wince/ceresstr.h b/xwords4/wince/ceresstr.h new file mode 100644 index 000000000..eb5e54c99 --- /dev/null +++ b/xwords4/wince/ceresstr.h @@ -0,0 +1,38 @@ +/* -*- compile-command: ""; -*- */ +/* + * Copyright 2009 by Eric House (xwords@eehouse.org). All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _CERESSTR_H_ +#define _CERESSTR_H_ + +#include "cemain.h" + +HINSTANCE ceLoadResFile( const XP_UCHAR* file ); +void ceCloseResFile( HINSTANCE inst ); +XP_Bool ceChooseResFile( CEAppGlobals* globals, XP_UCHAR* buf, XP_U16 bufLen ); + +const XP_UCHAR* ceGetResString( CEAppGlobals* globals, XP_U16 resID ); +const wchar_t* ceGetResStringL( CEAppGlobals* globals, XP_U16 resID ); + +# ifdef LOADSTRING_BROKEN +void ceFreeResStrings( CEAppGlobals* globals ); +# else +# define ceFreeResStrings(g) +# endif + +#endif diff --git a/xwords4/wince/cestrbx.h b/xwords4/wince/cestrbx.h index 74eae0a09..a19a00fca 100755 --- a/xwords4/wince/cestrbx.h +++ b/xwords4/wince/cestrbx.h @@ -29,7 +29,7 @@ LRESULT CALLBACK StrBox(HWND hDlg, UINT message, WPARAM wParam, typedef struct StrBoxState { CeDlgHdr dlgHdr; - wchar_t* title; + const wchar_t* title; XWStreamCtxt* stream; XP_U16 result; XP_Bool isQuery; diff --git a/xwords4/wince/cesvdgms.c b/xwords4/wince/cesvdgms.c index 0d6e655cd..94af1766e 100644 --- a/xwords4/wince/cesvdgms.c +++ b/xwords4/wince/cesvdgms.c @@ -29,6 +29,7 @@ #include "cemain.h" #include "cesvdgms.h" #include "ceutil.h" +#include "ceresstr.h" #include "cedebug.h" #include "debhacks.h" @@ -49,22 +50,22 @@ ceFileExists( CEAppGlobals* globals, const wchar_t* name ) XP_U16 len; len = ceGetPath( globals, DEFAULT_DIR_PATH_L, buf, VSIZE(buf) ); - swprintf( &buf[len], L"%s.xwg", name ); + _snwprintf( &buf[len], VSIZE(buf)-len, L"%s.xwg", name ); attributes = GetFileAttributes( buf ); return attributes != 0xFFFFFFFF; } static void -makeUniqueName( CEAppGlobals* globals, wchar_t* buf, - XP_U16 XP_UNUSED_DBG(bufLen) ) +makeUniqueName( CEAppGlobals* globals, wchar_t* buf, XP_U16 bufLen ) { XP_U16 ii; + const wchar_t* fmt = ceGetResStringL( globals, IDS_UNTITLED_FORMAT ); for ( ii = 1; ii < 100; ++ii ) { #ifdef DEBUG int len = #endif - swprintf( buf, L"Untitled%d", ii ); + _snwprintf( buf, bufLen, fmt, ii ); XP_ASSERT( len < bufLen ); if ( !ceFileExists( globals, buf ) ) { break; @@ -89,7 +90,7 @@ SaveNameDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) state->inited = XP_FALSE; wchar_t buf[128]; - LoadString( state->dlgHdr.globals->hInst, state->lableTextId, + LoadString( state->dlgHdr.globals->locInst, state->lableTextId, buf, VSIZE(buf) ); (void)SetDlgItemText( hDlg, IDC_SVGN_SELLAB, buf ); @@ -120,16 +121,22 @@ SaveNameDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) VSIZE(buf) ); if ( ceFileExists( globals, buf ) ) { wchar_t widebuf[128]; - snwprintf( widebuf, VSIZE(widebuf), - L"File \"%s\" already exists.", buf ); - result = MessageBox( hDlg, widebuf, L"Oops!", + _snwprintf( widebuf, VSIZE(widebuf), + ceGetResStringL( globals, + IDS_FILEEXISTSFMT_L ), + buf ); + result = MessageBox( hDlg, widebuf, + ceGetResStringL(globals, + IDS_FYI_L ), MB_OK | MB_ICONHAND ); - (void)SetDlgItemText( hDlg, IDC_SVGN_EDIT, state->buf ); + (void)SetDlgItemText( hDlg, IDC_SVGN_EDIT, + state->buf ); break; } len = ceGetPath( globals, DEFAULT_DIR_PATH_L, state->buf, state->buflen ); - swprintf( &state->buf[len], L"%s.xwg", buf ); + _snwprintf( &state->buf[len], state->buflen - len, + L"%s.xwg", buf ); XP_LOGW( __func__, state->buf ); /* fallthru */ state->cancelled = XP_FALSE; @@ -161,7 +168,7 @@ ceConfirmUniqueName( CEAppGlobals* globals, HWND hWnd, XP_U16 strId, state.buf = buf; state.buflen = buflen; state.lableTextId = strId; - (void)DialogBoxParam( globals->hInst, (LPCTSTR)IDD_SAVENAMEDLG, + (void)DialogBoxParam( globals->locInst, (LPCTSTR)IDD_SAVENAMEDLG, hWnd, (DLGPROC)SaveNameDlg, (long)&state ); XP_LOGW( __func__, buf ); return !state.cancelled; @@ -315,7 +322,7 @@ renameSelected( CeSavedGamesState* state ) calling code handle it. If we're renaming any other game, we can do it here. */ if ( state->openGameIndex == state->sel ) { - swprintf( state->buf, L"%s", newPath ); + _snwprintf( state->buf, state->buflen, L"%s", newPath ); state->result = CE_SVGAME_RENAME; } else { wchar_t curPath[MAX_PATH]; @@ -358,11 +365,11 @@ duplicateSelected( CeSavedGamesState* state ) static XP_Bool deleteSelected( CeSavedGamesState* state ) { + CEAppGlobals* globals = state->dlgHdr.globals; /* confirm first!!!! */ - XP_Bool confirmed = queryBoxChar( state->dlgHdr.hDlg, - "Are you certain you want to delete the " - "selected game? This action cannot be " - "undone."); + XP_Bool confirmed = queryBoxChar( globals, state->dlgHdr.hDlg, + ceGetResString( globals, + IDS_CONFIM_DELETE ) ); if ( confirmed ) { wchar_t pathW[CE_MAX_PATH_LEN]; XP_U16 len = ceGetPath( state->dlgHdr.globals, @@ -447,7 +454,8 @@ SavedGamesDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) len = ceGetPath( state->dlgHdr.globals, DEFAULT_DIR_PATH_L, state->buf, state->buflen ); - swprintf( &state->buf[len], L"%s.xwg", buf ); + _snwprintf( &state->buf[len], state->buflen - len, + L"%s.xwg", buf ); XP_LOGW( "returning", state->buf ); state->result = CE_SVGAME_OPEN; } @@ -498,7 +506,7 @@ ceSavedGamesDlg( CEAppGlobals* globals, const XP_UCHAR* curPath, state.result = CE_SVGAME_CANCEL; assertOnTop( globals->hWnd ); - (void)DialogBoxParam( globals->hInst, (LPCTSTR)IDD_SAVEDGAMESDLG, + (void)DialogBoxParam( globals->locInst, (LPCTSTR)IDD_SAVEDGAMESDLG, globals->hWnd, (DLGPROC)SavedGamesDlg, (long)&state ); diff --git a/xwords4/wince/ceutil.c b/xwords4/wince/ceutil.c index 98e00eb7a..499a288fb 100755 --- a/xwords4/wince/ceutil.c +++ b/xwords4/wince/ceutil.c @@ -25,6 +25,7 @@ #include "cedefines.h" #include "cedebug.h" #include "debhacks.h" +#include "ceresstr.h" #define BUF_SIZE 128 #define VPADDING 4 @@ -33,22 +34,23 @@ static XP_Bool ceDoDlgScroll( CeDlgHdr* dlgHdr, WPARAM wParam ); static void ceDoDlgFocusScroll( CeDlgHdr* dlgHdr, HWND nextCtrl ); +static void adjustScrollPos( HWND hDlg, XP_S16 vertChange ); void -ceSetDlgItemText( HWND hDlg, XP_U16 id, const XP_UCHAR* buf ) +ceSetDlgItemText( HWND hDlg, XP_U16 id, const XP_UCHAR* str ) { wchar_t widebuf[BUF_SIZE]; XP_U16 len; - XP_ASSERT( buf != NULL ); + XP_ASSERT( str != NULL ); - len = (XP_U16)XP_STRLEN( buf ); + len = (XP_U16)XP_STRLEN( str ); - if ( len >= BUF_SIZE ) { - len = BUF_SIZE - 1; + if ( len >= VSIZE(widebuf) ) { + len = VSIZE(widebuf) - 1; } - MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, buf, len, widebuf, len ); + MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, str, len, widebuf, len ); widebuf[len] = 0; SendDlgItemMessage( hDlg, id, WM_SETTEXT, 0, (long)widebuf ); } /* ceSetDlgItemText */ @@ -314,7 +316,7 @@ mkFullscreenWithSoftkeys( CEAppGlobals* globals, HWND hDlg, XP_U16 curHt, } else { mbi.nToolBarId = IDM_OKCANCEL_MENUBAR; } - mbi.hInstRes = globals->hInst; + mbi.hInstRes = globals->locInst; success = SHCreateMenuBar( &mbi ); if ( !success ) { XP_LOGF( "SHCreateMenuBar failed: %ld", GetLastError() ); @@ -345,12 +347,25 @@ mkFullscreenWithSoftkeys( CEAppGlobals* globals, HWND hDlg, XP_U16 curHt, } /* mkFullscreenWithSoftkeys */ #endif +static void +ceCenterBy( HWND hDlg, XP_U16 byHowMuch ) +{ + HWND child; + + for ( child = GetWindow( hDlg, GW_CHILD ); + !!child; + child = GetWindow( child, GW_HWNDNEXT ) ) { + XP_S16 resID = GetDlgCtrlID( child ); + ceMoveItem( hDlg, resID, byHowMuch, 0 ); + } +} /* ceCenterBy */ + #define TITLE_HT 20 /* Need to get this from the OS */ void ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat ) { RECT rect; - XP_U16 fullHeight; + XP_U16 fullHeight, origWidth; CEAppGlobals* globals = dlgHdr->globals; dlgHdr->hDlg = hDlg; @@ -364,6 +379,7 @@ ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat ) GetClientRect( hDlg, &rect ); XP_ASSERT( rect.top == 0 ); fullHeight = rect.bottom; /* This is before we've resized it */ + origWidth = rect.right; #ifdef _WIN32_WCE (void)mkFullscreenWithSoftkeys( globals, hDlg, fullHeight, doWhat); @@ -377,6 +393,9 @@ ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat ) /* Measure again post-resize */ GetClientRect( hDlg, &rect ); + if ( rect.right > origWidth ) { + ceCenterBy( hDlg, (rect.right - origWidth) / 2 ); + } /* Set up the scrollbar if we're on PPC */ if ( !IS_SMARTPHONE(globals) ) { @@ -431,6 +450,18 @@ editHasFocus( void ) } /* editHasFocus */ #endif + +static void +scrollForMove( CeDlgHdr* dlgHdr, XP_U16 newY ) +{ + if ( dlgHdr->penDown ) { + XP_LOGF( "%s(%d)", __func__, newY ); + XP_S16 vertChange = dlgHdr->prevY - newY; + dlgHdr->prevY = newY; + adjustScrollPos( dlgHdr->hDlg, vertChange ); + } +} + XP_Bool ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam ) { @@ -456,6 +487,20 @@ ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam ) handled = ceDoDlgScroll( dlgHdr, wParam ); break; + case WM_LBUTTONDOWN: + dlgHdr->penDown = XP_TRUE; + dlgHdr->prevY = HIWORD(lParam); + handled = XP_TRUE; + break; + case WM_MOUSEMOVE: + scrollForMove( dlgHdr, HIWORD(lParam) ); + handled = XP_TRUE; + break; + case WM_LBUTTONUP: + dlgHdr->penDown = XP_FALSE; + handled = XP_TRUE; + break; + case WM_COMMAND: if ( BN_SETFOCUS == HIWORD(wParam) ) { ceDoDlgFocusScroll( dlgHdr, (HWND)lParam ); @@ -466,7 +511,7 @@ ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam ) break; } return handled; -} +} /* ceDoDlgHandle */ static void setScrollPos( HWND hDlg, XP_S16 newPos ) @@ -900,6 +945,33 @@ ceMessageBoxChar( CEAppGlobals* XP_UNUSED(globals), const XP_UCHAR* str, int ceOops( CEAppGlobals* globals, const XP_UCHAR* str ) { - return ceMessageBoxChar( globals, str, L"Oops!", + return ceMessageBoxChar( globals, str, + ceGetResStringL( globals, IDS_FYI_L ), MB_OK | MB_ICONHAND ); } + +XP_Bool +ceGetExeDir( wchar_t* buf, XP_U16 bufLen ) +{ + /* I wanted to use SHGetKnownFolderPath to search in \\Program + Files\\Crosswords, but perhaps it's better to search in the directory + in which the app is located. If I get CAB files working for + Smartphone, then that directory will be \\Program Files\\Crosswords. + But if users have to install files using the File Explorer it'll be + easier for them if all that's required is that the app and dictionaries + be in the same place. GetModuleFileName() supports both. + */ + + DWORD nChars = GetModuleFileName( NULL, buf, bufLen ); + XP_Bool success = nChars < bufLen; + if ( success ) { + wchar_t* lastSlash = wcsrchr( buf, '\\' ); + if ( !!lastSlash ) { + *lastSlash = 0; + } + } + + /* SHGetSpecialFolderPath(NULL,NULL,0,FALSE); */ + + return success; +} /* ceGetExeDir */ diff --git a/xwords4/wince/ceutil.h b/xwords4/wince/ceutil.h index d7ac2e24b..b093c88b3 100755 --- a/xwords4/wince/ceutil.h +++ b/xwords4/wince/ceutil.h @@ -73,6 +73,8 @@ typedef struct CeDlgHdr { /* Below this line is private to ceutil.c */ DlgStateTask doWhat; XP_U16 nPage; + XP_U16 prevY; + XP_Bool penDown; } CeDlgHdr; void ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat ); void ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId ); @@ -82,6 +84,7 @@ XP_Bool ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lPa XP_Bool ceIsLandscape( CEAppGlobals* globals ); void ceSetLeftSoftkey( CEAppGlobals* globals, XP_U16 id ); +XP_Bool ceGetExeDir( wchar_t* buf, XP_U16 bufLen ); #if defined _WIN32_WCE void ceSizeIfFullscreen( CEAppGlobals* globals, HWND hWnd ); diff --git a/xwords4/wince/l10n/xwords4_caps.rc b/xwords4/wince/l10n/xwords4_caps.rc new file mode 100644 index 000000000..6fbe5aca4 --- /dev/null +++ b/xwords4/wince/l10n/xwords4_caps.rc @@ -0,0 +1,993 @@ +// -*- mode: c; compile-command: "make TARGET_OS=wince DEBUG=TRUE"; -*- +// +// Microsoft Developer Studio generated resource script. But now I'm +// editing it. :-) +// +#include "../resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "../newres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +#include "winnt.h" +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_XWORDS4 ICON DISCARDABLE "xwords4.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""winnt.h""\r\n" + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""newres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menubar +// + +IDM_MENU MENU DISCARDABLE +BEGIN +#ifndef _WIN32_WCE + POPUP "BUTTON" + BEGIN + MENUITEM "--", W32_DUMMY_ID + END +#endif + POPUP "MENU" // <- translate + BEGIN + MENUITEM "TURN DONE", ID_MOVE_TURNDONE // <- translate + MENUITEM "JUGGLE", ID_MOVE_JUGGLE // <- translate + MENUITEM "FLIP", ID_MOVE_FLIP // <- translate + MENUITEM "TRADE", ID_MOVE_TRADE // <- translate + MENUITEM "HIDE TRAY", ID_MOVE_HIDETRAY // <- translate + + POPUP "UNDO" // <- translate + BEGIN + MENUITEM "UNDO CURRENT", ID_MOVE_UNDOCURRENT // <- translate + MENUITEM "UNDO LAST", ID_MOVE_UNDOLAST // <- translate + END + + POPUP "HINT" // <- translate + BEGIN + MENUITEM "NEXT HINT", ID_MOVE_NEXTHINT // <- translate + MENUITEM "HINT", ID_MOVE_HINT // <- translate +#ifdef XWFEATURE_SEARCHLIMIT + MENUITEM "LIMITED HINT...", ID_MOVE_LIMITEDHINT // <- translate +#endif + MENUITEM SEPARATOR + MENUITEM "SHOW VALUES", ID_MOVE_VALUES // <- translate + END + + POPUP "GAME" // <- translate + BEGIN + MENUITEM "TILE COUNTS AND VALUES", ID_GAME_TILECOUNTSANDVALUES // <- translate + MENUITEM "TILES LEFT", ID_GAME_TILESLEFT // <- translate + MENUITEM SEPARATOR + MENUITEM "GAME INFO", ID_GAME_GAMEINFO // <- translate + MENUITEM "HISTORY", ID_GAME_HISTORY // <- translate + MENUITEM "FINAL SCORES", ID_GAME_FINALSCORES // <- translate +#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH + MENUITEM "RESEND MESSAGES", ID_GAME_RESENDMSGS // <- translate +#endif + END + + POPUP "FILE" // <- translate + BEGIN + MENUITEM "FULL SCREEN", ID_FILE_FULLSCREEN // <- translate + MENUITEM SEPARATOR + MENUITEM "NEW GAME...", ID_FILE_NEWGAME // <- translate + MENUITEM "SAVED GAMES...", ID_FILE_SAVEDGAMES // <- translate + MENUITEM "PREFERENCES...", ID_FILE_PREFERENCES // <- translate + MENUITEM SEPARATOR + MENUITEM "ABOUT...", ID_FILE_ABOUT // <- translate + MENUITEM "LOCALES...", ID_FILE_LOCALES + MENUITEM SEPARATOR + MENUITEM "EXIT", ID_FILE_EXIT // <- translate + END + END +END + +#ifdef _WIN32_WCE +// soft key bar described at +// http://msdn2.microsoft.com/en-us/library/aa457781.aspx +IDM_MAIN_MENUBAR RCDATA +BEGIN + IDM_MENU, 2, + I_IMAGENONE, ID_INITIAL_SOFTID, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_DUMMY, 0, + NOMENU, + I_IMAGENONE, IDM_MENU, TBSTATE_ENABLED, + TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_MENU, 0, + 0 // Use the 0th popup above -- the only one +END + +IDM_OKCANCEL_MENUBAR RCDATA +BEGIN + 0, 2, + I_IMAGENONE, IDOK, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_OK, 0, + NOMENU, + I_IMAGENONE, IDCANCEL, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_CANCEL, 0, + NOMENU +END + +IDM_OK_MENUBAR RCDATA +BEGIN + 0, 1, + I_IMAGENONE, IDOK, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_OK, 0, + NOMENU +END + +IDM_DONE_MENUBAR RCDATA +BEGIN + 0, 1, + I_IMAGENONE, IDOK, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_DONE, 0, + NOMENU +END +#endif + +#include "../rc_incs.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// +#define BUTTON_HT 12 +#define REPOS_BUTTON_HT BUTTON_HT +#define REPOS_BUTTON_WIDTH 28 +#define REPOS_BUTTON_VPAD 2 +#define REPOS_BUTTON_HPAD 2 + +// ******** IDD_GAMEINFO DIALOG ********* +#ifdef CEFEATURE_CANSCROLL +# define ROW_HEIGHT 10 +# define ROW_SPACE 12 +# define ROW_SPACE_PL 11 +#else +# define ROW_HEIGHT 12 +# define ROW_SPACE 15 +# define ROW_SPACE_PL ROW_SPACE +#endif +#define CHECK_WIDTH 10 +#define LEFT_COL 2 +#ifdef XWFEATURE_STANDALONE_ONLY +# define GAME_NAME_WIDTH 56 +# define GAME_LABEL_WIDTH (GAME_NAME_WIDTH-10) +# define GAME_NAME_LEFT LEFT_COL +# define GAME_ROBOT_LEFT (GAME_NAME_LEFT + GAME_NAME_WIDTH + 5) +# define GAME_PWD_LEFT (GAME_ROBOT_LEFT + 15) +# define NPLAYERS_ROW 3 +# define GAME_NAMELABEL_LEFT GAME_NAME_LEFT +# define GAME_NAMELABEL_WIDTH (GAME_NAME_WIDTH-15) +# define GAME_ROBOTLABEL_LEFT (GAME_ROBOT_LEFT-7) +# define GAME_PWDLABEL_LEFT GAME_PWD_LEFT +#else +# define SERVERROLE_ROW 3 +# define GAME_NAME_WIDTH 56 +# define NPLAYERS_ROW (SERVERROLE_ROW+ROW_SPACE+3) +# define GAME_REMOTE_LEFT 1 +# define GAME_NAME_LEFT 11 +# define GAME_ROBOT_LEFT (GAME_NAME_LEFT+GAME_NAME_WIDTH+2) +# define GAME_PWD_LEFT (GAME_ROBOT_LEFT + CHECK_WIDTH + 4) +# define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT + 20) +# define GAME_NAMELABEL_WIDTH (GAME_NAME_WIDTH-15) +# define GAME_ROBOTLABEL_LEFT (GAME_ROBOT_LEFT-10) +# define GAME_PWDLABEL_LEFT (GAME_PWD_LEFT) +#endif + + +#define LABELS_ROW (NPLAYERS_ROW+ROW_SPACE) +#define PLAYER_ROW_1 (LABELS_ROW+ROW_SPACE_PL) +#define PLAYER_ROW_2 (PLAYER_ROW_1+ROW_SPACE_PL) +#define PLAYER_ROW_3 (PLAYER_ROW_2+ROW_SPACE_PL) +#define PLAYER_ROW_4 (PLAYER_ROW_3+ROW_SPACE_PL) +#define DICTPICK_LAB_ROW (PLAYER_ROW_4+ROW_SPACE+2) +#define DICTPICK_ROW (DICTPICK_LAB_ROW+ROW_SPACE-2) +#define PREFS_ROW (DICTPICK_ROW+ROW_SPACE+3) +#ifndef _WIN32_WCE +# define BUTTONS_ROW (PREFS_ROW+ROW_SPACE+3) +#endif +#ifdef _WIN32_WCE +# define GAMEINFO_HEIGHT (PREFS_ROW + ROW_SPACE + 4) +#else +# define GAMEINFO_HEIGHT (BUTTONS_ROW + BUTTON_HT + 4) +#endif + + +/* in commctrl.h, but including isn't enough */ +#undef UPDOWN_CLASS +#define UPDOWN_CLASS "msctls_updown32" + +#define CE_PLAYER_ROW(nameEdit,playerRow,robotCheck,passEdit) \ + EDITTEXT nameEdit,GAME_NAME_LEFT,playerRow,GAME_NAME_WIDTH,ROW_HEIGHT, \ + ES_AUTOHSCROLL \ + CONTROL "",robotCheck,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, \ + GAME_ROBOT_LEFT,playerRow,CHECK_WIDTH,ROW_HEIGHT \ + EDITTEXT passEdit,GAME_PWD_LEFT,playerRow,15,ROW_HEIGHT, \ + ES_PASSWORD | ES_AUTOHSCROLL \ + + +IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, 116, GAMEINFO_HEIGHT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "GAME INFO" // <- translate GAME INFO +FONT 8, "System" +BEGIN +#ifndef XWFEATURE_STANDALONE_ONLY + LTEXT "ROLE:",IDC_ROLELABEL,5,SERVERROLE_ROW,20,8 + XWCOMBO(IDC_ROLECOMBO,26,SERVERROLE_ROW,70,ROW_HEIGHT,0,58,0) + PUSHBUTTON "CONF.",GIROLECONF_BUTTON,75,SERVERROLE_ROW,20,ROW_HEIGHT // <- translate CONF. (configure) + +#endif + + LTEXT "",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,43,8 + XWCOMBO(IDC_NPLAYERSCOMBO,46,NPLAYERS_ROW,24,ROW_HEIGHT,0,58,0) + + PUSHBUTTON "JUGL.",GIJUGGLE_BUTTON,75,NPLAYERS_ROW,20,ROW_HEIGHT // <- translate JUGL. (juggle) + + LTEXT "NAME",IDC_NAMELABEL,GAME_NAMELABEL_LEFT, // <- translate NAME + LABELS_ROW,GAME_NAMELABEL_WIDTH,8,SS_NOPREFIX + LTEXT "ROBOT",IDC_ROBOTLABEL,GAME_ROBOTLABEL_LEFT,LABELS_ROW,22,8 // <- translate ROBOT + LTEXT "PWD",IDC_PASSWDLABEL,GAME_PWDLABEL_LEFT,LABELS_ROW,16,8 // <- translate PWD (password) + +#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH + LTEXT "REMOTE",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX // <- translate REMOTE + CONTROL "",REMOTE_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_1,CHECK_WIDTH,ROW_HEIGHT + CONTROL "",REMOTE_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_2,CHECK_WIDTH,ROW_HEIGHT + CONTROL "",REMOTE_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_3,CHECK_WIDTH,ROW_HEIGHT + CONTROL "",REMOTE_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_4,CHECK_WIDTH,ROW_HEIGHT +#endif + CE_PLAYER_ROW( NAME_EDIT1, PLAYER_ROW_1, ROBOT_CHECK1, PASS_EDIT1 ) + CE_PLAYER_ROW( NAME_EDIT2, PLAYER_ROW_2, ROBOT_CHECK2, PASS_EDIT2 ) + CE_PLAYER_ROW( NAME_EDIT3, PLAYER_ROW_3, ROBOT_CHECK3, PASS_EDIT3 ) + CE_PLAYER_ROW( NAME_EDIT4, PLAYER_ROW_4, ROBOT_CHECK4, PASS_EDIT4 ) + + LTEXT "DICTIONARY:",IDC_DICTLABEL,LEFT_COL,DICTPICK_LAB_ROW,36,8, // <- translate DICTIONARY + SS_NOPREFIX + XWCOMBO(IDC_DICTLIST, LEFT_COL+10,DICTPICK_ROW,80,ROW_HEIGHT,LBS_SORT,58,CBS_SORT) + + PUSHBUTTON "PREFERENCES...",OPTIONS_BUTTON,LEFT_COL,PREFS_ROW,55,12 // <- translate PREFERENCES.... + +#ifndef _WIN32_WCE + PUSHBUTTON "OK",IDOK,29,BUTTONS_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT // <- translate OK + DEFPUSHBUTTON "CANCEL",IDCANCEL,70,BUTTONS_ROW, // <- translate CANCEL + REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END + +#define SB_WIDTH 121 +#define SB_BUTTON_WIDTH 19 +#define SB_OK_LEFT ((SB_WIDTH/2)-10-SB_BUTTON_WIDTH) +#define SB_CANCEL_LEFT ((SB_WIDTH/2)+10) + +#ifdef _WIN32_WCE +# define STRBOX_HT 81 +#else +# define STRBOX_HT 97 +#endif + +IDD_STRBOX DIALOG DISCARDABLE 0, 25, SB_WIDTH, STRBOX_HT + STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "DIALOG" // <- translate DIALOG +FONT 8, "System" +BEGIN + EDITTEXT ID_EDITTEXT,3,3,115,76,ES_MULTILINE | ES_READONLY + | WS_VSCROLL +#ifndef _WIN32_WCE + PUSHBUTTON "OK",IDOK, SB_OK_LEFT,81,SB_BUTTON_WIDTH,REPOS_BUTTON_HT // <- translate OK + DEFPUSHBUTTON "NO",IDCANCEL,SB_CANCEL_LEFT,81,SB_BUTTON_WIDTH,REPOS_BUTTON_HT // <- translate NO +#endif +END + +#define ASKB_DLG_WIDTH 80 +#define ASKB_COLLEFT 5 +#define ASKB_LABELTOP 0 +#define ASKB_LABELHT 36 +#define ASKB_LABELWIDTH 40 +#define ASKB_COMBOLEFT (ASKB_COLLEFT+ASKB_LABELWIDTH) +#define ASKB_EDITTOP (ASKB_LABELTOP + ASKB_LABELHT) +#define ASKB_EDITHT 24 +#define ASKB_PUTTOP (ASKB_EDITTOP+ASKB_EDITHT) +#define WCE_BOTTOM (ASKB_PUTTOP + BUTTON_HT + 4) +#ifdef _WIN32_WCE +# define ASKB_DLG_HEIGHT WCE_BOTTOM +#else +# define ASKB_DLG_HEIGHT (WCE_BOTTOM + REPOS_BUTTON_HT + 4) +#endif + + +IDD_ASKBLANK DIALOG DISCARDABLE 0, 0, ASKB_DLG_WIDTH, ASKB_DLG_HEIGHT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "TILE PICKER" // <- translate TILE PICKER +FONT 8, "System" +BEGIN + LTEXT "ENTER A LETTER FOR THIS BLANK TILE.",IDC_BPICK, // <- translate ENTER A LETTER FOR THIS BLANK TILE. + ASKB_COLLEFT,ASKB_LABELTOP,ASKB_LABELWIDTH,ASKB_LABELHT +#ifdef FEATURE_TRAY_EDIT + LTEXT "PICK A TILE FOR YOUR TRAY.",IDC_CPICK, // <- translate PICK A TILE FOR YOUR TRAY + ASKB_COLLEFT,ASKB_LABELTOP,ASKB_LABELWIDTH,ASKB_LABELHT + EDITTEXT IDC_PICKMSG,ASKB_COLLEFT,ASKB_EDITTOP,80,ASKB_EDITHT, + ES_MULTILINE | ES_READONLY + + PUSHBUTTON "PUT BACK",IDC_BACKUP,ASKB_COLLEFT,ASKB_PUTTOP,35,14 // <- translate PUT BACK +#endif + + XWCOMBO(BLANKFACE_LIST,ASKB_COMBOLEFT,ASKB_COLLEFT,27,12,LBS_SORT,70,CBS_SORT) + +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,80,WCE_BOTTOM,REPOS_BUTTON_WIDTH, BUTTON_HT // <- translate OK + PUSHBUTTON "CANCEL",IDCANCEL,20,WCE_BOTTOM,REPOS_BUTTON_WIDTH, BUTTON_HT // <- translate CANCEL +#endif +END + +#define SVGN_LEFT_COL 2 +#define SVGN_ROW_1 2 +#define SVGN_LTEXT_HT 46 +#define SVGN_ROW_2 (SVGN_ROW_1+SVGN_LTEXT_HT) +#define SVGN_ROW_3 (SVGN_ROW_2+18) +#ifdef _WIN32_WCE +# define SVGN_DLG_HT SVGN_ROW_3 +#else +# define SVGN_DLG_HT (SVGN_ROW_3+BUTTON_HT+3) +#endif + +IDD_SAVENAMEDLG DIALOG DISCARDABLE 0, 0, 90, SVGN_DLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "GAME NAME" // <- translate GAME NAME +FONT 8, "System" +BEGIN + LTEXT "", + IDC_SVGN_SELLAB,SVGN_LEFT_COL,SVGN_ROW_1,86,SVGN_LTEXT_HT + EDITTEXT IDC_SVGN_EDIT,SVGN_LEFT_COL,SVGN_ROW_2,86,12, + ES_AUTOHSCROLL +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,SVGN_LEFT_COL+10,SVGN_ROW_3,REPOS_BUTTON_WIDTH, // <- translate OK + BUTTON_HT + PUSHBUTTON "CANCEL",IDCANCEL,SVGN_LEFT_COL+10+REPOS_BUTTON_WIDTH+10, // <- translate CANCEL + SVGN_ROW_3,REPOS_BUTTON_WIDTH, BUTTON_HT +#endif +END + +#define SVGM_LEFT_COL 2 +#define SVGM_ROW_1 2 +#define SVGM_ROW_2 (SVGM_ROW_1+35) +#define SVGM_ROW_3 (SVGM_ROW_2+13) +#define SVGM_ROW_4 (SVGM_ROW_3+19) +#ifdef _WIN32_WCE +/* # define SVGM_DLG_HT (SVGM_ROW_3) */ +# define SVGM_DLG_HT (SVGM_ROW_4+16) + +#else +# define SVGM_ROW_OK (SVGM_ROW_4 + 21) +# define SVGM_DLG_HT (SVGM_ROW_OK + 16) +#endif + + +IDD_SAVEDGAMESDLG DIALOG DISCARDABLE 0, 0, 85, SVGM_DLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "SAVED GAMES" // <- translate SAVED GAMES +FONT 8, "System" +BEGIN + LTEXT /* wince windres can't handle split lines....*/ + "SELECT A SAVED GAME. (SOME BUTTONS WILL BE DISABLED WHEN THE CURRENT GAME IS SELECTED.)", + // ^- translate SELECT A SAVED GAME. (SOME BUTTONS WILL BE DISABLED WHEN THE CURRENT GAME IS SELECTED.) + IDC_SVGM_SELLAB,SVGM_LEFT_COL, + SVGM_ROW_1,90,35 + XWCOMBO(IDC_SVGM_GAMELIST, SVGM_LEFT_COL,SVGM_ROW_2,70,ROW_HEIGHT,LBS_SORT,58,CBS_SORT) + + PUSHBUTTON "OPEN",IDC_SVGM_OPEN, // <- translate OPEN + SVGM_LEFT_COL,SVGM_ROW_3,40,14,WS_DISABLED + + PUSHBUTTON "DUP.",IDC_SVGM_DUP, // <- translate DUP. (=duplicate) + SVGM_LEFT_COL,SVGM_ROW_4,20,14,WS_DISABLED + PUSHBUTTON "DELETE",IDC_SVGM_DEL, // <- translate DELETE + SVGM_LEFT_COL+22,SVGM_ROW_4,28,14,WS_DISABLED + PUSHBUTTON "RENAME",IDC_SVGM_CHANGE, // <- translate RENAME + SVGM_LEFT_COL+52,SVGM_ROW_4,32,14,WS_DISABLED + +#ifndef _WIN32_WCE + DEFPUSHBUTTON "DONE",IDOK,SVGM_LEFT_COL,SVGM_ROW_OK,REPOS_BUTTON_WIDTH, // <- translate DONE + BUTTON_HT +#endif +END + +#define PW_WIDTH 104 +#define PW_OK_LEFT ((PW_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define PW_CANCEL_LEFT ((PW_WIDTH/2)+10) + +#ifdef _WIN32_WCE +# define ASKPASS_HT 32 +#else +# define ASKPASS_HT 50 +#endif + +IDD_ASKPASS DIALOG DISCARDABLE 0, 0, PW_WIDTH, ASKPASS_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "PASSWORD" // <- translate PASSWORD +FONT 8, "System" +BEGIN + LTEXT "",IDC_PWDLABEL,5,8,67,24 + EDITTEXT PASS_EDIT,76,8,23,12,ES_PASSWORD | ES_AUTOHSCROLL +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,PW_OK_LEFT,32,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT // <- translate OK + PUSHBUTTON "CANCEL",IDCANCEL, // <- translate TILE HINT CANCEL + PW_CANCEL_LEFT,32,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END + +#ifdef XWFEATURE_SEARCHLIMIT +#define HC_LABELS_COL 5 +#define HC_DROPDOWNS_COL 70 +#define HC_MINROW 3 +#define HC_MAXROW 16 +#define HC_WIDTH 98 +#define HC_OK_LEFT ((HC_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define HC_CANCEL_LEFT ((HC_WIDTH/2)+10) + +#ifdef _WIN32_WCE +# define ASKHINTLIMTS_HT 31 +#else +# define ASKHINTLIMTS_HT 47 +#endif + +IDD_ASKHINTLIMTS DIALOG DISCARDABLE 0, 0, HC_WIDTH, ASKHINTLIMTS_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "TILE HINT LIMITS" // <- translate TILE HINT LIMITS +FONT 8, "System" +BEGIN + LTEXT "USE AT LEAST:",HC_MIN_LABEL, // <- translate USE AT LEAST: + HC_LABELS_COL,HC_MINROW,60,ROW_HEIGHT + XWCOMBO(HC_MIN_COMBO, HC_DROPDOWNS_COL,HC_MINROW, 24, ROW_HEIGHT, 0,58,0) + + LTEXT "BUT NO MORE THAN:",HC_MAX_LABEL,HC_LABELS_COL,HC_MAXROW,60,ROW_HEIGHT // <- translate BUT NO MORE THAN + XWCOMBO(HC_MAX_COMBO, HC_DROPDOWNS_COL,HC_MAXROW, 24, ROW_HEIGHT,0,58,0) + +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,HC_OK_LEFT,31,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT // <- translate OK + PUSHBUTTON "CANCEL",IDCANCEL,HC_CANCEL_LEFT,31,REPOS_BUTTON_WIDTH, // <- translate CANCEL + REPOS_BUTTON_HT +#endif +END +#endif + +#define PR_WIDTH 118 +#define PR_OK_LEFT ((PR_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define PR_CANCEL_LEFT ((PR_WIDTH/2)+10) +#define PREFS_ROW_HT 9 + +#define PR_SPACING 13 +#define PR_ROW1 5 +#define PR_ROW2 (PR_ROW1+PR_SPACING) +#define PR_ROW3 (PR_ROW2+PR_SPACING) +#define PR_ROW4 (PR_ROW3+PR_SPACING) +#define PR_ROW5 (PR_ROW4+PR_SPACING) +#define PR_ROW6 (PR_ROW5+PR_SPACING) +#define PR_ROW7 (PR_ROW6+PR_SPACING) +#define PR_BUTTONROW (PR_ROW7+PR_SPACING) + +#ifdef _WIN32_WCE +# define PREFS_DLG_HT PR_BUTTONROW +#else +# define PREFS_DLG_HT (PR_BUTTONROW+PR_SPACING+3) +#endif + +IDD_OPTIONSDLG DIALOG DISCARDABLE 0, 20, PR_WIDTH, PREFS_DLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "PREFERENCES" // <- translate PREFERENCES +FONT 8, "System" +BEGIN + CONTROL "THIS GAME",IDC_RADIOLOCAL,"Button", // <- translate THIS GAME + BS_AUTORADIOBUTTON | WS_GROUP,4,PR_ROW1,47,10 + CONTROL "ALL GAMES",IDC_RADIOGLOBAL,"Button", // <- translate ALL GAMES + BS_AUTORADIOBUTTON,52,PR_ROW1,53,10 + + /* Global */ + CONTROL "COLOR PLAYED TILES",IDC_CHECKCOLORPLAYED,"Button", // <- translate COLOR PLAYED TILES + BS_AUTOCHECKBOX | WS_TABSTOP | WS_GROUP, + 8,PR_ROW2,80,PREFS_ROW_HT + CONTROL "ENABLE CURSOR",IDC_CHECKSHOWCURSOR,"Button", // <- translate ENABLE CURSOR + BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW3,80,PREFS_ROW_HT + CONTROL "EXPLAIN ROBOT SCORES",IDC_CHECKROBOTSCORES,"Button", // <- translate EXPLAIN ROBOT SCORES + BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW4,80,PREFS_ROW_HT + CONTROL "HIDE TILE VALUES",IDC_HIDETILEVALUES,"Button", // <- translate HIDE TILE VALUES + BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW5,80,PREFS_ROW_HT + PUSHBUTTON "EDIT COLORS...",IDC_PREFCOLORS,8,PR_ROW6,60,12 // <- translate EDIT COLORS... +#ifdef ALLOW_CHOOSE_FONTS + PUSHBUTTON "CHOOSE FONT...",IDC_PREFFONTS,8,PR_ROW7,60,12 // <- translate CHOOSE FONT... +#endif + + /* Per game */ + CONTROL "SMART ROBOT",IDC_CHECKSMARTROBOT,"Button", // <- translate SMART ROBOT + BS_AUTOCHECKBOX | WS_TABSTOP | WS_GROUP,8,PR_ROW2,60, + PREFS_ROW_HT + CONTROL "ALLOW HINTS",IDC_CHECKHINTSOK,"Button", // <- translate ALLOW HINTS + BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW3,60,PREFS_ROW_HT +#ifdef XWFEATURE_SEARCHLIMIT + CONTROL "HINT LIMITS",IDC_CHECKHINTSLIMITS,"Button", // <- translate HINT LIMITS + BS_AUTOCHECKBOX | WS_TABSTOP,8+10,PR_ROW4-2,50,10 +#endif + CONTROL "TIMER ON (MINUTES)",TIMER_CHECK,"Button", // <- translate TIMER ON (MINUTES) + BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW5,75,PREFS_ROW_HT + EDITTEXT TIMER_EDIT,85,PR_ROW5,16,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "PHONIES:",PHONIES_LABEL,8,PR_ROW6,28,PREFS_ROW_HT // <- translate PHONIES: + XWCOMBO(PHONIES_COMBO, 38,PR_ROW6,50,PREFS_ROW_HT, 0,58,0) + +#ifdef FEATURE_TRAY_EDIT + CONTROL "PICK TILES FACE-UP", IDC_PICKTILES, "Button", // <- translate PICK TILES FACE-UP + BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW7,90,PREFS_ROW_HT +#else +#endif +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,PR_OK_LEFT,PR_BUTTONROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT // <- translate OK + PUSHBUTTON "CANCEL",IDCANCEL,PR_CANCEL_LEFT,PR_BUTTONROW, // <- translate CANCEL + REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END + +#ifndef XWFEATURE_STANDALONE_ONLY + +# define LAB_COL 5 +# define LAB_COL_WIDTH 38 +# define CTRL_COL 15 +# define CTRL_COL_WIDTH 80 +# define CONN_ROW_1 2 +# define CONN_ROW_2 (CONN_ROW_1+ROW_SPACE) +# define CONN_ROW_3 (CONN_ROW_2+ROW_SPACE) +# define CONN_ROW_4 (CONN_ROW_3+ROW_SPACE) +# define CONN_ROW_5 (CONN_ROW_4+ROW_SPACE) +# define CONN_ROW_6 (CONN_ROW_5+ROW_SPACE) +# define CONN_ROW_7 (CONN_ROW_6+ROW_SPACE) +# define CONN_ROW_8 (CONN_ROW_7+ROW_SPACE) +# define BUTTON_ROW (CONN_ROW_8+ROW_SPACE) +#ifdef _WIN32_WCE +# define CONNSDLG_HT BUTTON_ROW +#else +# define CONNSDLG_HT (BUTTON_ROW+ROW_SPACE+3) +#endif + + /* #This is a comment???? */ +IDD_CONNSSDLG DIALOG DISCARDABLE 0, 20, 120, CONNSDLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "CONNECTION" // <- translate CONNECTION +FONT 8, "System" +BEGIN + + LTEXT "CONNECT VIA:",IDC_CCONVIA_LAB,LAB_COL,CONN_ROW_1,40,ROW_HEIGHT // <- translate CONNECT VIA: + XWCOMBO(IDC_CONNECT_COMBO, CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,ROW_HEIGHT, 0,58,0) + +#ifdef XWFEATURE_RELAY + LTEXT "COOKIE:",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT // <- translate COOKIE: + EDITTEXT COOKIE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL + + LTEXT "RELAY NAME (RARELY CHANGES):",IDC_CRELAYNAME_LAB, // <- translate RELAY NAME (RARELY CHANGES): + LAB_COL,CONN_ROW_5,120,ROW_HEIGHT + EDITTEXT RELAYNAME_EDIT,CTRL_COL,CONN_ROW_6,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL + LTEXT "RELAY PORT (RARELY CHANGES):",IDC_CRELAYPORT_LAB, // <- translate RELAY PORT (RARELY CHANGES): + LAB_COL,CONN_ROW_7,120,ROW_HEIGHT + EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL | ES_NUMBER +#else + LTEXT "RELAY CONNECTION NOT SUPPORTED.",IDC_COOKIE_LAB, // <- translate RELAY CONNECTION NOT SUPPORTED + LAB_COL,CONN_ROW_3,40,40 +#endif + +#ifdef XWFEATURE_IP_DIRECT + LTEXT "HOST NAME OR ADDRESS",IDC_IPNAME_LAB, // <- translate HOST NAME OR ADDRESS + LAB_COL,CONN_ROW_3,100,ROW_HEIGHT + EDITTEXT IPNAME_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,ES_AUTOHSCROLL +#else + LTEXT "DIRECT IP CONNECTION NOT SUPPORTED.",IDC_IPNAME_LAB, // <- translate DIRECT IP CONNECTION NOT SUPPORTED + LAB_COL,CONN_ROW_3,40,40 +#endif + +#ifdef XWFEATURE_SMS + LTEXT "HOST PHONE:",IDC_SMS_PHONE_LAB,LAB_COL,CONN_ROW_3,60,ROW_HEIGHT // <- translate HOST PHONE: + EDITTEXT IDC_SMS_PHONE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL | ES_NUMBER + LTEXT "HOST PORT:",IDC_SMS_PORT_LAB,LAB_COL,CONN_ROW_5,60,ROW_HEIGHT // <- translate HOST PORT: + EDITTEXT IDC_SMS_PORT_EDIT,CTRL_COL,CONN_ROW_6,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL | ES_NUMBER +#else + LTEXT "TEXTING NOT SUPPORTED.", // <- translate TEXTING NOT SUPPORTED + IDC_SMS_PHONE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT +#endif + +#ifndef _WIN32_WCE + PUSHBUTTON "OK",IDOK,9,BUTTON_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT // <- translate EDIT + DEFPUSHBUTTON "CANCEL",IDCANCEL,70,BUTTON_ROW, // <- translate EDIT + REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END +#endif + +#define CLR_WIDTH 114 +#define CLR_OK_LEFT ((CLR_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define CLR_CANCEL_LEFT ((CLR_WIDTH/2)+10) +#define CLR_LAB_WIDTH 45 +#define CLR_SAMPLE_WIDTH 12 +#define CLR_LAB_HT 12 +#define CLR_BUT_WIDTH 12 +#define CLR_BUT_HT 10 + +#define CLR_SMALL_GAP 12 +#define CLR_LRG_GAP 16 + +#define CLR_ROW_1 4 +#define CLR_ROW_2 (CLR_ROW_1+CLR_SMALL_GAP) +#define CLR_ROW_3 (CLR_ROW_2+CLR_SMALL_GAP) +#define CLR_ROW_4 (CLR_ROW_3+CLR_SMALL_GAP) +#define CLR_ROW_5 (CLR_ROW_4+CLR_LRG_GAP) +#define CLR_ROW_6 (CLR_ROW_5+CLR_SMALL_GAP) +#define CLR_ROW_7 (CLR_ROW_6+CLR_SMALL_GAP) +#define CLR_ROW_8 (CLR_ROW_7+CLR_LRG_GAP) +#define CLR_ROW_9 (CLR_ROW_8+CLR_SMALL_GAP) +#define CLR_ROW_10 (CLR_ROW_9+CLR_SMALL_GAP) +#define CLR_ROW_11 (CLR_ROW_10+CLR_SMALL_GAP) + +#define CLR_BUTTON_ROW CLR_ROW_11 + CLR_LRG_GAP +#define CLR_COL_1 7 +#define CLR_COL_2 (CLR_COL_1 + CLR_LAB_WIDTH+2) +/* #define CLR_COL_3 58 */ +/* #define CLR_COL_4 99 */ +#define CLR_COL_3 CLR_COL_1 +#define CLR_COL_4 CLR_COL_2 +#ifdef _WIN32_WCE +# define COLORSDLG_HT CLR_BUTTON_ROW +#else +# define COLORSDLG_HT CLR_BUTTON_ROW + BUTTON_HT + 3 +#endif + +#define COLOR_BUTTON(txt,id,xx,yy) \ + LTEXT txt,id,xx,yy,CLR_LAB_WIDTH,CLR_LAB_HT + /* Hack alert. Smartphone isn't delivering WM_COMMAND events for + clicks on BS_OWNERDRAW buttons, and WinMo (PPC and Smartphone) + won't deliver WM_DRAWITEM events for SS_OWNERDRAW static + controls. The solution: use an OWNERDRAW button as the color + sample (must disable it in code; WS_DISABLED doesn't work here) + and have a separate button to trigger the edit dialog. */ +#define COLOR_SAMPLE(id1,id2,xx,yy) \ + PUSHBUTTON "",id2,xx,yy,CLR_BUT_WIDTH,CLR_BUT_HT,BS_OWNERDRAW \ + PUSHBUTTON "EDIT",id1,xx+CLR_SAMPLE_WIDTH+4,yy,20,CLR_BUT_HT,BS_NOTIFY // <- translate EDIT + +IDD_COLORSDLG DIALOG DISCARDABLE 0, 20, CLR_WIDTH, COLORSDLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "COLOR PREFERENCES" // <- translate COLOR PREFERENCES +FONT 8, "System" +BEGIN + COLOR_BUTTON("DOUBLE LETTER:",DLBLTR_LABEL,CLR_COL_1,CLR_ROW_1) // <- translate DOUBLE LETTER + COLOR_SAMPLE(DLBLTR_BUTTON,DLBLTR_SAMPLE,CLR_COL_2,CLR_ROW_1) + + COLOR_BUTTON("DOUBLE WORD:",DBLWRD_LABEL,CLR_COL_1,CLR_ROW_2 ) // <- translate DOUBLE WORD + COLOR_SAMPLE(DBLWRD_BUTTON,DBLWRD_SAMPLE,CLR_COL_2,CLR_ROW_2) + COLOR_BUTTON("TRIPLE LETTER:",TPLLTR_LABEL,CLR_COL_1,CLR_ROW_3 ) // <- translate TRIPLE LETTER + COLOR_SAMPLE(TPLLTR_BUTTON,TPLLTR_SAMPLE,CLR_COL_2,CLR_ROW_3) + + COLOR_BUTTON("TRIPLE WORD:",TPLWRD_LABEL,CLR_COL_3,CLR_ROW_4) // <- translate TRIPLE WORD + COLOR_SAMPLE(TPLWRD_BUTTON,TPLWRD_SAMPLE,CLR_COL_4,CLR_ROW_4) + COLOR_BUTTON("EMPTY CELL:",EMPCELL_LABEL,CLR_COL_1,CLR_ROW_5) // <- translate EMPTY CELL + COLOR_SAMPLE(EMPCELL_BUTTON,EMPCELL_SAMPLE,CLR_COL_2,CLR_ROW_5) + COLOR_BUTTON("TILE BACK:",TBACK_LABEL,CLR_COL_3,CLR_ROW_6) // <- translate TILE BACK + COLOR_SAMPLE(TBACK_BUTTON,TBACK_SAMPLE,CLR_COL_4,CLR_ROW_6) + COLOR_BUTTON("FOCUS COLOR:",FOCUSCLR_LABEL,CLR_COL_1,CLR_ROW_7) // <- translate FOCUS COLOR + COLOR_SAMPLE(FOCUSCLR_BUTTON,FOCUSCLR_SAMPLE,CLR_COL_2,CLR_ROW_7) + COLOR_BUTTON("PLAYER 1:",PLAYER1_LABEL,CLR_COL_1,CLR_ROW_8) // <- translate PLAYER 1 + COLOR_SAMPLE(PLAYER1_BUTTON,PLAYER1_SAMPLE,CLR_COL_2,CLR_ROW_8) + COLOR_BUTTON("PLAYER 2:",PLAYER2_LABEL,CLR_COL_3,CLR_ROW_9) // <- translate PLAYER 2 + COLOR_SAMPLE(PLAYER2_BUTTON,PLAYER2_SAMPLE,CLR_COL_4,CLR_ROW_9) + COLOR_BUTTON("PLAYER 3:",PLAYER3_LABEL,CLR_COL_1,CLR_ROW_10) // <- translate PLAYER 3 + COLOR_SAMPLE(PLAYER3_BUTTON,PLAYER3_SAMPLE,CLR_COL_2,CLR_ROW_10) + COLOR_BUTTON("PLAYER 4:",PLAYER4_LABEL,CLR_COL_3,CLR_ROW_11) // <- translate PLAYER 4 + COLOR_SAMPLE(PLAYER4_BUTTON,PLAYER4_SAMPLE,CLR_COL_4,CLR_ROW_11) + +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,CLR_OK_LEFT,CLR_BUTTON_ROW, // <- translate OK + REPOS_BUTTON_WIDTH,BUTTON_HT,BS_NOTIFY + PUSHBUTTON "CANCEL",IDCANCEL,CLR_CANCEL_LEFT,CLR_BUTTON_ROW, // <- translate CANCEL + REPOS_BUTTON_WIDTH,BUTTON_HT,BS_NOTIFY +#endif +END + +// +// Editor for individual colors +// +#ifdef MY_COLOR_SEL + +# define CLRE_LAB_WIDTH 22 +# define CLEDIT_WIDTH 18 +# define CLSLIDER_WIDTH 30 +# define CLSAMPLE_WIDTH 15 + +# define CLRELABEL_COL 3 +# define CLREEDIT_COL (CLRELABEL_COL+CLRE_LAB_WIDTH+2) +# define CLRESLIDER_COL (CLREEDIT_COL+CLEDIT_WIDTH+3) +# define CLSAMPLE_COL (CLRESLIDER_COL+CLSLIDER_WIDTH+5) +# define CLRE_LAB_HT 12 +# define CLREDIT_ROW_1 5 +# define CLREDIT_ROW_2 21 +# define CLREDIT_ROW_3 37 +# define CLRE_WIDTH (CLSAMPLE_COL+CLSAMPLE_WIDTH+5) +# define CLRE_OK_LEFT ((CLRE_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +# define CLRE_CANCEL_LEFT ((CLRE_WIDTH/2)+10) +# ifdef _WIN32_WCE +# define COLOREDITDLG_HT 56 +# else +# define COLOREDITDLG_HT 72 +# endif + +# define COLOR_EDIT_LINE(txt,row,labelId,editId,sliderId) \ + LTEXT txt,labelId,CLRELABEL_COL,row, \ + CLRE_LAB_WIDTH,CLRE_LAB_HT \ + EDITTEXT editId,CLREEDIT_COL,row,CLEDIT_WIDTH,12, \ + ES_AUTOHSCROLL | ES_NUMBER \ + CONTROL "",sliderId,"msctls_trackbar32", \ + TBS_BOTH|TBS_NOTICKS|WS_TABSTOP, \ + CLRESLIDER_COL,row,CLSLIDER_WIDTH,12 + +IDD_COLOREDITDLG DIALOG DISCARDABLE 0, 0, CLRE_WIDTH, COLOREDITDLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "" /* set by code */ +FONT 8, "System" +BEGIN + COLOR_EDIT_LINE("RED:", CLREDIT_ROW_1, RED_LABEL, RED_EDIT, CLREDT_SLIDER1 ) // <- translate RED + COLOR_EDIT_LINE("GREEN:", CLREDIT_ROW_2, GREEN_LABEL, GREEN_EDIT, CLREDT_SLIDER2 ) // <- translate GREEN + COLOR_EDIT_LINE("BLUE:", CLREDIT_ROW_3, BLUE_LABEL, BLUE_EDIT, CLREDT_SLIDER3 ) // <- translate BLUE + + /* See hack alert above. Bogus owner-draw button seems the only way to get a sample + color rect into the dialog. */ + PUSHBUTTON "",CLSAMPLE_BUTTON_ID,CLSAMPLE_COL,CLREDIT_ROW_1, + CLSAMPLE_WIDTH,CLREDIT_ROW_3-CLREDIT_ROW_1+CLRE_LAB_HT,BS_OWNERDRAW + +# ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,CLRE_OK_LEFT,56,REPOS_BUTTON_WIDTH, // <- translate OK + REPOS_BUTTON_HT + PUSHBUTTON "CANCEL",IDCANCEL,CLRE_CANCEL_LEFT,56,REPOS_BUTTON_WIDTH, // <- translate CANCEL + REPOS_BUTTON_HT +# endif +END +#endif + + +IDD_LOCALESDLG DIALOG DISCARDABLE 0, 0, 120, 115 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "LANGUAGE PICKER" +FONT 8, "System" +BEGIN + LTEXT "CHOOSE THE LANGUAGE FOR MENUS AND DIALOG TEXT.", + LOCALES_LABEL,LEFT_COL,2,100,36 + XWCOMBO(LOCALES_COMBO, LEFT_COL,40,70,12, 0,58,0) + +# ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,LEFT_COL,55,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT + PUSHBUTTON "CANCEL",IDCANCEL,50,55,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT +# endif +END + +///////////////////////////////////////////////////////////////////////////// +// +// String Table. Note that these are ascii strings unless L proceeds the +// first ". +// + +STRINGTABLE DISCARDABLE +BEGIN +#ifdef DEBUG + IDS_APP_TITLE "Crossw_dbg" +#else + IDS_APP_TITLE "Crosswords" +#endif + IDS_MENU "MENU" // <- translate + IDS_DUMMY "--" + IDS_CANCEL "CANCEL" // <- translate + IDS_OK "OK" // <- translate + IDS_DONE "DONE" // <- translate + IDS_LANGUAGE_NAME "ENGLISH" // <- translate + IDS_NEW_GAME "NEW GAME" // <- translate + IDS_ABOUT "CROSSWORDS 4.4A1 (REV " SVN_REV ") "\ + "FOR WINDOWS MOBILE. COPYRIGHT 1998-2009 BY "\ + "ERIC HOUSE. THIS SOFTWARE IS RELEASED UNDER THE GNU "\ + "PUBLIC LICENSE.\r\r"\ + "FOR DICTIONARIES, A MANUAL, OR SOURCE CODE GO TO "\ + "HTTP://XWORDS.SF.NET OR HTTP://EEHOUSE.ORG/XWORDS/." // <- translate + IDS_DICTLOC "PLEASE INSTALL A CROSSWORDS DICTIONARY (.xwd FILE) "\ + "IN THE SAME DIRECTORY AS THE CROSSWORDS .EXE FILE, OR "\ + "IN A DIRECTORY CALLED CROSSWORDS ON AN EXTERNAL CARD, "\ + "E.G. IN \\STORAGE CARD\\CROSSWORDS. "\ + "DOWNLOAD DICTIONARIES FROM HTTP://XWORDS.SF.NET OR "\ + "HTTP://EEHOUSE.ORG/XWORDS." // <- translate + IDS_SAVENAME "ENTER A NAME FOR THE CURRENT GAME. (YOU CAN CHANGE THE "\ + "NAME LATER USING THE SAVED GAMES DIALOG.)" // <- translate + IDS_DUPENAME "ENTER A NAME FOR A COPY OF THIS GAME." // <- translate + IDS_RENAME "ENTER A NEW NAME FOR THIS GAME." // <- translate + + IDS_REMAINING_TILES_ADD "+ %d [ALL REMAINING TILES]" // <- translate + IDS_UNUSED_TILES_SUB "- %d [UNUSED TILES]" // <- translate + IDS_BONUS_ALL "BONUS FOR USING ALL TILES: 50" XP_CR // <- translate + IDS_TURN_SCORE "SCORE FOR TURN: %d" XP_CR // <- translate + IDS_COMMIT_CONFIRM "COMMIT THE CURRENT MOVE?" XP_CR // <- translate + IDS_LOCAL_NAME "%s" // <- translate + IDS_REM "REM" + IDS_IGNORE_L "IGNORE" + IDS_WARN_L "WARN" + IDS_DISALLOW_L "DISALLOW" + IDS_NONLOCAL_NAME "%s (REMOTE)" // <- translate + IDS_TIME_PENALTY_SUB " - %d [TIME]" // <- translate + IDS_CUMULATIVE_SCORE "CUMULATIVE SCORE: %d" XP_CR // <- translate + IDS_MOVE_ACROSS "MOVE (FROM %s ACROSS)" XP_CR // <- translate + IDS_MOVE_DOWN "MOVE (FROM %s DOWN)" XP_CR // <- translate + IDS_TRAY_AT_START "TRAY AT START: %s" XP_CR // <- translate + IDS_NEW_TILES "NEW TILES: %s" XP_CR // <- translate + IDS_TRADED_FOR "TRADED %s FOR %s." // <- translate + IDS_PASS "PASS" XP_CR // <- translate + IDS_PHONY_REJECTED "ILLEGAL WORD IN MOVE; TURN LOST!" XP_CR // <- translate + IDS_ROBOT_TRADED "ROBOT TRADED TILES %d THIS TURN." // <- translate + IDS_ROBOT_MOVED "THE ROBOT MADE THIS MOVE:" XP_CR // <- translate + IDS_REMOTE_MOVED "REMOTE PLAYER MADE THIS MOVE:" XP_CR // <- translate + IDS_PASSED "PASSED" // <- translate + IDS_SUMMARYSCORED "%s:%d" // <- translate + IDS_TRADED "TRADED %d" // <- translate + IDS_LOSTTURN "LOST TURN" // <- translate +#ifndef XWFEATURE_STANDALONE_ONLY + IDS_LOCALPLAYERS "LOCL PLAYRS:" // <- translate +#endif + IDS_TOTALPLAYERS "PLAYER COUNT:" // <- translate + IDS_VALUES_HEADER "%s COUNTS/VALUES:" XP_CR // <- translate + IDS_QUERY_TRADE "ARE YOU SURE YOU WANT TO TRADE THE SELECTED TILES?" // <- translate + IDS_DOUBLE_LETTER "DOUBLE LETTER" // <- translate + IDS_DOUBLE_WORD "DOUBLE WORD" // <- translate + IDS_TRIPLE_LETTER "TRIPLE LETTER" // <- translate + IDS_TRIPLE_WORD "TRIPLE WORD" // <- translate + IDS_INTRADE_MW "TRADING TILES." XP_CR "SELECT 'TURN DONE' WHEN READY" // <- translate + + + IDS_TILES_NOT_IN_LINE "ALL TILES PLAYED MUST BE IN A LINE." // <- translate + IDS_NO_EMPTIES_IN_TURN "EMPTY SQUARES CANNOT SEPARATE TILES PLAYED." // <- translate + IDS_TWO_TILES_FIRST_MOVE "MUST PLAY TWO OR MORE PIECES ON THE FIRST MOVE." // <- translate + IDS_TILES_MUST_CONTACT "NEW PIECES MUST CONTACT OTHERS ALREADY IN PLACE (OR "\ + "THE MIDDLE SQUARE ON THE FIRST MOVE)." // <- translate + IDS_NOT_YOUR_TURN "YOU CAN'T DO THAT; IT'S NOT YOUR TURN!" // <- translate + IDS_NO_PEEK_ROBOT_TILES "NO PEEKING AT THE ROBOT'S TILES!" // <- translate + IDS_CANT_TRADE_MID_MOVE "REMOVE PLAYED TILES BEFORE TRADING." // <- translate + IDS_TOO_FEW_TILES_LEFT_TO_TRADE "TOO FEW TILES LEFT TO TRADE." // <- translate + IDS_CANT_UNDO_TILEASSIGN "TILE ASSIGNMENT CAN'T BE UNDONE." // <- translate + IDS_CANT_HINT_WHILE_DISABLED "THE HINT FEATURE IS DISABLED FOR THIS GAME. "\ + "ENABLE IT FOR A NEW GAME USING THE PREFERENCES "\ + "DIALOG." // <- translate + + IDS_COUNTSVALS_L "TILE COUNTS AND VALUES" // <- translate + IDS_REMTILES_L "REMAINING TILES" // <- translate + IDS_GAMEHIST_L "GAME HISTORY" // <- translate + IDS_FINALSCORE_L "FINAL SCORES" // <- translate + IDS_QUESTION_L "QUESTION" // <- translate + IDS_FYI_L "FYI" // <- translate + IDS_ILLEGALWRD_L "ILLEGAL WORD" // <- translate + IDS_WRDNOTFOUND "WORD[S] %s NOT FOUND IN DICTIONARY." // <- translate + IDS_USEANYWAY "USE IT ANYWAY?" // <- translate + IDS_FYI_L "OOPS!" // <- translate + IDS_CANNOTOPEN_GAME "SAVED GAME CANNOT BE OPENED." // <- translate + IDS_NODICT_L "DICTIONARY NOT FOUND" // <- translate + IDS_ABOUT_L "ABOUT CROSSWORDS" // <- translate + IDS_OVERWRITE "DO YOU REALLY WANT TO OVERWRITE THE CURRENT GAME?" // <- translate + IDS_ENDNOW "ARE YOU SURE YOU WANT TO END THE GAME NOW?" // <- translate + IDS_CANNOTOPEN_DICT "UNABLE TO OPEN DICTIONARY: %s" // <- translate + IDS_CONFIM_DELETE "ARE YOU CERTAIN YOU WANT TO DELETE THE "\ + "SELECTED GAME? THIS ACTION CANNOT BE UNDONE." // <- translate + + IDS_ROLE_STANDALONE "STANDALONE" // <- translate + IDS_ROLE_HOST "HOST" // <- translate + IDS_ROLE_GUEST "GUEST" // <- translate + IDS_PLAYER_FORMAT "PLAYER %d" // <- translate + IDS_UNTITLED_FORMAT "UNTITLED %d" // <- translate + IDS_CONN_RELAY_L "RELAY" // <- translate + IDS_CONN_DIRECT "DIRECT CONNECTION" // <- translate + IDS_PASSWDFMT_L "ENTER PASSWORD FOR %ls:" // <- translate + IDS_FILEEXISTSFMT_L "FILE %s ALREADY EXISTS." // <- translate + IDS_NEED_TOUCH "THIS FEATURE REQUIRES A TOUCH SCREEN." + IDS_EDITCOLOR_FORMAT "EDIT COLOR FOR %s" + +#ifndef XWFEATURE_STANDALONE_ONLY +# ifdef XWFEATURE_SMS + IDS_SMS_CONN_L "TEXTING" // <- translate + +# endif +# ifdef XWFEATURE_IP_DIRECT + IDS_DIRECT_CONN_L "DIRECT CONNECTION" // <- translate +# endif + + IDS_NO_PEEK_REMOTE_TILES "NO PEEKING AT REMOTE PLAYERS' TILES!" // <- translate + IDS_REG_UNEXPECTED_USER "REFUSED ATTEMPT TO REGISTER UNEXPECTED USER[S]." // <- translate + IDS_SERVER_DICT_WINS "CONFLICT BETWEEN HOST AND GUEST DICTIONARIES; "\ + "HOST WINS." // <- translate + IDS_REG_SERVER_SANS_REMOTE "AT LEAST ONE PLAYER MUST BE MARKED REMOTE FOR "\ + "A GAME STARTED AS HOST." // <- translate + +# ifdef XWFEATURE_RELAY + IDS_RELAY_CONN_L "RELAY" + IDS_XWRELAY_ERROR_TIMEOUT "THE RELAY TIMED YOU OUT; USUALLY THAT "\ + "MEANS THE OTHER PLAYERS DIDN'T SHOW." // <- translate + IDS_ERROR_HEART_YOU "YOU WERE DISCONNECTED FROM RELAY BECAUSE "\ + "IT DIDN'T HEAR FROM YOU IN TOO LONG." // <- translate + IDS_XWRELAY_ERROR_HEART_OTHER "THE RELAY HAS LOST CONTACT WITH A DEVICE "\ + "IN THIS GAME." // <- translate +/* IDS_XWRELAY_ERROR_LOST_OTHER "THE RELAY HAS LOST CONTACT WITH A DEVICE IN THIS GAME." */ +# endif +#endif + + +END + +#ifdef _WIN32_WCE +// from http://msdn.microsoft.com/en-us/library/ms838191.aspx: don't +// let WinMo draw 320x320 as 240x240 +HI_RES_AWARE CEUX {1} +#endif + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + +/* This is supposed to keep the OS from running us in "emulation mode", but it + isn't working. Changing the versions as reported by objdump does work */ +/* #ifdef _WIN32_WCE */ +/* HI_RES_AWARE CEUX {1} */ +/* #endif */ + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/xwords4/wince/l10n/xwords4_french.rc b/xwords4/wince/l10n/xwords4_french.rc new file mode 100644 index 000000000..9e0cbbe88 --- /dev/null +++ b/xwords4/wince/l10n/xwords4_french.rc @@ -0,0 +1,1005 @@ +// -*- mode: c; compile-command: "cd ../ && make TARGET_OS=wince DEBUG=TRUE obj_wince_dbg/built/xwords4_french.dll"; -*- +// +// Microsoft Developer Studio generated resource script. But now I'm +// editing it. :-) +// +#include "../resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "../newres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +#include "winnt.h" +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_XWORDS4 ICON DISCARDABLE "xwords4.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""winnt.h""\r\n" + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""newres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Menubar +// + +IDM_MENU MENU DISCARDABLE +BEGIN +#ifndef _WIN32_WCE + POPUP "BUTTON" + BEGIN + MENUITEM "--", W32_DUMMY_ID + END +#endif + POPUP "Menu" + BEGIN + MENUITEM "Jouer le coup", ID_MOVE_TURNDONE + MENUITEM "Mélanger", ID_MOVE_JUGGLE + MENUITEM "Retourner", ID_MOVE_FLIP + MENUITEM "Echanger", ID_MOVE_TRADE + MENUITEM "Cacher tirage", ID_MOVE_HIDETRAY + + POPUP "Annuler" + BEGIN + MENUITEM "Annuler actuel", ID_MOVE_UNDOCURRENT + MENUITEM "Annuler précédent", ID_MOVE_UNDOLAST + END + + POPUP "Conseil" + BEGIN + MENUITEM "Conseil suivant", ID_MOVE_NEXTHINT + MENUITEM "Conseil", ID_MOVE_HINT +#ifdef XWFEATURE_SEARCHLIMIT + MENUITEM "Conseil limité...", ID_MOVE_LIMITEDHINT +#endif + MENUITEM SEPARATOR + MENUITEM "Montrer les valeurs", ID_MOVE_VALUES + END + + POPUP "Partie" + BEGIN + MENUITEM "Nombre/Valeur des lettres", ID_GAME_TILECOUNTSANDVALUES + MENUITEM "Lettres restantes", ID_GAME_TILESLEFT + MENUITEM SEPARATOR + MENUITEM "Infos partie", ID_GAME_GAMEINFO + MENUITEM "Historique", ID_GAME_HISTORY + MENUITEM "Score final", ID_GAME_FINALSCORES +#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH + MENUITEM "Renvoyer message", ID_GAME_RESENDMSGS +#endif + END + + POPUP "Fichier" + BEGIN + MENUITEM "Plein écran", ID_FILE_FULLSCREEN + MENUITEM SEPARATOR + MENUITEM "Nouvelle partie...", ID_FILE_NEWGAME + MENUITEM "Parties enregistrées...", ID_FILE_SAVEDGAMES + MENUITEM "Préférences...", ID_FILE_PREFERENCES + MENUITEM SEPARATOR + MENUITEM "A propos...", ID_FILE_ABOUT + MENUITEM "Langue...", ID_FILE_LOCALES // Or "Localisation" (more technical) + MENUITEM SEPARATOR + MENUITEM "Quitter", ID_FILE_EXIT + END + END +END + +#ifdef _WIN32_WCE +// soft key bar described at +// http://msdn2.microsoft.com/en-us/library/aa457781.aspx +IDM_MAIN_MENUBAR RCDATA +BEGIN + IDM_MENU, 2, + I_IMAGENONE, ID_INITIAL_SOFTID, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_DUMMY, 0, + NOMENU, + I_IMAGENONE, IDM_MENU, TBSTATE_ENABLED, + TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_MENU, 0, + 0 // Use the 0th popup above -- the only one +END + +IDM_OKCANCEL_MENUBAR RCDATA +BEGIN + 0, 2, + I_IMAGENONE, IDOK, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_OK, 0, + NOMENU, + I_IMAGENONE, IDCANCEL, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_CANCEL, 0, + NOMENU +END + +IDM_OK_MENUBAR RCDATA +BEGIN + 0, 1, + I_IMAGENONE, IDOK, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_OK, 0, + NOMENU +END + +IDM_DONE_MENUBAR RCDATA +BEGIN + 0, 1, + I_IMAGENONE, IDOK, TBSTATE_ENABLED, + TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, IDS_DONE, 0, + NOMENU +END +#endif + +#include "../rc_incs.h" + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// +#define BUTTON_HT 12 +#define REPOS_BUTTON_HT BUTTON_HT +#define REPOS_BUTTON_WIDTH 32 +#define REPOS_BUTTON_VPAD 2 +#define REPOS_BUTTON_HPAD 2 + +// ******** IDD_GAMEINFO DIALOG ********* +#define GAMEINFO_WIDTH 116 +#ifdef CEFEATURE_CANSCROLL +# define ROW_HEIGHT 10 +# define ROW_SPACE 12 +# define ROW_SPACE_PL 11 +#else +# define ROW_HEIGHT 12 +# define ROW_SPACE 15 +# define ROW_SPACE_PL ROW_SPACE +#endif +#define CHECK_WIDTH 10 +#define LEFT_COL 2 +#ifdef XWFEATURE_STANDALONE_ONLY +# define GAME_NAME_WIDTH 56 +# define GAME_LABEL_WIDTH (GAME_NAME_WIDTH-10) +# define GAME_NAME_LEFT LEFT_COL +# define ROBOT_LABEL_ADJUST 10 +# define NAME_LABEL_ADJUST 20 +# define GAME_ROBOT_LEFT (GAME_NAME_LEFT + GAME_NAME_WIDTH + 5) +# define GAME_PWD_LEFT (GAME_ROBOT_LEFT + 15) +# define NPLAYERS_ROW 3 +# define GAME_NAMELABEL_LEFT GAME_NAME_LEFT +# define GAME_NAMELABEL_WIDTH (GAME_NAME_WIDTH-ROBOT_LABEL_ADJUST-NAME_LABEL_ADJUST) +# define GAME_ROBOTLABEL_LEFT (GAME_ROBOT_LEFT-7) +# define GAME_ROBOTLABEL_WIDTH (GAME_PWD_LEFT-GAME_ROBOT_LEFT+ROBOT_LABEL_ADJUST) +# define GAME_PWDLABEL_LEFT (GAME_PWD_LEFT-4) +# define GAME_PWDLABEL_WIDTH (GAMEINFO_WIDTH-GAME_PWD_LEFT) +#else +# define SERVERROLE_ROW 3 +# define GAME_NAME_WIDTH 56 +# define SERVERCONF_ROW (SERVERROLE_ROW+ROW_SPACE+3) +# define NPLAYERS_ROW (SERVERCONF_ROW+ROW_SPACE+3) +# define GAME_REMOTE_LEFT 1 +# define GAME_NAME_LEFT 11 +# define ROBOT_LABEL_ADJUST 10 +# define GAME_ROBOT_LEFT (GAME_NAME_LEFT+GAME_NAME_WIDTH+2) +# define GAME_PWD_LEFT (GAME_ROBOT_LEFT + CHECK_WIDTH + 4) +# define NAME_LABEL_ADJUST 20 +# define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT+NAME_LABEL_ADJUST) +# define GAME_NAMELABEL_WIDTH (GAME_NAME_WIDTH-ROBOT_LABEL_ADJUST-NAME_LABEL_ADJUST) +# define GAME_ROBOTLABEL_LEFT (GAME_ROBOT_LEFT-ROBOT_LABEL_ADJUST) +# define GAME_ROBOTLABEL_WIDTH (GAME_PWD_LEFT-GAME_ROBOT_LEFT+ROBOT_LABEL_ADJUST) +# define GAME_PWDLABEL_LEFT (GAME_PWD_LEFT) +# define GAME_PWDLABEL_WIDTH (GAMEINFO_WIDTH-GAME_PWD_LEFT) +#endif + + +#define LABELS_ROW (NPLAYERS_ROW+ROW_SPACE) +#define PLAYER_ROW_1 (LABELS_ROW+ROW_SPACE_PL) +#define PLAYER_ROW_2 (PLAYER_ROW_1+ROW_SPACE_PL) +#define PLAYER_ROW_3 (PLAYER_ROW_2+ROW_SPACE_PL) +#define PLAYER_ROW_4 (PLAYER_ROW_3+ROW_SPACE_PL) +#define JUGGLE_ROW (PLAYER_ROW_4+ROW_SPACE) +#define DICTPICK_LAB_ROW (JUGGLE_ROW+ROW_SPACE+2) +#define DICTPICK_ROW (DICTPICK_LAB_ROW+ROW_SPACE-2) +#define PREFS_ROW (DICTPICK_ROW+ROW_SPACE+3) +#ifndef _WIN32_WCE +# define BUTTONS_ROW (PREFS_ROW+ROW_SPACE+3) +#endif +#ifdef _WIN32_WCE +# define GAMEINFO_HEIGHT (PREFS_ROW + ROW_SPACE + 4) +#else +# define GAMEINFO_HEIGHT (BUTTONS_ROW + BUTTON_HT + 4) +#endif + + +/* in commctrl.h, but including isn't enough */ +#undef UPDOWN_CLASS +#define UPDOWN_CLASS "msctls_updown32" + +#define CE_PLAYER_ROW(nameEdit,playerRow,robotCheck,passEdit) \ + EDITTEXT nameEdit,GAME_NAME_LEFT,playerRow,GAME_NAME_WIDTH,ROW_HEIGHT, \ + ES_AUTOHSCROLL \ + CONTROL "",robotCheck,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, \ + GAME_ROBOT_LEFT,playerRow,CHECK_WIDTH,ROW_HEIGHT \ + EDITTEXT passEdit,GAME_PWD_LEFT,playerRow,13,ROW_HEIGHT, \ + ES_PASSWORD | ES_AUTOHSCROLL \ + + +IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, GAMEINFO_WIDTH, GAMEINFO_HEIGHT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "Infos partie" +FONT 8, "System" +BEGIN +#ifndef XWFEATURE_STANDALONE_ONLY + LTEXT "Mode:",IDC_ROLELABEL,LEFT_COL,SERVERROLE_ROW,20,8 + XWCOMBO(IDC_ROLECOMBO,26,SERVERROLE_ROW,70,ROW_HEIGHT,0,58,0) + + PUSHBUTTON "Configure mode",GIROLECONF_BUTTON,LEFT_COL+10, + SERVERCONF_ROW,60,ROW_HEIGHT // <- translate Configure mode +#endif + + LTEXT "",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,70,8 + XWCOMBO(IDC_NPLAYERSCOMBO,74,NPLAYERS_ROW,24,ROW_HEIGHT,0,58,0) + + LTEXT "Nom",IDC_NAMELABEL,GAME_NAMELABEL_LEFT, + LABELS_ROW,GAME_NAMELABEL_WIDTH,8,SS_NOPREFIX + LTEXT "Robot",IDC_ROBOTLABEL,GAME_ROBOTLABEL_LEFT,LABELS_ROW, + GAME_ROBOTLABEL_WIDTH,8 + LTEXT "Mdp",IDC_PASSWDLABEL,GAME_PWDLABEL_LEFT,LABELS_ROW, + GAME_PWDLABEL_WIDTH,8 + +#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH + LTEXT "Distant",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX + CONTROL "",REMOTE_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_1,CHECK_WIDTH,ROW_HEIGHT + CONTROL "",REMOTE_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_2,CHECK_WIDTH,ROW_HEIGHT + CONTROL "",REMOTE_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_3,CHECK_WIDTH,ROW_HEIGHT + CONTROL "",REMOTE_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + GAME_REMOTE_LEFT, PLAYER_ROW_4,CHECK_WIDTH,ROW_HEIGHT +#endif + CE_PLAYER_ROW( NAME_EDIT1, PLAYER_ROW_1, ROBOT_CHECK1, PASS_EDIT1 ) + CE_PLAYER_ROW( NAME_EDIT2, PLAYER_ROW_2, ROBOT_CHECK2, PASS_EDIT2 ) + CE_PLAYER_ROW( NAME_EDIT3, PLAYER_ROW_3, ROBOT_CHECK3, PASS_EDIT3 ) + CE_PLAYER_ROW( NAME_EDIT4, PLAYER_ROW_4, ROBOT_CHECK4, PASS_EDIT4 ) + + PUSHBUTTON "Mélanger",GIJUGGLE_BUTTON,LEFT_COL+10,JUGGLE_ROW, + 60,BUTTON_HT + + LTEXT "Dictionnaire:",IDC_DICTLABEL,LEFT_COL,DICTPICK_LAB_ROW,50,8, + SS_NOPREFIX + XWCOMBO(IDC_DICTLIST,LEFT_COL+10,DICTPICK_ROW,80,ROW_HEIGHT,LBS_SORT,58,CBS_SORT) + + PUSHBUTTON "Préférences...",OPTIONS_BUTTON,LEFT_COL,PREFS_ROW,55,12 + +#ifndef _WIN32_WCE + PUSHBUTTON "OK",IDOK,20,BUTTONS_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT + DEFPUSHBUTTON "Annuler",IDCANCEL,50,BUTTONS_ROW, + REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END + +#define SB_WIDTH 121 +#define SB_BUTTON_WIDTH 19 +#define SB_OK_LEFT ((SB_WIDTH/2)-10-SB_BUTTON_WIDTH) +#define SB_CANCEL_LEFT ((SB_WIDTH/2)+10) + +#ifdef _WIN32_WCE +# define STRBOX_HT 81 +#else +# define STRBOX_HT 97 +#endif + +IDD_STRBOX DIALOG DISCARDABLE 0, 25, SB_WIDTH, STRBOX_HT + STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "Dialogue" +FONT 8, "System" +BEGIN + EDITTEXT ID_EDITTEXT,3,3,115,76,ES_MULTILINE | ES_READONLY + | WS_VSCROLL +#ifndef _WIN32_WCE + PUSHBUTTON "OK",IDOK, SB_OK_LEFT,81,SB_BUTTON_WIDTH,REPOS_BUTTON_HT + DEFPUSHBUTTON "Non",IDCANCEL,SB_CANCEL_LEFT,81,SB_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END + +#define ASKB_DLG_WIDTH 80 +#define ASKB_COLLEFT 5 +#define ASKB_LABELTOP 0 +#define ASKB_LABELHT 36 +#define ASKB_LABELWIDTH 40 +#define ASKB_COMBOLEFT (ASKB_COLLEFT+ASKB_LABELWIDTH) +#define ASKB_EDITTOP (ASKB_LABELTOP + ASKB_LABELHT) +#define ASKB_EDITHT 24 +#define ASKB_PUTTOP (ASKB_EDITTOP+ASKB_EDITHT) +#define WCE_BOTTOM (ASKB_PUTTOP + BUTTON_HT + 4) +#ifdef _WIN32_WCE +# define ASKB_DLG_HEIGHT WCE_BOTTOM +#else +# define ASKB_DLG_HEIGHT (WCE_BOTTOM + REPOS_BUTTON_HT + 4) +#endif + + +IDD_ASKBLANK DIALOG DISCARDABLE 0, 0, ASKB_DLG_WIDTH, ASKB_DLG_HEIGHT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "Choix de lettre" +FONT 8, "System" +BEGIN + LTEXT "Entrez une lettre pour ce joker.",IDC_BPICK, + ASKB_COLLEFT,ASKB_LABELTOP,ASKB_LABELWIDTH,ASKB_LABELHT +#ifdef FEATURE_TRAY_EDIT + LTEXT "Choisissez une lettre de votre tirage.",IDC_CPICK, + ASKB_COLLEFT,ASKB_LABELTOP,ASKB_LABELWIDTH,ASKB_LABELHT + EDITTEXT IDC_PICKMSG,ASKB_COLLEFT,ASKB_EDITTOP,80,ASKB_EDITHT, + ES_MULTILINE | ES_READONLY + + PUSHBUTTON "Remettre",IDC_BACKUP,ASKB_COLLEFT,ASKB_PUTTOP,35,14 +#endif + + XWCOMBO(BLANKFACE_LIST,ASKB_COMBOLEFT,ASKB_COLLEFT,27,12,LBS_SORT,70,CBS_SORT) +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,80,WCE_BOTTOM,REPOS_BUTTON_WIDTH,BUTTON_HT + PUSHBUTTON "Annuler",IDCANCEL,20,WCE_BOTTOM,REPOS_BUTTON_WIDTH,BUTTON_HT +#endif +END + +#define SVGN_LEFT_COL 2 +#define SVGN_ROW_1 2 +#define SVGN_LTEXT_HT 46 +#define SVGN_ROW_2 (SVGN_ROW_1+SVGN_LTEXT_HT) +#define SVGN_ROW_3 (SVGN_ROW_2+18) +#ifdef _WIN32_WCE +# define SVGN_DLG_HT SVGN_ROW_3 +#else +# define SVGN_DLG_HT (SVGN_ROW_3+BUTTON_HT+3) +#endif + +IDD_SAVENAMEDLG DIALOG DISCARDABLE 0, 0, 90, SVGN_DLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "Nom partie" +FONT 8, "System" +BEGIN + LTEXT "", + IDC_SVGN_SELLAB,SVGN_LEFT_COL,SVGN_ROW_1,86,SVGN_LTEXT_HT + EDITTEXT IDC_SVGN_EDIT,SVGN_LEFT_COL,SVGN_ROW_2,86,12, + ES_AUTOHSCROLL +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,SVGN_LEFT_COL+10,SVGN_ROW_3,REPOS_BUTTON_WIDTH, + BUTTON_HT + PUSHBUTTON "Annuler",IDCANCEL,SVGN_LEFT_COL+10+REPOS_BUTTON_WIDTH+10, + SVGN_ROW_3,REPOS_BUTTON_WIDTH, BUTTON_HT +#endif +END + +#define SVGM_LEFT_COL 2 +#define SVGM_ROW_1 2 +#define SVGM_ROW_2 (SVGM_ROW_1+45) +#define SVGM_ROW_3 (SVGM_ROW_2+13) +#define SVGM_ROW_4 (SVGM_ROW_3+19) +#ifdef _WIN32_WCE +/* # define SVGM_DLG_HT (SVGM_ROW_3) */ +# define SVGM_DLG_HT (SVGM_ROW_4+16) + +#else +# define SVGM_ROW_OK (SVGM_ROW_4 + 21) +# define SVGM_DLG_HT (SVGM_ROW_OK + 16) +#endif + + +IDD_SAVEDGAMESDLG DIALOG DISCARDABLE 0, 0, 85, SVGM_DLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "Parties enregistrées" +FONT 8, "System" +BEGIN + LTEXT /* wince windres can't handle split lines....*/ + "Sélectionnez une partie enregistrée. (Certains boutons seront désactivés si la partie en cours est sélectionnée.)", + IDC_SVGM_SELLAB,SVGM_LEFT_COL,SVGM_ROW_1,90,45 + XWCOMBO(IDC_SVGM_GAMELIST, SVGM_LEFT_COL,SVGM_ROW_2,70,ROW_HEIGHT,LBS_SORT,58,CBS_SORT) + + PUSHBUTTON "Ouvrir",IDC_SVGM_OPEN, + SVGM_LEFT_COL,SVGM_ROW_3,40,14,WS_DISABLED + + PUSHBUTTON "Dupl.",IDC_SVGM_DUP, + SVGM_LEFT_COL,SVGM_ROW_4,20,14,WS_DISABLED + PUSHBUTTON "Effacer",IDC_SVGM_DEL, + SVGM_LEFT_COL+22,SVGM_ROW_4,26,14,WS_DISABLED + PUSHBUTTON "Renommer",IDC_SVGM_CHANGE, + SVGM_LEFT_COL+50,SVGM_ROW_4,40,14,WS_DISABLED + +#ifndef _WIN32_WCE + DEFPUSHBUTTON "Terminé",IDOK,SVGM_LEFT_COL,SVGM_ROW_OK,REPOS_BUTTON_WIDTH, + BUTTON_HT +#endif +END + +#define PW_WIDTH 104 +#define PW_OK_LEFT ((PW_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define PW_CANCEL_LEFT ((PW_WIDTH/2)+10) + +#ifdef _WIN32_WCE +# define ASKPASS_HT 32 +#else +# define ASKPASS_HT 50 +#endif + +IDD_ASKPASS DIALOG DISCARDABLE 0, 0, PW_WIDTH, ASKPASS_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "Mode de passe" +FONT 8, "System" +BEGIN + LTEXT "",IDC_PWDLABEL,5,8,67,24 + EDITTEXT PASS_EDIT,76,8,23,12,ES_PASSWORD | ES_AUTOHSCROLL +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,PW_OK_LEFT,32,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT + PUSHBUTTON "Annuler",IDCANCEL, + PW_CANCEL_LEFT,32,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END + +#ifdef XWFEATURE_SEARCHLIMIT +#define HC_LABELS_COL 5 +#define HC_DROPDOWNS_COL 70 +#define HC_MINROW 3 +#define HC_MAXROW 16 +#define HC_WIDTH 98 +#define HC_OK_LEFT ((HC_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define HC_CANCEL_LEFT ((HC_WIDTH/2)+10) + +#ifdef _WIN32_WCE +# define ASKHINTLIMTS_HT 31 +#else +# define ASKHINTLIMTS_HT 47 +#endif + +IDD_ASKHINTLIMTS DIALOG DISCARDABLE 0, 0, HC_WIDTH, ASKHINTLIMTS_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "Longueur des mots conseillés" +FONT 8, "System" +BEGIN + LTEXT "Utiliser au moins:",HC_MIN_LABEL, + HC_LABELS_COL,HC_MINROW,60,ROW_HEIGHT + XWCOMBO(HC_MIN_COMBO,HC_DROPDOWNS_COL,HC_MINROW,24,ROW_HEIGHT,0,58,0) + + LTEXT "Mais pas plus de:",HC_MAX_LABEL, + HC_LABELS_COL,HC_MAXROW,60,ROW_HEIGHT + XWCOMBO(HC_MAX_COMBO,HC_DROPDOWNS_COL,HC_MAXROW,24,ROW_HEIGHT,0,58,0) + +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,HC_OK_LEFT,31,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT + PUSHBUTTON "Annuler",IDCANCEL,HC_CANCEL_LEFT,31,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT +#endif +END +#endif + +#define PR_WIDTH 118 +#define PR_OK_LEFT ((PR_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define PR_CANCEL_LEFT ((PR_WIDTH/2)+10) +#define PREFS_ROW_HT 9 + +#define PR_SPACING 13 +#define PR_ROW1 5 +#define PR_ROW2 (PR_ROW1+PR_SPACING) +#define PR_ROW3 (PR_ROW2+PR_SPACING) +#define PR_ROW4 (PR_ROW3+PR_SPACING) +#define PR_ROW5 (PR_ROW4+PR_SPACING) +#define PR_ROW6 (PR_ROW5+PR_SPACING) +#define PR_ROW7 (PR_ROW6+PR_SPACING) +#define PR_BUTTONROW (PR_ROW7+PR_SPACING) +#define PR_LEFT 6 + +#ifdef _WIN32_WCE +# define PREFS_DLG_HT PR_BUTTONROW +#else +# define PREFS_DLG_HT (PR_BUTTONROW+PR_SPACING+3) +#endif + +IDD_OPTIONSDLG DIALOG DISCARDABLE 0, 20, PR_WIDTH, PREFS_DLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "Préférences" +FONT 8, "System" +BEGIN + CONTROL "Cette partie",IDC_RADIOLOCAL,"Button", + BS_AUTORADIOBUTTON | WS_GROUP,4,PR_ROW1,47,10 + CONTROL "Générales",IDC_RADIOGLOBAL,"Button", + BS_AUTORADIOBUTTON,52,PR_ROW1,53,10 + + /* Global */ + CONTROL "Couleur des lettres placées",IDC_CHECKCOLORPLAYED,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP | WS_GROUP, + PR_LEFT,PR_ROW2,90,PREFS_ROW_HT + CONTROL "Activer curseur",IDC_CHECKSHOWCURSOR,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,PR_LEFT,PR_ROW3,60,PREFS_ROW_HT + CONTROL "Détails des points du robot",IDC_CHECKROBOTSCORES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,PR_LEFT,PR_ROW4,87,PREFS_ROW_HT + CONTROL "Cacher valeur des lettres",IDC_HIDETILEVALUES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,PR_LEFT,PR_ROW5,85,PREFS_ROW_HT + PUSHBUTTON "Editer les couleurs...",IDC_PREFCOLORS,PR_LEFT,PR_ROW6,70,12 +#ifdef ALLOW_CHOOSE_FONTS + PUSHBUTTON "Choisir une police...",IDC_PREFFONTS,PR_LEFT,PR_ROW7,60,12 +#endif + + /* Per game */ + CONTROL "Robot intelligent",IDC_CHECKSMARTROBOT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP | WS_GROUP,PR_LEFT,PR_ROW2,60, + PREFS_ROW_HT + CONTROL "Conseils permis",IDC_CHECKHINTSOK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,PR_LEFT,PR_ROW3,60,PREFS_ROW_HT +#ifdef XWFEATURE_SEARCHLIMIT + CONTROL "Limitation des conseils",IDC_CHECKHINTSLIMITS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,8+PR_LEFT,PR_ROW4-2,80,10 +#endif + CONTROL "Chrono",TIMER_CHECK,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,PR_LEFT,PR_ROW5,65,PREFS_ROW_HT + EDITTEXT TIMER_EDIT,65,PR_ROW5,16,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Erreurs:",PHONIES_LABEL,PR_LEFT,PR_ROW6,28,PREFS_ROW_HT + XWCOMBO(PHONIES_COMBO, 38,PR_ROW6,50,PREFS_ROW_HT,0,58,0) + +#ifdef FEATURE_TRAY_EDIT + CONTROL "Tirage manuel", IDC_PICKTILES, "Button", + BS_AUTOCHECKBOX | WS_TABSTOP,PR_LEFT,PR_ROW7,90,PREFS_ROW_HT +#else +#endif +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,PR_OK_LEFT,PR_BUTTONROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT + PUSHBUTTON "Annuler",IDCANCEL,PR_CANCEL_LEFT,PR_BUTTONROW, + REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END + +#ifndef XWFEATURE_STANDALONE_ONLY + +# define LAB_COL 5 +# define LAB_COL_WIDTH 38 +# define CTRL_COL 15 +# define CTRL_COL_WIDTH 80 +# define CONN_ROW_1 2 +# define CONN_ROW_2 (CONN_ROW_1+ROW_SPACE) +# define CONN_ROW_3 (CONN_ROW_2+ROW_SPACE) +# define CONN_ROW_4 (CONN_ROW_3+ROW_SPACE) +# define CONN_ROW_5 (CONN_ROW_4+ROW_SPACE) +# define CONN_ROW_6 (CONN_ROW_5+ROW_SPACE) +# define CONN_ROW_7 (CONN_ROW_6+ROW_SPACE) +# define CONN_ROW_8 (CONN_ROW_7+ROW_SPACE) +# define BUTTON_ROW (CONN_ROW_8+ROW_SPACE) +#ifdef _WIN32_WCE +# define CONNSDLG_HT BUTTON_ROW +#else +# define CONNSDLG_HT (BUTTON_ROW+ROW_SPACE+3) +#endif + + /* #This is a comment???? */ +IDD_CONNSSDLG DIALOG DISCARDABLE 0, 20, 120, CONNSDLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "Connexion" +FONT 8, "System" +BEGIN + + LTEXT "Connecter via:",IDC_CCONVIA_LAB,LAB_COL,CONN_ROW_1,40,ROW_HEIGHT + XWCOMBO(IDC_CONNECT_COMBO, CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,ROW_HEIGHT,0,58,0) + +#ifdef XWFEATURE_RELAY + LTEXT "Cookie:",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT + EDITTEXT COOKIE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL + + LTEXT "Nom du relai (change rarement):",IDC_CRELAYNAME_LAB, + LAB_COL,CONN_ROW_5,120,ROW_HEIGHT + EDITTEXT RELAYNAME_EDIT,CTRL_COL,CONN_ROW_6,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL + LTEXT "Port du relai (change rarement):",IDC_CRELAYPORT_LAB, + LAB_COL,CONN_ROW_7,120,ROW_HEIGHT + EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_8,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL | ES_NUMBER +#else + LTEXT "Connexion non supportée.",IDC_COOKIE_LAB, + LAB_COL,CONN_ROW_3,40,40 +#endif + +#ifdef XWFEATURE_IP_DIRECT + LTEXT "Nom et adresse de l'hôte",IDC_IPNAME_LAB, + LAB_COL,CONN_ROW_3,100,ROW_HEIGHT + EDITTEXT IPNAME_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT,ES_AUTOHSCROLL +#else + LTEXT "Connexion IP directe non supportée.",IDC_IPNAME_LAB, + LAB_COL,CONN_ROW_3,40,40 +#endif + +#ifdef XWFEATURE_SMS + LTEXT "Téléphone hôte:",IDC_SMS_PHONE_LAB,LAB_COL,CONN_ROW_3,60,ROW_HEIGHT + EDITTEXT IDC_SMS_PHONE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Port hôte:",IDC_SMS_PORT_LAB,LAB_COL,CONN_ROW_5,60,ROW_HEIGHT + EDITTEXT IDC_SMS_PORT_EDIT,CTRL_COL,CONN_ROW_6,CTRL_COL_WIDTH,ROW_HEIGHT, + ES_AUTOHSCROLL | ES_NUMBER +#else + LTEXT "SMS non supporté.", + IDC_SMS_PHONE_LAB,LAB_COL,CONN_ROW_3,40,ROW_HEIGHT +#endif + +#ifndef _WIN32_WCE + PUSHBUTTON "OK",IDOK,9,BUTTON_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT + DEFPUSHBUTTON "Annuler",IDCANCEL,70,BUTTON_ROW, + REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT +#endif +END +#endif + +#define CLR_WIDTH 114 +#define CLR_OK_LEFT ((CLR_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +#define CLR_CANCEL_LEFT ((CLR_WIDTH/2)+10) +#define CLR_LAB_WIDTH 45 +#define CLR_SAMPLE_WIDTH 12 +#define CLR_LAB_HT 12 +#define CLR_BUT_WIDTH 12 +#define CLR_BUT_HT 10 + +#define CLR_SMALL_GAP 12 +#define CLR_LRG_GAP 16 + +#define CLR_ROW_1 4 +#define CLR_ROW_2 (CLR_ROW_1+CLR_SMALL_GAP) +#define CLR_ROW_3 (CLR_ROW_2+CLR_SMALL_GAP) +#define CLR_ROW_4 (CLR_ROW_3+CLR_SMALL_GAP) +#define CLR_ROW_5 (CLR_ROW_4+CLR_LRG_GAP) +#define CLR_ROW_6 (CLR_ROW_5+CLR_SMALL_GAP) +#define CLR_ROW_7 (CLR_ROW_6+CLR_SMALL_GAP) +#define CLR_ROW_8 (CLR_ROW_7+CLR_LRG_GAP+5) +#define CLR_ROW_9 (CLR_ROW_8+CLR_SMALL_GAP) +#define CLR_ROW_10 (CLR_ROW_9+CLR_SMALL_GAP) +#define CLR_ROW_11 (CLR_ROW_10+CLR_SMALL_GAP) + +#define CLR_BUTTON_ROW CLR_ROW_11 + CLR_LRG_GAP +#define CLR_COL_1 7 +#define CLR_COL_2 (CLR_COL_1 + CLR_LAB_WIDTH+2) +/* #define CLR_COL_3 58 */ +/* #define CLR_COL_4 99 */ +#define CLR_COL_3 CLR_COL_1 +#define CLR_COL_4 CLR_COL_2 +#ifdef _WIN32_WCE +# define COLORSDLG_HT CLR_BUTTON_ROW +#else +# define COLORSDLG_HT CLR_BUTTON_ROW + BUTTON_HT + 3 +#endif + +#define COLOR_BUTTON(txt,id,xx,yy,ht) \ + LTEXT txt,id,xx,yy,CLR_LAB_WIDTH,ht + /* Hack alert. Smartphone isn't delivering WM_COMMAND events for + clicks on BS_OWNERDRAW buttons, and WinMo (PPC and Smartphone) + won't deliver WM_DRAWITEM events for SS_OWNERDRAW static + controls. The solution: use an OWNERDRAW button as the color + sample (must disable it in code; WS_DISABLED doesn't work here) + and have a separate button to trigger the edit dialog. */ +#define COLOR_SAMPLE(id1,id2,xx,yy) \ + PUSHBUTTON "",id2,xx,yy,CLR_BUT_WIDTH,CLR_BUT_HT,BS_OWNERDRAW \ + PUSHBUTTON "Editer",id1,xx+CLR_SAMPLE_WIDTH+4,yy,24,CLR_BUT_HT,BS_NOTIFY + +IDD_COLORSDLG DIALOG DISCARDABLE 0, 20, CLR_WIDTH, COLORSDLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL +CAPTION "Préférences des couleurs" +FONT 8, "System" +BEGIN + COLOR_BUTTON("Lettre double:",DLBLTR_LABEL,CLR_COL_1,CLR_ROW_1,CLR_LAB_HT) + COLOR_SAMPLE(DLBLTR_BUTTON,DLBLTR_SAMPLE,CLR_COL_2,CLR_ROW_1) + + COLOR_BUTTON("Mot double:",DBLWRD_LABEL,CLR_COL_1,CLR_ROW_2,CLR_LAB_HT ) + COLOR_SAMPLE(DBLWRD_BUTTON,DBLWRD_SAMPLE,CLR_COL_2,CLR_ROW_2) + COLOR_BUTTON("Lettre triple:",TPLLTR_LABEL,CLR_COL_1,CLR_ROW_3,CLR_LAB_HT ) + COLOR_SAMPLE(TPLLTR_BUTTON,TPLLTR_SAMPLE,CLR_COL_2,CLR_ROW_3) + + COLOR_BUTTON("Mot triple:",TPLWRD_LABEL,CLR_COL_3,CLR_ROW_4,CLR_LAB_HT) + COLOR_SAMPLE(TPLWRD_BUTTON,TPLWRD_SAMPLE,CLR_COL_4,CLR_ROW_4) + COLOR_BUTTON("Case vide:",EMPCELL_LABEL,CLR_COL_1,CLR_ROW_5,CLR_LAB_HT) + COLOR_SAMPLE(EMPCELL_BUTTON,EMPCELL_SAMPLE,CLR_COL_2,CLR_ROW_5) + COLOR_BUTTON("Fond de lettre:",TBACK_LABEL,CLR_COL_3,CLR_ROW_6,CLR_LAB_HT) + COLOR_SAMPLE(TBACK_BUTTON,TBACK_SAMPLE,CLR_COL_4,CLR_ROW_6) + COLOR_BUTTON("Couleur sélection:",FOCUSCLR_LABEL,CLR_COL_1,CLR_ROW_7,CLR_LAB_HT+10) + COLOR_SAMPLE(FOCUSCLR_BUTTON,FOCUSCLR_SAMPLE,CLR_COL_2,CLR_ROW_7+5) + COLOR_BUTTON("Joueur 1:",PLAYER1_LABEL,CLR_COL_1,CLR_ROW_8,CLR_LAB_HT) + COLOR_SAMPLE(PLAYER1_BUTTON,PLAYER1_SAMPLE,CLR_COL_2,CLR_ROW_8) + COLOR_BUTTON("Joueur 2:",PLAYER2_LABEL,CLR_COL_3,CLR_ROW_9,CLR_LAB_HT) + COLOR_SAMPLE(PLAYER2_BUTTON,PLAYER2_SAMPLE,CLR_COL_4,CLR_ROW_9) + COLOR_BUTTON("Joueur 3:",PLAYER3_LABEL,CLR_COL_1,CLR_ROW_10,CLR_LAB_HT) + COLOR_SAMPLE(PLAYER3_BUTTON,PLAYER3_SAMPLE,CLR_COL_2,CLR_ROW_10) + COLOR_BUTTON("Joueur 4:",PLAYER4_LABEL,CLR_COL_3,CLR_ROW_11,CLR_LAB_HT) + COLOR_SAMPLE(PLAYER4_BUTTON,PLAYER4_SAMPLE,CLR_COL_4,CLR_ROW_11) + +#ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,CLR_OK_LEFT,CLR_BUTTON_ROW, + REPOS_BUTTON_WIDTH,BUTTON_HT,BS_NOTIFY + PUSHBUTTON "Annuler",IDCANCEL,CLR_CANCEL_LEFT,CLR_BUTTON_ROW, + REPOS_BUTTON_WIDTH,BUTTON_HT,BS_NOTIFY +#endif +END + +// +// Editor for individual colors +// +#ifdef MY_COLOR_SEL + +# define CLRE_LAB_WIDTH 22 +# define CLEDIT_WIDTH 18 +# define CLSLIDER_WIDTH 30 +# define CLSAMPLE_WIDTH 15 + +# define CLRELABEL_COL 3 +# define CLREEDIT_COL (CLRELABEL_COL+CLRE_LAB_WIDTH+2) +# define CLRESLIDER_COL (CLREEDIT_COL+CLEDIT_WIDTH+3) +# define CLSAMPLE_COL (CLRESLIDER_COL+CLSLIDER_WIDTH+5) +# define CLRE_LAB_HT 12 +# define CLREDIT_ROW_1 5 +# define CLREDIT_ROW_2 21 +# define CLREDIT_ROW_3 37 +# define CLRE_WIDTH (CLSAMPLE_COL+CLSAMPLE_WIDTH+5) +# define CLRE_OK_LEFT ((CLRE_WIDTH/2)-10-REPOS_BUTTON_WIDTH) +# define CLRE_CANCEL_LEFT ((CLRE_WIDTH/2)+10) +# ifdef _WIN32_WCE +# define COLOREDITDLG_HT 56 +# else +# define COLOREDITDLG_HT 72 +# endif + +# define COLOR_EDIT_LINE(txt,row,labelId,editId,sliderId) \ + LTEXT txt,labelId,CLRELABEL_COL,row, \ + CLRE_LAB_WIDTH,CLRE_LAB_HT \ + EDITTEXT editId,CLREEDIT_COL,row,CLEDIT_WIDTH,12, \ + ES_AUTOHSCROLL | ES_NUMBER \ + CONTROL "",sliderId,"msctls_trackbar32", \ + TBS_BOTH|TBS_NOTICKS|WS_TABSTOP, \ + CLRESLIDER_COL,row,CLSLIDER_WIDTH,12 + +IDD_COLOREDITDLG DIALOG DISCARDABLE 0, 0, CLRE_WIDTH, COLOREDITDLG_HT +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "" /* set by code */ +FONT 8, "System" +BEGIN + COLOR_EDIT_LINE("Rouge:", CLREDIT_ROW_1, RED_LABEL, RED_EDIT, CLREDT_SLIDER1 ) + COLOR_EDIT_LINE("Vert:", CLREDIT_ROW_2, GREEN_LABEL, GREEN_EDIT, CLREDT_SLIDER2 ) + COLOR_EDIT_LINE("Bleu:", CLREDIT_ROW_3, BLUE_LABEL, BLUE_EDIT, CLREDT_SLIDER3 ) + + /* See hack alert above. Bogus owner-draw button seems the only way to get a sample + color rect into the dialog. */ + PUSHBUTTON "",CLSAMPLE_BUTTON_ID,CLSAMPLE_COL,CLREDIT_ROW_1, + CLSAMPLE_WIDTH,CLREDIT_ROW_3-CLREDIT_ROW_1+CLRE_LAB_HT,BS_OWNERDRAW + +# ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,CLRE_OK_LEFT,56,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT + PUSHBUTTON "Annuler",IDCANCEL,CLRE_CANCEL_LEFT,56,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT +# endif +END +#endif + + +IDD_LOCALESDLG DIALOG DISCARDABLE 0, 0, 120, 115 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "LANGUAGE PICKER" +FONT 8, "System" +BEGIN + LTEXT "CHOOSE the LANGUAGE for MENUS and DIALOG TEXT.", + LOCALES_LABEL,LEFT_COL,2,100,36 + XWCOMBO(LOCALES_COMBO,LEFT_COL,40,70,12,0,58,0) + +# ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,LEFT_COL,55,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT + PUSHBUTTON "Annuler",IDCANCEL,50,55,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT +# endif +END + +///////////////////////////////////////////////////////////////////////////// +// +// String Table. Note that these are ascii strings unless L proceeds the +// first ". +// + +STRINGTABLE DISCARDABLE +BEGIN +#ifdef DEBUG + IDS_APP_TITLE "Crossw_dbg" +#else + IDS_APP_TITLE "Crosswords" +#endif + IDS_MENU "Menu" + IDS_DUMMY "--" + IDS_CANCEL "Annuler" + IDS_OK "OK" + IDS_DONE "Terminé" + IDS_LANGUAGE_NAME "Français" + IDS_NEW_GAME "NEW GAME" // <- translate + IDS_ABOUT "Crosswords 4.4a1 (REV " SVN_REV ") "\ + "pour Windows Mobile. Copyright 1998-2009 "\ + "Eric House. Ce logiciel est produit sous licence "\ + "publique GNU.\r\r"\ + "Pour obtenir des dictionnaires, le manuel ou le "\ + "code source allez sur "\ + "http://xwords.sf.net ou http://eehouse.org/xwords/.\r\r"\ + "Traduction française par Jean-Marc Charette." + IDS_DICTLOC "Veuillez installer un dictionnaire (Fichier .xwd) "\ + "dans le même dossier que le fichier exécutable crosswords.exe ou "\ + "dans un dossier nommé crosswords sur la carte de stockage, "\ + "par exemple dans \\Carte de Stockage\\crosswords. "\ + "Téléchargez des dictionnaires sur le site http://xwords.sf.net ou "\ + "http://eehouse.org/xwords." + IDS_SAVENAME "Entrez un nom pour la partie. (Vous pourrez le changer "\ + "plus tard via la boîte de dialogue Enregistrer partie.)" + IDS_DUPENAME "Entrez un nom pour une copie de cette partie." + IDS_RENAME "Entrez un nouveau nom pour cette partie." + + IDS_REMAINING_TILES_ADD "+ %d [Toutes les lettres restantes]" + IDS_UNUSED_TILES_SUB "- %d [Lettres non utilisées]" + IDS_BONUS_ALL "Bonus scrabble: 50" XP_CR + IDS_TURN_SCORE "Score pour ce coup: %d" XP_CR + IDS_COMMIT_CONFIRM "Accepter ce coup?" XP_CR + IDS_LOCAL_NAME "%s" + IDS_REM "Res" + IDS_IGNORE_L "Ignorer" + IDS_WARN_L "Avertir" + IDS_DISALLOW_L "Refuser" + IDS_NONLOCAL_NAME "%s (Distant)" + IDS_TIME_PENALTY_SUB " - %d [Temps]" + IDS_CUMULATIVE_SCORE "Score cumulé: %d" XP_CR + IDS_MOVE_ACROSS "Placement (de %s horizontalement)" XP_CR + IDS_MOVE_DOWN "Placement (de %s verticalement)" XP_CR + IDS_TRAY_AT_START "Tirage de départ: %s" XP_CR + IDS_NEW_TILES "Nouvelles lettres: %s" XP_CR + IDS_TRADED_FOR "Echangé %s contre %s." + IDS_PASS "Passe" XP_CR + IDS_PHONY_REJECTED "Mot refusé dans ce coup; tour perdu!" XP_CR + IDS_ROBOT_TRADED "Le robot a échangé %d lettre(s) durant ce tour." + IDS_ROBOT_MOVED "Le robot a joué ce coup:" XP_CR + IDS_REMOTE_MOVED "Le joueur distant a joué ce coup:" XP_CR + IDS_PASSED "Passé" + IDS_SUMMARYSCORED "%s:%d" + IDS_TRADED "Echangé %d" + IDS_LOSTTURN "Tour perdu" +#ifndef XWFEATURE_STANDALONE_ONLY + IDS_LOCALPLAYERS "Joueurs loc.:" +#endif + IDS_TOTALPLAYERS "Nombre de joueurs:" + IDS_VALUES_HEADER "%s Nombres/Valeurs:" XP_CR + IDS_QUERY_TRADE "Etes-vous sûr de vouloir échanger les lettres sélectionnées?" + IDS_DOUBLE_LETTER "Lettre compte double" + IDS_DOUBLE_WORD "Mot compte double" + IDS_TRIPLE_LETTER "Lettre compte triple" + IDS_TRIPLE_WORD "Mot compte triple" + + IDS_INTRADE_MW "Echange de lettres." XP_CR "Choisir 'Terminé' quand vous avez fini" + + + IDS_TILES_NOT_IN_LINE "Toutes les lettres jouées doivent être alignées." + IDS_NO_EMPTIES_IN_TURN "Aucune case vide ne peut séparer deux lettres placées." + IDS_TWO_TILES_FIRST_MOVE "Lors du premier coup, vous devez placer deux lettres au minimum." + IDS_TILES_MUST_CONTACT "Les lettres doivent être placées en contact avec des lettres déja présentes sur le plateau de jeu (ou "\ + "recouvrir la case centrale du plateau lors du premier coup)." + IDS_NOT_YOUR_TURN "Vous ne pouvez pas faire cela, ce n'est pas votre tour!" + IDS_NO_PEEK_ROBOT_TILES "Pas de coup d'oeil sur les lettres du robot!" + IDS_CANT_TRADE_MID_MOVE "Retirez les lettres placées avant d'échanger." + IDS_TOO_FEW_TILES_LEFT_TO_TRADE "Il reste trop peu de lettres pour l'échange." + IDS_CANT_UNDO_TILEASSIGN "L'attribution des lettres ne peut être annulé." + IDS_CANT_HINT_WHILE_DISABLED "Les conseils sont désactivés dans cette partie. "\ + "activez-les pour une nouvelle partie en utilisant les préférences." + + IDS_COUNTSVALS_L "Nombre et valeur des lettres" + IDS_REMTILES_L "Lettres restantes" + IDS_GAMEHIST_L "Historique de la partie" + IDS_FINALSCORE_L "Score final" + IDS_QUESTION_L "Question" + IDS_FYI_L "Info" + IDS_ILLEGALWRD_L "Mot interdit" + IDS_WRDNOTFOUND "Mot(s) %s non trouvé(s) dans le dictionnaire." + IDS_USEANYWAY "L'utiliser malgré tout?" + IDS_FYI_L "Oups!" + IDS_CANNOTOPEN_GAME "La partie enregistrée ne peut être ouverte." + IDS_NODICT_L "Dictionnaire non trouvé" + IDS_ABOUT_L "A propos de Crosswords" + IDS_OVERWRITE "Voulez-vous vraiment effacer la partie en cours?" + IDS_ENDNOW "Etes-vous sûr de vouloir terminer la partie maintenant?" + IDS_CANNOTOPEN_DICT "Impossible d'ouvrir le dictionnaire: %s" + IDS_CONFIM_DELETE "Etes-vous certain de vouloir effacer la partie "\ + "sélectionnée? Cette action ne pourra pas être annulée." + + IDS_ROLE_STANDALONE "Autonome" + IDS_ROLE_HOST "Hôte" + IDS_ROLE_GUEST "Invité" + IDS_PLAYER_FORMAT "Joueur %d" + IDS_UNTITLED_FORMAT "Sans titre %d" + IDS_CONN_RELAY_L "Transmission" + IDS_CONN_DIRECT "Connexion directe" + IDS_PASSWDFMT_L "ENTER PASSWORD FOR %ls:" // <- translate + IDS_FILEEXISTSFMT_L "File %s already exists." // <- translate + IDS_NEED_TOUCH "This feature requires a touch screen." // <- translate + IDS_EDITCOLOR_FORMAT "EDIT COLOR FOR %s" // <- translate + +#ifndef XWFEATURE_STANDALONE_ONLY +# ifdef XWFEATURE_SMS + IDS_SMS_CONN_L "Texting" +# endif +# ifdef XWFEATURE_IP_DIRECT + IDS_DIRECT_CONN_L "Direct connection" // <- translate +# endif + + IDS_NO_PEEK_REMOTE_TILES "Pas de coup d'oeil sur le jeu des joueurs distants!" + IDS_REG_UNEXPECTED_USER "Refus de la tentative d'enregistrer un joueur non prévu." + IDS_SERVER_DICT_WINS "Conflit de dictionnaire entre l'hôte et l'invité; l'hôte gagne." + IDS_REG_SERVER_SANS_REMOTE "Au moins un joueur doit être distant dans une partie "\ + "débutée en tant qu'hôte." + +# ifdef XWFEATURE_RELAY + IDS_RELAY_CONN_L "Relay" // <- translate + IDS_XWRELAY_ERROR_TIMEOUT "La transmission a échoué dans les délais; cela signifie généralement "\ + "que les autres joueurs ne vous ont pas vu." + IDS_ERROR_HEART_YOU "Vous avez été déconnecté parce que vous n'avez rien émis "\ + "pendant trop longtemps." + IDS_XWRELAY_ERROR_HEART_OTHER "La transmission a perdu le contact avec un appareil durant cette partie." +/* IDS_XWRELAY_ERROR_LOST_OTHER "The relay has lost contact with a device in this game." */ +# endif +#endif + +END + +#ifdef _WIN32_WCE +// from http://msdn.microsoft.com/en-us/library/ms838191.aspx: don't +// let WinMo draw 320x320 as 240x240 +HI_RES_AWARE CEUX {1} +#endif + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + +/* This is supposed to keep the OS from running us in "emulation mode", but it + isn't working. Changing the versions as reported by objdump does work */ +/* #ifdef _WIN32_WCE */ +/* HI_RES_AWARE CEUX {1} */ +/* #endif */ + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/xwords4/wince/rc_incs.h b/xwords4/wince/rc_incs.h new file mode 100644 index 000000000..0983f2d91 --- /dev/null +++ b/xwords4/wince/rc_incs.h @@ -0,0 +1,24 @@ +// -*- mode: c; compile-command: "make TARGET_OS=wince DEBUG=TRUE"; -*- + +#ifdef _WIN32_WCE +# define UDS_EXPANDABLE 0x0200 +# define UDS_NOSCROLL 0x0400 +# define LISTBOX_CONTROL_FLAGS \ + NOT LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_TABSTOP +# define SPINNER_CONTROL_FLAGS \ + UDS_AUTOBUDDY | UDS_HORZ | UDS_ALIGNRIGHT | UDS_ARROWKEYS |\ + UDS_SETBUDDYINT | UDS_EXPANDABLE +#endif + +#ifdef _WIN32_WCE +# define XWCOMBO(id,xx,yy,ww,ht1,exf1,ht2,exf2) \ + LISTBOX id, xx,yy,ww,ht1, LISTBOX_CONTROL_FLAGS | exf1 \ + CONTROL "", id+1, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,0,0,0,0 \ + COMBOBOX id+2,xx,yy,ww,ht2, \ + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +#else +# define XWCOMBO(id,xx,yy,ww,ht1,exf1,ht2,exf2) \ + COMBOBOX id+2,xx,yy,ww,ht1, \ + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | exf2 +#endif + diff --git a/xwords4/wince/resource.h b/xwords4/wince/resource.h index dbc1c7012..34b92a33a 100755 --- a/xwords4/wince/resource.h +++ b/xwords4/wince/resource.h @@ -2,6 +2,12 @@ // Microsoft Developer Studio generated include file. // Used by xwords4.rc // + +// Stuff needed by C and .rc files... +// 'Doze expects a carraige return followed by a linefeed +#define XP_CR "\015\012" + + #define IDS_APP_TITLE 1 #define IDC_XWORDS4 3 #define IDI_XWORDS4 101 @@ -31,6 +37,7 @@ #ifdef ALLOW_CHOOSE_FONTS # define IDD_FONTSSDLG 127 #endif +#define IDD_LOCALESDLG 128 #define REMOTE_CHECK1 1005 #define NAME_EDIT1 1006 @@ -156,6 +163,20 @@ # define FONTSIZE_COMBO_PPC 1130 #endif +/* Dll/language picker */ +#define LOCALES_COMBO 1131 +#define IDC_LOCALESUPDOWN 1132 +#define LOCALES_COMBO_PPC 1133 + +#define IDC_ROLELABEL 1134 +#define IDC_NAMELABEL 1135 +#define IDC_ROBOTLABEL 1136 +#define IDC_PASSWDLABEL 1137 +#define HC_MIN_LABEL 1138 +#define HC_MAX_LABEL 1139 +#define LOCALES_LABEL 1140 + + #define IDC_CCONVIA_LAB 1106 #define IDC_COOKIE_LAB 1107 @@ -194,6 +215,7 @@ #define ID_FILE_EXIT 40002 #define IDM_HELP_ABOUT 40003 #define ID_FILE_ABOUT 40004 +#define ID_FILE_LOCALES 40029 #define ID_GAME_GAMEINFO 40005 #define ID_GAME_HISTORY 40006 #define ID_GAME_FINALSCORES 40007 @@ -229,16 +251,9 @@ #define ID_BONUS_RES 9998 #define IDM_MAIN_COMMAND1 40001 -#define IDS_MENU 40002 -#define IDS_DUMMY 40003 -#define IDS_CANCEL 40004 -#define IDS_OK 40005 -#define IDS_ABOUT 40006 -#define IDS_DONE 40007 -#define IDS_DICTLOC 40029 -#define IDS_SAVENAME 40030 -#define IDS_DUPENAME 40031 -#define IDS_RENAME 40032 +#define IDS_DUMMY 40002 + +#include "strids.h" // These are in sets of three, and must be consecutive and in the right order within each set #define PHONIES_COMBO 1200 diff --git a/xwords4/wince/scripts/makezip.sh b/xwords4/wince/scripts/makezip.sh index 129380fa7..08cb01532 100755 --- a/xwords4/wince/scripts/makezip.sh +++ b/xwords4/wince/scripts/makezip.sh @@ -59,7 +59,7 @@ fi cat > $README <(b)?(a):(b)) diff --git a/xwords4/wince/xwords4.rc b/xwords4/wince/xwords4.rc index e6302d2c2..bb7cccaeb 100755 --- a/xwords4/wince/xwords4.rc +++ b/xwords4/wince/xwords4.rc @@ -121,6 +121,7 @@ BEGIN MENUITEM "Preferences...", ID_FILE_PREFERENCES MENUITEM SEPARATOR MENUITEM "About...", ID_FILE_ABOUT + MENUITEM "Locales...", ID_FILE_LOCALES MENUITEM SEPARATOR MENUITEM "Exit", ID_FILE_EXIT END @@ -169,15 +170,7 @@ BEGIN END #endif -#ifdef _WIN32_WCE -# define UDS_EXPANDABLE 0x0200 -# define UDS_NOSCROLL 0x0400 -# define LISTBOX_CONTROL_FLAGS \ - NOT LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_TABSTOP -# define SPINNER_CONTROL_FLAGS \ - UDS_AUTOBUDDY | UDS_HORZ | UDS_ALIGNRIGHT | UDS_ARROWKEYS |\ - UDS_SETBUDDYINT | UDS_EXPANDABLE -#endif +#include "rc_incs.h" ///////////////////////////////////////////////////////////////////////////// // @@ -190,6 +183,7 @@ END #define REPOS_BUTTON_HPAD 2 // ******** IDD_GAMEINFO DIALOG ********* +#define GAMEINFO_WIDTH 116 #ifdef CEFEATURE_CANSCROLL # define ROW_HEIGHT 10 # define ROW_SPACE 12 @@ -200,26 +194,39 @@ END # define ROW_SPACE_PL ROW_SPACE #endif #define CHECK_WIDTH 10 -#define GAME_NAME_WIDTH 56 #define LEFT_COL 2 #ifdef XWFEATURE_STANDALONE_ONLY +# define GAME_NAME_WIDTH 56 +# define GAME_LABEL_WIDTH (GAME_NAME_WIDTH-10) # define GAME_NAME_LEFT LEFT_COL # define GAME_ROBOT_LEFT (GAME_NAME_LEFT + GAME_NAME_WIDTH + 5) # define GAME_PWD_LEFT (GAME_ROBOT_LEFT + 15) # define NPLAYERS_ROW 3 +# define ROBOT_LABEL_ADJUST 10 +# define NAME_LABEL_ADJUST 20 # define GAME_NAMELABEL_LEFT GAME_NAME_LEFT -# define GAME_ROBOTLABEL_LEFT GAME_ROBOT_LEFT +# define GAME_NAMELABEL_WIDTH (GAME_NAME_WIDTH-ROBOT_LABEL_ADJUST-NAME_LABEL_ADJUST) +# define GAME_ROBOTLABEL_LEFT (GAME_ROBOT_LEFT-7) +# define GAME_ROBOTLABEL_WIDTH (GAME_PWD_LEFT-GAME_ROBOT_LEFT+ROBOT_LABEL_ADJUST) # define GAME_PWDLABEL_LEFT GAME_PWD_LEFT +# define GAME_PWDLABEL_WIDTH (GAMEINFO_WIDTH-GAME_PWD_LEFT) #else # define SERVERROLE_ROW 3 -# define NPLAYERS_ROW (SERVERROLE_ROW+ROW_SPACE+3) -# define GAME_REMOTE_LEFT 2 -# define GAME_NAME_LEFT 15 -# define GAME_ROBOT_LEFT 92 -# define GAME_PWD_LEFT (GAME_ROBOT_LEFT + CHECK_WIDTH + 6) -# define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT + 20) -# define GAME_ROBOTLABEL_LEFT 87 -# define GAME_PWDLABEL_LEFT 105 +# define GAME_NAME_WIDTH 56 +# define SERVERCONF_ROW (SERVERROLE_ROW+ROW_SPACE+3) +# define NPLAYERS_ROW (SERVERCONF_ROW+ROW_SPACE+3) +# define GAME_REMOTE_LEFT 1 +# define GAME_NAME_LEFT 11 +# define ROBOT_LABEL_ADJUST 10 +# define GAME_ROBOT_LEFT (GAME_NAME_LEFT+GAME_NAME_WIDTH+2) +# define GAME_PWD_LEFT (GAME_ROBOT_LEFT + CHECK_WIDTH + 4) +# define NAME_LABEL_ADJUST 20 +# define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT+NAME_LABEL_ADJUST) +# define GAME_NAMELABEL_WIDTH (GAME_NAME_WIDTH-ROBOT_LABEL_ADJUST-NAME_LABEL_ADJUST) +# define GAME_ROBOTLABEL_LEFT (GAME_ROBOT_LEFT-ROBOT_LABEL_ADJUST) +# define GAME_ROBOTLABEL_WIDTH (GAME_PWD_LEFT-GAME_ROBOT_LEFT+ROBOT_LABEL_ADJUST) +# define GAME_PWDLABEL_LEFT (GAME_PWD_LEFT) +# define GAME_PWDLABEL_WIDTH (GAMEINFO_WIDTH-GAME_PWD_LEFT) #endif @@ -228,7 +235,8 @@ END #define PLAYER_ROW_2 (PLAYER_ROW_1+ROW_SPACE_PL) #define PLAYER_ROW_3 (PLAYER_ROW_2+ROW_SPACE_PL) #define PLAYER_ROW_4 (PLAYER_ROW_3+ROW_SPACE_PL) -#define DICTPICK_LAB_ROW (PLAYER_ROW_4+ROW_SPACE+2) +#define JUGGLE_ROW (PLAYER_ROW_4+ROW_SPACE) +#define DICTPICK_LAB_ROW (JUGGLE_ROW+ROW_SPACE+2) #define DICTPICK_ROW (DICTPICK_LAB_ROW+ROW_SPACE-2) #define PREFS_ROW (DICTPICK_ROW+ROW_SPACE+3) #ifndef _WIN32_WCE @@ -254,33 +262,30 @@ END ES_PASSWORD | ES_AUTOHSCROLL \ -IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, 116, GAMEINFO_HEIGHT +IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, GAMEINFO_WIDTH, GAMEINFO_HEIGHT STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER | WS_VSCROLL CAPTION "Game info" FONT 8, "System" BEGIN #ifndef XWFEATURE_STANDALONE_ONLY - LTEXT "Role:",IDC_STATIC,25,SERVERROLE_ROW,20,8 - COMBOBOX IDC_ROLECOMBO,45,SERVERROLE_ROW,50,58,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP - + LTEXT "Role:",IDC_ROLELABEL,LEFT_COL,SERVERROLE_ROW,20,8 + XWCOMBO(IDC_ROLECOMBO,26,SERVERROLE_ROW,70,ROW_HEIGHT,0,58,0) + + PUSHBUTTON "Configure role",GIROLECONF_BUTTON,LEFT_COL+10, + SERVERCONF_ROW,60,ROW_HEIGHT #endif - LTEXT "",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,43,8 -#ifdef _WIN32_WCE - LISTBOX IDC_NPLAYERSCOMBO, 46, NPLAYERS_ROW, 24, ROW_HEIGHT, LISTBOX_CONTROL_FLAGS - CONTROL "", IDC_NPLAYERSUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX IDC_NPLAYERSCOMBO_PPC,46,NPLAYERS_ROW,24,58,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP + LTEXT "",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,63,8 + XWCOMBO(IDC_NPLAYERSCOMBO,66,NPLAYERS_ROW,24,ROW_HEIGHT,0,58,0) - PUSHBUTTON "Jugl.",GIJUGGLE_BUTTON,75,NPLAYERS_ROW,20,ROW_HEIGHT + // error + LTEXT "Name",IDC_NAMELABEL,GAME_NAMELABEL_LEFT,LABELS_ROW, + GAME_NAMELABEL_WIDTH,8,SS_NOPREFIX - LTEXT "Name",IDC_STATIC,GAME_NAMELABEL_LEFT, - LABELS_ROW,GAME_NAME_WIDTH-10,8,SS_NOPREFIX - LTEXT "Robot",IDC_STATIC,GAME_ROBOTLABEL_LEFT-7,LABELS_ROW,22,8 - LTEXT "Pwd",IDC_STATIC,GAME_PWDLABEL_LEFT,LABELS_ROW,16,8 + LTEXT "Robot",IDC_ROBOTLABEL,GAME_ROBOTLABEL_LEFT,LABELS_ROW, + GAME_ROBOTLABEL_WIDTH,8 + LTEXT "Pwd",IDC_PASSWDLABEL,GAME_PWDLABEL_LEFT,LABELS_ROW, + GAME_PWDLABEL_WIDTH,8 #if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH LTEXT "Remote",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX @@ -298,21 +303,19 @@ BEGIN CE_PLAYER_ROW( NAME_EDIT3, PLAYER_ROW_3, ROBOT_CHECK3, PASS_EDIT3 ) CE_PLAYER_ROW( NAME_EDIT4, PLAYER_ROW_4, ROBOT_CHECK4, PASS_EDIT4 ) + PUSHBUTTON "Juggle players",GIJUGGLE_BUTTON,LEFT_COL+10,JUGGLE_ROW, + 60,BUTTON_HT + LTEXT "Dictionary:",IDC_DICTLABEL,LEFT_COL,DICTPICK_LAB_ROW,36,8, SS_NOPREFIX -#ifdef _WIN32_WCE - LISTBOX IDC_DICTLIST, LEFT_COL+10,DICTPICK_ROW,80,ROW_HEIGHT,LISTBOX_CONTROL_FLAGS|LBS_SORT - CONTROL "", IDC_DICTUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX IDC_DICTLIST_PPC,LEFT_COL+10,DICTPICK_ROW,80,58, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + XWCOMBO(IDC_DICTLIST, LEFT_COL+10,DICTPICK_ROW,80,ROW_HEIGHT,LBS_SORT,58,CBS_SORT) - PUSHBUTTON "Preferences...",OPTIONS_BUTTON,LEFT_COL,PREFS_ROW,55,12 + PUSHBUTTON "Preferences...",OPTIONS_BUTTON,LEFT_COL,PREFS_ROW, + 55,BUTTON_HT #ifndef _WIN32_WCE - PUSHBUTTON "OK",IDOK,29,BUTTONS_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT - DEFPUSHBUTTON "Cancel",IDCANCEL,70,BUTTONS_ROW, + PUSHBUTTON "OK",IDOK,20,BUTTONS_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT + DEFPUSHBUTTON "Cancel",IDCANCEL,50,BUTTONS_ROW, REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT #endif END @@ -374,14 +377,8 @@ BEGIN PUSHBUTTON "Put back",IDC_BACKUP,ASKB_COLLEFT,ASKB_PUTTOP,35,14 #endif -#ifdef _WIN32_WCE - LISTBOX BLANKFACE_LIST,ASKB_COMBOLEFT,ASKB_COLLEFT,27,12, - LISTBOX_CONTROL_FLAGS | LBS_SORT - CONTROL "", IDC_ASKBLANK_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX BLANKFACE_LIST_PPC,ASKB_COMBOLEFT,ASKB_COLLEFT,27,70, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + XWCOMBO(BLANKFACE_LIST,ASKB_COMBOLEFT,ASKB_COLLEFT,27,12,LBS_SORT,70,CBS_SORT) + #ifndef _WIN32_WCE DEFPUSHBUTTON "OK",IDOK,80,WCE_BOTTOM,REPOS_BUTTON_WIDTH, BUTTON_HT PUSHBUTTON "Cancel",IDCANCEL,20,WCE_BOTTOM,REPOS_BUTTON_WIDTH, BUTTON_HT @@ -440,14 +437,7 @@ BEGIN "Select a saved game. (Some buttons will be disabled when the current game is selected.)", IDC_SVGM_SELLAB,SVGM_LEFT_COL, SVGM_ROW_1,90,35 -#ifdef _WIN32_WCE - LISTBOX IDC_SVGM_GAMELIST, SVGM_LEFT_COL,SVGM_ROW_2,70,ROW_HEIGHT, - LISTBOX_CONTROL_FLAGS | LBS_SORT - CONTROL "", IDC_SVGM_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX IDC_SVGM_GAMELIST_PPC,SVGM_LEFT_COL,SVGM_ROW_2,70,58, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | CBS_SORT + XWCOMBO(IDC_SVGM_GAMELIST, SVGM_LEFT_COL,SVGM_ROW_2,70,ROW_HEIGHT,LBS_SORT,58,CBS_SORT) PUSHBUTTON "Open",IDC_SVGM_OPEN, SVGM_LEFT_COL,SVGM_ROW_3,40,14,WS_DISABLED @@ -508,23 +498,14 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER CAPTION "Tile hint limits" FONT 8, "System" BEGIN - LTEXT "Use at least:",IDC_STATIC,HC_LABELS_COL,HC_MINROW,60,ROW_HEIGHT -#ifdef _WIN32_WCE - LISTBOX HC_MIN_COMBO, HC_DROPDOWNS_COL,HC_MINROW, 24, ROW_HEIGHT, LISTBOX_CONTROL_FLAGS - CONTROL "", HC_MIN_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX HC_MIN_COMBO_PPC,HC_DROPDOWNS_COL,HC_MINROW,17,58, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Use at least:",HC_MIN_LABEL,HC_LABELS_COL,HC_MINROW,60, + ROW_HEIGHT + XWCOMBO(HC_MIN_COMBO, HC_DROPDOWNS_COL,HC_MINROW,24,ROW_HEIGHT,0,58,0) + + LTEXT "But no more than:",HC_MAX_LABEL,HC_LABELS_COL,HC_MAXROW,60, + ROW_HEIGHT + XWCOMBO(HC_MAX_COMBO, HC_DROPDOWNS_COL,HC_MAXROW, 24, ROW_HEIGHT, 0,58,0) - LTEXT "But no more than:",IDC_STATIC,HC_LABELS_COL,HC_MAXROW,60,ROW_HEIGHT -#ifdef _WIN32_WCE - LISTBOX HC_MAX_COMBO, HC_DROPDOWNS_COL,HC_MAXROW, 24, ROW_HEIGHT, LISTBOX_CONTROL_FLAGS - CONTROL "", HC_MAX_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX HC_MAX_COMBO_PPC,HC_DROPDOWNS_COL,HC_MAXROW,17,58, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP #ifndef _WIN32_WCE DEFPUSHBUTTON "OK",IDOK,HC_OK_LEFT,31,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT PUSHBUTTON "Cancel",IDCANCEL,HC_CANCEL_LEFT,31,REPOS_BUTTON_WIDTH, @@ -593,13 +574,7 @@ BEGIN BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW5,75,PREFS_ROW_HT EDITTEXT TIMER_EDIT,85,PR_ROW5,16,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Phonies:",PHONIES_LABEL,8,PR_ROW6,28,PREFS_ROW_HT -#ifdef _WIN32_WCE - LISTBOX PHONIES_COMBO, 38,PR_ROW6,50,PREFS_ROW_HT, LISTBOX_CONTROL_FLAGS - CONTROL "", IDC_PHONIESUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX PHONIES_COMBO_PPC,38,PR_ROW6,40,58,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP + XWCOMBO(PHONIES_COMBO, 38,PR_ROW6,50,PREFS_ROW_HT, 0, 58, 0) #ifdef FEATURE_TRAY_EDIT CONTROL "Pick tiles face-up", IDC_PICKTILES, "Button", @@ -633,8 +608,8 @@ FONT 8, "System" BEGIN LTEXT "Connect via",IDC_CCONVIA_LAB,LAB_COL,CONN_ROW_1,40,12 - COMBOBOX IDC_CONNECTCOMBO,CTRL_COL,CONN_ROW_1,CTRL_COL_WIDTH,58,CBS_DROPDOWNLIST | - WS_VSCROLL | WS_TABSTOP + XWCOMBO(IDC_CONNECT_COMBO,CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,ROW_HEIGHT,58,0) + #ifdef XWFEATURE_RELAY LTEXT "Cookie",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_2,40,12 @@ -828,22 +803,10 @@ FONT 8, "System" BEGIN LTEXT "Fonts:",FONTS_LABEL,5,2,25,12 -#ifdef _WIN32_WCE - LISTBOX FONTS_COMBO, 30,2,70,12, LISTBOX_CONTROL_FLAGS | LBS_SORT - CONTROL "", IDC_FONTSUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX FONTS_COMBO_PPC,30,2,70,58, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + XWCOMBO(FONTS_COMBO, 30,2,70,12,0,58,0) LTEXT "Size:",FONTSIZE_LABEL,5,16,25,12 -#ifdef _WIN32_WCE - LISTBOX FONTSIZE_COMBO, 30,16,25,12, LISTBOX_CONTROL_FLAGS | LBS_SORT - CONTROL "", IDC_FONTSIZEUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS, - 0, 0, 0, 0 -#endif - COMBOBOX FONTSIZE_COMBO_PPC,30,16,25,58, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + XWCOMBO(FONTSIZE_COMBO, 30,16,25,12,0,58,0) # ifndef _WIN32_WCE DEFPUSHBUTTON "OK",IDOK,20,100,REPOS_BUTTON_WIDTH, @@ -854,6 +817,23 @@ BEGIN END #endif +IDD_LOCALESDLG DIALOG DISCARDABLE 0, 0, 120, 60 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +CAPTION "Language Picker" +FONT 8, "System" +BEGIN + LTEXT "Choose the language for menus and dialog text.", + LOCALES_LABEL,LEFT_COL,2,100,36 + + XWCOMBO(LOCALES_COMBO,LEFT_COL,40,70,12,0,58,0) +# ifndef _WIN32_WCE + DEFPUSHBUTTON "OK",IDOK,LEFT_COL,55,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT + PUSHBUTTON "Cancel",IDCANCEL,50,55,REPOS_BUTTON_WIDTH, + REPOS_BUTTON_HT +# endif +END + ///////////////////////////////////////////////////////////////////////////// // // Bitmap @@ -922,7 +902,9 @@ BEGIN IDS_CANCEL "Cancel" IDS_OK "Ok" IDS_DONE "Done" - IDS_ABOUT "Crosswords 4.2.1 (rev " SVN_REV ") "\ + IDS_LANGUAGE_NAME "English" + IDS_NEW_GAME "New Game" + IDS_ABOUT "Crosswords 4.2.1 b1 (rev " SVN_REV ") "\ "for Windows Mobile. Copyright 1998-2009 by "\ "Eric House. This software is released under the GNU "\ "Public License.\r\r"\ @@ -939,6 +921,117 @@ BEGIN IDS_DUPENAME "Enter a name for a copy of this game." IDS_RENAME "Enter a new name for this game." + IDS_REMAINING_TILES_ADD "+ %d [all remaining tiles]" + IDS_UNUSED_TILES_SUB "- %d [unused tiles]" + IDS_BONUS_ALL "Bonus for using all tiles: 50" XP_CR + IDS_TURN_SCORE "Score for turn: %d" XP_CR + IDS_COMMIT_CONFIRM + "Commit the current move?" XP_CR + IDS_LOCAL_NAME "%s" + IDS_REM "Rem" + IDS_IGNORE_L "Ignore" + IDS_WARN_L "Warn" + IDS_DISALLOW_L "Disallow" + IDS_NONLOCAL_NAME "%s (remote)" + IDS_TIME_PENALTY_SUB " - %d [time]" + IDS_CUMULATIVE_SCORE "Cumulative score: %d" XP_CR + IDS_MOVE_ACROSS "move (from %s across)" XP_CR + IDS_MOVE_DOWN "move (from %s down)" XP_CR + IDS_TRAY_AT_START "Tray at start: %s" XP_CR + IDS_NEW_TILES "New tiles: %s" XP_CR + IDS_TRADED_FOR "Traded %s for %s." + IDS_PASS "pass" XP_CR + IDS_PHONY_REJECTED "Illegal word in move; turn lost!" XP_CR + IDS_ROBOT_TRADED "Robot traded tiles %d this turn." + IDS_ROBOT_MOVED "The robot made this move:" XP_CR + IDS_REMOTE_MOVED "Remote player made this move:" XP_CR + IDS_PASSED "Passed" + IDS_SUMMARYSCORED "%s:%d" + IDS_TRADED "Traded %d" + IDS_LOSTTURN "Lost turn" + IDS_TOTALPLAYERS "Number of players:" + IDS_VALUES_HEADER "%s counts/values:" XP_CR + IDS_QUERY_TRADE "Are you sure you want to trade the selected tiles?" + + IDS_DOUBLE_LETTER "Double Letter" + IDS_DOUBLE_WORD "Double Word" + IDS_TRIPLE_LETTER "Triple Letter" + IDS_TRIPLE_WORD "Triple Word" + IDS_INTRADE_MW "Trading tiles." XP_CR "Select 'turn done' when ready" + + IDS_TILES_NOT_IN_LINE "All tiles played must be in a line." + IDS_NO_EMPTIES_IN_TURN "Empty squares cannot separate tiles played." + IDS_TWO_TILES_FIRST_MOVE "Must play two or more pieces on the first move." + IDS_TILES_MUST_CONTACT "New pieces must contact others already in place (or "\ + "the middle square on the first move)." + IDS_NOT_YOUR_TURN "You can't do that; it's not your turn!" + IDS_NO_PEEK_ROBOT_TILES "No peeking at the robot's tiles!" + IDS_CANT_TRADE_MID_MOVE "Remove played tiles before trading." + IDS_TOO_FEW_TILES_LEFT_TO_TRADE "Too few tiles left to trade." + IDS_CANT_UNDO_TILEASSIGN "Tile assignment can't be undone." + IDS_CANT_HINT_WHILE_DISABLED "The hint feature is disabled for this game. Enable "\ + "it for a new game using the Preferences dialog." + + IDS_COUNTSVALS_L "Tile Counts and Values" + IDS_REMTILES_L "Remaining tiles" + IDS_GAMEHIST_L "Game history" + IDS_FINALSCORE_L "Final scores" + IDS_QUESTION_L "Question" + IDS_FYI_L "FYI" + IDS_ILLEGALWRD_L "Illegal word" + IDS_WRDNOTFOUND "Word[s] %s not found in dictionary." + IDS_USEANYWAY "Use it anyway?" + IDS_FYI_L "Oops!" + IDS_CANNOTOPEN_GAME "Saved game cannot be opened." + IDS_NODICT_L "Dictionary Not Found" + IDS_ABOUT_L "About Crosswords" + IDS_OVERWRITE "Do you really want to overwrite the current game?" + IDS_ENDNOW "Are you sure you want to end the game now?" + IDS_CANNOTOPEN_DICT "Unable to open dictionary: %s" + IDS_CONFIM_DELETE "Are you certain you want to delete the "\ + "selected game? This action cannot be undone." + + IDS_ROLE_STANDALONE "Standalone" + IDS_ROLE_HOST "Host" + IDS_ROLE_GUEST "Guest" + IDS_PLAYER_FORMAT "Player %d" + IDS_UNTITLED_FORMAT "Untitled %d" + IDS_CONN_RELAY_L "Relay" + IDS_CONN_DIRECT "Direct connection" + IDS_PASSWDFMT_L "Enter password for %ls:" + + IDS_FILEEXISTSFMT_L "File %s already exists." + IDS_NEED_TOUCH "This feature requires a touch screen." + IDS_EDITCOLOR_FORMAT "Edit color for %s" + +#ifndef XWFEATURE_STANDALONE_ONLY + + IDS_LOCALPLAYERS "Locl playrs:" + IDS_NO_PEEK_REMOTE_TILES "No peeking at remote players' tiles!" + IDS_REG_UNEXPECTED_USER "Refused attempt to register unexpected "\ + "user[s]." + IDS_SERVER_DICT_WINS "Conflict between Host and Guest dictionaries; " + "Host wins." + IDS_REG_SERVER_SANS_REMOTE "At least one player must be marked remote "\ + "for a game started as Host." + +# ifdef XWFEATURE_SMS + IDS_SMS_CONN_L "Texting" +# endif +# ifdef XWFEATURE_IP_DIRECT + IDS_DIRECT_CONN_L "Direct connection" +# endif +# ifdef XWFEATURE_RELAY + IDS_RELAY_CONN_L "Relay" + IDS_XWRELAY_ERROR_TIMEOUT "The relay timed you out; usually that means "\ + "the other players didn't show." + IDS_ERROR_HEART_YOU "You were disconnected from relay because it "\ + "didn't hear from you in too long." + IDS_XWRELAY_ERROR_HEART_OTHER "The relay has lost contact with a device in this game." +/* IDS_XWRELAY_ERROR_LOST_OTHER "The relay has lost contact with a device in this game." */ +# endif +#endif + END #ifdef _WIN32_WCE