diff --git a/xwords4/wince/ceginfo.c b/xwords4/wince/ceginfo.c index 7d5bdc972..ae9081f95 100755 --- a/xwords4/wince/ceginfo.c +++ b/xwords4/wince/ceginfo.c @@ -25,6 +25,7 @@ #include "cedict.h" #include "cecondlg.h" #include "strutils.h" +#include "cedebug.h" #define NUM_COLS 4 #define MENUDICTS_INCR 16 @@ -120,7 +121,7 @@ addDictsToMenu( GameInfoState* giState ) for ( i = 0; i < nMenuDicts; ++i ) { wchar_t* wPath = giState->menuDicts[i]; shortname = wbname( shortPath, sizeof(shortPath), wPath ); - SendDlgItemMessage( giState->hDlg, IDC_DICTCOMBO, CB_ADDSTRING, 0, + SendDlgItemMessage( giState->hDlg, IDC_DICTLIST, ADDSTRING, 0, (long)shortname ); if ( giState->newDictName[0] != 0 && sel == 0 ) { @@ -133,7 +134,7 @@ addDictsToMenu( GameInfoState* giState ) } } - SendDlgItemMessage( giState->hDlg, IDC_DICTCOMBO, CB_SETCURSEL, sel, 0L ); + SendDlgItemMessage( giState->hDlg, IDC_DICTLIST, SETCURSEL, sel, 0L ); } /* addDictsToMenu */ static void @@ -168,7 +169,7 @@ loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState ) wchar_t widebuf[8]; /* put a string in the moronic combobox */ swprintf( widebuf, L"%d", i + 1 ); - SendDlgItemMessage( hDlg, IDC_NPLAYERSCOMBO, CB_ADDSTRING, 0, + SendDlgItemMessage( hDlg, IDC_NPLAYERSCOMBO, ADDSTRING, 0, (long)widebuf ); } @@ -195,7 +196,7 @@ loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState ) #endif if ( !giState->isNewGame ) { - ceEnOrDisable( hDlg, IDC_DICTCOMBO, XP_FALSE ); + ceEnOrDisable( hDlg, IDC_DICTLIST, XP_FALSE ); } } /* loadFromGameInfo */ @@ -210,8 +211,7 @@ stateToGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState ) /* dictionary */ { int sel; - sel = SendDlgItemMessage( hDlg, IDC_DICTCOMBO, CB_GETCURSEL, - 0, 0L ); + sel = SendDlgItemMessage( hDlg, IDC_DICTLIST, GETCURSEL, 0, 0L ); if ( sel >= 0 ) { WideCharToMultiByte( CP_ACP, 0, giState->menuDicts[sel], -1, giState->newDictName, @@ -427,12 +427,12 @@ ceSetAttrProc(void* closure, NewGameAttr attr, const NGValue value ) switch ( attr ) { case NG_ATTR_NPLAYERS: - SendDlgItemMessage( giState->hDlg, resID, CB_SETCURSEL, + SendDlgItemMessage( giState->hDlg, resID, SETCURSEL, value.ng_u16 - 1, 0L ); break; #ifndef XWFEATURE_STANDALONE_ONLY case NG_ATTR_ROLE: - SendDlgItemMessage( giState->hDlg, resID, CB_SETCURSEL, + SendDlgItemMessage( giState->hDlg, resID, SETCURSEL, value.ng_role, 0L ); break; #endif @@ -557,7 +557,7 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) value.ng_u16 = 1 + (XP_U16) SendDlgItemMessage( hDlg, IDC_NPLAYERSCOMBO, - CB_GETCURSEL, 0, 0L); + GETCURSEL, 0, 0L); newg_attrChanged( giState->newGameCtx, NG_ATTR_NPLAYERS, value ); } diff --git a/xwords4/wince/cemain.c b/xwords4/wince/cemain.c index 27d15c05e..9560ae8af 100755 --- a/xwords4/wince/cemain.c +++ b/xwords4/wince/cemain.c @@ -165,9 +165,6 @@ static XP_Bool ceSetDictName( const wchar_t* wPath, XP_U16 index, void* ctxt ); static void messageBoxStream( CEAppGlobals* globals, XWStreamCtxt* stream, wchar_t* title ); static XP_Bool ceQueryFromStream( CEAppGlobals* globals, XWStreamCtxt* stream); -#ifdef _WIN32_WCE -static void sizeIfFullscreen( CEAppGlobals* globals ); -#endif #if defined DEBUG && ! defined _WIN32_WCE @@ -282,7 +279,6 @@ WinMain( HINSTANCE hInstance, int main() { - XP_LOGF( "" ); LOG_FUNC(); return WinMain( GetModuleHandle(NULL), 0, @@ -726,9 +722,7 @@ ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, } XP_ASSERT( !!globals->game.board ); -#ifdef _WIN32_WCE - sizeIfFullscreen( globals ); -#endif + ceSizeIfFullscreen( globals, globals->hWnd ); (void)cePositionBoard( globals ); board_invalAll( globals->game.board ); @@ -808,7 +802,7 @@ ceSavePrefs( CEAppGlobals* globals ) /* write prefs, including version num */ WriteFile( fileH, &globals->appPrefs, sizeof(globals->appPrefs), &nWritten, NULL ); - XP_DEBUGF( "sizeof(appPrefs) => %ld", sizeof( globals->appPrefs ) ); + XP_DEBUGF( "sizeof(appPrefs) => %d", sizeof( globals->appPrefs ) ); WriteFile( fileH, &nameLen, sizeof(nameLen), &nWritten, NULL ); WriteFile( fileH, name, nameLen, &nWritten, NULL ); @@ -1095,33 +1089,50 @@ doDictsMovedAlert( CEAppGlobals* globals ) static void getOSInfo( CEAppGlobals* globals ) { - LOG_FUNC(); + OSVERSIONINFO ver = {0}; TCHAR buf[128]; + XW_WinceVersion winceVersion = WINCE_UNKNOWN; - globals->winceVersion = WINCE_UNKNOWN; - // Check we are running on a Pocket PC + if ( GetVersionEx( &ver )) { + XP_LOGF( "version = %ld.%ld", ver.dwMajorVersion, ver.dwMinorVersion ); + } else { + XP_WARNF( "GetVersionEx failed" ); + } if ( SystemParametersInfo( SPI_GETPLATFORMTYPE, sizeof(buf), buf, FALSE ) ) { - OSVERSIONINFO ver = {0}; - if (GetVersionEx( &ver )) { - XP_LOGF( "version = %d.%d", ver.dwMajorVersion, ver.dwMinorVersion ); - } - - if ( lstrcmp( buf, L"PocketPC") == 0 ) { + if ( 0 == lstrcmp( buf, L"PocketPC") ) { // We are on a Pocket PC, so check the OS version, // Pocket PC 2003 used WinCE 4.2 - - if ( ver.dwMajorVersion <= 4 ) { - globals->winceVersion = WINCE_PPC_2003; + if ( ver.dwMajorVersion < 4 ) { + winceVersion = WINCE_PPC_V1; + } else if ( ver.dwMajorVersion == 4 ) { + winceVersion = WINCE_PPC_2003; } else if ( ver.dwMajorVersion > 4 ) { - globals->winceVersion = WINCE_PPC_2005; + winceVersion = WINCE_PPC_2005; + } + } else if ( 0 == lstrcmp( buf, L"SmartPhone") ) { + if ( ver.dwMajorVersion < 4 ) { + winceVersion = WINCE_SMARTPHONE_V1; + } else if ( ver.dwMajorVersion == 4 ) { + winceVersion = WINCE_SMARTPHONE_2003; + } else if ( ver.dwMajorVersion > 4 ) { + winceVersion = WINCE_SMARTPHONE_2005; } } else { XP_LOGW( "unknown OS type", buf ); } + } else if ( GetLastError() == ERROR_ACCESS_DENIED ) { + if ( ver.dwMajorVersion < 4 ) { + winceVersion = WINCE_SMARTPHONE_V1; + } else { + winceVersion = WINCE_SMARTPHONE_2003; + } } - LOG_RETURN_VOID(); -} + + XP_ASSERT( winceVersion != WINCE_UNKNOWN ); + globals->winceVersion = winceVersion; + XP_LOGF( "%s: set version to %d", __func__, winceVersion ); +} /* getOSInfo */ #else #define getOSInfo( g ) #endif @@ -1183,8 +1194,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow) #endif globals = (CEAppGlobals*)XP_MALLOC( mpool, sizeof(*globals) ); - XP_DEBUGF( "" ); - XP_DEBUGF( "globals created: 0x%lx", globals ); + XP_DEBUGF( "globals created: 0x%p", globals ); XP_MEMSET( globals, 0, sizeof(*globals) ); MPASSIGN( globals->mpool, mpool ); @@ -2028,43 +2038,12 @@ ceCheckHandleFocusKey( CEAppGlobals* globals, WPARAM wParam, LPARAM lParam, #endif /* KEYBOARD_NAV */ #ifdef _WIN32_WCE -static void -sizeIfFullscreen( CEAppGlobals* globals ) -{ - RECT rect; - XP_U16 cbHeight = 0; - if ( !!globals->hwndCB ) { - GetWindowRect( globals->hwndCB, &rect ); - cbHeight = rect.bottom - rect.top; - } - - /* I'm leaving the SIP/cmdbar in place until I can figure out how to get - menu events with it hidden -- and also the UI for making sure users - don't get stuck in fullscreen mode not knowing how to reach menus to - get out. Later, add SHFS_SHOWSIPBUTTON and SHFS_HIDESIPBUTTON to the - sets shown and hidden below.*/ - if ( globals->appPrefs.fullScreen ) { - SHFullScreen( globals->hWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON ); - - SystemParametersInfo( SPI_GETWORKAREA, 0, &rect, FALSE ); - } else { - SHFullScreen( globals->hWnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON ); - - SetRect( &rect, 0, 0, GetSystemMetrics(SM_CXSCREEN), - GetSystemMetrics(SM_CYSCREEN) ); - } - - rect.bottom -= cbHeight; - MoveWindow( globals->hWnd, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE ); -} /* sizeIfFullscreen */ - static void ceToggleFullScreen( CEAppGlobals* globals ) { globals->appPrefs.fullScreen = !globals->appPrefs.fullScreen; - sizeIfFullscreen( globals ); + ceSizeIfFullscreen( globals, globals->hWnd ); (void)cePositionBoard( globals ); } /* ceToggleFullScreen */ @@ -2507,7 +2486,7 @@ makeTimeStamp( XP_UCHAR* timeStamp, XP_U16 XP_UNUSED_DBG(size) ) } /* makeTimeStamp */ void -wince_debugf(XP_UCHAR* format, ...) +wince_debugf(const XP_UCHAR* format, ...) { #ifdef XWFEATURE_RELAY static HANDLE s_logMutex = NULL; diff --git a/xwords4/wince/cemain.h b/xwords4/wince/cemain.h index df0055cc0..4cadc03b2 100755 --- a/xwords4/wince/cemain.h +++ b/xwords4/wince/cemain.h @@ -32,9 +32,13 @@ #ifdef _WIN32_WCE typedef enum { WINCE_UNKNOWN + , WINCE_PPC_V1 , WINCE_PPC_2003 , WINCE_PPC_2005 - , WINCE_SMARTPHONE + , _LAST_PPC /* so can test for PPC */ + , WINCE_SMARTPHONE_V1 + , WINCE_SMARTPHONE_2003 + , WINCE_SMARTPHONE_2005 } XW_WinceVersion; #endif @@ -196,5 +200,15 @@ void messageToBuf( UINT message, char* buf, int bufSize ); # define logLastError(c) #endif +/* These allow LISTBOX and COMBOBOX to be used by the same code */ +#ifdef _WIN32_WCE +# define SETCURSEL LB_SETCURSEL +# define GETCURSEL LB_GETCURSEL +# define ADDSTRING LB_ADDSTRING +#else +# define SETCURSEL CB_SETCURSEL +# define GETCURSEL CB_GETCURSEL +# define ADDSTRING CB_ADDSTRING +#endif #endif /* _CEMAIN_H_ */ diff --git a/xwords4/wince/ceprefs.c b/xwords4/wince/ceprefs.c index 3d807a42c..0ac6c4005 100755 --- a/xwords4/wince/ceprefs.c +++ b/xwords4/wince/ceprefs.c @@ -38,7 +38,7 @@ stuffPhoniesList( HWND hDlg ) }; for ( i = 0; i < 3; ++i ) { - SendDlgItemMessage( hDlg, PHONIES_COMBO, CB_ADDSTRING, + SendDlgItemMessage( hDlg, PHONIES_COMBO, ADDSTRING, 0, (long)strings[i] ); } } /* stuffPhoniesList */ @@ -70,7 +70,7 @@ adjustForChoice( HWND hDlg, CePrefsDlgState* state ) IDC_PREFCOLORS }; XP_U16 goesWithLocal[] = {IDC_CHECKSMARTROBOT, IDC_CHECKNOHINTS, TIMER_CHECK, TIMER_EDIT, PHONIES_LABEL, - PHONIES_COMBO, IDC_PICKTILES + PHONIES_COMBO, IDC_PHONIESUPDOWN, IDC_PICKTILES #ifdef XWFEATURE_SEARCHLIMIT ,IDC_CHECKHINTSLIMITS #endif @@ -188,7 +188,7 @@ loadControlsFromState( HWND hDlg, CePrefsDlgState* pState ) /* timer */ ceSetDlgItemNum( hDlg, TIMER_EDIT, prefsPrefs->gp.gameSeconds / 60 ); - SendDlgItemMessage( hDlg, PHONIES_COMBO, CB_SETCURSEL, + SendDlgItemMessage( hDlg, PHONIES_COMBO, SETCURSEL, prefsPrefs->gp.phoniesAction, 0L ); if ( !pState->isNewGame ) { @@ -217,7 +217,7 @@ ceControlsToPrefs( HWND hDlg, CePrefsPrefs* prefsPrefs ) = ceGetChecked( hDlg, IDC_CHECKSMARTROBOT ) ? 1 : 0; prefsPrefs->gp.hintsNotAllowed = ceGetChecked( hDlg, IDC_CHECKNOHINTS ); - selIndex = (XP_U16)SendDlgItemMessage( hDlg, PHONIES_COMBO, CB_GETCURSEL, + selIndex = (XP_U16)SendDlgItemMessage( hDlg, PHONIES_COMBO, GETCURSEL, 0, 0 ); if ( selIndex != LB_ERR ) { prefsPrefs->gp.phoniesAction = (XWPhoniesChoice)selIndex; diff --git a/xwords4/wince/ceutil.c b/xwords4/wince/ceutil.c index f0df7abd7..933bfd11f 100755 --- a/xwords4/wince/ceutil.c +++ b/xwords4/wince/ceutil.c @@ -197,7 +197,7 @@ ceCenterCtl( HWND hDlg, XP_U16 resID ) if ( !MoveWindow( itemH, newX, buttonR.top, buttonWidth, buttonR.bottom - buttonR.top, TRUE ) ) { - XP_LOGF( "MoveWindow=>%d", GetLastError() ); + XP_LOGF( "MoveWindow=>%ld", GetLastError() ); } } /* ceCenterCtl */ @@ -249,26 +249,47 @@ ceIsVisible( HWND XP_UNUSED_CE(hwnd) ) } /* ceIsVisible */ #ifdef _WIN32_WCE +void +ceSizeIfFullscreen( CEAppGlobals* globals, HWND hWnd ) +{ + RECT rect; + XP_U16 cbHeight = 0; + if ( !!globals->hwndCB && hWnd == globals->hWnd ) { + GetWindowRect( globals->hwndCB, &rect ); + cbHeight = rect.bottom - rect.top; + } + + /* I'm leaving the SIP/cmdbar in place until I can figure out how to get + menu events with it hidden -- and also the UI for making sure users + don't get stuck in fullscreen mode not knowing how to reach menus to + get out. Later, add SHFS_SHOWSIPBUTTON and SHFS_HIDESIPBUTTON to the + sets shown and hidden below.*/ + if ( globals->appPrefs.fullScreen ) { + SHFullScreen( hWnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON ); + + SystemParametersInfo( SPI_GETWORKAREA, 0, &rect, FALSE ); + } else { + SHFullScreen( hWnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON ); + + SetRect( &rect, 0, 0, GetSystemMetrics(SM_CXSCREEN), + GetSystemMetrics(SM_CYSCREEN) ); + } + + rect.bottom -= cbHeight; + MoveWindow( hWnd, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE ); +} /* ceSizeIfFullscreen */ + static XP_Bool mkFullscreenWithSoftkeys( CEAppGlobals* globals, HWND hDlg ) { -/* XP_Bool fullScreen = XP_FALSE; /\* probably want this TRUE for */ -/* small-screened smartphones only. *\/ */ -/* if ( fullScreen ) { */ -/* SHINITDLGINFO info; */ - -/* info.dwMask = SHIDIM_FLAGS; */ -/* info.dwFlags = SHIDIF_SIZEDLG */ -/* /\* | SHIDIF_DONEBUTTON *\/ */ -/* | SHIDIF_WANTSCROLLBAR; */ -/* info.hDlg = hDlg; */ - -/* BOOL b = SHInitDialog( &info ); */ -/* XP_LOGF( "SHInitDialog=>%d", (int)b ); */ -/* } */ - XP_Bool success = XP_FALSE; SHMENUBARINFO mbi; + XP_Bool fullScreen = XP_TRUE; /* probably want this TRUE for + small-screened smartphones only. */ + if ( fullScreen ) { + ceSizeIfFullscreen( globals, hDlg ); + } XP_MEMSET( &mbi, 0, sizeof(mbi) ); mbi.cbSize = sizeof(mbi); @@ -354,7 +375,8 @@ ceStackButtonsRight( CEAppGlobals* globals, HWND hDlg ) if ( justRemove ) { MoveWindow( hDlg, wrect.left, wrect.top, - wrect.right - wrect.left, wrect.bottom - wrect.top - butHeight - 2, + wrect.right - wrect.left, + wrect.bottom - wrect.top - butHeight - 2, FALSE ); } else { butWidth += HPADDING_L + HPADDING_R; diff --git a/xwords4/wince/ceutil.h b/xwords4/wince/ceutil.h index 979ba1a0a..f43131f34 100755 --- a/xwords4/wince/ceutil.h +++ b/xwords4/wince/ceutil.h @@ -52,4 +52,10 @@ XP_Bool ceIsLandscape( CEAppGlobals* globals ); void ceSetLeftSoftkey( CEAppGlobals* globals, XP_U16 id ); +#ifdef _WIN32_WCE +void ceSizeIfFullscreen( CEAppGlobals* globals, HWND hWnd ); +#else +# define ceSizeIfFullscreen( globals, hWnd ) +#endif + #endif diff --git a/xwords4/wince/resource.h b/xwords4/wince/resource.h index 2476bb67e..e237a4984 100755 --- a/xwords4/wince/resource.h +++ b/xwords4/wince/resource.h @@ -53,8 +53,8 @@ #define TIMER_CHECK 1024 #define NAME_EDIT5 1025 #define TIMER_EDIT 1026 -#define IDC_DICTCOMBO 1027 -#define IDC_COMBO3 1028 +#define IDC_DICTLIST 1027 +#define IDC_DICTUPDOWN 1028 #define BLANKFACE_COMBO 1029 #define PHONIES_COMBO 1030 #define IDC_PWDLABEL 1031 @@ -154,7 +154,9 @@ # define IDC_BLUET_ADDR_EDIT 1101 # define IDC_BLUET_ADDR_BROWSE 1102 #endif - +#define IDS_UPDOWN 1103 +#define IDC_NPLAYERSUPDOWN 1104 +#define IDC_PHONIESUPDOWN 1105 #define ID_FILE_EXIT 40002 diff --git a/xwords4/wince/xwords4.rc b/xwords4/wince/xwords4.rc index e4f00270d..0e5c8a792 100755 --- a/xwords4/wince/xwords4.rc +++ b/xwords4/wince/xwords4.rc @@ -197,11 +197,12 @@ END # define ROW_SPACE 15 # define ROW_SPACE_PL ROW_SPACE #endif +#define GAME_NAME_WIDTH 60 #define LEFT_COL 2 #ifdef XWFEATURE_STANDALONE_ONLY # define GAME_NAME_LEFT LEFT_COL -# define GAME_ROBOT_LEFT 81 -# define GAME_PWD_LEFT 105 +# define GAME_ROBOT_LEFT 66 +# define GAME_PWD_LEFT 80 # define NPLAYERS_ROW 3 # define GAME_NAMELABEL_LEFT GAME_NAME_LEFT # define GAME_ROBOTLABEL_LEFT GAME_ROBOT_LEFT @@ -215,7 +216,7 @@ END # define GAME_PWD_LEFT 110 # define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT + 20) # define GAME_ROBOTLABEL_LEFT 87 -# define GAME_PWDLABEL_LEFT 112 +# define GAME_PWDLABEL_LEFT 105 #endif @@ -225,14 +226,23 @@ END #define PLAYER_ROW_3 (PLAYER_ROW_2+ROW_SPACE_PL) #define PLAYER_ROW_4 (PLAYER_ROW_3+ROW_SPACE_PL) #define DICTPICK_ROW (PLAYER_ROW_4+ROW_SPACE+2) -#define BUTTONS_ROW (DICTPICK_ROW+ROW_SPACE+3) +#define PREFS_ROW (DICTPICK_ROW+ROW_SPACE+2) +#define BUTTONS_ROW (PREFS_ROW+ROW_SPACE+3) #define BUTTON_HT 12 #define GAMEINFO_HEIGHT (BUTTONS_ROW + BUTTON_HT + 4) #define CHECK_WIDTH 10 -IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, 133, GAMEINFO_HEIGHT +/* Not in cegcc's mingw headers yet */ +#define UDS_EXPANDABLE 0x0200 +#define UDS_NOSCROLL 0x0400 +/* in commctrl.h, but including isn't enough */ +#undef UPDOWN_CLASS +#define UPDOWN_CLASS "msctls_updown32" + +IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, 116, GAMEINFO_HEIGHT STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +/* | WS_VSCROLL */ CAPTION "Game info" FONT 8, "System" BEGIN @@ -242,17 +252,27 @@ BEGIN WS_VSCROLL | WS_TABSTOP #endif + LTEXT "",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,43,8 - COMBOBOX IDC_NPLAYERSCOMBO,46,NPLAYERS_ROW,17,58,CBS_DROPDOWNLIST | +#ifdef _WIN32_WCE + LISTBOX IDC_NPLAYERSCOMBO, 46, NPLAYERS_ROW, 24, 12, WS_TABSTOP + CONTROL "", IDC_NPLAYERSUPDOWN, UPDOWN_CLASS, + UDS_AUTOBUDDY | UDS_HORZ | UDS_ALIGNRIGHT | UDS_WRAP | /* UDS_ARROWKEYS | */ + UDS_SETBUDDYINT | UDS_EXPANDABLE | UDS_NOSCROLL, + 0, 0, 0, 0 +#else + COMBOBOX IDC_NPLAYERSCOMBO,46,NPLAYERS_ROW,24,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +#endif + + // "R" for rearrange. Go to J if no change becomes possible. - PUSHBUTTON "R",GIJUGGLE_BUTTON,65,NPLAYERS_ROW,12,12 + PUSHBUTTON "Juggle",GIJUGGLE_BUTTON,75,NPLAYERS_ROW,28,12 - PUSHBUTTON "Preferences...",OPTIONS_BUTTON,79,NPLAYERS_ROW,51,12 LTEXT "Name",IDC_STATIC,GAME_NAMELABEL_LEFT, LABELS_ROW,19,8,SS_NOPREFIX - LTEXT "Robot",IDC_STATIC,GAME_ROBOTLABEL_LEFT,LABELS_ROW,20,8 + LTEXT "Robot",IDC_STATIC,GAME_ROBOTLABEL_LEFT-7,LABELS_ROW,20,8 LTEXT "Pwd",IDC_STATIC,GAME_PWDLABEL_LEFT,LABELS_ROW,16,8 #if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH LTEXT "Remote",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX @@ -274,28 +294,38 @@ BEGIN CONTROL "",ROBOT_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, GAME_ROBOT_LEFT, PLAYER_ROW_4,CHECK_WIDTH,ROW_HEIGHT - EDITTEXT NAME_EDIT1,GAME_NAME_LEFT,PLAYER_ROW_1,70,ROW_HEIGHT, + EDITTEXT NAME_EDIT1,GAME_NAME_LEFT,PLAYER_ROW_1,GAME_NAME_WIDTH,ROW_HEIGHT, ES_AUTOHSCROLL - EDITTEXT NAME_EDIT2,GAME_NAME_LEFT,PLAYER_ROW_2,70,ROW_HEIGHT, + EDITTEXT NAME_EDIT2,GAME_NAME_LEFT,PLAYER_ROW_2,GAME_NAME_WIDTH,ROW_HEIGHT, ES_AUTOHSCROLL - EDITTEXT NAME_EDIT3,GAME_NAME_LEFT,PLAYER_ROW_3,70,ROW_HEIGHT, + EDITTEXT NAME_EDIT3,GAME_NAME_LEFT,PLAYER_ROW_3,GAME_NAME_WIDTH,ROW_HEIGHT, ES_AUTOHSCROLL - EDITTEXT NAME_EDIT4,GAME_NAME_LEFT,PLAYER_ROW_4,70,ROW_HEIGHT, + EDITTEXT NAME_EDIT4,GAME_NAME_LEFT,PLAYER_ROW_4,GAME_NAME_WIDTH,ROW_HEIGHT, ES_AUTOHSCROLL | NOT WS_VISIBLE - EDITTEXT PASS_EDIT1,GAME_PWD_LEFT,PLAYER_ROW_1,20,ROW_HEIGHT, + EDITTEXT PASS_EDIT1,GAME_PWD_LEFT,PLAYER_ROW_1,15,ROW_HEIGHT, ES_PASSWORD | ES_AUTOHSCROLL - EDITTEXT PASS_EDIT2,GAME_PWD_LEFT,PLAYER_ROW_2,20,ROW_HEIGHT, + EDITTEXT PASS_EDIT2,GAME_PWD_LEFT,PLAYER_ROW_2,15,ROW_HEIGHT, ES_PASSWORD | ES_AUTOHSCROLL - EDITTEXT PASS_EDIT3,GAME_PWD_LEFT,PLAYER_ROW_3,20,ROW_HEIGHT, + EDITTEXT PASS_EDIT3,GAME_PWD_LEFT,PLAYER_ROW_3,15,ROW_HEIGHT, ES_PASSWORD | ES_AUTOHSCROLL - EDITTEXT PASS_EDIT4,GAME_PWD_LEFT,PLAYER_ROW_4,20,ROW_HEIGHT, + EDITTEXT PASS_EDIT4,GAME_PWD_LEFT,PLAYER_ROW_4,15,ROW_HEIGHT, ES_PASSWORD | ES_AUTOHSCROLL LTEXT "Dictionary:",IDC_STATIC,LEFT_COL,DICTPICK_ROW,36,8, SS_NOPREFIX - COMBOBOX IDC_DICTCOMBO,43,DICTPICK_ROW,85,58, +#ifdef _WIN32_WCE + LISTBOX IDC_DICTLIST, 38,DICTPICK_ROW,70,12, WS_TABSTOP + CONTROL "", IDC_DICTUPDOWN, UPDOWN_CLASS, + UDS_AUTOBUDDY | UDS_HORZ | UDS_ALIGNRIGHT | UDS_WRAP | /* UDS_ARROWKEYS | */ + UDS_SETBUDDYINT | UDS_EXPANDABLE | UDS_NOSCROLL, + 0, 0, 0, 0 +#else + COMBOBOX IDC_DICTLIST,38,DICTPICK_ROW,70,58, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +#endif + + PUSHBUTTON "Preferences...",OPTIONS_BUTTON,LEFT_COL,PREFS_ROW,55,12 PUSHBUTTON "OK",IDOK,29,BUTTONS_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT DEFPUSHBUTTON "Cancel",IDCANCEL,70,BUTTONS_ROW, @@ -387,7 +417,8 @@ END #define PREFS_ROW_HT 9 IDD_OPTIONSDLG DIALOG DISCARDABLE 0, 20, PR_WIDTH, 112 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER +| WS_VSCROLL CAPTION "Preferences" FONT 8, "System" BEGIN @@ -412,11 +443,19 @@ BEGIN #endif CONTROL "Timer on (minutes)",TIMER_CHECK,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,8,50,85,PREFS_ROW_HT - EDITTEXT TIMER_EDIT,93,52,24,12,ES_AUTOHSCROLL | ES_NUMBER + BS_AUTOCHECKBOX | WS_TABSTOP,8,50,70,PREFS_ROW_HT + EDITTEXT TIMER_EDIT,85,49,20,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Phonies:",PHONIES_LABEL,8,65,28,PREFS_ROW_HT +#ifdef _WIN32_WCE + LISTBOX PHONIES_COMBO, 38,65,50,12, WS_TABSTOP + CONTROL "", IDC_PHONIESUPDOWN, UPDOWN_CLASS, + UDS_AUTOBUDDY | UDS_HORZ | UDS_ALIGNRIGHT | UDS_WRAP | /* UDS_ARROWKEYS | */ + UDS_SETBUDDYINT | UDS_EXPANDABLE | UDS_NOSCROLL, + 0, 0, 0, 0 +#else COMBOBOX PHONIES_COMBO,38,65,67,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +#endif #ifdef FEATURE_TRAY_EDIT CONTROL "Pick tiles face-up", IDC_PICKTILES, "Button", BS_AUTOCHECKBOX | WS_TABSTOP,8,80,90,PREFS_ROW_HT @@ -489,85 +528,92 @@ END #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 40 +#define CLR_LAB_WIDTH 50 #define CLR_LAB_HT 12 #define CLR_BUT_WIDTH 12 #define CLR_BUT_HT 10 #define CLR_SMALL_GAP 12 -#define CLR_LRG_GAP 14 +#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_LRG_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 81 -#define CLR_COL_1 2 -#define CLR_COL_2 43 -#define CLR_COL_3 58 -#define CLR_COL_4 99 +#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 IDD_COLORSDLG DIALOG DISCARDABLE 0, 20, CLR_WIDTH, 96 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER CAPTION "Color preferences" FONT 8, "System" BEGIN - LTEXT "Dbl letter:",DLBLTR_LABEL,CLR_COL_1,CLR_ROW_1, + LTEXT "Double letter:",DLBLTR_LABEL,CLR_COL_1,CLR_ROW_1, CLR_LAB_WIDTH,CLR_LAB_HT PUSHBUTTON "",DLBLTR_BUTTON,CLR_COL_2,CLR_ROW_1,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Dbl word:",DBLWRD_LABEL,CLR_COL_3,CLR_ROW_1, + LTEXT "Double word:",DBLWRD_LABEL,CLR_COL_1,CLR_ROW_2, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",DBLWRD_BUTTON,CLR_COL_4,CLR_ROW_1,CLR_BUT_WIDTH, + PUSHBUTTON "",DBLWRD_BUTTON,CLR_COL_2,CLR_ROW_2,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Triple letter:",TPLLTR_LABEL,CLR_COL_1,CLR_ROW_2, + LTEXT "Triple letter:",TPLLTR_LABEL,CLR_COL_1,CLR_ROW_3, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",TPLLTR_BUTTON,CLR_COL_2,CLR_ROW_2,CLR_BUT_WIDTH, + PUSHBUTTON "",TPLLTR_BUTTON,CLR_COL_2,CLR_ROW_3,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Triple word:",TPLWRD_LABEL,CLR_COL_3,CLR_ROW_2, + LTEXT "Triple word:",TPLWRD_LABEL,CLR_COL_3,CLR_ROW_4, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",TPLWRD_BUTTON,CLR_COL_4,CLR_ROW_2,CLR_BUT_WIDTH, + PUSHBUTTON "",TPLWRD_BUTTON,CLR_COL_4,CLR_ROW_4,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Empty cell:",EMPCELL_LABEL,CLR_COL_1,CLR_ROW_3, + LTEXT "Empty cell:",EMPCELL_LABEL,CLR_COL_1,CLR_ROW_5, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",EMPCELL_BUTTON,CLR_COL_2,CLR_ROW_3,CLR_BUT_WIDTH, + PUSHBUTTON "",EMPCELL_BUTTON,CLR_COL_2,CLR_ROW_5,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Tile bkgnd:",TBACK_LABEL,CLR_COL_3,CLR_ROW_3, + LTEXT "Tile back:",TBACK_LABEL,CLR_COL_3,CLR_ROW_6, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",TBACK_BUTTON,CLR_COL_4,CLR_ROW_3,CLR_BUT_WIDTH, + PUSHBUTTON "",TBACK_BUTTON,CLR_COL_4,CLR_ROW_6,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Focus color:",FOCUSCLR_LABEL,CLR_COL_1,CLR_ROW_4, + LTEXT "Focus color:",FOCUSCLR_LABEL,CLR_COL_1,CLR_ROW_7, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",FOCUSCLR_BUTTON,CLR_COL_2,CLR_ROW_4,CLR_BUT_WIDTH, + PUSHBUTTON "",FOCUSCLR_BUTTON,CLR_COL_2,CLR_ROW_7,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Player 1:",PLAYER1_LABEL,CLR_COL_1,CLR_ROW_5, + LTEXT "Player 1:",PLAYER1_LABEL,CLR_COL_1,CLR_ROW_8, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",PLAYER1_BUTTON,CLR_COL_2,CLR_ROW_5,CLR_BUT_WIDTH, + PUSHBUTTON "",PLAYER1_BUTTON,CLR_COL_2,CLR_ROW_8,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Player 2:",PLAYER2_LABEL,CLR_COL_3,CLR_ROW_5, + LTEXT "Player 2:",PLAYER2_LABEL,CLR_COL_3,CLR_ROW_9, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",PLAYER2_BUTTON,CLR_COL_4,CLR_ROW_5,CLR_BUT_WIDTH, + PUSHBUTTON "",PLAYER2_BUTTON,CLR_COL_4,CLR_ROW_9,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Player 3:",PLAYER3_LABEL,CLR_COL_1,CLR_ROW_6, + LTEXT "Player 3:",PLAYER3_LABEL,CLR_COL_1,CLR_ROW_10, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",PLAYER3_BUTTON,CLR_COL_2,CLR_ROW_6,CLR_BUT_WIDTH, + PUSHBUTTON "",PLAYER3_BUTTON,CLR_COL_2,CLR_ROW_10,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW - LTEXT "Player 4:",PLAYER4_LABEL,CLR_COL_3,CLR_ROW_6, + LTEXT "Player 4:",PLAYER4_LABEL,CLR_COL_3,CLR_ROW_11, CLR_LAB_WIDTH,CLR_LAB_HT - PUSHBUTTON "",PLAYER4_BUTTON,CLR_COL_4,CLR_ROW_6,CLR_BUT_WIDTH, + PUSHBUTTON "",PLAYER4_BUTTON,CLR_COL_4,CLR_ROW_11,CLR_BUT_WIDTH, CLR_BUT_HT,BS_OWNERDRAW DEFPUSHBUTTON "OK",IDOK,CLR_OK_LEFT,CLR_BUTTON_ROW,