[Lldb-commits] [PATCH] D104395: [LLDB][GUI] Add initial forms support

Omar Emara via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 18 13:42:39 PDT 2021


OmarEmaraDev added a comment.

@clayborg I tried implementing scrolling mechanisms as suggested. My first trial essentially defined a "visible area" rectangle which gets updated with every time the selection changes, then when it comes to drawing, each field checks if it is completely contained in the visible area and draws itself with an offset that we get from from the visible area origin. This worked, but fields that spans multiple columns can completely disappear leaving mostly no fields on the window, so it worked in most cases, but not all. My second trial was about drawing to an ncurses pad that is large enough to fit all contents, then the window is refreshed from that pad. This used manual ncurses calls because we don't support pads at the moment, so I scratched that for now. I think support for pads would be good for those kind of applications in the future. I plan to work on a proposal that would include support for pads and lightweight subwindows, I will detail that later.

I eventually opted to create "pages" for the forms. Basically, during form construction, if the number of fields is large and can't fit in the window, the user can call `NewPage()` to create a new page, all fields after that call gets added to the new page. As the user selects fields, the form can scroll to different pages. This is similar to the ncurses form scrolling functionality. Visual indicator for the current pages and the active page is added to the form if there is more than one page. I hope this solution is satisfactory.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104395/new/

https://reviews.llvm.org/D104395



More information about the lldb-commits mailing list