| 3038 | } |
| 3039 | |
| 3040 | bool newuiListBox::SetCurrentItem(const char *name) { |
| 3041 | int i, found = 0; |
| 3042 | |
| 3043 | for (i = 0; i < m_NumItems; i++) { |
| 3044 | int res = (m_Flags & UILB_CASESENSITIVE) ? stricmp(m_ItemList[i], name) : strcmp(m_ItemList[i], name); |
| 3045 | if (res == 0) { |
| 3046 | SetCurrentIndex(m_Real2Virt[i]); |
| 3047 | found = 1; |
| 3048 | break; |
| 3049 | } |
| 3050 | } |
| 3051 | |
| 3052 | if (!found) { |
| 3053 | mprintf(0, "newuiListBox::SelectItem item not found!\n"); |
| 3054 | return false; |
| 3055 | } |
| 3056 | |
| 3057 | return true; |
| 3058 | } |
| 3059 | |
| 3060 | // set callbacks |
| 3061 | void newuiListBox::SetSelectChangeCallback(void (*fn)(int)) { selectchange_fn = fn; } |
no test coverage detected