-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support selection and activation in tree controls #40
base: master
Are you sure you want to change the base?
Conversation
I'm not sure I completely understand what this is trying to fix, but two observations to begin with. First, this introduces compile-time warnings which need resolved:
But more importantly, this PR breaks existing good behavior: with the current code, if I open a CHM file, navigate to Index and start typing, if any of the list items is a (partial) match I can just press Enter and the associated page is displayed. With your patch, Enter doesn't work anymore. |
I would also appreciate it if you could split these into more commits (or even more pull requests), to make reviews and bisection easier. For example, I could see a separate commit here just doing clean-up work (removing unused headers + switching to It's easy to consider that obvious when doing the coding, but when you're a reviewer precision and the least amount of noise matters. Thanks! |
a3e840b
to
f83c85e
Compare
I fixed the problems and added a commit that makes "Enter" focus the HTML window. I wanted to submit it in a later PR, but it probably makes sense in this one. I can try to explain what I am trying to fix. Here are the use cases. First use case.
Second use case.
Third use case.
I also plan to submit a PR which make Up and Down keys work in the text box and move the focus to the index list. |
Thanks! Sorry the review is taking a while, I've been (and still am) extremely busy and it'll take a while yet until I can get to it. |
No problem. |
I understand that xCHM currently does not focus the displayed HTML on pressing Enter (your 3rd use case). That's arguably useful, but you can also just press Tab one more time after that. Having the focus stay on the index list has the benefit of being able to navigate it with the keyboard as well. But I can't reproduce your 1st use case on my Arch Linux machine with wxWidgets 3.2.6. The up and down buttons can navigate the index list and the focus does not jump anywhere. What is your setup? The 2nd case I still don't understand. What is supposed to happen when you press Enter? Just pressing up or down automatically displays the page related to the list item. There's nothing else that a double-click or Enter should do. Here is a short screencast I've recorded. I'm just typing something in, Tab to switch focus to the list, then up and down. Nothing jumps, and when an item is focused the link associated with it is simply displayed without Enter or double-clicks: Screencast.From.2024-12-10.21-18-44.mp4 |
One other confusing aspect of this PR is that the subject refers to tree controls, and yet all the enumerated use cases concern the index list control. |
Yes it's the list control and not the tree control. I tested it on Windows. I know it's not supported, so if it's working for you I'm OK with closing the PR. |
I'm just trying to understand it so far. I remember a long time ago I used to do Windows builds (with MSVC) and I don't recall problems with the application. It's possible that in the meantime problems appeared with the Windows build, but I'd like to be able to reproduce them somehow before a potential merge (and I no longer have a Windows build environment, so ideally with some type of Linux build). Are you using MSVC? Cygwin? Something else? |
The first commit focuses the selected item, otherwise if you switch focus with tab and use arrow keys it jumps to the the top item.
Second commit adds support for activation in addition to selection. Activation happens with ENTER and double click. This makes keyboard navigation easier and fixes some problems like the inability to select an already selected item and the need to manually focus the HTML window with tab after selecting an item.