static void _SelectByKey(LISTBOX_Handle hObj, int Key) { int i; LISTBOX_Obj* pObj = LISTBOX_H2P(hObj); Key = _Tolower(Key); for (i = 0; i < _GetNumItems(pObj); i++) { char c = _Tolower(*(*(pObj->ppText + i))); if (c == Key) { LISTBOX_SetSel(hObj, i); break; } } }
/********************************************************************* * * _SelectByKey */ static void _SelectByKey(DROPDOWN_Handle hObj, int Key) { int i; DROPDOWN_Obj* pObj; pObj = DROPDOWN_H2P(hObj); Key = _Tolower(Key); for (i = 0; i < _GetNumItems(pObj); i++) { char c = _Tolower(*_GetpItem(pObj, i)); if (c == Key) { DROPDOWN_SetSel(hObj, i); break; } } }
/********************************************************************* * * _SelectByKey */ static void _SelectByKey(LISTBOX_Handle hObj, int Key) { unsigned i; LISTBOX_Obj* pObj; pObj = LISTBOX_H2P(hObj); Key = _Tolower(Key); for (i = 0; i < LISTBOX__GetNumItems(pObj); i++) { const char* s = LISTBOX__GetpString(pObj, i); if (_Tolower(*s) == Key) { LISTBOX_SetSel(hObj, i); break; } } }
/********************************************************************* * * _IsAlphaNum */ static int _IsAlphaNum(int Key) { Key = _Tolower(Key); if (Key >= 'a' && Key <= 'z') { return 1; } if (Key >= '0' && Key <= '9') { return 1; } return 0; }