begin work of allowing multi-device play over WiFi/Cellular: add

dialog to gather params, save 'em, and stub out send proc.  Still need
to debug a bit, and add threads to send/receive packets.
This commit is contained in:
ehouse 2005-07-23 15:31:21 +00:00
parent 24fb48008f
commit 3ecc871515
11 changed files with 428 additions and 103 deletions

122
xwords4/wince/cecondlg.c Executable file
View file

@ -0,0 +1,122 @@
/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */
/*
* Copyright 2005 by Eric House (fixin@peak.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 XWFEATURE_STANDALONE_ONLY
#include "cecondlg.h"
#include "ceutil.h"
static void
ceControlsToAddrRec( HWND hDlg, CeConnDlgState* cState )
{
XP_U16 len;
len = sizeof(cState->addrRec.u.ip_relay.hostName);
ceGetDlgItemText( hDlg, RELAYNAME_EDIT,
cState->addrRec.u.ip_relay.hostName, &len );
cState->addrRec.u.ip_relay.port =
(XP_U16)ceGetDlgItemNum( hDlg, RELAYPORT_EDIT );
len = sizeof(cState->addrRec.u.ip_relay.cookie);
ceGetDlgItemText( hDlg, COOKIE_EDIT, cState->addrRec.u.ip_relay.cookie,
&len );
}
static void
ceControlsFromAddrRec( HWND hDlg, const CeConnDlgState* cState )
{
XP_UCHAR* str;
switch( cState->addrRec.conType ) {
case COMMS_CONN_RELAY:
str = L"WiFi/Cellular data";
break;
default:
XP_LOGF( "conType is %d", cState->addrRec.conType );
XP_ASSERT( 0 );
str = L"bad conType";
break;
}
SendDlgItemMessage( hDlg, IDC_CONNECTCOMBO, CB_ADDSTRING, 0, str );
SendDlgItemMessage( hDlg, IDC_CONNECTCOMBO, CB_SETCURSEL, 0, 0L );
ceSetDlgItemText( hDlg, RELAYNAME_EDIT, cState->addrRec.u.ip_relay.hostName );
ceSetDlgItemNum( hDlg, RELAYPORT_EDIT, cState->addrRec.u.ip_relay.port );
ceSetDlgItemText( hDlg, COOKIE_EDIT, cState->addrRec.u.ip_relay.cookie );
}
static LRESULT CALLBACK
ConnsDlg( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
LRESULT result = FALSE;
CeConnDlgState* cState;
CEAppGlobals* globals;
if ( message == WM_INITDIALOG ) {
SetWindowLong( hDlg, GWL_USERDATA, lParam );
cState = (CeConnDlgState*)lParam;
globals = cState->globals;
ceControlsFromAddrRec( hDlg, cState );
result = TRUE;
} else {
cState = (CeConnDlgState*)GetWindowLong( hDlg, GWL_USERDATA );
if ( !!cState ) {
globals = cState->globals;
if ( message == WM_COMMAND ) {
XP_U16 id = LOWORD(wParam);
switch( id ) {
case IDOK:
ceControlsToAddrRec( hDlg, cState );
case IDCANCEL:
EndDialog(hDlg, id);
cState->userCancelled = id == IDCANCEL;
result = TRUE;
}
}
}
}
return result;
} /* ConnsDlg */
XP_Bool
WrapConnsDlg( HWND hDlg, CEAppGlobals* globals, const CommsAddrRec* addrRec,
CeConnDlgState* state )
{
XP_Bool result;
XP_MEMSET( state, 0, sizeof( *state ) );
XP_LOGF( "WrapConnsDlg" );
state->globals = globals;
XP_MEMCPY( &state->addrRec, addrRec, sizeof(state->addrRec) );
DialogBoxParam( globals->hInst, (LPCTSTR)IDD_CONNSSDLG, hDlg,
(DLGPROC)ConnsDlg, (long)state );
result = !state->userCancelled;
return result;
} /* WrapConnsDlg */
#endif

35
xwords4/wince/cecondlg.h Executable file
View file

