From b957e9c1955d2880fb719c0a24d761f6c872bcde Mon Sep 17 00:00:00 2001 From: ehouse Date: Sun, 25 Oct 2009 15:00:06 +0000 Subject: [PATCH] Only set StrBox font on Win32. WinMo devices seem to have Unicode font even if not localized. --- xwords4/wince/cestrbx.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/xwords4/wince/cestrbx.c b/xwords4/wince/cestrbx.c index 64cd46c50..2b2332498 100755 --- a/xwords4/wince/cestrbx.c +++ b/xwords4/wince/cestrbx.c @@ -1,6 +1,6 @@ /* -*- fill-column: 77; c-basic-offset: 4; compile-command: "make TARGET_OS=wince DEBUG=TRUE" -*- */ /* - * Copyright 2002-2006 by Eric House (xwords@eehouse.org). All rights reserved. + * Copyright 2002-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 @@ -27,7 +27,9 @@ typedef struct StrBoxState { CeDlgHdr dlgHdr; const wchar_t* title; +#ifndef _WIN32_WCE HFONT font; +#endif XWStreamCtxt* stream; XP_U16 result; XP_Bool isQuery; @@ -76,10 +78,10 @@ StrBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) if ( !!state->title ) { SendMessage( hDlg, WM_SETTEXT, 0, (long)state->title ); } - - SendDlgItemMessage( hDlg, ID_EDITTEXT, WM_SETFONT, +#ifndef _WIN32_WCE + SendDlgItemMessage( hDlg, ID_EDITTEXT, WM_SETFONT, (WPARAM)state->font, 0L ); - +#endif if ( !state->isQuery ) { ceShowOrHide( hDlg, IDCANCEL, XP_FALSE ); } @@ -136,20 +138,23 @@ WrapStrBox( CEAppGlobals* globals, const wchar_t* title, state.isQuery = (buttons & ~MB_ICONMASK) != MB_OK; state.dlgHdr.globals = globals; +#ifndef _WIN32_WCE LOGFONT fontInfo; XP_MEMSET( &fontInfo, 0, sizeof(fontInfo) ); fontInfo.lfHeight = 14; fontInfo.lfQuality = PROOF_QUALITY; wcscpy( fontInfo.lfFaceName, IS_SMARTPHONE(globals)? L"Segoe Condensed" : L"Tahoma" ); - state.font = CreateFontIndirect( &fontInfo ); +#endif assertOnTop( globals->hWnd ); DialogBoxParam( globals->locInst, (LPCTSTR)IDD_STRBOX, globals->hWnd, (DLGPROC)StrBox, (long)&state ); +#ifndef _WIN32_WCE DeleteObject( state.font ); +#endif return state.result == IDOK; }