From 3ab61e42649a27f2fbd37962a06297046f3dcd6e Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 13 Dec 2008 04:39:06 +0000 Subject: [PATCH] Use Ok for stringbox, Done for Saved games dialog; next release to be rc1, not b7 --- wince/cestrbx.c | 2 +- wince/ceutil.c | 19 ++++++++++++++----- wince/ceutil.h | 3 ++- wince/resource.h | 1 + wince/scripts/makezip.sh | 3 ++- wince/xwords4.rc | 10 +++++++++- 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/wince/cestrbx.c b/wince/cestrbx.c index 9aa0986f4..d53853a70 100755 --- a/wince/cestrbx.c +++ b/wince/cestrbx.c @@ -78,7 +78,7 @@ StrBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) } ceDlgSetup( &state->dlgHdr, hDlg, - state->isQuery? DLG_STATE_NONE : DLG_STATE_DONEONLY ); + state->isQuery? DLG_STATE_NONE : DLG_STATE_OKONLY ); handled = TRUE; } else { diff --git a/wince/ceutil.c b/wince/ceutil.c index 301a71e3d..26ca397a3 100755 --- a/wince/ceutil.c +++ b/wince/ceutil.c @@ -299,7 +299,7 @@ ceSizeIfFullscreen( CEAppGlobals* globals, HWND hWnd ) static XP_Bool mkFullscreenWithSoftkeys( CEAppGlobals* globals, HWND hDlg, XP_U16 curHt, - XP_Bool doneOnly ) + DlgStateTask doWhat ) { XP_Bool success = XP_FALSE; @@ -307,7 +307,13 @@ mkFullscreenWithSoftkeys( CEAppGlobals* globals, HWND hDlg, XP_U16 curHt, XP_MEMSET( &mbi, 0, sizeof(mbi) ); mbi.cbSize = sizeof(mbi); mbi.hwndParent = hDlg; - mbi.nToolBarId = doneOnly? IDM_DONE_MENUBAR:IDM_OKCANCEL_MENUBAR; + if ( 0 != (doWhat & DLG_STATE_DONEONLY) ) { + mbi.nToolBarId = IDM_DONE_MENUBAR; + } else if ( 0 != (doWhat & DLG_STATE_OKONLY) ) { + mbi.nToolBarId = IDM_OK_MENUBAR; + } else { + mbi.nToolBarId = IDM_OKCANCEL_MENUBAR; + } mbi.hInstRes = globals->hInst; success = SHCreateMenuBar( &mbi ); if ( !success ) { @@ -351,14 +357,16 @@ ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat ) XP_ASSERT( !!globals ); XP_ASSERT( !!hDlg ); + /* at most one of these two should be set */ + XP_ASSERT( (doWhat & (DLG_STATE_OKONLY|DLG_STATE_DONEONLY)) + != (DLG_STATE_OKONLY|DLG_STATE_DONEONLY)); GetClientRect( hDlg, &rect ); XP_ASSERT( rect.top == 0 ); fullHeight = rect.bottom; /* This is before we've resized it */ #ifdef _WIN32_WCE - (void)mkFullscreenWithSoftkeys( globals, hDlg, fullHeight, - (doWhat & DLG_STATE_DONEONLY) != 0); + (void)mkFullscreenWithSoftkeys( globals, hDlg, fullHeight, doWhat); #elif defined DEBUG /* Force it to be small so we can test scrolling etc. */ if ( globals->dbWidth > 0 && globals->dbHeight > 0) { @@ -435,7 +443,8 @@ ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam ) if ( editHasFocus() ) { SHSendBackToFocusWindow( message, wParam, lParam ); } else if ( 0 != (BACK_KEY_UP_MAYBE & LOWORD(lParam) ) ) { - WPARAM cmd = (0 != (dlgHdr->doWhat & DLG_STATE_DONEONLY)) ? + WPARAM cmd = (0 != (dlgHdr->doWhat + & (DLG_STATE_DONEONLY|DLG_STATE_OKONLY))) ? IDOK : IDCANCEL; SendMessage( dlgHdr->hDlg, WM_COMMAND, cmd, 0L ); } diff --git a/wince/ceutil.h b/wince/ceutil.h index 4899868f8..e01c42027 100755 --- a/wince/ceutil.h +++ b/wince/ceutil.h @@ -63,7 +63,8 @@ XP_U16 ceGetPath( CEAppGlobals* globals, CePathType typ, /* set vHeight to 0 to turn off scrolling */ typedef enum { DLG_STATE_NONE = 0 , DLG_STATE_TRAPBACK = 1 - , DLG_STATE_DONEONLY = 2 + , DLG_STATE_OKONLY = 2 + , DLG_STATE_DONEONLY = 4 } DlgStateTask; typedef struct CeDlgHdr { CEAppGlobals* globals; diff --git a/wince/resource.h b/wince/resource.h index 945068d79..dbc1c7012 100755 --- a/wince/resource.h +++ b/wince/resource.h @@ -20,6 +20,7 @@ #define IDM_MAIN_MENUBAR 120 #define IDM_OKCANCEL_MENUBAR 121 #define IDM_DONE_MENUBAR 122 +#define IDM_OK_MENUBAR 123 #define IDB_ORIGIN 124 #ifdef XWFEATURE_SEARCHLIMIT # define IDD_ASKHINTLIMTS 125 diff --git a/wince/scripts/makezip.sh b/wince/scripts/makezip.sh index 4363d2f06..49b9bbb5c 100755 --- a/wince/scripts/makezip.sh +++ b/wince/scripts/makezip.sh @@ -58,7 +58,8 @@ if [ ! -z "$NAME" ]; then fi cat > $README <