@ -0,0 +1,35 @@
/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */
/*
* Copyright 2005 by Eric House (fixin@peak.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 _CECONDLG_H_
#define _CECONDLG_H_
#include "comms.h"
#include "cemain.h"
typedef struct CeConnDlgState {
CommsAddrRec addrRec;
CEAppGlobals* globals;
XP_Bool userCancelled;
} CeConnDlgState;
XP_Bool WrapConnsDlg( HWND hDlg, CEAppGlobals* globals,
const CommsAddrRec* addrRec, CeConnDlgState* state );
#endif

View file

@ -21,10 +21,12 @@
#include "cemain.h" #include "cemain.h"
#include "ceutil.h" #include "ceutil.h"
#include "cedict.h" #include "cedict.h"
#include "cecondlg.h"
#include "strutils.h" #include "strutils.h"
#define NUM_COLS 4 #define NUM_COLS 4
#if 0
static XP_U16 static XP_U16
ceCountLocalIn( HWND hDlg, XP_U16 nPlayers ) ceCountLocalIn( HWND hDlg, XP_U16 nPlayers )
{ {
@ -39,6 +41,7 @@ ceCountLocalIn( HWND hDlg, XP_U16 nPlayers )
return nLocal; return nLocal;
} /* ceCountLocalIn */ } /* ceCountLocalIn */
#endif
static void static void
loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState ) loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
@ -63,9 +66,18 @@ loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
idToCheck = lp->isRobot? resID : 0; idToCheck = lp->isRobot? resID : 0;
CheckRadioButton( hDlg, resID, resID, idToCheck ); CheckRadioButton( hDlg, resID, resID, idToCheck );
#ifndef XWFEATURE_STANDALONE_ONLY
/* set the remote checkbox */
resID = REMOTE_CHECK1 + (NUM_COLS*i);
idToCheck = lp->isLocal? 0 : resID;
CheckRadioButton( hDlg, resID, resID, idToCheck );
#endif
/* set the player name */ /* set the player name */
resID = NAME_EDIT1 + (NUM_COLS*i); if ( lp->name != NULL ) {
ceSetDlgItemText( hDlg, resID, lp->name ); resID = NAME_EDIT1 + (NUM_COLS*i);
ceSetDlgItemText( hDlg, resID, lp->name );
}
/* set the password, if any */ /* set the password, if any */
@ -81,12 +93,12 @@ loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
gi->nPlayers-1, 0L ); gi->nPlayers-1, 0L );
#ifndef XWFEATURE_STANDALONE_ONLY #ifndef XWFEATURE_STANDALONE_ONLY
for ( i = 0; i < 3; ++i ) { for ( i = 0; i < (sizeof(roles)/sizeof(roles[0])); ++i ) {
SendDlgItemMessage( hDlg, IDC_ROLECOMBO, CB_ADDSTRING, 0, SendDlgItemMessage( hDlg, IDC_ROLECOMBO, CB_ADDSTRING, 0,
(long)roles[i] ); (long)roles[i] );
} }
SendDlgItemMessage( hDlg, IDC_ROLECOMBO, CB_SETCURSEL, SendDlgItemMessage( hDlg, IDC_ROLECOMBO, CB_SETCURSEL,
gi->serverRole, 0L ); giState->curServerHilite, 0L );
#endif #endif
/* set the dictionary name */ /* set the dictionary name */
@ -114,6 +126,7 @@ loadFromGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
if ( !giState->isNewGame ) { if ( !giState->isNewGame ) {
XP_U16 disableIDs[] = { IDC_NPLAYERSCOMBO, XP_U16 disableIDs[] = { IDC_NPLAYERSCOMBO,
IDC_ROLECOMBO,
IDC_DICTBUTTON}; IDC_DICTBUTTON};
XP_U16 i; XP_U16 i;
for( i = 0; i < sizeof(disableIDs)/sizeof(disableIDs[0]); ++i ) { for( i = 0; i < sizeof(disableIDs)/sizeof(disableIDs[0]); ++i ) {
@ -195,6 +208,7 @@ countAndSetRemote( HWND hDlg, XP_U16 nPlayers, XP_Bool counterWins,
static XP_Bool static XP_Bool
ceAdjustVisibility( HWND hDlg, GameInfoState* giState, XP_Bool counterWins ) ceAdjustVisibility( HWND hDlg, GameInfoState* giState, XP_Bool counterWins )
{ {
XP_Bool result;
Connectedness serverRole = (Connectedness) Connectedness serverRole = (Connectedness)
SendDlgItemMessage( hDlg, IDC_ROLECOMBO, CB_GETCURSEL, 0, 0L ); SendDlgItemMessage( hDlg, IDC_ROLECOMBO, CB_GETCURSEL, 0, 0L );
XP_U16 nToDraw = MAX_NUM_PLAYERS; XP_U16 nToDraw = MAX_NUM_PLAYERS;
@ -256,12 +270,17 @@ ceAdjustVisibility( HWND hDlg, GameInfoState* giState, XP_Bool counterWins )
if ( !counterWins ) { if ( !counterWins ) {
(void)SendDlgItemMessage( hDlg, IDC_NPLAYERSCOMBO, (void)SendDlgItemMessage( hDlg, IDC_NPLAYERSCOMBO,
CB_SETCURSEL, nDrawn - 1, 0L ); CB_SETCURSEL, nDrawn - 1, 0L );
return XP_TRUE; result = XP_TRUE;
} else { } else {
XP_ASSERT( nDrawn <= nToDraw ); XP_ASSERT( nDrawn <= nToDraw );
return nDrawn == nToDraw; result = nDrawn == nToDraw;
} }
#ifndef XWFEATURE_STANDALONE_ONLY
ceShowOrHide( hDlg, IDC_CONNBUTTON, serverRole != SERVER_STANDALONE );
#endif
return result;
} /* ceAdjustVisibility */ } /* ceAdjustVisibility */
static void static void
@ -288,6 +307,8 @@ stateToGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
Connectedness curServerHilite Connectedness curServerHilite
= (Connectedness )SendDlgItemMessage( hDlg, IDC_ROLECOMBO, = (Connectedness )SendDlgItemMessage( hDlg, IDC_ROLECOMBO,
CB_GETCURSEL, 0, 0L ); CB_GETCURSEL, 0, 0L );
XP_ASSERT( curServerHilite == giState->curServerHilite );
gi->serverRole = curServerHilite;
nPlayers = 1 + (XP_U16)SendDlgItemMessage( hDlg, IDC_NPLAYERSCOMBO, nPlayers = 1 + (XP_U16)SendDlgItemMessage( hDlg, IDC_NPLAYERSCOMBO,
CB_GETCURSEL, 0, 0 ); CB_GETCURSEL, 0, 0 );
@ -299,12 +320,14 @@ stateToGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
XP_Bool checked; XP_Bool checked;
LocalPlayer* lp = &gi->players[i]; LocalPlayer* lp = &gi->players[i];
#ifndef XWFEATURE_STANDALONE_ONLY
if ( curServerHilite == SERVER_ISSERVER ) { if ( curServerHilite == SERVER_ISSERVER ) {
id = REMOTE_CHECK1 + offset; id = REMOTE_CHECK1 + offset;
lp->isLocal = !ceGetChecked( hDlg, id ); lp->isLocal = !ceGetChecked( hDlg, id );
} else { } else {
lp->isLocal = XP_TRUE; lp->isLocal = XP_TRUE;
} }
#endif
/* robot */ /* robot */
id = ROBOT_CHECK1 + offset; id = ROBOT_CHECK1 + offset;
@ -339,7 +362,8 @@ stateToGameInfo( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
/* preferences */ /* preferences */
if ( giState->prefsChanged ) { if ( giState->prefsChanged ) {
loadCurPrefsFromState( &globals->appPrefs, gi, &giState->prefsPrefs ); loadCurPrefsFromState( globals, &globals->appPrefs, gi,
&giState->prefsPrefs );
} }
} /* stateToGameInfo */ } /* stateToGameInfo */
@ -361,6 +385,21 @@ handleOptionsButton( HWND hDlg, CEAppGlobals* globals, GameInfoState* giState )
} }
} /* handleOptionsButton */ } /* handleOptionsButton */
#ifndef XWFEATURE_STANDALONE_ONLY
static void
handleConnOptionsButton( HWND hDlg, CEAppGlobals* globals,
GameInfoState* giState )
{
CeConnDlgState state;
if ( WrapConnsDlg( hDlg, globals, &giState->prefsPrefs.addrRec, &state ) ) {
XP_MEMCPY( &giState->prefsPrefs.addrRec, &state.addrRec,
sizeof(giState->prefsPrefs.addrRec) );
giState->addrChanged = XP_TRUE;
}
}
#endif
/* playersFollowCounts: /* playersFollowCounts:
* Force the data on players into sync with the counts. This is really only * Force the data on players into sync with the counts. This is really only
* an issue if a local/remote change has happened. Meant to be called after * an issue if a local/remote change has happened. Meant to be called after
@ -413,7 +452,7 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
globals = giState->globals; globals = giState->globals;
loadFromGameInfo( hDlg, globals, giState ); loadFromGameInfo( hDlg, globals, giState );
loadStateFromCurPrefs( &globals->appPrefs, &globals->gameInfo, loadStateFromCurPrefs( globals, &globals->appPrefs, &globals->gameInfo,
&giState->prefsPrefs ); &giState->prefsPrefs );
ceAdjustVisibility( hDlg, giState, XP_FALSE ); ceAdjustVisibility( hDlg, giState, XP_FALSE );
@ -453,15 +492,18 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
case IDC_NPLAYERSCOMBO: case IDC_NPLAYERSCOMBO:
if ( HIWORD(wParam) == CBN_SELCHANGE ) { if ( HIWORD(wParam) == CBN_SELCHANGE ) {
if ( giState->isNewGame ) { /* ignore if in info mode */ if ( giState->isNewGame ) { /* ignore if in info mode */
XP_U16 role; XP_U16 role;
XP_U16 sel; XP_U16 sel;
sel = (XP_U16)SendDlgItemMessage( hDlg, sel = (XP_U16)SendDlgItemMessage( hDlg,
IDC_NPLAYERSCOMBO, IDC_NPLAYERSCOMBO,
CB_GETCURSEL, 0, 0L); CB_GETCURSEL,
0, 0L);
++sel; ++sel;
role = (XP_U16)SendDlgItemMessage( hDlg, IDC_ROLECOMBO, role = (XP_U16)SendDlgItemMessage( hDlg,
CB_GETCURSEL, 0, 0L); IDC_ROLECOMBO,
CB_GETCURSEL,
0, 0L);
ceAdjustVisibility( hDlg, giState, XP_TRUE ); ceAdjustVisibility( hDlg, giState, XP_TRUE );
} }
} }
@ -469,16 +511,24 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
case IDC_ROLECOMBO: case IDC_ROLECOMBO:
if ( HIWORD(wParam) == CBN_SELCHANGE ) { if ( HIWORD(wParam) == CBN_SELCHANGE ) {
if ( giState->isNewGame ) { /* ignore if in info mode */ if ( giState->isNewGame ) { /* ignore if in info mode */
XP_U16 sel; XP_U16 sel;
sel = (XP_U16)SendDlgItemMessage( hDlg, IDC_ROLECOMBO, sel = (XP_U16)SendDlgItemMessage( hDlg, IDC_ROLECOMBO,
CB_GETCURSEL, 0, 0L); CB_GETCURSEL, 0,
0L);
giState->curServerHilite = (Connectedness)sel; giState->curServerHilite = (Connectedness)sel;
ceAdjustVisibility( hDlg, giState, XP_FALSE ); ceAdjustVisibility( hDlg, giState, XP_FALSE );
} }
} }
break; break;
#ifndef XWFEATURE_STANDALONE_ONLY
case IDC_CONNBUTTON:
XP_LOGF( "calling handleConnOptionsButton" );
handleConnOptionsButton( hDlg, globals, giState );
break;
#endif
#ifndef STUBBED_DICT #ifndef STUBBED_DICT
case IDC_DICTBUTTON: case IDC_DICTBUTTON:
if ( giState->isNewGame ) { /* ignore if in info mode */ if ( giState->isNewGame ) { /* ignore if in info mode */

View file

@ -33,6 +33,7 @@ typedef struct GameInfoState {
XP_Bool prefsChanged; XP_Bool prefsChanged;
XP_Bool colorsChanged; XP_Bool colorsChanged;
XP_Bool addrChanged;
Connectedness curServerHilite; Connectedness curServerHilite;
CePrefsPrefs prefsPrefs; CePrefsPrefs prefsPrefs;
} GameInfoState; } GameInfoState;

View file

@ -73,6 +73,9 @@ typedef struct FileWriteState {
} FileWriteState; } FileWriteState;
/* forward util function decls */ /* forward util function decls */
static XP_S16 ce_send_proc( XP_U8* buf, XP_U16 len, CommsAddrRec* addr,
void* closure );
static VTableMgr* ce_util_getVTManager( XW_UtilCtxt* uc ); static VTableMgr* ce_util_getVTManager( XW_UtilCtxt* uc );
static void ce_util_userError( XW_UtilCtxt* uc, UtilErrID id ); static void ce_util_userError( XW_UtilCtxt* uc, UtilErrID id );
static XP_Bool ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id, static XP_Bool ce_util_userQuery( XW_UtilCtxt* uc, UtilQueryID id,
@ -104,6 +107,11 @@ static XWStreamCtxt* ce_util_makeStreamFromAddr( XW_UtilCtxt* uc,
static XP_UCHAR* ce_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode ); static XP_UCHAR* ce_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode );
static XP_Bool ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi, static XP_Bool ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
XP_U16 turn, XP_Bool turnLost ); XP_U16 turn, XP_Bool turnLost );
#ifdef BEYOND_IR
static void ce_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
const CommsAddrRec* newAddr );
#endif
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
static XP_Bool ce_util_getTraySearchLimits( XW_UtilCtxt* uc, XP_U16* min, static XP_Bool ce_util_getTraySearchLimits( XW_UtilCtxt* uc, XP_U16* min,
XP_U16* max ); XP_U16* max );
@ -247,6 +255,9 @@ ceInitUtilFuncs( CEAppGlobals* globals )
vtable->m_util_makeEmptyDict = ce_util_makeEmptyDict; vtable->m_util_makeEmptyDict = ce_util_makeEmptyDict;
vtable->m_util_getUserString = ce_util_getUserString; vtable->m_util_getUserString = ce_util_getUserString;
vtable->m_util_warnIllegalWord = ce_util_warnIllegalWord; vtable->m_util_warnIllegalWord = ce_util_warnIllegalWord;
#ifdef BEYOND_IR
vtable->m_util_addrChange = ce_util_addrChange;
#endif
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
vtable->m_util_getTraySearchLimits = ce_util_getTraySearchLimits; vtable->m_util_getTraySearchLimits = ce_util_getTraySearchLimits;
#endif #endif
@ -484,7 +495,8 @@ ceSetTitleFromName( CEAppGlobals* globals )
} /* ceSetTitleFromName */ } /* ceSetTitleFromName */
static void static void
ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, CeGamePrefs* gp ) ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, CeGamePrefs* gp,
const CommsAddrRec* addr )
{ {
DictionaryCtxt* dict; DictionaryCtxt* dict;
XP_UCHAR* newDictName = globals->gameInfo.dictName; XP_UCHAR* newDictName = globals->gameInfo.dictName;
@ -522,13 +534,19 @@ ceInitAndStartBoard( CEAppGlobals* globals, XP_Bool newGame, CeGamePrefs* gp )
if ( newGame ) { if ( newGame ) {
XP_U16 newGameID = 0; XP_U16 newGameID = 0;
game_reset( MEMPOOL &globals->game, &globals->gameInfo, &globals->util, game_reset( MEMPOOL &globals->game, &globals->gameInfo, &globals->util,
newGameID, &globals->appPrefs.cp, (TransportSend)NULL, newGameID, &globals->appPrefs.cp, ce_send_proc,
globals ); globals );
if ( !!gp ) { if ( !!gp ) {
globals->gameInfo.hintsNotAllowed = gp->hintsNotAllowed; globals->gameInfo.hintsNotAllowed = gp->hintsNotAllowed;
globals->gameInfo.robotSmartness = gp->robotSmartness; globals->gameInfo.robotSmartness = gp->robotSmartness;
} }
#ifndef XWFEATURE_STANDALONE_ONLY
if ( !!addr ) {
comms_setAddr( globals->game.comms, addr );
}
#endif
} }
XP_ASSERT( !!globals->game.board ); XP_ASSERT( !!globals->game.board );
@ -747,7 +765,7 @@ ceLoadSavedGame( CEAppGlobals* globals )
game_makeFromStream( MEMPOOL stream, &globals->game, game_makeFromStream( MEMPOOL stream, &globals->game,
&globals->gameInfo, &globals->gameInfo,
dict, &globals->util, globals->draw, dict, &globals->util, globals->draw,
&globals->appPrefs.cp, ce_ir_send, globals ); &globals->appPrefs.cp, ce_send_proc, globals );
} }
stream_destroy( stream ); stream_destroy( stream );
@ -756,15 +774,6 @@ ceLoadSavedGame( CEAppGlobals* globals )
return success; return success;
} /* ceLoadSavedGame */ } /* ceLoadSavedGame */
#ifndef XWFEATURE_STANDALONE_ONLY
XP_S16
ce_ir_send( XP_U8* buf, XP_U16 len, CommsAddrRec* addr, void* closure )
{
XP_DEBUGF( "ce_ir_send called" );
return -1;
} /* ce_ir_send */
#endif
static void static void
colorsFromRsrc( CEAppGlobals* globals ) colorsFromRsrc( CEAppGlobals* globals )
{ {
@ -911,7 +920,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
game_makeNewGame( MPPARM(mpool) &globals->game, &globals->gameInfo, game_makeNewGame( MPPARM(mpool) &globals->game, &globals->gameInfo,
&globals->util, globals->draw, gameID, &globals->util, globals->draw, gameID,
&globals->appPrefs.cp, &globals->appPrefs.cp,
(TransportSend)NULL, globals ); ce_send_proc, globals );
newDone = doNewGame( globals, XP_TRUE ); /* calls ceInitAndStartBoard */ newDone = doNewGame( globals, XP_TRUE ); /* calls ceInitAndStartBoard */
if ( !newDone ) { if ( !newDone ) {
@ -926,7 +935,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow)
} }
if ( result && !newDone ) { if ( result && !newDone ) {
ceInitAndStartBoard( globals, !oldGameLoaded, NULL ); ceInitAndStartBoard( globals, !oldGameLoaded, NULL, NULL );
} }
return result; return result;
@ -1051,6 +1060,7 @@ static XP_Bool
doNewGame( CEAppGlobals* globals, XP_Bool silent ) doNewGame( CEAppGlobals* globals, XP_Bool silent )
{ {
GameInfoState giState; GameInfoState giState;
CommsAddrRec* addr = NULL;
XP_Bool changed = XP_FALSE; XP_Bool changed = XP_FALSE;
/* What happens if user cancels below? I'm hosed without a name, no? /* What happens if user cancels below? I'm hosed without a name, no?
@ -1074,13 +1084,19 @@ doNewGame( CEAppGlobals* globals, XP_Bool silent )
) { ) {
if ( giState.prefsChanged ) { if ( giState.prefsChanged ) {
loadCurPrefsFromState( &globals->appPrefs, &globals->gameInfo, loadCurPrefsFromState( globals, &globals->appPrefs,
&giState.prefsPrefs ); &globals->gameInfo, &giState.prefsPrefs );
if ( giState.colorsChanged ) { if ( giState.colorsChanged ) {
updateForColors( globals ); updateForColors( globals );
} }
} }
ceInitAndStartBoard( globals, XP_TRUE, NULL ); #ifndef XWFEATURE_STANDALONE_ONLY
if ( giState.addrChanged ) {
addr = &giState.prefsPrefs.addrRec;
}
#endif
ceInitAndStartBoard( globals, XP_TRUE, NULL, addr );
changed = XP_TRUE; changed = XP_TRUE;
} }
@ -1130,7 +1146,7 @@ ceChooseAndOpen( CEAppGlobals* globals )
globals->curGameName = name; globals->curGameName = name;
ceLoadSavedGame( globals ); ceLoadSavedGame( globals );
ceInitAndStartBoard( globals, XP_FALSE, NULL ); ceInitAndStartBoard( globals, XP_FALSE, NULL, NULL );
ceSetTitleFromName( globals ); ceSetTitleFromName( globals );
} }
} }
@ -1153,7 +1169,7 @@ ceDoPrefsDlg( CEAppGlobals* globals )
XP_MEMSET( &state, 0, sizeof(state) ); XP_MEMSET( &state, 0, sizeof(state) );
loadStateFromCurPrefs( &globals->appPrefs, &globals->gameInfo, loadStateFromCurPrefs( globals, &globals->appPrefs, &globals->gameInfo,
&prefsPrefs ); &prefsPrefs );
(void)WrapPrefsDialog( globals->hWnd, globals, &state, &prefsPrefs, (void)WrapPrefsDialog( globals->hWnd, globals, &state, &prefsPrefs,
@ -1161,7 +1177,7 @@ ceDoPrefsDlg( CEAppGlobals* globals )
if ( !state.userCancelled ) { if ( !state.userCancelled ) {
loadCurPrefsFromState( &globals->appPrefs, &globals->gameInfo, loadCurPrefsFromState( globals, &globals->appPrefs, &globals->gameInfo,
&prefsPrefs ); &prefsPrefs );
(void)cePositionBoard( globals ); (void)cePositionBoard( globals );
@ -1928,6 +1944,13 @@ wince_snprintf( XP_UCHAR* buf, XP_U16 len, XP_UCHAR* format, ... )
return strlen(buf); return strlen(buf);
} /* wince_snprintf */ } /* wince_snprintf */
static XP_S16
ce_send_proc( XP_U8* buf, XP_U16 len, CommsAddrRec* addr, void* closure )
{
XP_LOGF( "ce_send_proc called" );
return 0;
} /* ce_send_proc */
/* I can't believe the stupid compiler's making me implement this */ /* I can't believe the stupid compiler's making me implement this */
void p_ignore(XP_UCHAR* c, ...){} void p_ignore(XP_UCHAR* c, ...){}
@ -2314,6 +2337,15 @@ ce_util_warnIllegalWord( XW_UtilCtxt* uc, BadWordInfo* bwi,
return isOk; return isOk;
} /* ce_util_warnIllegalWord */ } /* ce_util_warnIllegalWord */
#ifdef BEYOND_IR
static void
ce_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
const CommsAddrRec* newAddr )
{
XP_LOGF( "ce_util_addrChange called; DO SOMETHING." );
} /* ce_util_addrChange */
#endif
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
static XP_Bool static XP_Bool
ce_util_getTraySearchLimits( XW_UtilCtxt* uc, XP_U16* min, XP_U16* max ) ce_util_getTraySearchLimits( XW_UtilCtxt* uc, XP_U16* min, XP_U16* max )

