| 1684 | } |
| 1685 | for (int i = 0; i < DebugConsoleExpRows; i++) |
| 1686 | { |
| 1687 | CEdit* edit = dynamic_cast<CEdit*>(GetCtrl(IDC_DEBUG_EXP1 + i)); |
| 1688 | PoseidonAssert(edit); |
| 1689 | GDebugConsoleInfo.exp[i] = edit->GetText(); |
| 1690 | } |
| 1691 | break; |
| 1692 | } |
| 1693 | |
| 1694 | Display::OnButtonClicked(idc); |
| 1695 | } |
| 1696 | |
| 1697 | bool DisplayDebug::OnKeyDown(unsigned nChar, unsigned nRepCnt, unsigned nFlags) |
| 1698 | { |
| 1699 | if (this->GetFocused()->IDC() == IDC_DEBUG_EXP) |
| 1700 | { |
| 1701 | switch (nChar) |
| 1702 | { |
| 1703 | case SDLK_UP: |
| 1704 | if (_current > 0) |
| 1705 | { |
| 1706 | _current--; |
| 1707 | CEdit* edit = dynamic_cast<CEdit*>(GetCtrl(IDC_DEBUG_EXP)); |
| 1708 | PoseidonAssert(edit); |
| 1709 | edit->SetText(GDebugConsoleInfo.history[_current]); |
| 1710 | } |
| 1711 | return true; |
| 1712 | case SDLK_DOWN: |
| 1713 | if (_current < GDebugConsoleInfo.history.Size() - 1) |
| 1714 | { |
| 1715 | _current++; |
| 1716 | CEdit* edit = dynamic_cast<CEdit*>(GetCtrl(IDC_DEBUG_EXP)); |
| 1717 | PoseidonAssert(edit); |