nyanpasu64 / j0CC-FamiTracker

(Archived, see https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker) Numerous bugfixes for 0CC-FamiTracker (based off 0.3.14.5).
https://github.com/Dn-Programming-Core-Management/Dn-FamiTracker
GNU General Public License v2.0
15 stars 2 forks source link

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

Open nyanpasu64 opened 6 years ago

nyanpasu64 commented 6 years ago

https://github.com/HertzDevil/0CC-FamiTracker/issues/69 http://hertzdevil.info/forum/index.php/topic,24.0.html

nyanpasu64 commented 6 years ago

In Source/InstrumentListCtrl.cpp, I mapped LVN_ITEMCHANGED events to CInstrumentList::OnNMClick. When I create or click an instrument...

Both SelectInstrument functions are called in many places. How can OnNMClick filter out internal events?

@owomomo do you have any ideas?

nyanpasu64 commented 6 years ago

reduced in https://github.com/jimbo1qaz/0CC-FamiTracker/pull/20/commits/fb883ee8de8ea65032f44cfed9edf96e32c60bdb

nyanpasu64 commented 6 years ago

http://www.flounder.com/avoid_en_change.htm related: "One of the problems that is intrinsic to Windows is the fact that an ordinary Edit control, MFC class CEdit, will generate EN_CHANGE notifications any time the text changes, even if the text is changed programmatically by the application."