NewPagodi / wxAccordion

An Accordion Control for wxWidgets
Other
28 stars 6 forks source link

Nasty bug under Windows: Crash when pressing F1 while in a textbox within the wxAccordion #2

Open xamidi opened 2 years ago

xamidi commented 2 years ago

I was using a variant of wxAccordion and came across a bug where the app would crash after pressing F1 two times. Fixed as follows: On Windows, pressing the F1 key fires the wxEVT_HELP event, automatically calling wxWindow::OnHelp(). Usually, it does nothing, but in this case, there ia a panel inside of a custom implementatation of a wxBookCtrlBase. When that panel was containing a text input control which received two F1 key presses, it would crash. By simply redirecting the wxEVT_HELP event from the panel to my own empty method, the bug was fixed.

NewPagodi commented 2 years ago

Sorry about the delay with this issue. Could this possibly be the same as this issue? If so, this might have been a bug in wxWidgets itself and should be fixed now and work with the latest version of wxWidgets.

If not, I guess I could add an empty wxEVT_HELP handler for the accordian control. I've never actually used that event, but I assume that should work.

xamidi commented 2 years ago

Possibly 59463ec fixes it, since it affects wxBookCtrlBase, from which wxAccordion is inherited. However, the bug is present for all versions prior to 3.1.7.

I modified your widget to fix some bugs (including this one) and renamed it to wxFlatAccordion, so for whoever would like to make use of it, I'll upload the modified files in their current state here (which are part of a still private repo): wxflataccordion-20220511.zip

Note that due to rendering performance issues since 3.1.4 with wxGrid on MSW, I will keep using 3.1.3 and recommend anyone building for Windows to do so (unless those severe issues are resolved, which seems unlikely given the mentality of current maintainers).