View file

@ -106,8 +106,8 @@ adjustForChoice( HWND hDlg, CePrefsDlgState* state )
* committing should user cancel. * committing should user cancel.
*/ */
void void
loadStateFromCurPrefs( const CEAppPrefs* appPrefs, const CurGameInfo* gi, loadStateFromCurPrefs( CEAppGlobals* globals, const CEAppPrefs* appPrefs,
CePrefsPrefs* prefsPrefs ) const CurGameInfo* gi, CePrefsPrefs* prefsPrefs )
{ {
prefsPrefs->gp.hintsNotAllowed = gi->hintsNotAllowed; prefsPrefs->gp.hintsNotAllowed = gi->hintsNotAllowed;
prefsPrefs->gp.robotSmartness = gi->robotSmartness; prefsPrefs->gp.robotSmartness = gi->robotSmartness;
@ -125,11 +125,19 @@ loadStateFromCurPrefs( const CEAppPrefs* appPrefs, const CurGameInfo* gi,
XP_MEMCPY( &prefsPrefs->cp, &appPrefs->cp, sizeof(prefsPrefs->cp) ); XP_MEMCPY( &prefsPrefs->cp, &appPrefs->cp, sizeof(prefsPrefs->cp) );
XP_MEMCPY( &prefsPrefs->colors, &appPrefs->colors, XP_MEMCPY( &prefsPrefs->colors, &appPrefs->colors,
sizeof(prefsPrefs->colors) ); sizeof(prefsPrefs->colors) );
#ifndef XWFEATURE_STANDALONE_ONLY
if ( globals->game.comms != NULL ) {
comms_getAddr( globals->game.comms, &prefsPrefs->addrRec );
} else {
comms_getInitialAddr( &prefsPrefs->addrRec );
}
#endif
} /* loadStateFromCurPrefs */ } /* loadStateFromCurPrefs */
void void
loadCurPrefsFromState( CEAppPrefs* appPrefs, CurGameInfo* gi, loadCurPrefsFromState( CEAppGlobals* globals, CEAppPrefs* appPrefs,
const CePrefsPrefs* prefsPrefs ) CurGameInfo* gi, const CePrefsPrefs* prefsPrefs )
{ {
gi->hintsNotAllowed = prefsPrefs->gp.hintsNotAllowed; gi->hintsNotAllowed = prefsPrefs->gp.hintsNotAllowed;
gi->robotSmartness = prefsPrefs->gp.robotSmartness; gi->robotSmartness = prefsPrefs->gp.robotSmartness;
@ -147,6 +155,15 @@ loadCurPrefsFromState( CEAppPrefs* appPrefs, CurGameInfo* gi,
XP_MEMCPY( &appPrefs->cp, &prefsPrefs->cp, sizeof(appPrefs->cp) ); XP_MEMCPY( &appPrefs->cp, &prefsPrefs->cp, sizeof(appPrefs->cp) );
XP_MEMCPY( &appPrefs->colors, &prefsPrefs->colors, XP_MEMCPY( &appPrefs->colors, &prefsPrefs->colors,
sizeof(prefsPrefs->colors) ); sizeof(prefsPrefs->colors) );
#ifndef XWFEATURE_STANDALONE_ONLY
/* I don't think this'll work... */
if ( globals->game.comms != NULL ) {
comms_setAddr( globals->game.comms, &prefsPrefs->addrRec );
} else {
XP_LOGF( "no comms to set addr on!!!" );
}
#endif
} /* loadCurPrefsFromState */ } /* loadCurPrefsFromState */
/* Reflect local state into the controls user will see. /* Reflect local state into the controls user will see.

View file

@ -43,6 +43,10 @@ typedef struct CePrefsPrefs {
/* per-game */ /* per-game */
CeGamePrefs gp; CeGamePrefs gp;
#ifndef XWFEATURE_STANDALONE_ONLY
CommsAddrRec addrRec;
#endif
/* global */ /* global */
CommonPrefs cp; CommonPrefs cp;
XP_Bool showColors; XP_Bool showColors;
@ -63,10 +67,10 @@ typedef struct CePrefsDlgState {
XP_Bool WrapPrefsDialog( HWND hDlg, CEAppGlobals* globals, XP_Bool WrapPrefsDialog( HWND hDlg, CEAppGlobals* globals,
CePrefsDlgState* state, CePrefsPrefs* prefsPrefs, CePrefsDlgState* state, CePrefsPrefs* prefsPrefs,
XP_Bool isNewGame ); XP_Bool isNewGame );
void loadStateFromCurPrefs( const CEAppPrefs* appPrefs, const CurGameInfo* gi, void loadStateFromCurPrefs( CEAppGlobals* globals, const CEAppPrefs* appPrefs,
CePrefsPrefs* prefsPrefs ); const CurGameInfo* gi, CePrefsPrefs* prefsPrefs );
void loadCurPrefsFromState( CEAppPrefs* appPrefs, CurGameInfo* gi, void loadCurPrefsFromState( CEAppGlobals* globals, CEAppPrefs* appPrefs,
const CePrefsPrefs* prefsPrefs ); CurGameInfo* gi, const CePrefsPrefs* prefsPrefs );
LRESULT CALLBACK PrefsDlg(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK PrefsDlg(HWND, UINT, WPARAM, LPARAM);

View file

@ -3,7 +3,6 @@
// Used by xwords4.rc // Used by xwords4.rc
// //
#define IDS_APP_TITLE 1 #define IDS_APP_TITLE 1
#define IDS_HELLO 2
#define IDC_XWORDS4 3 #define IDC_XWORDS4 3
#define IDI_XWORDS4 101 #define IDI_XWORDS4 101
#define IDM_MENU 102 #define IDM_MENU 102
@ -26,6 +25,9 @@
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
# define IDD_ASKHINTLIMTS 125 # define IDD_ASKHINTLIMTS 125
#endif #endif
#ifndef XWFEATURE_STANDALONE_ONLY
# define IDD_CONNSSDLG 126
#endif
#define FLIP_BUTTON_ID 1001 #define FLIP_BUTTON_ID 1001
#define VALUE_BUTTON_ID 1002 #define VALUE_BUTTON_ID 1002
@ -78,59 +80,75 @@
#define IDC_PREFCOLORS 1044 #define IDC_PREFCOLORS 1044
#define PHONIES_LABEL 1045 #define PHONIES_LABEL 1045
#define IDC_ROLECOMBO 1046 #define IDC_ROLECOMBO 1046
#define IDC_LOCALP_LABEL 1047 #define IDC_CONNBUTTON 1047
#define IDC_TOTAL_LABEL 1048 #define IDC_LOCALP_LABEL 1048
#define IDC_REMOTE_LABEL 1049 #define IDC_TOTAL_LABEL 1049
#define IDC_PICKTILES 1050 #define IDC_REMOTE_LABEL 1050
#define IDC_BPICK 1051 #define IDC_PICKTILES 1051
#define IDC_PICKMSG 1052 #define IDC_BPICK 1052
#define IDC_PICKMSG 1053
#ifdef FEATURE_TRAY_EDIT #ifdef FEATURE_TRAY_EDIT
# define IDC_CPICK 1053 # define IDC_CPICK 1054
# define IDC_PICKALL 1054 # define IDC_PICKALL 1055
# define IDC_BACKUP 1055 # define IDC_BACKUP 1056
#endif #endif
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
# define IDC_CHECKHINTSLIMITS 1056 # define IDC_CHECKHINTSLIMITS 1057
#endif #endif
#define DLBLTR_BUTTON 1056 #define DLBLTR_BUTTON 1058
#define DBLWRD_BUTTON 1057 #define DBLWRD_BUTTON 1059
#define TPLLTR_BUTTON 1058 #define TPLLTR_BUTTON 1060
#define TPLWRD_BUTTON 1059 #define TPLWRD_BUTTON 1061
#define EMPCELL_BUTTON 1060 #define EMPCELL_BUTTON 1062
#define TBACK_BUTTON 1061 #define TBACK_BUTTON 1063
#define PLAYER1_BUTTON 1062 #define PLAYER1_BUTTON 1064
#define PLAYER2_BUTTON 1063 #define PLAYER2_BUTTON 1065
#define PLAYER3_BUTTON 1064 #define PLAYER3_BUTTON 1066
#define PLAYER4_BUTTON 1065 #define PLAYER4_BUTTON 1067
#define PLAYER1_LABEL 1066 #define PLAYER1_LABEL 1068
#define PLAYER2_LABEL 1067 #define PLAYER2_LABEL 1069
#define PLAYER3_LABEL 1068 #define PLAYER3_LABEL 1070
#define PLAYER4_LABEL 1069 #define PLAYER4_LABEL 1071
#define DLBLTR_LABEL 1070 #define DLBLTR_LABEL 1072
#define DBLWRD_LABEL 1071 #define DBLWRD_LABEL 1073
#define TPLLTR_LABEL 1072 #define TPLLTR_LABEL 1074
#define TPLWRD_LABEL 1073 #define TPLWRD_LABEL 1075
#define EMPTYCELL_LABEL 1074 #define EMPTYCELL_LABEL 1076
#define TILEBACK_LABEL 1075 #define TILEBACK_LABEL 1077
/* editor dlg: assumption is that the edit field's ID is one more /* editor dlg: assumption is that the edit field's ID is one more
than the corresponding slider's */ than the corresponding slider's */
#ifdef MY_COLOR_SEL #ifdef MY_COLOR_SEL
# define CLREDT_SLIDER1 1076 # define CLREDT_SLIDER1 1078
# define RED_EDIT 1077 # define RED_EDIT 1079
# define CLREDT_SLIDER2 1078 # define CLREDT_SLIDER2 1080
# define GREEN_EDIT 1079 # define GREEN_EDIT 1081
# define CLREDT_SLIDER3 1080 # define CLREDT_SLIDER3 1082
# define BLUE_EDIT 1081 # define BLUE_EDIT 1083
# define RED_LABEL 1082 # define RED_LABEL 1084
# define GREEN_LABEL 1083 # define GREEN_LABEL 1085
# define BLUE_LABEL 1084 # define BLUE_LABEL 1086
#endif // MY_COLOR_SEL #endif // MY_COLOR_SEL
#define HC_MIN_COMBO 1085 #define HC_MIN_COMBO 1087
#define HC_MAX_COMBO 1086 #define HC_MAX_COMBO 1088
#define IDC_CCONVIA_LAB 1089
#define IDC_CRELAYNAME_LAB 1090
#define IDC_CRELAYPORT_LAB 1091
#define IDC_COOKIE_LAB 1092
#ifndef XWFEATURE_STANDALONE_ONLY
# define IDC_CONNECTCOMBO 1093
# define RELAYNAME_EDIT 1094
# define RELAYPORT_EDIT 1095
# define COOKIE_EDIT 1096
#endif
#define IDM_FILE_EXIT 40002 #define IDM_FILE_EXIT 40002
#define IDM_HELP_ABOUT 40003 #define IDM_HELP_ABOUT 40003

View file

@ -14,6 +14,7 @@ PLATOBJ = \
$(PLATFORM)/cedict.o \ $(PLATFORM)/cedict.o \
$(PLATFORM)/cedraw.o \ $(PLATFORM)/cedraw.o \
$(PLATFORM)/ceginfo.o \ $(PLATFORM)/ceginfo.o \
$(PLATFORM)/cecondlg.o \
$(PLATFORM)/cemain.o \ $(PLATFORM)/cemain.o \
$(PLATFORM)/ceprefs.o \ $(PLATFORM)/ceprefs.o \
$(PLATFORM)/cestrbx.o \ $(PLATFORM)/cestrbx.o \

View file

@ -111,6 +111,8 @@ XP_U16 wince_snprintf( XP_UCHAR* buf, XP_U16 len, XP_UCHAR* format, ... );
#define XP_HTONL(l) htonl(l) #define XP_HTONL(l) htonl(l)
#define XP_HTONS(s) htons(s) #define XP_HTONS(s) htons(s)
#define XP_LD "%ld"
#ifdef CPLUS #ifdef CPLUS
} }
#endif #endif

View file

@ -164,15 +164,15 @@ END
# define GAME_ROBOT_LEFT 81 # define GAME_ROBOT_LEFT 81
# define GAME_PWD_LEFT 105 # define GAME_PWD_LEFT 105
# define NPLAYERS_ROW 3 # define NPLAYERS_ROW 3
# define GAME_NAMELABEL_LEFT GAME_NAME_LEFT # define GAME_NAMELABEL_LEFT GAME_NAME_LEFT+10
#else #else
# define SERVERROLE_ROW 3 # define SERVERROLE_ROW 3
# define NPLAYERS_ROW (SERVERROLE_ROW+ROW_SPACE+3) # define NPLAYERS_ROW (SERVERROLE_ROW+ROW_SPACE+3)
# define GAME_REMOTE_LEFT 0 # define GAME_REMOTE_LEFT 2
# define GAME_NAME_LEFT 20 # define GAME_NAME_LEFT 15
# define GAME_ROBOT_LEFT 92 # define GAME_ROBOT_LEFT 92
# define GAME_PWD_LEFT 110 # define GAME_PWD_LEFT 110
# define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT + 10) # define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT + 20)
#endif #endif
@ -186,6 +186,8 @@ END
#define BUTTON_HT 12 #define BUTTON_HT 12
#define GAMEINFO_HEIGHT (BUTTONS_ROW + BUTTON_HT + 4) #define GAMEINFO_HEIGHT (BUTTONS_ROW + BUTTON_HT + 4)
#define CHECK_WIDTH 10
IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, 133, GAMEINFO_HEIGHT IDD_GAMEINFO DIALOG DISCARDABLE 0, 0, 133, GAMEINFO_HEIGHT
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER
CAPTION "Game info" CAPTION "Game info"
@ -195,6 +197,9 @@ BEGIN
LTEXT "Role:",IDC_STATIC,25,SERVERROLE_ROW,20,8 LTEXT "Role:",IDC_STATIC,25,SERVERROLE_ROW,20,8
COMBOBOX IDC_ROLECOMBO,45,SERVERROLE_ROW,50,58,CBS_DROPDOWNLIST | COMBOBOX IDC_ROLECOMBO,45,SERVERROLE_ROW,50,58,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Conn...",IDC_CONNBUTTON,45+50+2,SERVERROLE_ROW,
35, ROW_SPACE
#endif #endif
LTEXT "local players",IDC_LOCALP_LABEL,LEFT_COL,NPLAYERS_ROW,40,8 LTEXT "local players",IDC_LOCALP_LABEL,LEFT_COL,NPLAYERS_ROW,40,8
/* capitalizing total truncates the things!!! */ /* capitalizing total truncates the things!!! */
@ -205,26 +210,26 @@ BEGIN
LTEXT "Remote",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX LTEXT "Remote",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX
LTEXT "Name",IDC_STATIC,GAME_NAMELABEL_LEFT, LTEXT "Name",IDC_STATIC,GAME_NAMELABEL_LEFT,
LABELS_ROW,19,8,SS_NOPREFIX LABELS_ROW,19,8,SS_NOPREFIX
LTEXT "Robot",IDC_STATIC,77,LABELS_ROW,20,8 LTEXT "Robot",IDC_STATIC,87,LABELS_ROW,20,8
LTEXT "Pwd",IDC_STATIC,109,LABELS_ROW,16,8 LTEXT "Pwd",IDC_STATIC,112,LABELS_ROW,16,8
#ifndef XWFEATURE_STANDALONE_ONLY #ifndef XWFEATURE_STANDALONE_ONLY
CONTROL "",REMOTE_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",REMOTE_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_REMOTE_LEFT, PLAYER_ROW_1,16,ROW_HEIGHT GAME_REMOTE_LEFT, PLAYER_ROW_1,CHECK_WIDTH,ROW_HEIGHT
CONTROL "",REMOTE_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",REMOTE_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_REMOTE_LEFT, PLAYER_ROW_2,16,ROW_HEIGHT GAME_REMOTE_LEFT, PLAYER_ROW_2,CHECK_WIDTH,ROW_HEIGHT
CONTROL "",REMOTE_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",REMOTE_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_REMOTE_LEFT, PLAYER_ROW_3,16,ROW_HEIGHT GAME_REMOTE_LEFT, PLAYER_ROW_3,CHECK_WIDTH,ROW_HEIGHT
CONTROL "",REMOTE_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",REMOTE_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_REMOTE_LEFT, PLAYER_ROW_4,16,ROW_HEIGHT GAME_REMOTE_LEFT, PLAYER_ROW_4,CHECK_WIDTH,ROW_HEIGHT
#endif #endif
CONTROL "",ROBOT_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",ROBOT_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_ROBOT_LEFT,PLAYER_ROW_1,16,ROW_HEIGHT GAME_ROBOT_LEFT,PLAYER_ROW_1,CHECK_WIDTH,ROW_HEIGHT
CONTROL "",ROBOT_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",ROBOT_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_ROBOT_LEFT,PLAYER_ROW_2,16,ROW_HEIGHT GAME_ROBOT_LEFT,PLAYER_ROW_2,CHECK_WIDTH,ROW_HEIGHT
CONTROL "",ROBOT_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",ROBOT_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_ROBOT_LEFT,PLAYER_ROW_3,16,ROW_HEIGHT GAME_ROBOT_LEFT,PLAYER_ROW_3,CHECK_WIDTH,ROW_HEIGHT
CONTROL "",ROBOT_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, CONTROL "",ROBOT_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
GAME_ROBOT_LEFT, PLAYER_ROW_4,16,ROW_HEIGHT 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,70,ROW_HEIGHT,
ES_AUTOHSCROLL ES_AUTOHSCROLL
@ -235,13 +240,13 @@ BEGIN
EDITTEXT NAME_EDIT4,GAME_NAME_LEFT,PLAYER_ROW_4,70,ROW_HEIGHT, EDITTEXT NAME_EDIT4,GAME_NAME_LEFT,PLAYER_ROW_4,70,ROW_HEIGHT,
ES_AUTOHSCROLL | NOT WS_VISIBLE ES_AUTOHSCROLL | NOT WS_VISIBLE
EDITTEXT PASS_EDIT1,GAME_PWD_LEFT,PLAYER_ROW_1,23,ROW_HEIGHT, EDITTEXT PASS_EDIT1,GAME_PWD_LEFT,PLAYER_ROW_1,20,ROW_HEIGHT,
ES_PASSWORD | ES_AUTOHSCROLL ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT PASS_EDIT2,GAME_PWD_LEFT,PLAYER_ROW_2,23,ROW_HEIGHT, EDITTEXT PASS_EDIT2,GAME_PWD_LEFT,PLAYER_ROW_2,20,ROW_HEIGHT,
ES_PASSWORD | ES_AUTOHSCROLL ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT PASS_EDIT3,GAME_PWD_LEFT,PLAYER_ROW_3,23,ROW_HEIGHT, EDITTEXT PASS_EDIT3,GAME_PWD_LEFT,PLAYER_ROW_3,20,ROW_HEIGHT,
ES_PASSWORD | ES_AUTOHSCROLL ES_PASSWORD | ES_AUTOHSCROLL
EDITTEXT PASS_EDIT4,GAME_PWD_LEFT,PLAYER_ROW_4,23,ROW_HEIGHT, EDITTEXT PASS_EDIT4,GAME_PWD_LEFT,PLAYER_ROW_4,20,ROW_HEIGHT,
ES_PASSWORD | ES_AUTOHSCROLL ES_PASSWORD | ES_AUTOHSCROLL
LTEXT "Dictionary:",IDC_STATIC,LEFT_COL,DICTPICK_ROW,36,8,SS_NOPREFIX LTEXT "Dictionary:",IDC_STATIC,LEFT_COL,DICTPICK_ROW,36,8,SS_NOPREFIX
@ -358,6 +363,44 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,70,98,39,14 PUSHBUTTON "Cancel",IDCANCEL,70,98,39,14
END END
#ifndef XWFEATURE_STANDALONE_ONLY
# define LAB_COL 8
# define LAB_COL_WIDTH 40
# define CTRL_COL 50
# define CTRL_COL_WIDTH 60
# define CONN_ROW_1 10
# define CONN_ROW_2 25
# define CONN_ROW_3 40
# define CONN_ROW_4 55
/* #This is a comment???? */
IDD_CONNSSDLG DIALOG DISCARDABLE 0, 20, 120, 115
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | DS_CENTER
CAPTION "Connection"
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
LTEXT "Relay name",IDC_CRELAYNAME_LAB,LAB_COL,CONN_ROW_2,40,12
EDITTEXT RELAYNAME_EDIT,CTRL_COL,CONN_ROW_2,CTRL_COL_WIDTH,12,
ES_AUTOHSCROLL
LTEXT "Relay port",IDC_CRELAYPORT_LAB,LAB_COL,CONN_ROW_3,40,12
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_3,CTRL_COL_WIDTH,12,
ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Cookie",IDC_COOKIE_LAB,LAB_COL,CONN_ROW_4,40,12
EDITTEXT COOKIE_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,12,
ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,9,98,38,14
PUSHBUTTON "Cancel",IDCANCEL,70,98,39,14
END
#endif
#define CLR_LAB_WIDTH 40 #define CLR_LAB_WIDTH 40
#define CLR_LAB_HT 14 #define CLR_LAB_HT 14
#define CLR_BUT_WIDTH 12 #define CLR_BUT_WIDTH 12