mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
Remove overdesigned edit-control-caching mechanism in favor of just
asking if the current focus owner is an edit control.
This commit is contained in:
parent
4dde28bc28
commit
c81e85deef
2 changed files with 5 additions and 34 deletions
|
@ -333,26 +333,6 @@ mkFullscreenWithSoftkeys( CEAppGlobals* globals, HWND hDlg, XP_U16 curHt,
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
} /* mkFullscreenWithSoftkeys */
|
} /* mkFullscreenWithSoftkeys */
|
||||||
|
|
||||||
static void
|
|
||||||
findEditCtrls( CeDlgHdr* dlgHdr )
|
|
||||||
{
|
|
||||||
HWND ctrl;
|
|
||||||
XP_U16 nEdits = 0;
|
|
||||||
|
|
||||||
for ( ctrl = GetWindow( dlgHdr->hDlg, GW_CHILD );
|
|
||||||
!!ctrl && nEdits < MAX_EDITS;
|
|
||||||
ctrl = GetWindow( ctrl, GW_HWNDNEXT ) ) {
|
|
||||||
wchar_t buf[32];
|
|
||||||
if ( 0 != GetClassName( ctrl, buf, VSIZE(buf) )
|
|
||||||
&& !wcscmp( L"Edit", buf ) ) {
|
|
||||||
XP_ASSERT( nEdits < MAX_EDITS );
|
|
||||||
dlgHdr->edits[nEdits++] = ctrl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Sanity check: there are no Edits OR we're trapping them */
|
|
||||||
XP_ASSERT( (nEdits == 0) || ((dlgHdr->doWhat & DLG_STATE_TRAPBACK) != 0) );
|
|
||||||
} /* findEditCtrls */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TITLE_HT 20 /* Need to get this from the OS */
|
#define TITLE_HT 20 /* Need to get this from the OS */
|
||||||
|
@ -409,7 +389,6 @@ ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat )
|
||||||
but I don't understand why: trapping here is still required. */
|
but I don't understand why: trapping here is still required. */
|
||||||
if ( IS_SMARTPHONE(globals) ) {
|
if ( IS_SMARTPHONE(globals) ) {
|
||||||
trapBackspaceKey( hDlg );
|
trapBackspaceKey( hDlg );
|
||||||
findEditCtrls( dlgHdr );
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} /* ceDlgSetup */
|
} /* ceDlgSetup */
|
||||||
|
@ -430,18 +409,12 @@ ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId )
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
editHasFocus( const CeDlgHdr* dlgHdr )
|
editHasFocus( const CeDlgHdr* dlgHdr )
|
||||||
{
|
{
|
||||||
XP_Bool found = XP_FALSE;
|
|
||||||
HWND focus = GetFocus();
|
HWND focus = GetFocus();
|
||||||
XP_U16 ii;
|
wchar_t buf[32];
|
||||||
for ( ii = 0; ii < MAX_EDITS && !found; ++ii ) {
|
XP_Bool isEdit = !!focus
|
||||||
HWND ctrl = dlgHdr->edits[ii];
|
&& ( 0 != GetClassName( focus, buf, VSIZE(buf) ) )
|
||||||
if ( NULL == ctrl ) {
|
&& !wcscmp( L"Edit", buf );
|
||||||
break;
|
return isEdit;
|
||||||
} else if ( ctrl == focus ) {
|
|
||||||
found = XP_TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return found;
|
|
||||||
} /* editHasFocus */
|
} /* editHasFocus */
|
||||||
|
|
||||||
XP_Bool
|
XP_Bool
|
||||||
|
|
|
@ -48,7 +48,6 @@ typedef enum { DLG_STATE_NONE = 0
|
||||||
, DLG_STATE_TRAPBACK = 1
|
, DLG_STATE_TRAPBACK = 1
|
||||||
, DLG_STATE_DONEONLY = 2
|
, DLG_STATE_DONEONLY = 2
|
||||||
} DlgStateTask;
|
} DlgStateTask;
|
||||||
#define MAX_EDITS 8 /* the most any control has */
|
|
||||||
typedef struct CeDlgHdr {
|
typedef struct CeDlgHdr {
|
||||||
CEAppGlobals* globals;
|
CEAppGlobals* globals;
|
||||||
HWND hDlg;
|
HWND hDlg;
|
||||||
|
@ -56,7 +55,6 @@ typedef struct CeDlgHdr {
|
||||||
/* Below this line is private to ceutil.c */
|
/* Below this line is private to ceutil.c */
|
||||||
DlgStateTask doWhat;
|
DlgStateTask doWhat;
|
||||||
XP_U16 nPage;
|
XP_U16 nPage;
|
||||||
HWND edits[MAX_EDITS];
|
|
||||||
} CeDlgHdr;
|
} CeDlgHdr;
|
||||||
void ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat );
|
void ceDlgSetup( CeDlgHdr* dlgHdr, HWND hDlg, DlgStateTask doWhat );
|
||||||
void ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId );
|
void ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId );
|
||||||
|
|
Loading…
Reference in a new issue