wince support for Rem: focus and showing remaining tiles

This commit is contained in:
ehouse 2008-10-24 09:05:13 +00:00
parent 77d14163b1
commit 3b5337d7d2
3 changed files with 22 additions and 3 deletions

View file

@ -1188,7 +1188,7 @@ DRAW_FUNC_NAME(measureRemText)( DrawCtx* p_dctx, const XP_Rect* xprect,
DLSTATIC void
DRAW_FUNC_NAME(drawRemText)( DrawCtx* p_dctx, const XP_Rect* rInner,
const XP_Rect* XP_UNUSED(rOuter),
XP_S16 nTilesLeft )
XP_S16 nTilesLeft, XP_Bool focussed )
{
CEDrawCtx* dctx = (CEDrawCtx*)p_dctx;
CEAppGlobals* globals = dctx->globals;
@ -1200,11 +1200,16 @@ DRAW_FUNC_NAME(drawRemText)( DrawCtx* p_dctx, const XP_Rect* rInner,
formatRemText( nTilesLeft, dctx->scoreIsVertical, buf );
XPRtoRECT( &rt, rInner );
if ( focussed ) {
SetBkColor( hdc, dctx->globals->appPrefs.colors[CE_FOCUS_COLOR] );
FillRect( hdc, &rt, dctx->brushes[CE_FOCUS_COLOR] );
}
InsetRect( &rt, 1, 1 );
fce = ceGetSizedFont( dctx, 0, RFONTS_REM );
oldFont = SelectObject( hdc, fce->setFont );
XPRtoRECT( &rt, rInner );
InsetRect( &rt, 1, 1 );
ceDrawLinesClipped( hdc, fce, buf, XP_TRUE, &rt );
(void)SelectObject( hdc, oldFont );

View file

@ -126,6 +126,7 @@ static const XP_UCHAR* ce_util_getUserString( XW_UtilCtxt* uc,
XP_U16 stringCode );
static XP_Bool ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
XP_U16 turn, XP_Bool turnLost );
static void ce_util_remSelected( XW_UtilCtxt* uc );
#if defined XWFEATURE_BLUETOOTH || defined XWFEATURE_RELAY
static void ce_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
const CommsAddrRec* newAddr );
@ -349,6 +350,7 @@ ceInitUtilFuncs( CEAppGlobals* globals )
vtable->m_util_makeEmptyDict = ce_util_makeEmptyDict;
vtable->m_util_getUserString = ce_util_getUserString;
vtable->m_util_warnIllegalWord = ce_util_warnIllegalWord;
vtable->m_util_remSelected = ce_util_remSelected;
#ifdef XWFEATURE_RELAY
vtable->m_util_addrChange = ce_util_addrChange;
vtable->m_util_makeStreamFromAddr = ce_util_makeStreamFromAddr;
@ -2501,6 +2503,10 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
draw = server_do( globals->game.server );
break;
case XWWM_REM_SEL:
ceTilesLeft( globals );
break;
#ifndef XWFEATURE_STANDALONE_ONLY
case XWWM_PACKET_ARRIVED:
draw = processPacket( globals, (XWStreamCtxt*)lParam );
@ -3311,6 +3317,13 @@ ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
return isOk;
} /* ce_util_warnIllegalWord */
static void
ce_util_remSelected( XW_UtilCtxt* uc )
{
CEAppGlobals* globals = (CEAppGlobals*)uc->closure;
PostMessage( globals->hWnd, XWWM_REM_SEL, 0, 0 );
}
#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH
static void
ce_util_addrChange( XW_UtilCtxt* XP_UNUSED(uc),

View file

@ -174,6 +174,7 @@ typedef struct CEAppGlobals {
enum {
XWWM_TIME_RQST = WM_APP
,XWWM_REM_SEL
,XWWM_PACKET_ARRIVED
};