HertzDevil / 0CC-FamiTracker

Extension of jsr's FamiTracker
http://0cc-famitracker.tumblr.com/
GNU General Public License v2.0
308 stars 32 forks source link

Binding NM_CLICK and NM_KEYDOWN to CListCtrl is an incorrect programming logic #69

Open owomomo opened 6 years ago

owomomo commented 6 years ago

I have mentioned this problem in the official FamiTracker forum few years ago (http://forums.famitracker.com/viewtopic.php?f=5&t=203), but I noticed the recent SVN update still using the NM_CLICK and NM_KEYDOWN programming on the shortcut key, it even changed the General Config window to this logic either! (https://github.com/HertzDevil/0CC-FamiTracker/commit/d479d50a9fb2de36fb697a8f1781923126a2df14#diff-523bb8df3ca857bfc056686feb71f97e)

This is an incorrect logic for CListCtrl, if only capture mouse click and key press, the text in the other objects won't always change with the selection in the list. You can try to click one of the items and press up or down key, or press mouse button down and move the mouse outside the window then release it to see the text at the bottom didn't change, and it keeps going wrong.

I know other messages and complicated programs can be added into the message map to fix this, but these don't get the goal, the easiest way is to bind LVN_ITEMCHANGED.

Currently the Shortcut Key and General Config window have this bug. It's not sure why HertzDevil loves to add NM_CLICK and NM_KEYDOWN to CListCtrl so much, if more and more CListCtrl was changed to this, they would have the same buggy behaviour in 0CC-FamiTracker.

nyanpasu64 commented 6 years ago

HertzDevil doesn't check this issue tracker, can I repost on his own forum and provide a video sample (type-to-find is always 1 entry behind)?

Also what's the correct fix?

EDIT: [He] reported at http://hertzdevil.info/forum/index.php/topic,24.0.html .