mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-11-16 07:48:07 +01:00
Catch up with changes including three enabled states for control and
setting dialog strings. Align titles with columns for standalone version.
This commit is contained in:
parent
0460136a90
commit
1af17b7672
5 changed files with 58 additions and 15 deletions
|
@ -51,6 +51,11 @@ enum {
|
|||
STRD_TRADED,
|
||||
STR_LOSTTURN,
|
||||
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
STR_LOCALPLAYERS,
|
||||
#endif
|
||||
STR_TOTALPLAYERS,
|
||||
|
||||
STRS_VALUES_HEADER,
|
||||
|
||||
STR_NOT_USED
|
||||
|
|
|
@ -308,27 +308,48 @@ resIDForAttr( NewGameAttr attr )
|
|||
case NG_ATTR_NPLAYERS:
|
||||
resID = IDC_NPLAYERSCOMBO;
|
||||
break;
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
case NG_ATTR_ROLE:
|
||||
resID = IDC_ROLECOMBO;
|
||||
break;
|
||||
case NG_ATTR_REMHEADER:
|
||||
resID = IDC_REMOTE_LABEL;
|
||||
break;
|
||||
#endif
|
||||
case NG_ATTR_NPLAYHEADER:
|
||||
resID = IDC_TOTAL_LABEL;
|
||||
break;
|
||||
default:
|
||||
XP_ASSERT(0);
|
||||
}
|
||||
return resID;
|
||||
} /* resIDForAttr */
|
||||
|
||||
static void
|
||||
doForNWEnable( HWND hDlg, XP_U16 resID, NewGameEnable enable )
|
||||
{
|
||||
XP_Bool makeVisible = enable != NGEnableHidden;
|
||||
ceShowOrHide( hDlg, resID, makeVisible );
|
||||
if ( makeVisible ) {
|
||||
ceEnOrDisable( hDlg, resID, enable == NGEnableEnabled );
|
||||
}
|
||||
} /* doForNWEnable */
|
||||
|
||||
static void
|
||||
ceEnableColProc( void* closure, XP_U16 player, NewGameColumn col,
|
||||
XP_Bool enable )
|
||||
NewGameEnable enable )
|
||||
{
|
||||
GameInfoState* giState = (GameInfoState*)closure;
|
||||
ceShowOrHide( giState->hDlg, resIDForCol( player, col ), enable );
|
||||
XP_U16 resID = resIDForCol( player, col );
|
||||
doForNWEnable( giState->hDlg, resID, enable );
|
||||
}
|
||||
|
||||
static void
|
||||
ceEnableAttrProc( void* closure, NewGameAttr attr, XP_Bool enable )
|
||||
ceEnableAttrProc( void* closure, NewGameAttr attr, NewGameEnable enable )
|
||||
{
|
||||
GameInfoState* giState = (GameInfoState*)closure;
|
||||
XP_U16 resID = resIDForAttr( attr );
|
||||
ceEnOrDisable( giState->hDlg, resID, enable );
|
||||
doForNWEnable( giState->hDlg, resID, enable );
|
||||
} /* ceEnableAttrProc */
|
||||
|
||||
static void
|
||||
|
@ -402,9 +423,16 @@ ceSetAttrProc(void* closure, NewGameAttr attr, const NGValue value )
|
|||
switch ( attr ) {
|
||||
case NG_ATTR_NPLAYERS:
|
||||
--val; /* adjust: it's 1-based */
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
case NG_ATTR_ROLE:
|
||||
#endif
|
||||
SendDlgItemMessage( giState->hDlg, resID, CB_SETCURSEL, val, 0L );
|
||||
break;
|
||||
case NG_ATTR_NPLAYHEADER:
|
||||
ceSetDlgItemText( giState->hDlg, resID, value.ng_cp );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} /* ceSetAttrProc */
|
||||
|
||||
|
@ -444,6 +472,7 @@ GameInfo(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
giState->newGameCtx = newg_make( MPPARM(globals->mpool)
|
||||
giState->isNewGame,
|
||||
&globals->util,
|
||||
ceEnableColProc,
|
||||
ceEnableAttrProc,
|
||||
ceGetColProc,
|
||||
|
|
|
@ -2432,6 +2432,7 @@ ce_util_userError( XW_UtilCtxt* uc, UtilErrID id )
|
|||
#endif
|
||||
|
||||
default:
|
||||
XP_LOGF( "%s(%d)", __FUNCTION__, id );
|
||||
message = "unknown errorcode ID!!!";
|
||||
break;
|
||||
}
|
||||
|
@ -2729,6 +2730,13 @@ ce_util_getUserString( XW_UtilCtxt* uc, XP_U16 stringCode )
|
|||
case STR_LOSTTURN:
|
||||
return (XP_UCHAR*)"Lost turn";
|
||||
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
case STR_LOCALPLAYERS:
|
||||
return (XP_UCHAR*)"Local playrs";
|
||||
#endif
|
||||
case STR_TOTALPLAYERS:
|
||||
return (XP_UCHAR*)"Player count";
|
||||
|
||||
case STRS_VALUES_HEADER:
|
||||
return (XP_UCHAR*)"%s counts/values:" XP_CR;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
#define IDC_PREFCOLORS 1044
|
||||
#define PHONIES_LABEL 1045
|
||||
#define IDC_ROLECOMBO 1046
|
||||
#define IDC_LOCALP_LABEL 1048
|
||||
#define GIJUGGLE_BUTTON 1048
|
||||
#define IDC_TOTAL_LABEL 1049
|
||||
#define IDC_REMOTE_LABEL 1050
|
||||
#define IDC_PICKTILES 1051
|
||||
|
@ -147,7 +147,6 @@
|
|||
# define COOKIE_EDIT 1097
|
||||
#endif
|
||||
|
||||
#define GIJUGGLE_BUTTON 1098
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -172,7 +172,9 @@ END
|
|||
# define GAME_ROBOT_LEFT 81
|
||||
# define GAME_PWD_LEFT 105
|
||||
# define NPLAYERS_ROW 3
|
||||
# define GAME_NAMELABEL_LEFT GAME_NAME_LEFT+10
|
||||
# define GAME_NAMELABEL_LEFT GAME_NAME_LEFT
|
||||
# define GAME_ROBOTLABEL_LEFT GAME_ROBOT_LEFT
|
||||
# define GAME_PWDLABEL_LEFT GAME_PWD_LEFT
|
||||
#else
|
||||
# define SERVERROLE_ROW 3
|
||||
# define NPLAYERS_ROW (SERVERROLE_ROW+ROW_SPACE+3)
|
||||
|
@ -181,6 +183,8 @@ END
|
|||
# define GAME_ROBOT_LEFT 92
|
||||
# define GAME_PWD_LEFT 110
|
||||
# define GAME_NAMELABEL_LEFT (GAME_NAME_LEFT + 20)
|
||||
# define GAME_ROBOTLABEL_LEFT 87
|
||||
# define GAME_PWDLABEL_LEFT 112
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -207,21 +211,19 @@ BEGIN
|
|||
WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
#endif
|
||||
LTEXT "local players",IDC_LOCALP_LABEL,LEFT_COL,NPLAYERS_ROW,40,8
|
||||
/* capitalizing total truncates the things!!! */
|
||||
LTEXT "total players",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,40,8
|
||||
LTEXT "",IDC_TOTAL_LABEL,LEFT_COL,NPLAYERS_ROW,40,8
|
||||
COMBOBOX IDC_NPLAYERSCOMBO,45,NPLAYERS_ROW,18,58,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
PUSHBUTTON "J",GIJUGGLE_BUTTON,65,NPLAYERS_ROW,12,12
|
||||
|
||||
PUSHBUTTON "Preferences...",OPTIONS_BUTTON,79,NPLAYERS_ROW,51,12
|
||||
LTEXT "Remote",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX
|
||||
LTEXT "Name",IDC_STATIC,GAME_NAMELABEL_LEFT,
|
||||
LABELS_ROW,19,8,SS_NOPREFIX
|
||||
LTEXT "Robot",IDC_STATIC,87,LABELS_ROW,20,8
|
||||
LTEXT "Pwd",IDC_STATIC,112,LABELS_ROW,16,8
|
||||
LTEXT "Robot",IDC_STATIC,GAME_ROBOTLABEL_LEFT,LABELS_ROW,20,8
|
||||
LTEXT "Pwd",IDC_STATIC,GAME_PWDLABEL_LEFT,LABELS_ROW,16,8
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
LTEXT "Remote",IDC_REMOTE_LABEL,LEFT_COL,LABELS_ROW,25,8,SS_NOPREFIX
|
||||
CONTROL "",REMOTE_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
GAME_REMOTE_LEFT, PLAYER_ROW_1,CHECK_WIDTH,ROW_HEIGHT
|
||||
CONTROL "",REMOTE_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
|
||||
|
@ -428,8 +430,8 @@ BEGIN
|
|||
EDITTEXT RELAYPORT_EDIT,CTRL_COL,CONN_ROW_4,CTRL_COL_WIDTH,12,
|
||||
ES_AUTOHSCROLL | ES_NUMBER
|
||||
|
||||
DEFPUSHBUTTON "OK",IDOK,9,BUTTON_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT
|
||||
PUSHBUTTON "Cancel",IDCANCEL,70,BUTTON_ROW,
|
||||
PUSHBUTTON "OK",IDOK,9,BUTTON_ROW,REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT
|
||||
DEFPUSHBUTTON "Cancel",IDCANCEL,70,BUTTON_ROW,
|
||||
REPOS_BUTTON_WIDTH,REPOS_BUTTON_HT
|
||||
END
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue