| 392 | } |
| 393 | |
| 394 | int ImGui_Console::HistoryKeyCallback(ImGuiInputTextCallbackData* data) |
| 395 | { |
| 396 | HistoryBuffer::reverse_iterator currentPos = m_HistoryIterator; |
| 397 | switch (data->EventKey) |
| 398 | { |
| 399 | case ImGuiKey_UpArrow: ++m_HistoryIterator; break; |
| 400 | case ImGuiKey_DownArrow: --m_HistoryIterator; break; |
| 401 | default: break; |
| 402 | } |
| 403 | if (currentPos != m_HistoryIterator) |
| 404 | { |
| 405 | std::string const& cmd = *m_HistoryIterator; |
| 406 | snprintf(data->Buf, data->BufSize, "%s", cmd.c_str()); |
| 407 | data->BufTextLen = (int)cmd.length(); |
| 408 | data->BufDirty = true; |
| 409 | } |
| 410 | return 0; |
| 411 | } |
| 412 | |
| 413 | int ImGui_Console::TextEditCallback(ImGuiInputTextCallbackData* data) |
| 414 | { |