| 264 | } |
| 265 | |
| 266 | void CListUI::DoEvent(TEventUI& event) |
| 267 | { |
| 268 | if( !IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND ) { |
| 269 | if( m_pParent != NULL ) m_pParent->DoEvent(event); |
| 270 | else CVerticalLayoutUI::DoEvent(event); |
| 271 | return; |
| 272 | } |
| 273 | |
| 274 | if( event.Type == UIEVENT_SETFOCUS ) |
| 275 | { |
| 276 | m_bFocused = true; |
| 277 | return; |
| 278 | } |
| 279 | if( event.Type == UIEVENT_KILLFOCUS ) |
| 280 | { |
| 281 | m_bFocused = false; |
| 282 | return; |
| 283 | } |
| 284 | |
| 285 | switch( event.Type ) { |
| 286 | case UIEVENT_KEYDOWN: |
| 287 | switch( event.chKey ) { |
| 288 | case VK_UP: |
| 289 | SelectItem(FindSelectable(m_iCurSel - 1, false), true); |
| 290 | return; |
| 291 | case VK_DOWN: |
| 292 | SelectItem(FindSelectable(m_iCurSel + 1, true), true); |
| 293 | return; |
| 294 | case VK_PRIOR: |
| 295 | PageUp(); |
| 296 | return; |
| 297 | case VK_NEXT: |
| 298 | PageDown(); |
| 299 | return; |
| 300 | case VK_HOME: |
| 301 | SelectItem(FindSelectable(0, false), true); |
| 302 | return; |
| 303 | case VK_END: |
| 304 | SelectItem(FindSelectable(GetCount() - 1, true), true); |
| 305 | return; |
| 306 | case VK_RETURN: |
| 307 | if( m_iCurSel != -1 ) GetItemAt(m_iCurSel)->Activate(); |
| 308 | return; |
| 309 | } |
| 310 | break; |
| 311 | case UIEVENT_SCROLLWHEEL: |
| 312 | { |
| 313 | switch( LOWORD(event.wParam) ) { |
| 314 | case SB_LINEUP: |
| 315 | if( m_bScrollSelect ) SelectItem(FindSelectable(m_iCurSel - 1, false), true); |
| 316 | else LineUp(); |
| 317 | return; |
| 318 | case SB_LINEDOWN: |
| 319 | if( m_bScrollSelect ) SelectItem(FindSelectable(m_iCurSel + 1, true), true); |
| 320 | else LineDown(); |
| 321 | return; |
| 322 | } |
| 323 | } |
nothing calls this directly
no test coverage detected