| 1345 | } |
| 1346 | |
| 1347 | void LWSlider::OnKeyDown(wxKeyEvent & event) |
| 1348 | { |
| 1349 | if (mEnabled) |
| 1350 | { |
| 1351 | switch( event.GetKeyCode() ) |
| 1352 | { |
| 1353 | case WXK_TAB: |
| 1354 | mParent->Navigate(event.ShiftDown() |
| 1355 | ? wxNavigationKeyEvent::IsBackward |
| 1356 | : wxNavigationKeyEvent::IsForward); |
| 1357 | break; |
| 1358 | |
| 1359 | case WXK_RIGHT: |
| 1360 | case WXK_UP: |
| 1361 | Increase( mScrollLine ); |
| 1362 | SendUpdate( mCurrentValue ); |
| 1363 | ShowTip(true); |
| 1364 | break; |
| 1365 | |
| 1366 | case WXK_LEFT: |
| 1367 | case WXK_DOWN: |
| 1368 | Decrease( mScrollLine ); |
| 1369 | SendUpdate( mCurrentValue ); |
| 1370 | ShowTip(true); |
| 1371 | break; |
| 1372 | |
| 1373 | case WXK_PAGEUP: |
| 1374 | Increase( mScrollPage ); |
| 1375 | SendUpdate( mCurrentValue ); |
| 1376 | ShowTip(true); |
| 1377 | break; |
| 1378 | |
| 1379 | case WXK_PAGEDOWN: |
| 1380 | Decrease( mScrollPage ); |
| 1381 | SendUpdate( mCurrentValue ); |
| 1382 | ShowTip(true); |
| 1383 | break; |
| 1384 | |
| 1385 | case WXK_HOME: |
| 1386 | SendUpdate( mMinValue ); |
| 1387 | ShowTip(true); |
| 1388 | break; |
| 1389 | |
| 1390 | case WXK_END: |
| 1391 | SendUpdate( mMaxValue ); |
| 1392 | ShowTip(true); |
| 1393 | break; |
| 1394 | |
| 1395 | case WXK_RETURN: |
| 1396 | case WXK_NUMPAD_ENTER: |
| 1397 | { |
| 1398 | wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(mParent), wxTopLevelWindow); |
| 1399 | wxWindow *def = tlw->GetDefaultItem(); |
| 1400 | if (def && def->IsEnabled()) { |
| 1401 | wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED, |
| 1402 | def->GetId()); |
| 1403 | cevent.SetEventObject( def ); |
| 1404 | mParent->GetEventHandler()->ProcessEvent(cevent); |
nothing calls this directly
no test coverage detected