mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
Fix to compile with XWFEATURE_FIVEWAY undefined
This commit is contained in:
parent
daefd456a3
commit
54e0ab64d1
4 changed files with 27 additions and 12 deletions
|
@ -287,8 +287,9 @@ eType_2str( eventsEnum eType )
|
||||||
CASESTR( loadGameEvent);
|
CASESTR( loadGameEvent);
|
||||||
CASESTR( prefsChangedEvent);
|
CASESTR( prefsChangedEvent);
|
||||||
CASESTR( openSavedGameEvent);
|
CASESTR( openSavedGameEvent);
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
CASESTR( updateAfterFocusEvent);
|
CASESTR( updateAfterFocusEvent);
|
||||||
|
#endif
|
||||||
CASESTR( DOWN_ARROW_RESID );
|
CASESTR( DOWN_ARROW_RESID );
|
||||||
CASESTR( RIGHT_ARROW_RESID );
|
CASESTR( RIGHT_ARROW_RESID );
|
||||||
CASESTR( FLIP_BUTTON_BMP_RES_ID );
|
CASESTR( FLIP_BUTTON_BMP_RES_ID );
|
||||||
|
|
|
@ -967,11 +967,11 @@ initHighResGlobals( PalmAppGlobals* globals )
|
||||||
globals->oneDotFiveAvail = globals->hasHiRes
|
globals->oneDotFiveAvail = globals->hasHiRes
|
||||||
&& (err == errNone) && (vers >= 5);
|
&& (err == errNone) && (vers >= 5);
|
||||||
|
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
err = FtrGet( sysFtrCreator, sysFtrNumUIHardwareFlags, &vers );
|
err = FtrGet( sysFtrCreator, sysFtrNumUIHardwareFlags, &vers );
|
||||||
globals->generatesKeyUp = ( (err == errNone) &&
|
globals->generatesKeyUp = ( (err == errNone) &&
|
||||||
((vers & sysFtrNumUIHardwareHasKbd) != 0) )
|
((vers & sysFtrNumUIHardwareHasKbd) != 0) )
|
||||||
|| globals->isZodiac;
|
|| globals->isZodiac;
|
||||||
#ifdef XWFEATURE_FIVEWAY
|
|
||||||
globals->hasTreoFiveWay = (err == errNone)
|
globals->hasTreoFiveWay = (err == errNone)
|
||||||
&& ((vers & sysFtrNumUIHardwareHas5Way) != 0) && !globals->isZodiac;
|
&& ((vers & sysFtrNumUIHardwareHas5Way) != 0) && !globals->isZodiac;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1272,7 +1272,9 @@ static void
|
||||||
stopApplication( PalmAppGlobals* globals )
|
stopApplication( PalmAppGlobals* globals )
|
||||||
{
|
{
|
||||||
if ( globals != NULL ) {
|
if ( globals != NULL ) {
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
Int16 focusItem = getFocusOwner();
|
Int16 focusItem = getFocusOwner();
|
||||||
|
#endif
|
||||||
MPSLOT;
|
MPSLOT;
|
||||||
|
|
||||||
saveOpenGame( globals );
|
saveOpenGame( globals );
|
||||||
|
@ -1295,7 +1297,9 @@ stopApplication( PalmAppGlobals* globals )
|
||||||
prefs.versionNum = XP_HTONS( prefs.versionNum );
|
prefs.versionNum = XP_HTONS( prefs.versionNum );
|
||||||
prefs.curGameIndex = XP_HTONS( prefs.curGameIndex );
|
prefs.curGameIndex = XP_HTONS( prefs.curGameIndex );
|
||||||
|
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
prefs.focusItem = XP_HTONS(focusItem);
|
prefs.focusItem = XP_HTONS(focusItem);
|
||||||
|
#endif
|
||||||
|
|
||||||
PrefSetAppPreferences( AppType, PrefID, VERSION_NUM,
|
PrefSetAppPreferences( AppType, PrefID, VERSION_NUM,
|
||||||
&prefs, sizeof(prefs), true );
|
&prefs, sizeof(prefs), true );
|
||||||
|
@ -1800,7 +1804,9 @@ drawBitmapButton( PalmAppGlobals* globals, UInt16 ctrlID, UInt16 resID,
|
||||||
static void
|
static void
|
||||||
drawFormButtons( PalmAppGlobals* globals )
|
drawFormButtons( PalmAppGlobals* globals )
|
||||||
{
|
{
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
Int16 focusItem;
|
Int16 focusItem;
|
||||||
|
#endif
|
||||||
XP_U16 pairs[] = {
|
XP_U16 pairs[] = {
|
||||||
XW_MAIN_FLIP_BUTTON_ID, FLIP_BUTTON_BMP_RES_ID, XP_TRUE,
|
XW_MAIN_FLIP_BUTTON_ID, FLIP_BUTTON_BMP_RES_ID, XP_TRUE,
|
||||||
XW_MAIN_VALUE_BUTTON_ID, VALUE_BUTTON_BMP_RES_ID, XP_TRUE,
|
XW_MAIN_VALUE_BUTTON_ID, VALUE_BUTTON_BMP_RES_ID, XP_TRUE,
|
||||||
|
@ -2203,10 +2209,11 @@ handleFocusEvent( PalmAppGlobals* globals, const EventType* event,
|
||||||
/* Work around OS's insistence on sending initial take event. */
|
/* Work around OS's insistence on sending initial take event. */
|
||||||
globals->initialTakeDropped = XP_TRUE;
|
globals->initialTakeDropped = XP_TRUE;
|
||||||
} else {
|
} else {
|
||||||
/* Need to invalidate the neighborhood of buttons on which palm draws the
|
/* Need to invalidate the neighborhood of buttons on which palm draws
|
||||||
focus ring when they lose focus -- to redraw where the focus ring may
|
the focus ring when they lose focus -- to redraw where the focus
|
||||||
have been. No need unless we have the focus now, however, since we'll
|
ring may have been. No need unless we have the focus now,
|
||||||
otherwise have drawn the object correctly (unfocussed). */
|
however, since we'll otherwise have drawn the object correctly
|
||||||
|
(unfocussed). */
|
||||||
|
|
||||||
if ( (!take) && (!isBoardObj) && isBoardObject( getFocusOwner() ) ) {
|
if ( (!take) && (!isBoardObj) && isBoardObject( getFocusOwner() ) ) {
|
||||||
EventType event;
|
EventType event;
|
||||||
|
@ -2215,11 +2222,11 @@ handleFocusEvent( PalmAppGlobals* globals, const EventType* event,
|
||||||
EvtAddEventToQueue( &event );
|
EvtAddEventToQueue( &event );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Board needs to know about any change involving it, including something
|
/* Board needs to know about any change involving it, including
|
||||||
else taking the focus it may think it has. Why? Because takes
|
something else taking the focus it may think it has. Why?
|
||||||
preceed losses, yet the board must draw itself without focus before
|
Because takes preceed losses, yet the board must draw itself
|
||||||
some button draws itself with focus and snags as part of the
|
without focus before some button draws itself with focus and snags
|
||||||
background the board in focussed state. */
|
as part of the background the board in focussed state. */
|
||||||
|
|
||||||
typ = isBoardObj? OBJ_BOARD + (objectID - XW_BOARD_GADGET_ID) : OBJ_NONE;
|
typ = isBoardObj? OBJ_BOARD + (objectID - XW_BOARD_GADGET_ID) : OBJ_NONE;
|
||||||
*drawP = board_focusChanged( globals->game.board, typ, take );
|
*drawP = board_focusChanged( globals->game.board, typ, take );
|
||||||
|
@ -2539,10 +2546,12 @@ mainViewHandleEvent( EventPtr event )
|
||||||
FrmUpdateForm( 0, frmRedrawUpdateCode ); /* <- why is this necessary? */
|
FrmUpdateForm( 0, frmRedrawUpdateCode ); /* <- why is this necessary? */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
case updateAfterFocusEvent:
|
case updateAfterFocusEvent:
|
||||||
invalRectAroundButton( globals, event->data.generic.datum[0] );
|
invalRectAroundButton( globals, event->data.generic.datum[0] );
|
||||||
draw = XP_TRUE;
|
draw = XP_TRUE;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case winExitEvent:
|
case winExitEvent:
|
||||||
if ( event->data.winExit.exitWindow == (WinHandle)FrmGetActiveForm() ){
|
if ( event->data.winExit.exitWindow == (WinHandle)FrmGetActiveForm() ){
|
||||||
|
@ -3356,8 +3365,9 @@ askPassword( const XP_UCHAR* name, Boolean isNew, XP_UCHAR* retbuf,
|
||||||
FldSetTextPtr( field, (char*)name );
|
FldSetTextPtr( field, (char*)name );
|
||||||
FldDrawField( field );
|
FldDrawField( field );
|
||||||
}
|
}
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
setFormFocus( form, XW_PASSWORD_PASS_FIELD );
|
setFormFocus( form, XW_PASSWORD_PASS_FIELD );
|
||||||
|
#endif
|
||||||
field = getActiveObjectPtr( XW_PASSWORD_PASS_FIELD );
|
field = getActiveObjectPtr( XW_PASSWORD_PASS_FIELD );
|
||||||
|
|
||||||
if ( FrmDoDialog( form ) == XW_PASSWORD_OK_BUTTON ) {
|
if ( FrmDoDialog( form ) == XW_PASSWORD_OK_BUTTON ) {
|
||||||
|
|
|
@ -350,7 +350,9 @@ enum { dictSelectedEvent = firstUserEvent /* 0x6000 */
|
||||||
,loadGameEvent
|
,loadGameEvent
|
||||||
,prefsChangedEvent
|
,prefsChangedEvent
|
||||||
,openSavedGameEvent
|
,openSavedGameEvent
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
,updateAfterFocusEvent
|
,updateAfterFocusEvent
|
||||||
|
#endif
|
||||||
#if defined XWFEATURE_BLUETOOTH || defined XWFEATURE_RELAY
|
#if defined XWFEATURE_BLUETOOTH || defined XWFEATURE_RELAY
|
||||||
,connsSettingChgEvent
|
,connsSettingChgEvent
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -217,7 +217,9 @@ setFieldToSelText( SavedGamesState* state )
|
||||||
|
|
||||||
FldInsert( field, name, XP_STRLEN(name) );
|
FldInsert( field, name, XP_STRLEN(name) );
|
||||||
FldSetSelection( field, 0, FldGetTextLength(field) );
|
FldSetSelection( field, 0, FldGetTextLength(field) );
|
||||||
|
#ifdef XWFEATURE_FIVEWAY
|
||||||
setFormFocus( state->form, XW_SAVEDGAMES_NAME_FIELD );
|
setFormFocus( state->form, XW_SAVEDGAMES_NAME_FIELD );
|
||||||
|
#endif
|
||||||
FldDrawField( field );
|
FldDrawField( field );
|
||||||
} /* setFieldToSelText */
|
} /* setFieldToSelText */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue