diff options
author | 2016-06-02 19:06:39 +1200 | |
---|---|---|
committer | 2016-06-02 19:08:00 +1200 | |
commit | 27a8e715bc6faaa91a746cb27a947af5edfec612 (patch) | |
tree | 9e0816a17c2fda7f20b24668ef43d92bf4713652 /src/osd/modules/debugger/debugimgui.cpp | |
parent | b08a496e6ca461274ffacee84e0801a33a1bec50 (diff) |
debugimgui: removed scrollbar from memory windows, and let the view itself control what is displays. Use cursors/pageup/pagedown to control the memory window when the view cursor is visible.
Diffstat (limited to 'src/osd/modules/debugger/debugimgui.cpp')
-rw-r--r-- | src/osd/modules/debugger/debugimgui.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 4033e8e4176..199a4f72b87 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -499,10 +499,18 @@ void debug_imgui::draw_view(debug_area* view_ptr, bool exp_change) ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0,0)); ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0)); - // if the view has changed its expression (disasm, memory), then update scroll bar + // if the view has changed its expression (disasm, memory), then update scroll bar and view cursor if(exp_change) - ImGui::SetScrollY(view_ptr->view->visible_position().y * fsize.y); - + { + if(view_ptr->view->cursor_supported()) + { + view_ptr->view->set_cursor_visible(true); + view_ptr->view->set_cursor_position(debug_view_xy(0,view_ptr->view->visible_position().y)); + } + if(view_ptr->type != DVT_MEMORY) // no scroll bars in memory views + ImGui::SetScrollY(view_ptr->view->visible_position().y * fsize.y); + } + // update view location, while the cursor is at 0,0. view_ptr->ofs_x = ImGui::GetCursorScreenPos().x; view_ptr->ofs_y = ImGui::GetCursorScreenPos().y; @@ -512,7 +520,8 @@ void debug_imgui::draw_view(debug_area* view_ptr, bool exp_change) drawlist = ImGui::GetWindowDrawList(); // temporarily set cursor to the last line, this will set the scroll bar range - ImGui::SetCursorPosY((totalsize.y) * fsize.y); + if(view_ptr->type != DVT_MEMORY) // no scroll bars in memory views + ImGui::SetCursorPosY((totalsize.y) * fsize.y); // set the visible area to be displayed vsize.x = view_ptr->view_width / fsize.x; @@ -520,10 +529,13 @@ void debug_imgui::draw_view(debug_area* view_ptr, bool exp_change) view_ptr->view->set_visible_size(vsize); // set the visible position - pos.x = 0; - pos.y = ImGui::GetScrollY() / fsize.y; - view_ptr->view->set_visible_position(pos); - + if(view_ptr->type != DVT_MEMORY) // since ImGui cannot handle huge memory views, we'll just let the view control the displayed area + { + pos.x = 0; + pos.y = ImGui::GetScrollY() / fsize.y; + view_ptr->view->set_visible_position(pos); + } + viewdata = view_ptr->view->viewdata(); xy1.x = view_ptr->ofs_x; |