mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
add checkbox for hint rect
This commit is contained in:
parent
59ac0e42ef
commit
004ec05a64
4 changed files with 55 additions and 10 deletions
|
@ -314,13 +314,18 @@ END /* XW_CONNS_FORM */
|
||||||
#else
|
#else
|
||||||
# define TRAY_EDIT_ADJUST 0
|
# define TRAY_EDIT_ADJUST 0
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
# define SEARCHLIMIT_ADJUST 15
|
||||||
|
#else
|
||||||
|
# define SEARCHLIMIT_ADJUST 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#define PREFS_MODE_TOP 15
|
#define PREFS_MODE_TOP 15
|
||||||
#define PREFS_TOP 30
|
#define PREFS_TOP 30
|
||||||
#define DLG_TOP 52-TRAY_EDIT_ADJUST
|
#define DLG_TOP (52-TRAY_EDIT_ADJUST-SEARCHLIMIT_ADJUST)
|
||||||
#define DLG_HEIGHT 107+TRAY_EDIT_ADJUST
|
#define DLG_HEIGHT (107+TRAY_EDIT_ADJUST+SEARCHLIMIT_ADJUST)
|
||||||
#define TIMER_TOP 74
|
#define TIMER_TOP (74+SEARCHLIMIT_ADJUST)
|
||||||
#define BUTTON_TOP TIMER_TOP+16+TRAY_EDIT_ADJUST
|
#define BUTTON_TOP (TIMER_TOP+16+TRAY_EDIT_ADJUST)
|
||||||
|
|
||||||
FORM ID XW_PREFS_FORM AT (2 DLG_TOP 156 DLG_HEIGHT)
|
FORM ID XW_PREFS_FORM AT (2 DLG_TOP 156 DLG_HEIGHT)
|
||||||
USABLE MODAL SAVEBEHIND DEFAULTBTNID XW_PREFS_CANCEL_BUTTON_ID
|
USABLE MODAL SAVEBEHIND DEFAULTBTNID XW_PREFS_CANCEL_BUTTON_ID
|
||||||
|
@ -338,23 +343,31 @@ BEGIN
|
||||||
CHECKBOX "Color played tiles" ID XW_PREFS_PLAYERCOLORS_CHECKBOX_ID \
|
CHECKBOX "Color played tiles" ID XW_PREFS_PLAYERCOLORS_CHECKBOX_ID \
|
||||||
AT (LEFTCOL PREFS_TOP AUTO AUTO) NONUSABLE
|
AT (LEFTCOL PREFS_TOP AUTO AUTO) NONUSABLE
|
||||||
CHECKBOX "Show progress bar" ID XW_PREFS_PROGRESSBAR_CHECKBOX_ID \
|
CHECKBOX "Show progress bar" ID XW_PREFS_PROGRESSBAR_CHECKBOX_ID \
|
||||||
AT (LEFTCOL PREVBOTTOM AUTO AUTO) NONUSABLE
|
AT (LEFTCOL PREVBOTTOM+3 AUTO AUTO) NONUSABLE
|
||||||
CHECKBOX "Larger board" ID XW_PREFS_SHOWGRID_CHECKBOX_ID \
|
CHECKBOX "Larger board" ID XW_PREFS_SHOWGRID_CHECKBOX_ID \
|
||||||
AT (LEFTCOL PREVBOTTOM AUTO AUTO) NONUSABLE
|
AT (LEFTCOL PREVBOTTOM+3 AUTO AUTO) NONUSABLE
|
||||||
CHECKBOX "Enable arrow cursor" ID XW_PREFS_SHOWARROW_CHECKBOX_ID \
|
CHECKBOX "Enable arrow cursor" ID XW_PREFS_SHOWARROW_CHECKBOX_ID \
|
||||||
AT (LEFTCOL PREVBOTTOM AUTO AUTO) NONUSABLE
|
AT (LEFTCOL PREVBOTTOM+3 AUTO AUTO) NONUSABLE
|
||||||
CHECKBOX "Show robot scores" ID XW_PREFS_ROBOTSCORE_CHECKBOX_ID \
|
CHECKBOX "Show robot scores" ID XW_PREFS_ROBOTSCORE_CHECKBOX_ID \
|
||||||
AT (LEFTCOL PREVBOTTOM AUTO AUTO) NONUSABLE
|
AT (LEFTCOL PREVBOTTOM+3 AUTO AUTO) NONUSABLE
|
||||||
|
|
||||||
/* single-game prefs */
|
/* single-game prefs */
|
||||||
CHECKBOX "Smart robot" ID XW_PREFS_ROBOTSMART_CHECKBOX_ID \
|
CHECKBOX "Smart robot" ID XW_PREFS_ROBOTSMART_CHECKBOX_ID \
|
||||||
AT (LEFTCOL PREFS_TOP AUTO AUTO) NONUSABLE
|
AT (LEFTCOL PREFS_TOP AUTO AUTO) NONUSABLE
|
||||||
|
#ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
CHECKBOX "Disallow hints" ID XW_PREFS_NOHINTS_CHECKBOX_ID \
|
||||||
|
AT (LEFTCOL PREVBOTTOM+3 AUTO AUTO) NONUSABLE
|
||||||
|
CHECKBOX "Local hints" ID XW_PREFS_HINTRECT_CHECKBOX_ID \
|
||||||
|
AT (PREVRIGHT+3 PREVTOP AUTO AUTO) NONUSABLE
|
||||||
|
#else
|
||||||
CHECKBOX "Disallow hints" ID XW_PREFS_NOHINTS_CHECKBOX_ID \
|
CHECKBOX "Disallow hints" ID XW_PREFS_NOHINTS_CHECKBOX_ID \
|
||||||
AT (PREVRIGHT+3 PREVTOP AUTO AUTO) NONUSABLE
|
AT (PREVRIGHT+3 PREVTOP AUTO AUTO) NONUSABLE
|
||||||
|
#endif
|
||||||
|
|
||||||
LABEL "Phonies:" XW_PREFS_PHONIES_LABEL_ID AT (LEFTCOL PREVBOTTOM+3)
|
LABEL "Phonies:" XW_PREFS_PHONIES_LABEL_ID AT (LEFTCOL PREVBOTTOM+3)
|
||||||
POPUPTRIGGER "" ID XW_PREFS_PHONIES_TRIGGER_ID
|
POPUPTRIGGER "" ID XW_PREFS_PHONIES_TRIGGER_ID
|
||||||
AT (PREVRIGHT+5 PREVTOP 72 12) LEFTANCHOR
|
AT (PREVRIGHT+5 PREVTOP 72 12) LEFTANCHOR
|
||||||
|
|
||||||
LABEL "Board size: " XW_PREFS_BDSIZE_LABEL_ID
|
LABEL "Board size: " XW_PREFS_BDSIZE_LABEL_ID
|
||||||
AT (LEFTCOL PREVBOTTOM+2)
|
AT (LEFTCOL PREVBOTTOM+2)
|
||||||
SELECTORTRIGGER "" XW_PREFS_BDSIZE_SELECTOR_ID \
|
SELECTORTRIGGER "" XW_PREFS_BDSIZE_SELECTOR_ID \
|
||||||
|
|
|
@ -171,6 +171,9 @@ typedef struct PrefsDlgState {
|
||||||
#ifdef FEATURE_TRAY_EDIT
|
#ifdef FEATURE_TRAY_EDIT
|
||||||
XP_Bool allowPickTiles;
|
XP_Bool allowPickTiles;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
XP_Bool allowHintRect;
|
||||||
|
#endif
|
||||||
} PrefsDlgState;
|
} PrefsDlgState;
|
||||||
|
|
||||||
typedef struct DictState {
|
typedef struct DictState {
|
||||||
|
|
|
@ -43,6 +43,7 @@ PrefsFormHandleEvent( EventPtr event )
|
||||||
FormPtr form;
|
FormPtr form;
|
||||||
EventType eventToPost;
|
EventType eventToPost;
|
||||||
Int16 chosen;
|
Int16 chosen;
|
||||||
|
Boolean checked;
|
||||||
|
|
||||||
CALLBACK_PROLOGUE();
|
CALLBACK_PROLOGUE();
|
||||||
globals = getFormRefcon();
|
globals = getFormRefcon();
|
||||||
|
@ -96,6 +97,12 @@ PrefsFormHandleEvent( EventPtr event )
|
||||||
result = true;
|
result = true;
|
||||||
switch ( event->data.ctlSelect.controlID ) {
|
switch ( event->data.ctlSelect.controlID ) {
|
||||||
|
|
||||||
|
case XW_PREFS_NOHINTS_CHECKBOX_ID:
|
||||||
|
checked = getBooleanCtrl( XW_PREFS_NOHINTS_CHECKBOX_ID );
|
||||||
|
disOrEnable( FrmGetActiveForm(), XW_PREFS_HINTRECT_CHECKBOX_ID,
|
||||||
|
!checked );
|
||||||
|
break;
|
||||||
|
|
||||||
case XW_PREFS_PHONIES_TRIGGER_ID:
|
case XW_PREFS_PHONIES_TRIGGER_ID:
|
||||||
chosen = LstPopupList( state->phoniesList );
|
chosen = LstPopupList( state->phoniesList );
|
||||||
if ( chosen >= 0 ) {
|
if ( chosen >= 0 ) {
|
||||||
|
@ -191,6 +198,9 @@ GlobalPrefsToLocal( PalmAppGlobals* globals )
|
||||||
|
|
||||||
state->phoniesAction = globals->util.gameInfo->phoniesAction;
|
state->phoniesAction = globals->util.gameInfo->phoniesAction;
|
||||||
state->hintsNotAllowed = globals->gameInfo.hintsNotAllowed;
|
state->hintsNotAllowed = globals->gameInfo.hintsNotAllowed;
|
||||||
|
#ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
state->allowHintRect = globals->gameInfo.allowHintRect;
|
||||||
|
#endif
|
||||||
state->timerEnabled = globals->util.gameInfo->timerEnabled;
|
state->timerEnabled = globals->util.gameInfo->timerEnabled;
|
||||||
state->gameSeconds = globals->util.gameInfo->gameSeconds;
|
state->gameSeconds = globals->util.gameInfo->gameSeconds;
|
||||||
#ifdef FEATURE_TRAY_EDIT
|
#ifdef FEATURE_TRAY_EDIT
|
||||||
|
@ -223,7 +233,9 @@ LocalPrefsToGlobal( PalmAppGlobals* globals )
|
||||||
globals->util.gameInfo->phoniesAction = state->phoniesAction;
|
globals->util.gameInfo->phoniesAction = state->phoniesAction;
|
||||||
|
|
||||||
globals->gameInfo.hintsNotAllowed = state->hintsNotAllowed;
|
globals->gameInfo.hintsNotAllowed = state->hintsNotAllowed;
|
||||||
|
#ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
globals->gameInfo.allowHintRect = state->allowHintRect;
|
||||||
|
#endif
|
||||||
globals->util.gameInfo->timerEnabled = state->timerEnabled;
|
globals->util.gameInfo->timerEnabled = state->timerEnabled;
|
||||||
globals->util.gameInfo->gameSeconds = state->gameSeconds;
|
globals->util.gameInfo->gameSeconds = state->gameSeconds;
|
||||||
|
|
||||||
|
@ -258,6 +270,9 @@ localPrefsToControls( PalmAppGlobals* globals, PrefsDlgState* state )
|
||||||
setBooleanCtrl( XW_PREFS_PLAYERCOLORS_CHECKBOX_ID, state->showColors );
|
setBooleanCtrl( XW_PREFS_PLAYERCOLORS_CHECKBOX_ID, state->showColors );
|
||||||
setBooleanCtrl( XW_PREFS_PROGRESSBAR_CHECKBOX_ID, state->showProgress );
|
setBooleanCtrl( XW_PREFS_PROGRESSBAR_CHECKBOX_ID, state->showProgress );
|
||||||
setBooleanCtrl( XW_PREFS_NOHINTS_CHECKBOX_ID, state->hintsNotAllowed );
|
setBooleanCtrl( XW_PREFS_NOHINTS_CHECKBOX_ID, state->hintsNotAllowed );
|
||||||
|
#ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
setBooleanCtrl( XW_PREFS_HINTRECT_CHECKBOX_ID, state->allowHintRect );
|
||||||
|
#endif
|
||||||
setBooleanCtrl( XW_PREFS_ROBOTSMART_CHECKBOX_ID, state->smartRobot );
|
setBooleanCtrl( XW_PREFS_ROBOTSMART_CHECKBOX_ID, state->smartRobot );
|
||||||
setBooleanCtrl( XW_PREFS_SHOWGRID_CHECKBOX_ID, state->showGrid );
|
setBooleanCtrl( XW_PREFS_SHOWGRID_CHECKBOX_ID, state->showGrid );
|
||||||
setBooleanCtrl( XW_PREFS_SHOWARROW_CHECKBOX_ID, state->cp.showBoardArrow );
|
setBooleanCtrl( XW_PREFS_SHOWARROW_CHECKBOX_ID, state->cp.showBoardArrow );
|
||||||
|
@ -301,6 +316,9 @@ controlsToLocalPrefs( PalmAppGlobals* globals, PrefsDlgState* state )
|
||||||
(state->hintsNotAllowed ==
|
(state->hintsNotAllowed ==
|
||||||
getBooleanCtrl( XW_PREFS_NOHINTS_CHECKBOX_ID) ) );
|
getBooleanCtrl( XW_PREFS_NOHINTS_CHECKBOX_ID) ) );
|
||||||
state->hintsNotAllowed = getBooleanCtrl( XW_PREFS_NOHINTS_CHECKBOX_ID );
|
state->hintsNotAllowed = getBooleanCtrl( XW_PREFS_NOHINTS_CHECKBOX_ID );
|
||||||
|
#ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
state->allowHintRect = getBooleanCtrl( XW_PREFS_HINTRECT_CHECKBOX_ID );
|
||||||
|
#endif
|
||||||
|
|
||||||
state->timerEnabled = getBooleanCtrl( XW_PREFS_TIMERON_CHECKBOX_ID );
|
state->timerEnabled = getBooleanCtrl( XW_PREFS_TIMERON_CHECKBOX_ID );
|
||||||
state->gameSeconds = fieldToNum( XW_PREFS_TIMER_FIELD_ID ) * 60;
|
state->gameSeconds = fieldToNum( XW_PREFS_TIMER_FIELD_ID ) * 60;
|
||||||
|
|
|
@ -265,8 +265,16 @@
|
||||||
#define XW_PREFS_NOHINTS_CHECKBOX_ID 2720
|
#define XW_PREFS_NOHINTS_CHECKBOX_ID 2720
|
||||||
#define XW_PREFS_TIMERON_CHECKBOX_ID 2721
|
#define XW_PREFS_TIMERON_CHECKBOX_ID 2721
|
||||||
#define XW_PREFS_TIMER_FIELD_ID 2722
|
#define XW_PREFS_TIMER_FIELD_ID 2722
|
||||||
|
|
||||||
#ifdef FEATURE_TRAY_EDIT
|
#ifdef FEATURE_TRAY_EDIT
|
||||||
# define XW_PREFS_PICKTILES_CHECKBOX_ID 2723
|
# define XW_PREFS_PICKTILES_CHECKBOX_ID 2723
|
||||||
|
# ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
# define XW_PREFS_HINTRECT_CHECKBOX_ID 2724
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifdef XWFEATURE_SEARCHLIMIT
|
||||||
|
# define XW_PREFS_HINTRECT_CHECKBOX_ID 2723
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These aren't part of the hide/show thing as they're displayed only
|
/* These aren't part of the hide/show thing as they're displayed only
|
||||||
|
@ -278,7 +286,10 @@
|
||||||
#define XW_PREFS_FIRST_GLOBAL_ID XW_PREFS_PLAYERCOLORS_CHECKBOX_ID
|
#define XW_PREFS_FIRST_GLOBAL_ID XW_PREFS_PLAYERCOLORS_CHECKBOX_ID
|
||||||
#define XW_PREFS_LAST_GLOBAL_ID XW_PREFS_ROBOTSCORE_CHECKBOX_ID
|
#define XW_PREFS_LAST_GLOBAL_ID XW_PREFS_ROBOTSCORE_CHECKBOX_ID
|
||||||
#define XW_PREFS_FIRST_PERGAME_ID XW_PREFS_ROBOTSMART_CHECKBOX_ID
|
#define XW_PREFS_FIRST_PERGAME_ID XW_PREFS_ROBOTSMART_CHECKBOX_ID
|
||||||
#ifdef FEATURE_TRAY_EDIT
|
|
||||||
|
#if defined XWFEATURE_SEARCHLIMIT
|
||||||
|
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_HINTRECT_CHECKBOX_ID
|
||||||
|
#elif defined FEATURE_TRAY_EDIT
|
||||||
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_PICKTILES_CHECKBOX_ID
|
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_PICKTILES_CHECKBOX_ID
|
||||||
#else
|
#else
|
||||||
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_TIMER_FIELD_ID
|
# define XW_PREFS_LAST_PERGAME_ID XW_PREFS_TIMER_FIELD_ID
|
||||||
|
|
Loading…
Add table
Reference in a new issue