Author Topic: duplicated cbEVT_EDITOR_ACTIVATED event?  (Read 2826 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5721
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
duplicated cbEVT_EDITOR_ACTIVATED event?
« on: August 20, 2015, 04:55:31 pm »
Hi, I found that I have three cbEVT_EDITOR_ACTIVATED sent when I double click on a project tree file in the project manager panel.

See my log message here: Re: question about m_NeedsBatchColour variable in CC

Also, search the forum, we have discussed this issue before:

This one: Re: event sequence question? or that one: Puzzling cbEVT_EDITOR_* event behavior.

The duplicated events make writing plugin a little hard. Some caches are needed to only handle the editor event once(not three times)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.