mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
Go back to using combobox on PPC but keep spinners on Smartphone.
Meaning: both exist in the resource, and at runtime we disable the unwanted one and lookup IDs and sometimes window messages in order to operate on 'em. Also, spinners send WM_NOTIFY messages, so handle that. Current implementation is a bit of a hack but works.
This commit is contained in:
parent
6719c60ce1
commit
84758c8be2
14 changed files with 359 additions and 270 deletions
|
@ -23,10 +23,12 @@
|
|||
#include "debhacks.h"
|
||||
|
||||
static void
|
||||
loadLettersList( HWND hDlg, BlankDialogState* bState )
|
||||
loadLettersList( BlankDialogState* bState )
|
||||
{
|
||||
XP_U16 i;
|
||||
XP_U16 nTiles = bState->nTiles;
|
||||
HWND hDlg = bState->dlgHdr.hDlg;
|
||||
CEAppGlobals* globals = bState->dlgHdr.globals;
|
||||
const XP_UCHAR4* texts = bState->texts;
|
||||
|
||||
for ( i = 0; i < nTiles; ++i ) {
|
||||
|
@ -38,10 +40,15 @@ loadLettersList( HWND hDlg, BlankDialogState* bState )
|
|||
widebuf, VSIZE(widebuf) );
|
||||
widebuf[len] = 0;
|
||||
|
||||
SendDlgItemMessage( hDlg, BLANKFACE_LIST, ADDSTRING,
|
||||
0, (long)widebuf );
|
||||
SendDlgItemMessage( hDlg, LB_IF_PPC(globals,BLANKFACE_LIST),
|
||||
ADDSTRING(globals), 0, (long)widebuf );
|
||||
}
|
||||
ce_selectAndShow( hDlg, BLANKFACE_LIST, 0 );
|
||||
|
||||
SendDlgItemMessage( hDlg, LB_IF_PPC(globals,BLANKFACE_LIST),
|
||||
SETCURSEL(globals), 0, 0 );
|
||||
#ifdef _WIN32_WCE
|
||||
SendDlgItemMessage( hDlg, BLANKFACE_LIST_PPC, LB_SETANCHORINDEX, 0, 0 );
|
||||
#endif
|
||||
} /* loadLettersList */
|
||||
|
||||
#ifdef FEATURE_TRAY_EDIT
|
||||
|
@ -104,8 +111,9 @@ BlankDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
#endif
|
||||
|
||||
ceDlgSetup( &bState->dlgHdr, hDlg, DLG_STATE_TRAPBACK );
|
||||
ceDlgComboShowHide( &bState->dlgHdr, BLANKFACE_LIST );
|
||||
|
||||
loadLettersList( hDlg, bState );
|
||||
loadLettersList( bState );
|
||||
} else {
|
||||
bState = (BlankDialogState*)GetWindowLong( hDlg, GWL_USERDATA );
|
||||
if ( !!bState ) {
|
||||
|
@ -125,9 +133,11 @@ BlankDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
bState->result = PICKER_BACKUP;
|
||||
#endif
|
||||
} else if ( id == IDOK ) {
|
||||
bState->result =
|
||||
(XP_S16)SendDlgItemMessage( hDlg, BLANKFACE_LIST,
|
||||
GETCURSEL, 0, 0 );
|
||||
CEAppGlobals* globals = bState->dlgHdr.globals;
|
||||
bState->result = (XP_S16)
|
||||
SendDlgItemMessage( hDlg,
|
||||
LB_IF_PPC(globals,BLANKFACE_LIST),
|
||||
GETCURSEL(globals), 0, 0 );
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -73,6 +73,10 @@ messageToStr( UINT message )
|
|||
CASE_STR( WM_NCDESTROY );
|
||||
CASE_STR( WM_NOTIFY );
|
||||
CASE_STR( WM_NCHITTEST );
|
||||
CASE_STR( WM_HSCROLL );
|
||||
CASE_STR( WM_STYLECHANGED );
|
||||
CASE_STR( WM_NOTIFYFORMAT );
|
||||
CASE_STR( WM_KILLFOCUS );
|
||||
default:
|
||||
str = "<unknown>";
|
||||
}
|
||||
|
|
222
wince/ceginfo.c
222
wince/ceginfo.c
|
@ -26,7 +26,7 @@
|
|||
#include "cecondlg.h"
|
||||
#include "strutils.h"
|
||||
#include "cedebug.h"
|
||||
#include "debhacks.h"
|
||||
#include "strutils.h"
|
||||
|
||||
#define NUM_COLS 4
|
||||
#define MENUDICTS_INCR 16
|
||||
|
@ -117,13 +117,14 @@ addDictsToMenu( GameInfoState* giState )
|
|||
wchar_t shortPath[CE_MAX_PATH_LEN+1];
|
||||
XP_U16 i, nMenuDicts = giState->nMenuDicts;
|
||||
XP_S16 sel = 0;
|
||||
CEAppGlobals* globals = giState->dlgHdr.globals;
|
||||
|
||||
/* insert the short names in the menu */
|
||||
for ( i = 0; i < nMenuDicts; ++i ) {
|
||||
wchar_t* wPath = giState->menuDicts[i];
|
||||
shortname = wbname( shortPath, sizeof(shortPath), wPath );
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, IDC_DICTLIST, ADDSTRING, 0,
|
||||
(long)shortname );
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, giState->dictListId,
|
||||
ADDSTRING(globals), 0, (long)shortname );
|
||||
|
||||
if ( giState->newDictName[0] != 0 && sel == 0 ) {
|
||||
XP_UCHAR buf[CE_MAX_PATH_LEN+1];
|
||||
|
@ -135,7 +136,8 @@ addDictsToMenu( GameInfoState* giState )
|
|||
}
|
||||
}
|
||||
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, IDC_DICTLIST, SETCURSEL, sel, 0L );
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, giState->dictListId,
|
||||
SETCURSEL(globals), sel, 0L );
|
||||
} /* addDictsToMenu */
|
||||
|
||||
static void
|
||||
|
@ -156,7 +158,8 @@ static void
|
|||
loadFromGameInfo( GameInfoState* giState )
|
||||
{
|
||||
XP_U16 i;
|
||||
CurGameInfo* gi = &giState->dlgHdr.globals->gameInfo;
|
||||
CEAppGlobals* globals = giState->dlgHdr.globals;
|
||||
CurGameInfo* gi = &globals->gameInfo;
|
||||
|
||||
#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH
|
||||
wchar_t* roles[] = { L"Standalone", L"Host", L"Guest" };
|
||||
|
@ -170,7 +173,8 @@ loadFromGameInfo( GameInfoState* giState )
|
|||
wchar_t widebuf[8];
|
||||
/* put a string in the moronic combobox */
|
||||
swprintf( widebuf, L"%d", i + 1 );
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, IDC_NPLAYERSCOMBO, ADDSTRING, 0,
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, giState->comboId,
|
||||
ADDSTRING(globals), 0,
|
||||
(long)widebuf );
|
||||
}
|
||||
|
||||
|
@ -195,7 +199,7 @@ loadFromGameInfo( GameInfoState* giState )
|
|||
#endif
|
||||
|
||||
if ( !giState->isNewGame ) {
|
||||
ceEnOrDisable( giState->dlgHdr.hDlg, IDC_DICTLIST, XP_FALSE );
|
||||
ceEnOrDisable( giState->dlgHdr.hDlg, giState->dictListId, XP_FALSE );
|
||||
}
|
||||
} /* loadFromGameInfo */
|
||||
|
||||
|
@ -212,7 +216,8 @@ stateToGameInfo( GameInfoState* giState )
|
|||
|
||||
/* dictionary */ {
|
||||
int sel;
|
||||
sel = SendDlgItemMessage( hDlg, IDC_DICTLIST, GETCURSEL, 0, 0L );
|
||||
sel = SendDlgItemMessage( hDlg, giState->dictListId,
|
||||
GETCURSEL(globals), 0, 0L );
|
||||
if ( sel >= 0 ) {
|
||||
WideCharToMultiByte( CP_ACP, 0, giState->menuDicts[sel], -1,
|
||||
giState->newDictName,
|
||||
|
@ -242,7 +247,6 @@ stateToGameInfo( GameInfoState* giState )
|
|||
}
|
||||
}
|
||||
|
||||
LOG_RETURNF( "%d", (int)success );
|
||||
return success;
|
||||
} /* stateToGameInfo */
|
||||
|
||||
|
@ -304,12 +308,12 @@ resIDForCol( XP_U16 player, NewGameColumn col )
|
|||
} /* resIDForCol */
|
||||
|
||||
static XP_U16
|
||||
resIDForAttr( NewGameAttr attr )
|
||||
resIDForAttr( GameInfoState* state, NewGameAttr attr )
|
||||
{
|
||||
XP_U16 resID = 0;
|
||||
switch( attr ) {
|
||||
case NG_ATTR_NPLAYERS:
|
||||
resID = IDC_NPLAYERSCOMBO;
|
||||
resID = state->comboId;
|
||||
break;
|
||||
#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH
|
||||
case NG_ATTR_ROLE:
|
||||
|
@ -355,7 +359,7 @@ static void
|
|||
ceEnableAttrProc( void* closure, NewGameAttr attr, XP_TriEnable enable )
|
||||
{
|
||||
GameInfoState* giState = (GameInfoState*)closure;
|
||||
XP_U16 resID = resIDForAttr( attr );
|
||||
XP_U16 resID = resIDForAttr( giState, attr );
|
||||
doForNWEnable( giState->dlgHdr.hDlg, resID, enable );
|
||||
} /* ceEnableAttrProc */
|
||||
|
||||
|
@ -416,22 +420,24 @@ ceSetColProc( void* closure, XP_U16 player, NewGameColumn col,
|
|||
default:
|
||||
XP_ASSERT(0);
|
||||
}
|
||||
}
|
||||
} /* ceSetColProc */
|
||||
|
||||
static void
|
||||
ceSetAttrProc(void* closure, NewGameAttr attr, const NGValue value )
|
||||
{
|
||||
GameInfoState* giState = (GameInfoState*)closure;
|
||||
XP_U16 resID = resIDForAttr( attr );
|
||||
XP_U16 resID = resIDForAttr( giState, attr );
|
||||
CEAppGlobals* globals = giState->dlgHdr.globals;
|
||||
|
||||
switch ( attr ) {
|
||||
case NG_ATTR_NPLAYERS:
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, resID, SETCURSEL,
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, resID,
|
||||
SETCURSEL(globals),
|
||||
value.ng_u16 - 1, 0L );
|
||||
break;
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
case NG_ATTR_ROLE:
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, resID, SETCURSEL,
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, resID, SETCURSEL(globals),
|
||||
value.ng_role, 0L );
|
||||
break;
|
||||
#endif
|
||||
|
@ -448,7 +454,6 @@ playerFromID( XP_U16 id, XP_U16 base )
|
|||
{
|
||||
XP_U16 player;
|
||||
player = (id - base) / NUM_COLS;
|
||||
/* XP_LOGF( "%s: looks like row %d", __func__, player ); */
|
||||
return player;
|
||||
}
|
||||
|
||||
|
@ -481,6 +486,20 @@ ceDrawIconButton( CEAppGlobals* globals, DRAWITEMSTRUCT* dis )
|
|||
} /* ceDrawColorButton */
|
||||
#endif
|
||||
|
||||
static void
|
||||
checkUpdateCombo( GameInfoState* giState, XP_U16 id )
|
||||
{
|
||||
if ( giState->isNewGame ) { /* ignore if in info mode */
|
||||
NGValue value;
|
||||
value.ng_u16 = 1 + (XP_U16)
|
||||
SendDlgItemMessage( giState->dlgHdr.hDlg, id,
|
||||
GETCURSEL(giState->dlgHdr.globals), 0, 0L);
|
||||
XP_ASSERT( !!giState->newGameCtx );
|
||||
newg_attrChanged( giState->newGameCtx,
|
||||
NG_ATTR_NPLAYERS, value );
|
||||
}
|
||||
} /* checkUpdateCombo */
|
||||
|
||||
LRESULT CALLBACK
|
||||
GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -496,7 +515,12 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
giState = (GameInfoState*)lParam;
|
||||
globals = giState->dlgHdr.globals;
|
||||
|
||||
giState->comboId = LB_IF_PPC(globals,IDC_NPLAYERSCOMBO);
|
||||
giState->dictListId = LB_IF_PPC(globals,IDC_DICTLIST);
|
||||
|
||||
ceDlgSetup( &giState->dlgHdr, hDlg, DLG_STATE_TRAPBACK );
|
||||
ceDlgComboShowHide( &giState->dlgHdr, IDC_NPLAYERSCOMBO );
|
||||
ceDlgComboShowHide( &giState->dlgHdr, IDC_DICTLIST );
|
||||
|
||||
giState->newGameCtx = newg_make( MPPARM(globals->mpool)
|
||||
giState->isNewGame,
|
||||
|
@ -535,104 +559,98 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
#endif
|
||||
|
||||
case WM_NOTIFY:
|
||||
if ( !!giState->newGameCtx ) {
|
||||
checkUpdateCombo( giState, LOWORD(wParam)-1 );
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
result = TRUE;
|
||||
id = LOWORD(wParam);
|
||||
switch( id ) {
|
||||
|
||||
case ROBOT_CHECK1:
|
||||
case ROBOT_CHECK2:
|
||||
case ROBOT_CHECK3:
|
||||
case ROBOT_CHECK4:
|
||||
handleColChecked( giState, id, ROBOT_CHECK1 );
|
||||
break;
|
||||
if ( id == giState->comboId ) {
|
||||
if ( HIWORD(wParam) == CBN_SELCHANGE ) {
|
||||
checkUpdateCombo( giState, id );
|
||||
}
|
||||
} else {
|
||||
switch( id ) {
|
||||
case ROBOT_CHECK1:
|
||||
case ROBOT_CHECK2:
|
||||
case ROBOT_CHECK3:
|
||||
case ROBOT_CHECK4:
|
||||
handleColChecked( giState, id, ROBOT_CHECK1 );
|
||||
break;
|
||||
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
case REMOTE_CHECK1:
|
||||
case REMOTE_CHECK2:
|
||||
case REMOTE_CHECK3:
|
||||
case REMOTE_CHECK4:
|
||||
handleColChecked( giState, id, REMOTE_CHECK1 );
|
||||
break;
|
||||
case REMOTE_CHECK1:
|
||||
case REMOTE_CHECK2:
|
||||
case REMOTE_CHECK3:
|
||||
case REMOTE_CHECK4:
|
||||
handleColChecked( giState, id, REMOTE_CHECK1 );
|
||||
break;
|
||||
#endif
|
||||
|
||||
case IDC_NPLAYERSCOMBO:
|
||||
if ( HIWORD(wParam) == CBN_SELCHANGE ) {
|
||||
if ( giState->isNewGame ) { /* ignore if in info
|
||||
mode */
|
||||
NGValue value;
|
||||
value.ng_u16 = 1 + (XP_U16)
|
||||
SendDlgItemMessage( hDlg,
|
||||
IDC_NPLAYERSCOMBO,
|
||||
GETCURSEL, 0, 0L);
|
||||
newg_attrChanged( giState->newGameCtx,
|
||||
NG_ATTR_NPLAYERS, value );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined XWFEATURE_RELAY || defined XWFEATURE_BLUETOOTH
|
||||
case IDC_ROLECOMBO:
|
||||
if ( HIWORD(wParam) == CBN_SELCHANGE ) {
|
||||
if ( giState->isNewGame ) { /* ignore if in info
|
||||
mode */
|
||||
NGValue value;
|
||||
value.ng_role =
|
||||
(DeviceRole)SendDlgItemMessage( hDlg,
|
||||
IDC_ROLECOMBO,
|
||||
CB_GETCURSEL, 0,
|
||||
0L);
|
||||
newg_attrChanged( giState->newGameCtx,
|
||||
NG_ATTR_ROLE, value );
|
||||
/* If we've switched to a state where we'll be
|
||||
connecting */
|
||||
if ( value.ng_role != SERVER_STANDALONE ) {
|
||||
handleConnOptionsButton( hDlg, globals,
|
||||
value.ng_role,
|
||||
giState );
|
||||
case IDC_ROLECOMBO:
|
||||
if ( HIWORD(wParam) == CBN_SELCHANGE ) {
|
||||
if ( giState->isNewGame ) { /* ignore if in info
|
||||
mode */
|
||||
NGValue value;
|
||||
value.ng_role =
|
||||
(DeviceRole)SendDlgItemMessage( hDlg,
|
||||
IDC_ROLECOMBO,
|
||||
CB_GETCURSEL, 0,
|
||||
0L);
|
||||
newg_attrChanged( giState->newGameCtx,
|
||||
NG_ATTR_ROLE, value );
|
||||
/* If we've switched to a state where we'll be
|
||||
connecting */
|
||||
if ( value.ng_role != SERVER_STANDALONE ) {
|
||||
handleConnOptionsButton( hDlg, globals,
|
||||
value.ng_role,
|
||||
giState );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case GIJUGGLE_BUTTON:
|
||||
XP_ASSERT( giState->isNewGame );
|
||||
/* Juggle vs switch. On Win32, updates are coalesced so
|
||||
you don't see anything on screen if you change a field
|
||||
then change it back. In terms of messages, all we see
|
||||
here is a WM_CTLCOLOREDIT for each field being
|
||||
changed. If I post a custom event here, it comes in
|
||||
*before* the WM_CTLCOLOREDIT events. Short of a
|
||||
timer, which starts a race with the user, I see no way
|
||||
to get notified after the drawing's done. So for now,
|
||||
we switch rather than juggle: call juggle until
|
||||
something actually happens. */
|
||||
while ( !newg_juggle( giState->newGameCtx ) ) {
|
||||
}
|
||||
break;
|
||||
|
||||
case OPTIONS_BUTTON:
|
||||
handlePrefsButton( hDlg, globals, giState );
|
||||
break;
|
||||
|
||||
case IDOK:
|
||||
if ( !stateToGameInfo( giState ) ) {
|
||||
break;
|
||||
#endif
|
||||
case GIJUGGLE_BUTTON:
|
||||
XP_ASSERT( giState->isNewGame );
|
||||
/* Juggle vs switch. On Win32, updates are
|
||||
coalesced so you don't see anything on screen
|
||||
if you change a field then change it back. In
|
||||
terms of messages, all we see here is a
|
||||
WM_CTLCOLOREDIT for each field being changed.
|
||||
If I post a custom event here, it comes in
|
||||
*before* the WM_CTLCOLOREDIT events. Short of
|
||||
a timer, which starts a race with the user, I
|
||||
see no way to get notified after the drawing's
|
||||
done. So for now, we switch rather than
|
||||
juggle: call juggle until something actually
|
||||
happens. */
|
||||
while ( !newg_juggle( giState->newGameCtx ) ) {
|
||||
}
|
||||
break;
|
||||
|
||||
case OPTIONS_BUTTON:
|
||||
handlePrefsButton( hDlg, globals, giState );
|
||||
break;
|
||||
|
||||
case IDOK:
|
||||
if ( !stateToGameInfo( giState ) ) {
|
||||
break;
|
||||
}
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, id);
|
||||
giState->userCancelled = id == IDCANCEL;
|
||||
cleanupGameInfoState( giState );
|
||||
newg_destroy( giState->newGameCtx );
|
||||
giState->newGameCtx = NULL;
|
||||
}
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, id);
|
||||
giState->userCancelled = id == IDCANCEL;
|
||||
cleanupGameInfoState( giState );
|
||||
newg_destroy( giState->newGameCtx );
|
||||
break;
|
||||
default:
|
||||
result = FALSE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
result = FALSE;
|
||||
/* case WM_CLOSE: */
|
||||
/* EndDialog(hDlg, id); */
|
||||
/* return TRUE; */
|
||||
/* default: */
|
||||
/* return DefWindowProc(hDlg, message, wParam, lParam); */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ typedef struct GameInfoState {
|
|||
XP_U16 capMenuDicts;
|
||||
XP_U16 nMenuDicts;
|
||||
wchar_t** menuDicts;
|
||||
XP_U16 comboId;
|
||||
XP_U16 dictListId;
|
||||
|
||||
XP_Bool isNewGame; /* newGame or GameInfo */
|
||||
XP_Bool userCancelled; /* OUT param */
|
||||
|
|
|
@ -23,27 +23,29 @@
|
|||
#include "cehntlim.h"
|
||||
|
||||
static void
|
||||
initComboBox( HWND hDlg, XP_U16 id, XP_U16 startVal )
|
||||
initComboBox( HintLimitsState* state, XP_U16 id, XP_U16 startVal )
|
||||
{
|
||||
XP_U16 i;
|
||||
for ( i = 1; i <= MAX_TRAY_TILES; ++i ) {
|
||||
HWND hDlg = state->dlgHdr.hDlg;
|
||||
XP_U16 ii;
|
||||
for ( ii = 0; ii < MAX_TRAY_TILES; ++ii ) {
|
||||
wchar_t str[4];
|
||||
swprintf( str, L"%d", i );
|
||||
swprintf( str, L"%d", ii+1 );
|
||||
|
||||
SendDlgItemMessage( hDlg, id, ADDSTRING, 0, (long)str );
|
||||
SendDlgItemMessage( hDlg, id, INSERTSTRING(state->dlgHdr.globals), ii, (long)str );
|
||||
|
||||
if ( i == startVal ) {
|
||||
SendDlgItemMessage( hDlg, id, SETCURSEL, i-1, 0L );
|
||||
if ( (ii+1) == startVal ) {
|
||||
SendDlgItemMessage( hDlg, id, SETCURSEL(state->dlgHdr.globals), ii, 0L );
|
||||
}
|
||||
}
|
||||
|
||||
} /* initComboBox */
|
||||
|
||||
static XP_U16
|
||||
getComboValue( HWND hDlg, XP_U16 id )
|
||||
getComboValue( HintLimitsState* state, XP_U16 id )
|
||||
{
|
||||
HWND hDlg = state->dlgHdr.hDlg;
|
||||
LONG result;
|
||||
result = SendDlgItemMessage( hDlg, id, GETCURSEL, 0, 0L );
|
||||
result = SendDlgItemMessage( hDlg, id, GETCURSEL(state->dlgHdr.globals), 0, 0L );
|
||||
if ( result == CB_ERR ) {
|
||||
result = 1;
|
||||
}
|
||||
|
@ -54,13 +56,14 @@ LRESULT CALLBACK
|
|||
HintLimitsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
HintLimitsState* hState;
|
||||
XP_U16 id;
|
||||
|
||||
if ( message == WM_INITDIALOG ) {
|
||||
SetWindowLong( hDlg, GWL_USERDATA, lParam );
|
||||
hState = (HintLimitsState*)lParam;
|
||||
|
||||
ceDlgSetup( &hState->dlgHdr, hDlg, DLG_STATE_NONE );
|
||||
ceDlgComboShowHide( &hState->dlgHdr, HC_MIN_COMBO );
|
||||
ceDlgComboShowHide( &hState->dlgHdr, HC_MAX_COMBO );
|
||||
|
||||
return TRUE;
|
||||
} else {
|
||||
|
@ -68,8 +71,12 @@ HintLimitsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
|||
if ( !!hState ) {
|
||||
|
||||
if ( !hState->inited ) {
|
||||
initComboBox( hDlg, HC_MIN_COMBO, hState->min );
|
||||
initComboBox( hDlg, HC_MAX_COMBO, hState->max );
|
||||
initComboBox( hState,
|
||||
LB_IF_PPC(hState->dlgHdr.globals, HC_MIN_COMBO),
|
||||
hState->min );
|
||||
initComboBox( hState,
|
||||
LB_IF_PPC(hState->dlgHdr.globals,HC_MAX_COMBO),
|
||||
hState->max );
|
||||
hState->inited = XP_TRUE;
|
||||
}
|
||||
|
||||
|
@ -77,16 +84,17 @@ HintLimitsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
switch ( message ) {
|
||||
case WM_COMMAND:
|
||||
id = LOWORD(wParam);
|
||||
if ( (message == WM_COMMAND) && (BN_CLICKED == HIWORD(wParam) ) ) {
|
||||
XP_U16 id = LOWORD(wParam);
|
||||
switch( id ) {
|
||||
case IDOK:
|
||||
hState->min = getComboValue( hDlg, HC_MIN_COMBO );
|
||||
hState->max = getComboValue( hDlg, HC_MAX_COMBO );
|
||||
hState->min = getComboValue( hState,
|
||||
LB_IF_PPC(hState->dlgHdr.globals,HC_MIN_COMBO) );
|
||||
hState->max = getComboValue( hState,
|
||||
LB_IF_PPC(hState->dlgHdr.globals,HC_MAX_COMBO) );
|
||||
case IDCANCEL:
|
||||
hState->cancelled = id == IDCANCEL;
|
||||
|
||||
|
||||
EndDialog( hDlg, id );
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -505,7 +505,7 @@ figureBoardParms( CEAppGlobals* globals, XP_U16 nRows, CEBoardParms* bparms )
|
|||
width for a scrollbar. */
|
||||
boardHt = scrnHeight - scoreHeight - MIN_TRAY_HEIGHT;
|
||||
vScale = sizeBoard( &boardHt, &nVisibleRows );
|
||||
if ( nVisibleRows < nRows && !IS_SMARTPHONE(globals) ) {
|
||||
if ( (nVisibleRows < nRows) && !IS_SMARTPHONE(globals) ) {
|
||||
scrollWidth = SCROLLBAR_WIDTH;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef enum {
|
|||
|
||||
# define IS_SMARTPHONE(g) ((g)->winceVersion > _LAST_PPC)
|
||||
#else
|
||||
# define IS_SMARTPHONE(g) XP_FALSE
|
||||
# define IS_SMARTPHONE(g) ((g) != (g)) /* make compiler warnings go away */
|
||||
#endif
|
||||
|
||||
enum { CE_BONUS1_COLOR,
|
||||
|
@ -222,20 +222,14 @@ void messageToBuf( UINT message, char* buf, int bufSize );
|
|||
#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
|
||||
# define INSERTSTRING LB_INSERTSTRING
|
||||
# define GETLBTEXTLEN LB_GETTEXTLEN
|
||||
# define GETLBTEXT LB_GETTEXT
|
||||
#else
|
||||
# define SETCURSEL CB_SETCURSEL
|
||||
# define GETCURSEL CB_GETCURSEL
|
||||
# define ADDSTRING CB_ADDSTRING
|
||||
# define INSERTSTRING CB_INSERTSTRING
|
||||
# define GETLBTEXTLEN CB_GETLBTEXTLEN
|
||||
# define GETLBTEXT CB_GETLBTEXT
|
||||
#endif
|
||||
|
||||
#define INSERTSTRING(g) (IS_SMARTPHONE(g)?LB_INSERTSTRING:CB_INSERTSTRING)
|
||||
#define SETCURSEL(g) (IS_SMARTPHONE(g)?LB_SETCURSEL:CB_SETCURSEL)
|
||||
#define GETCURSEL(g) (IS_SMARTPHONE(g)?LB_GETCURSEL:CB_GETCURSEL)
|
||||
#define ADDSTRING(g) (IS_SMARTPHONE(g)?LB_ADDSTRING:CB_ADDSTRING)
|
||||
#define GETLBTEXT(g) (IS_SMARTPHONE(g)?LB_GETTEXT:CB_GETLBTEXT)
|
||||
#define GETLBTEXTLEN(g) (IS_SMARTPHONE(g)?LB_GETTEXTLEN:CB_GETLBTEXTLEN)
|
||||
|
||||
#define LB_IF_PPC(g,id) (IS_SMARTPHONE(g)?id:(id+2))
|
||||
|
||||
#endif /* _CEMAIN_H_ */
|
||||
|
|
|
@ -29,8 +29,10 @@
|
|||
/* Stuff the strings for phonies. Why can't I put this in the resource?
|
||||
*/
|
||||
static void
|
||||
stuffPhoniesList( HWND hDlg )
|
||||
stuffPhoniesList( CePrefsDlgState* state )
|
||||
{
|
||||
HWND hDlg = state->dlgHdr.hDlg;
|
||||
CEAppGlobals* globals = state->dlgHdr.globals;
|
||||
XP_U16 i;
|
||||
wchar_t* strings[] = {
|
||||
L"Ignore",
|
||||
|
@ -39,8 +41,8 @@ stuffPhoniesList( HWND hDlg )
|
|||
};
|
||||
|
||||
for ( i = 0; i < 3; ++i ) {
|
||||
SendDlgItemMessage( hDlg, PHONIES_COMBO, ADDSTRING,
|
||||
0, (long)strings[i] );
|
||||
SendDlgItemMessage( hDlg, state->phonComboId,
|
||||
ADDSTRING(globals), 0, (long)strings[i] );
|
||||
}
|
||||
} /* stuffPhoniesList */
|
||||
|
||||
|
@ -64,14 +66,16 @@ setTimerCtls( HWND hDlg, XP_Bool checked )
|
|||
} /* setTimerCtls */
|
||||
|
||||
static void
|
||||
adjustForChoice( HWND hDlg, CePrefsDlgState* state )
|
||||
adjustForChoice( CePrefsDlgState* state )
|
||||
{
|
||||
HWND hDlg = state->dlgHdr.hDlg;
|
||||
XP_U16 goesWithGlobal[] = {IDC_CHECKCOLORPLAYED, IDC_LEFTYCHECK,
|
||||
IDC_CHECKSHOWCURSOR, IDC_CHECKROBOTSCORES,
|
||||
IDC_PREFCOLORS };
|
||||
XP_U16 goesWithLocal[] = {IDC_CHECKSMARTROBOT, IDC_CHECKNOHINTS,
|
||||
TIMER_CHECK, TIMER_EDIT, PHONIES_LABEL,
|
||||
PHONIES_COMBO, IDC_PHONIESUPDOWN, IDC_PICKTILES
|
||||
PHONIES_COMBO, IDC_PHONIESUPDOWN, PHONIES_COMBO_PPC,
|
||||
IDC_PHONIESUPDOWN, IDC_PICKTILES
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
,IDC_CHECKHINTSLIMITS
|
||||
#endif
|
||||
|
@ -98,6 +102,7 @@ adjustForChoice( HWND hDlg, CePrefsDlgState* state )
|
|||
ceShowOrHide( hDlg, IDC_CHECKHINTSLIMITS,
|
||||
!ceGetChecked( hDlg, IDC_CHECKNOHINTS) );
|
||||
#endif
|
||||
ceDlgComboShowHide( &state->dlgHdr, PHONIES_COMBO );
|
||||
}
|
||||
} /* adjustForChoice */
|
||||
|
||||
|
@ -170,8 +175,10 @@ loadCurPrefsFromState( CEAppGlobals* XP_UNUSED_STANDALONE(globals),
|
|||
/* Reflect local state into the controls user will see.
|
||||
*/
|
||||
static void
|
||||
loadControlsFromState( HWND hDlg, CePrefsDlgState* pState )
|
||||
loadControlsFromState( CePrefsDlgState* pState )
|
||||
{
|
||||
HWND hDlg = pState->dlgHdr.hDlg;
|
||||
CEAppGlobals* globals = pState->dlgHdr.globals;
|
||||
CePrefsPrefs* prefsPrefs = &pState->prefsPrefs;
|
||||
|
||||
ceSetChecked( hDlg, IDC_CHECKCOLORPLAYED, prefsPrefs->showColors );
|
||||
|
@ -191,7 +198,7 @@ loadControlsFromState( HWND hDlg, CePrefsDlgState* pState )
|
|||
/* timer */
|
||||
ceSetDlgItemNum( hDlg, TIMER_EDIT, prefsPrefs->gp.gameSeconds / 60 );
|
||||
|
||||
SendDlgItemMessage( hDlg, PHONIES_COMBO, SETCURSEL,
|
||||
SendDlgItemMessage( hDlg, pState->phonComboId, SETCURSEL(globals),
|
||||
prefsPrefs->gp.phoniesAction, 0L );
|
||||
|
||||
if ( !pState->isNewGame ) {
|
||||
|
@ -211,16 +218,19 @@ loadControlsFromState( HWND hDlg, CePrefsDlgState* pState )
|
|||
* the values.
|
||||
*/
|
||||
static void
|
||||
ceControlsToPrefs( HWND hDlg, CePrefsPrefs* prefsPrefs )
|
||||
ceControlsToPrefs( CePrefsDlgState* state )
|
||||
{
|
||||
XP_S16 selIndex;
|
||||
CePrefsPrefs* prefsPrefs = &state->prefsPrefs;
|
||||
HWND hDlg = state->dlgHdr.hDlg;
|
||||
|
||||
prefsPrefs->showColors = ceGetChecked( hDlg, IDC_CHECKCOLORPLAYED );
|
||||
prefsPrefs->gp.robotSmartness
|
||||
= ceGetChecked( hDlg, IDC_CHECKSMARTROBOT ) ? 1 : 0;
|
||||
prefsPrefs->gp.hintsNotAllowed = ceGetChecked( hDlg, IDC_CHECKNOHINTS );
|
||||
|
||||
selIndex = (XP_U16)SendDlgItemMessage( hDlg, PHONIES_COMBO, GETCURSEL,
|
||||
selIndex = (XP_U16)SendDlgItemMessage( hDlg, state->phonComboId,
|
||||
GETCURSEL(state->dlgHdr.globals),
|
||||
0, 0 );
|
||||
if ( selIndex != LB_ERR ) {
|
||||
prefsPrefs->gp.phoniesAction = (XWPhoniesChoice)selIndex;
|
||||
|
@ -254,13 +264,17 @@ PrefsDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
if ( message == WM_INITDIALOG ) {
|
||||
SetWindowLong( hDlg, GWL_USERDATA, lParam );
|
||||
pState = (CePrefsDlgState*)lParam;
|
||||
|
||||
stuffPhoniesList( hDlg );
|
||||
|
||||
loadControlsFromState( hDlg, pState );
|
||||
adjustForChoice( hDlg, pState );
|
||||
|
||||
pState->phonComboId = LB_IF_PPC(pState->dlgHdr.globals,PHONIES_COMBO);
|
||||
|
||||
ceDlgSetup( &pState->dlgHdr, hDlg, DLG_STATE_TRAPBACK );
|
||||
ceDlgComboShowHide( &pState->dlgHdr, PHONIES_COMBO );
|
||||
|
||||
stuffPhoniesList( pState );
|
||||
|
||||
loadControlsFromState( pState );
|
||||
|
||||
adjustForChoice( pState );
|
||||
return TRUE;
|
||||
|
||||
} else {
|
||||
|
@ -278,7 +292,7 @@ PrefsDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
case IDC_RADIOGLOBAL:
|
||||
case IDC_RADIOLOCAL:
|
||||
globals->doGlobalPrefs = id == IDC_RADIOGLOBAL;
|
||||
adjustForChoice( hDlg, pState );
|
||||
adjustForChoice( pState );
|
||||
break;
|
||||
|
||||
case TIMER_CHECK:
|
||||
|
@ -300,7 +314,7 @@ PrefsDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
#endif
|
||||
|
||||
case IDOK:
|
||||
ceControlsToPrefs( hDlg, &pState->prefsPrefs );
|
||||
ceControlsToPrefs( pState );
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, id);
|
||||
pState->userCancelled = id == IDCANCEL;
|
||||
|
|
|
@ -59,6 +59,8 @@ typedef struct CePrefsDlgState {
|
|||
CeDlgHdr dlgHdr;
|
||||
CePrefsPrefs prefsPrefs;
|
||||
|
||||
XP_U16 phonComboId;
|
||||
|
||||
XP_Bool userCancelled;
|
||||
//XP_Bool doGlobalPrefs; /* state of the radio */
|
||||
XP_Bool isNewGame;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* -*- fill-column: 77; c-basic-offset: 4; compile-command: "make TARGET_OS=wince DEBUG=TRUE" -*- */
|
||||
/* -*- fill-column: 77; compile-command: "make TARGET_OS=wince DEBUG=TRUE" -*- */
|
||||
/*
|
||||
* Copyright 2004-2008 by Eric House (xwords@eehouse.org). All rights reserved.
|
||||
* Copyright 2004-2008 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
|
||||
|
@ -108,11 +109,12 @@ SaveNameDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
|||
(void)GetDlgItemText( hDlg, IDC_SVGN_EDIT, buf,
|
||||
VSIZE(buf) );
|
||||
if ( ceFileExists( buf ) ) {
|
||||
messageBoxChar( state->dlgHdr.globals, "File exists",
|
||||
L"Oops!", MB_OK );
|
||||
messageBoxChar( state->dlgHdr.globals,
|
||||
"File exists", L"Oops!", MB_OK );
|
||||
break;
|
||||
}
|
||||
swprintf( state->buf, DEFAULT_DIR_NAME L"\\%s.xwg", buf );
|
||||
swprintf( state->buf, DEFAULT_DIR_NAME L"\\%s.xwg",
|
||||
buf );
|
||||
XP_LOGW( __func__, state->buf );
|
||||
/* fallthru */
|
||||
state->cancelled = XP_FALSE;
|
||||
|
@ -160,6 +162,7 @@ typedef struct CeSavedGamesState {
|
|||
wchar_t curName[128];
|
||||
XP_U16 nItems;
|
||||
|
||||
XP_U16 gameListId;
|
||||
XP_Bool opened;
|
||||
XP_Bool inited;
|
||||
XP_Bool relaunch;
|
||||
|
@ -167,11 +170,18 @@ typedef struct CeSavedGamesState {
|
|||
|
||||
/* Probably belongs as a utility */
|
||||
static void
|
||||
getCBText( HWND hDlg, XP_U16 id, XP_U16 sel, wchar_t* buf, XP_U16* lenp )
|
||||
getCBText( CeSavedGamesState* state, XP_U16 id, XP_U16 sel, wchar_t* buf,
|
||||
XP_U16* lenp )
|
||||
{
|
||||
XP_U16 len = SendDlgItemMessage( hDlg, id, GETLBTEXTLEN, sel, 0L );
|
||||
HWND hDlg = state->dlgHdr.hDlg;
|
||||
CEAppGlobals* globals = state->dlgHdr.globals;
|
||||
XP_U16 len;
|
||||
|
||||
len = SendDlgItemMessage( hDlg, id, GETLBTEXTLEN(globals), sel, 0L );
|
||||
|
||||
if ( len < *lenp ) {
|
||||
(void)SendDlgItemMessage( hDlg, id, GETLBTEXT, sel, (LPARAM)buf );
|
||||
(void)SendDlgItemMessage( hDlg, id, GETLBTEXT(globals), sel,
|
||||
(LPARAM)buf );
|
||||
} else {
|
||||
XP_ASSERT( 0 );
|
||||
}
|
||||
|
@ -185,8 +195,7 @@ getFullSelPath( CeSavedGamesState* state, wchar_t* buf, XP_U16 buflen )
|
|||
lstrcpy( buf, DEFAULT_DIR_NAME L"\\" );
|
||||
len = lstrlen( buf );
|
||||
buflen -= len;
|
||||
getCBText( state->dlgHdr.hDlg, IDC_SVGM_GAMELIST, state->sel, &buf[len],
|
||||
&buflen );
|
||||
getCBText( state, state->gameListId, state->sel, &buf[len], &buflen );
|
||||
lstrcat( buf, L".xwg" );
|
||||
}
|
||||
|
||||
|
@ -208,6 +217,7 @@ initSavedGamesData( CeSavedGamesState* state )
|
|||
{
|
||||
HANDLE fileH;
|
||||
HWND hDlg = state->dlgHdr.hDlg;
|
||||
CEAppGlobals* globals = state->dlgHdr.globals;
|
||||
WIN32_FIND_DATA data;
|
||||
wchar_t path[256];
|
||||
XP_S16 curSel = -1;
|
||||
|
@ -231,14 +241,16 @@ initSavedGamesData( CeSavedGamesState* state )
|
|||
numbers of saved games. */
|
||||
for ( item = 0; item < nItems; ++item ) {
|
||||
wchar_t buf[256];
|
||||
(void)SendDlgItemMessage( hDlg, IDC_SVGM_GAMELIST, GETLBTEXT, item,
|
||||
(void)SendDlgItemMessage( hDlg, state->gameListId,
|
||||
GETLBTEXT(globals), item,
|
||||
(LPARAM)buf );
|
||||
/* Does the current item belong above the one we're inserting? */
|
||||
if ( 0 <= wcscmp( buf, data.cFileName ) ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
(void)SendDlgItemMessage( hDlg, IDC_SVGM_GAMELIST, INSERTSTRING,
|
||||
(void)SendDlgItemMessage( hDlg, state->gameListId,
|
||||
INSERTSTRING(globals),
|
||||
item, (LPARAM)data.cFileName );
|
||||
|
||||
/* Remember which entry matches the currently opened game, and adjust
|
||||
|
@ -262,7 +274,8 @@ initSavedGamesData( CeSavedGamesState* state )
|
|||
state->nItems = nItems;
|
||||
state->openGameIndex = curSel;
|
||||
|
||||
SendDlgItemMessage( hDlg, IDC_SVGM_GAMELIST, SETCURSEL, curSel, 0 );
|
||||
SendDlgItemMessage( hDlg, state->gameListId,
|
||||
SETCURSEL(globals), curSel, 0 );
|
||||
state->sel = curSel;
|
||||
|
||||
setButtons( state );
|
||||
|
@ -313,7 +326,8 @@ deleteSelected( CeSavedGamesState* state )
|
|||
"selected game? This action cannot be "
|
||||
"undone.");
|
||||
if ( confirmed ) {
|
||||
getCBText( state->dlgHdr.hDlg, IDC_SVGM_GAMELIST, state->sel, buf, &len );
|
||||
getCBText( state, state->gameListId,
|
||||
state->sel, buf, &len );
|
||||
swprintf( path, DEFAULT_DIR_NAME L"\\%s.xwg", buf );
|
||||
confirmed = DeleteFile( path );
|
||||
if ( confirmed ) {
|
||||
|
@ -323,6 +337,19 @@ deleteSelected( CeSavedGamesState* state )
|
|||
return confirmed;
|
||||
} /* deleteSelected */
|
||||
|
||||
static XP_Bool
|
||||
tryGameChanged( CeSavedGamesState* state )
|
||||
{
|
||||
XP_S16 sel = SendDlgItemMessage( state->dlgHdr.hDlg, state->gameListId,
|
||||
GETCURSEL(state->dlgHdr.globals), 0, 0L);
|
||||
XP_Bool changing = sel >= 0 && state->sel != sel;
|
||||
if ( changing ) {
|
||||
state->sel = sel;
|
||||
setButtons( state );
|
||||
}
|
||||
return changing;
|
||||
} /* tryGameChanged */
|
||||
|
||||
static LRESULT CALLBACK
|
||||
SavedGamesDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
|
@ -334,8 +361,10 @@ SavedGamesDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
|||
|
||||
state = (CeSavedGamesState*)lParam;
|
||||
state->inited = XP_FALSE;
|
||||
state->gameListId = LB_IF_PPC(state->dlgHdr.globals,IDC_SVGM_GAMELIST);
|
||||
|
||||
ceDlgSetup( &state->dlgHdr, hDlg, DLG_STATE_NONE|DLG_STATE_DONEONLY );
|
||||
ceDlgComboShowHide( &state->dlgHdr, IDC_SVGM_GAMELIST );
|
||||
|
||||
result = TRUE;
|
||||
} else {
|
||||
|
@ -349,17 +378,15 @@ SavedGamesDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
|||
|
||||
if ( ceDoDlgHandle( &state->dlgHdr, message, wParam, lParam) ) {
|
||||
result = TRUE;
|
||||
} else if ( WM_NOTIFY == message ) {
|
||||
result = tryGameChanged( state );
|
||||
} else if ( message == WM_COMMAND ) {
|
||||
XP_U16 wid = LOWORD(wParam);
|
||||
if ( (IDC_SVGM_GAMELIST == wid)
|
||||
&& (CBN_SELCHANGE == HIWORD(wParam)) ) {
|
||||
XP_S16 sel = SendDlgItemMessage( hDlg, IDC_SVGM_GAMELIST,
|
||||
GETCURSEL, 0, 0L);
|
||||
if ( sel >= 0 ) {
|
||||
state->sel = sel;
|
||||
setButtons( state );
|
||||
|
||||
if ( CBN_SELCHANGE == HIWORD(wParam) ) {
|
||||
if (state->gameListId == wid ) {
|
||||
result = tryGameChanged( state );
|
||||
}
|
||||
result = TRUE;
|
||||
} else if ( BN_CLICKED == HIWORD(wParam) ) {
|
||||
switch( wid ) {
|
||||
case IDC_SVGM_DUP:
|
||||
|
@ -375,9 +402,10 @@ SavedGamesDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
|
|||
case IDC_SVGM_OPEN: {
|
||||
wchar_t buf[128];
|
||||
XP_U16 len = VSIZE(buf);
|
||||
getCBText( hDlg, IDC_SVGM_GAMELIST, state->sel,
|
||||
getCBText( state, state->gameListId, state->sel,
|
||||
buf, &len );
|
||||
swprintf( state->buf, DEFAULT_DIR_NAME L"\\%s.xwg", buf );
|
||||
swprintf( state->buf, DEFAULT_DIR_NAME L"\\%s.xwg",
|
||||
buf );
|
||||
XP_LOGW( "returning", state->buf );
|
||||
state->opened = XP_TRUE;
|
||||
}
|
||||
|
|
|
@ -120,15 +120,6 @@ ceGetDlgItemNum( HWND hDlg, XP_U16 id )
|
|||
return result;
|
||||
} /* ceGetDlgItemNum */
|
||||
|
||||
void
|
||||
ce_selectAndShow( HWND hDlg, XP_U16 resID, XP_U16 index )
|
||||
{
|
||||
SendDlgItemMessage( hDlg, resID, SETCURSEL, index, 0 );
|
||||
#ifdef _WIN32_WCE
|
||||
SendDlgItemMessage( hDlg, resID, LB_SETANCHORINDEX, index, 0 );
|
||||
#endif
|
||||
} /* ce_selectAndShow */
|
||||
|
||||
void
|
||||
ceShowOrHide( HWND hDlg, XP_U16 resID, XP_Bool visible )
|
||||
{
|
||||
|
@ -398,6 +389,19 @@ ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat )
|
|||
dlgHdr->doWhat = doWhat;
|
||||
} /* ceDlgSetup */
|
||||
|
||||
void
|
||||
ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId )
|
||||
{
|
||||
HWND hDlg = dlgHdr->hDlg;
|
||||
|
||||
if ( IS_SMARTPHONE(dlgHdr->globals) ) {
|
||||
ceShowOrHide( hDlg, baseId+2, XP_FALSE );
|
||||
} else {
|
||||
ceShowOrHide( hDlg, baseId, XP_FALSE );
|
||||
ceShowOrHide( hDlg, baseId+1, XP_FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
XP_Bool
|
||||
ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
|
|
|
@ -57,6 +57,7 @@ typedef struct CeDlgHdr {
|
|||
XP_U16 nPage;
|
||||
} CeDlgHdr;
|
||||
void ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat );
|
||||
void ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId );
|
||||
XP_Bool ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
/* Are we drawing things in landscape mode? */
|
||||
|
|
|
@ -50,17 +50,12 @@
|
|||
|
||||
#define IDC_COMBO1 1021
|
||||
#define PLAYERNUM_COMBO 1022
|
||||
#define IDC_NPLAYERSCOMBO 1023
|
||||
#define TIMER_CHECK 1024
|
||||
#define NAME_EDIT5 1025
|
||||
#define TIMER_EDIT 1026
|
||||
#define IDC_DICTLIST 1027
|
||||
#define IDC_DICTUPDOWN 1028
|
||||
#define BLANKFACE_COMBO 1029
|
||||
#define PHONIES_COMBO 1030
|
||||
#define IDC_PWDLABEL 1031
|
||||
#define PASS_EDIT 1032
|
||||
#define BLANKFACE_LIST 1033
|
||||
#define IDC_NPLAYERSLIST 1034
|
||||
#define OPTIONS_BUTTON 1035
|
||||
#define IDC_RADIOGLOBAL 1036
|
||||
|
@ -144,48 +139,38 @@
|
|||
# define CLSAMPLE_BUTTON_ID 1123
|
||||
#endif // MY_COLOR_SEL
|
||||
|
||||
#define HC_MIN_COMBO 1100
|
||||
#define HC_MAX_COMBO 1101
|
||||
#define IDC_CCONVIA_LAB 1106
|
||||
|
||||
#define IDC_CCONVIA_LAB 1102
|
||||
|
||||
#define IDC_COOKIE_LAB 1103
|
||||
#define IDC_COOKIE_LAB 1107
|
||||
#ifdef XWFEATURE_RELAY
|
||||
# define IDC_CRELAYNAME_LAB 1104
|
||||
# define IDC_CRELAYPORT_LAB 1105
|
||||
# define IDC_CRELAYHINT_LAB 1106
|
||||
# define IDC_CRELAYNAME_LAB 1108
|
||||
# define IDC_CRELAYPORT_LAB 1109
|
||||
# define IDC_CRELAYHINT_LAB 1110
|
||||
|
||||
# define IDC_CONNECTCOMBO 1107
|
||||
# define RELAYNAME_EDIT 1108
|
||||
# define RELAYPORT_EDIT 1109
|
||||
# define COOKIE_EDIT 1110
|
||||
# define IDC_CONNECTCOMBO 1111
|
||||
# define RELAYNAME_EDIT 1112
|
||||
# define RELAYPORT_EDIT 1113
|
||||
# define COOKIE_EDIT 1114
|
||||
|
||||
#endif
|
||||
|
||||
#define IDC_BLUET_ADDR_LAB 1111
|
||||
#define IDC_BLUET_ADDR_LAB 1115
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
# define IDC_BLUET_ADDR_EDIT 1112
|
||||
# define IDC_BLUET_ADDR_BROWSE 1113
|
||||
# define IDC_BLUET_ADDR_EDIT 1116
|
||||
# define IDC_BLUET_ADDR_BROWSE 1117
|
||||
#endif
|
||||
#define IDS_UPDOWN 1114
|
||||
#define IDC_NPLAYERSUPDOWN 1115
|
||||
#define IDC_PHONIESUPDOWN 1116
|
||||
#define IDC_SVGM_UPDOWN 1117
|
||||
#define IDC_ASKBLANK_UPDOWN 1124
|
||||
#define HC_MIN_UPDOWN 1125
|
||||
#define HC_MAX_UPDOWN 1126
|
||||
/* #define IDS_UPDOWN 1118 */
|
||||
|
||||
|
||||
#define IDC_SVGM_SELLAB 1118
|
||||
#define IDC_SVGM_GAMELIST 1119
|
||||
#define IDC_SVGM_SELLAB 1127
|
||||
/* Let's remove these until they're implemented */
|
||||
#define IDC_SVGM_EDITLAB 1111
|
||||
#define IDC_SVGM_CHANGE 1112
|
||||
#define IDC_SVGM_DUP 1114
|
||||
#define IDC_SVGM_DEL 1115
|
||||
#define IDC_SVGM_EDITLAB 1131
|
||||
#define IDC_SVGM_CHANGE 1130
|
||||
#define IDC_SVGM_DUP 1129
|
||||
#define IDC_SVGM_DEL 1128
|
||||
#define IDC_SVGM_OPEN 1120
|
||||
|
||||
#define IDC_SVGN_SELLAB 1121
|
||||
#define IDC_SVGN_SELLAB 1125
|
||||
#define IDC_SVGN_EDIT 1122
|
||||
|
||||
|
||||
|
@ -238,6 +223,34 @@
|
|||
#define IDS_DUPENAME 40031
|
||||
#define IDS_RENAME 40032
|
||||
|
||||
// These are in sets of three, and must be consecutive and in the right order within each set
|
||||
#define PHONIES_COMBO 1200
|
||||
#define IDC_PHONIESUPDOWN 1201
|
||||
#define PHONIES_COMBO_PPC 1202
|
||||
|
||||
#define HC_MIN_COMBO 1203
|
||||
#define HC_MIN_UPDOWN 1204
|
||||
#define HC_MIN_COMBO_PPC 1205
|
||||
|
||||
#define HC_MAX_COMBO 1206
|
||||
#define HC_MAX_UPDOWN 1207
|
||||
#define HC_MAX_COMBO_PPC 1208
|
||||
|
||||
#define IDC_SVGM_GAMELIST 1209
|
||||
#define IDC_SVGM_UPDOWN 1210
|
||||
#define IDC_SVGM_GAMELIST_PPC 1211
|
||||
|
||||
#define BLANKFACE_LIST 1212
|
||||
#define IDC_ASKBLANK_UPDOWN 1213
|
||||
#define BLANKFACE_LIST_PPC 1214
|
||||
|
||||
#define IDC_DICTLIST 1215
|
||||
#define IDC_DICTUPDOWN 1216
|
||||
#define IDC_DICTLIST_PPC 1217
|
||||
|
||||
#define IDC_NPLAYERSCOMBO 1218
|
||||
#define IDC_NPLAYERSUPDOWN 1219
|
||||
#define IDC_NPLAYERSCOMBO_PPC 1220
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
|
@ -245,7 +258,7 @@
|
|||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 125
|
||||
#define _APS_NEXT_COMMAND_VALUE 40033
|
||||
#define _APS_NEXT_CONTROL_VALUE 1127
|
||||
#define _APS_NEXT_CONTROL_VALUE 1128
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -96,7 +96,7 @@ BEGIN
|
|||
MENUITEM "Limited hint", ID_MOVE_LIMITEDHINT
|
||||
#endif
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Tile values", ID_MOVE_VALUES
|
||||
MENUITEM "Toggle values", ID_MOVE_VALUES
|
||||
END
|
||||
|
||||
POPUP "Game"
|
||||
|
@ -164,9 +164,13 @@ END
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
# define UDS_EXPANDABLE 0x0200
|
||||
# define UDS_NOSCROLL 0x0400
|
||||
# define LISTBOX_CONTROL_FLAGS \
|
||||
NOT LBS_NOTIFY | LBS_SORT | LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_TABSTOP
|
||||
# define SPINNER_CONTROL_FLAGS \
|
||||
UDS_AUTOBUDDY | UDS_HORZ | UDS_ALIGNRIGHT | UDS_WRAP | /*UDS_ARROWKEYS |*/\
|
||||
UDS_SETBUDDYINT | UDS_EXPANDABLE | UDS_NOSCROLL
|
||||
UDS_AUTOBUDDY | UDS_HORZ | UDS_ALIGNRIGHT | UDS_ARROWKEYS |\
|
||||
UDS_SETBUDDYINT | UDS_EXPANDABLE
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -231,9 +235,6 @@ END
|
|||
|
||||
#define CHECK_WIDTH 10
|
||||
|
||||
/* 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"
|
||||
|
@ -252,17 +253,13 @@ BEGIN
|
|||
|
||||
LTEXT "",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,43,8
|
||||
#ifdef _WIN32_WCE
|
||||
LISTBOX IDC_NPLAYERSCOMBO, 46, NPLAYERS_ROW, 24, 12, WS_TABSTOP
|
||||
LISTBOX IDC_NPLAYERSCOMBO, 46, NPLAYERS_ROW, 24, 12,LISTBOX_CONTROL_FLAGS
|
||||
CONTROL "", IDC_NPLAYERSUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,
|
||||
0, 0, 0, 0
|
||||
#else
|
||||
COMBOBOX IDC_NPLAYERSCOMBO,46,NPLAYERS_ROW,24,58,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
#endif
|
||||
COMBOBOX IDC_NPLAYERSCOMBO_PPC,46,NPLAYERS_ROW,24,58,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
|
||||
|
||||
// "R" for rearrange. Go to J if no change becomes possible.
|
||||
PUSHBUTTON "Jugl.",GIJUGGLE_BUTTON,75,NPLAYERS_ROW,20,12
|
||||
|
||||
LTEXT "Name",IDC_STATIC,GAME_NAMELABEL_LEFT,
|
||||
|
@ -312,13 +309,12 @@ BEGIN
|
|||
LTEXT "Dictionary:",IDC_STATIC,LEFT_COL,DICTPICK_LAB_ROW,36,8,
|
||||
SS_NOPREFIX
|
||||
#ifdef _WIN32_WCE
|
||||
LISTBOX IDC_DICTLIST, LEFT_COL+10,DICTPICK_ROW,70,12, WS_TABSTOP
|
||||
LISTBOX IDC_DICTLIST, LEFT_COL+10,DICTPICK_ROW,70,12,LISTBOX_CONTROL_FLAGS
|
||||
CONTROL "", IDC_DICTUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,
|
||||
0, 0, 0, 0
|
||||
#else
|
||||
COMBOBOX IDC_DICTLIST,LEFT_COL+10,DICTPICK_ROW,70,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
#endif
|
||||
COMBOBOX IDC_DICTLIST_PPC,LEFT_COL+10,DICTPICK_ROW,70,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
PUSHBUTTON "Preferences...",OPTIONS_BUTTON,LEFT_COL,PREFS_ROW,55,12
|
||||
|
||||
|
@ -367,17 +363,16 @@ BEGIN
|
|||
#endif
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
LISTBOX BLANKFACE_LIST,65,8,25,12,WS_TABSTOP
|
||||
LISTBOX BLANKFACE_LIST,65,8,25,12,LISTBOX_CONTROL_FLAGS
|
||||
CONTROL "", IDC_ASKBLANK_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,
|
||||
0, 0, 0, 0
|
||||
#else
|
||||
COMBOBOX BLANKFACE_LIST,60,5,25,12,
|
||||
#endif
|
||||
COMBOBOX BLANKFACE_LIST_PPC,60,5,25,12,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
DEFPUSHBUTTON "OK",IDOK,70,70,REPOS_BUTTON_WIDTH, BUTTON_HT
|
||||
PUSHBUTTON "Cancel",IDCANCEL,20,70,REPOS_BUTTON_WIDTH, BUTTON_HT
|
||||
#endif
|
||||
|
||||
END
|
||||
|
||||
#define SVGN_LEFT_COL 2
|
||||
|
@ -432,14 +427,12 @@ BEGIN
|
|||
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,12,
|
||||
WS_TABSTOP
|
||||
LISTBOX IDC_SVGM_GAMELIST, SVGM_LEFT_COL,SVGM_ROW_2,70,12,LISTBOX_CONTROL_FLAGS
|
||||
CONTROL "", IDC_SVGM_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,
|
||||
0, 0, 0, 0
|
||||
#else
|
||||
COMBOBOX IDC_SVGM_GAMELIST,SVGM_LEFT_COL,SVGM_ROW_2,70,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
#endif
|
||||
COMBOBOX IDC_SVGM_GAMELIST_PPC,SVGM_LEFT_COL,SVGM_ROW_2,70,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
PUSHBUTTON "Open",IDC_SVGM_OPEN,
|
||||
SVGM_LEFT_COL,SVGM_ROW_3,40,14,WS_DISABLED
|
||||
|
@ -502,24 +495,21 @@ FONT 8, "System"
|
|||
BEGIN
|
||||
LTEXT "Use at least:",IDC_STATIC,HC_LABELS_COL,HC_MINROW,60,8
|
||||
#ifdef _WIN32_WCE
|
||||
LISTBOX HC_MIN_COMBO, HC_DROPDOWNS_COL,HC_MINROW, 24, 12, WS_TABSTOP
|
||||
LISTBOX HC_MIN_COMBO, HC_DROPDOWNS_COL,HC_MINROW, 24, 12, LISTBOX_CONTROL_FLAGS
|
||||
CONTROL "", HC_MIN_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,
|
||||
0, 0, 0, 0
|
||||
#else
|
||||
COMBOBOX HC_MIN_COMBO,HC_DROPDOWNS_COL,HC_MINROW,17,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
#endif
|
||||
|
||||
COMBOBOX HC_MIN_COMBO_PPC,HC_DROPDOWNS_COL,HC_MINROW,17,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
LTEXT "But no more than:",IDC_STATIC,HC_LABELS_COL,HC_MAXROW,60,8
|
||||
#ifdef _WIN32_WCE
|
||||
LISTBOX HC_MAX_COMBO, HC_DROPDOWNS_COL,HC_MAXROW, 24, 12, WS_TABSTOP
|
||||
LISTBOX HC_MAX_COMBO, HC_DROPDOWNS_COL,HC_MAXROW, 24, 12, LISTBOX_CONTROL_FLAGS
|
||||
CONTROL "", HC_MAX_UPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,
|
||||
0, 0, 0, 0
|
||||
#else
|
||||
COMBOBOX HC_MAX_COMBO,HC_DROPDOWNS_COL,HC_MAXROW,17,58,
|
||||
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
#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,
|
||||
|
@ -578,13 +568,13 @@ BEGIN
|
|||
EDITTEXT TIMER_EDIT,80,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,12, WS_TABSTOP
|
||||
LISTBOX PHONIES_COMBO, 38,PR_ROW6,50,12, LISTBOX_CONTROL_FLAGS
|
||||
CONTROL "", IDC_PHONIESUPDOWN, UPDOWN_CLASS, SPINNER_CONTROL_FLAGS,
|
||||
0, 0, 0, 0
|
||||
#else
|
||||
COMBOBOX PHONIES_COMBO,38,PR_ROW6,40,58,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
#endif
|
||||
COMBOBOX PHONIES_COMBO_PPC,38,PR_ROW6,40,58,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
|
||||
#ifdef FEATURE_TRAY_EDIT
|
||||
CONTROL "Pick tiles face-up", IDC_PICKTILES, "Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,8,PR_ROW7,90,PREFS_ROW_HT
|
||||
|
@ -649,10 +639,11 @@ BEGIN
|
|||
LTEXT "Bluetooth not supported.",
|
||||
IDC_BLUET_ADDR_LAB,LAB_COL,CONN_ROW_2,40,12
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WCE
|
||||
PUSHBUTTON "OK",IDOK,9,BUTTON_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT
|
||||
DEFPUSHBUTTON "Cancel",IDCANCEL,70,BUTTON_ROW,
|
||||
REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT
|
||||
#endif
|
||||
END
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue