Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
wrap char mode feature added for Editor Tweak plugin
dmoore:
where is the patch?
ollydbg:
--- Quote from: ollydbg on October 03, 2013, 05:54:23 pm ---
--- Quote from: ollydbg on September 29, 2013, 11:10:38 am ---
--- Quote from: dmoore on September 28, 2013, 09:32:41 pm ---This is often a problem with GTK so I assumed it would also be a problem with wxGTK. If you are sure it isn't then go ahead and remove it.
--- End quote ---
Ok, I asked this question on wx forums, and some one give me the reply, Re: wxMenu Check() cause event handler to be called?, now I need some one help to give me the result on Linux. BTW: I do have have a Linux system.
--- End quote ---
Ping, any one can test this on Linux, thanks.
--- End quote ---
@dmoore
Testing this under wxGTK don't need any patches, you just open the EditorTweak source, and set a breakpoint in any menu item event handler. Then you need to open two editors, change one menu item status. Now, you can swith between two editors, and the menu item status will change after the swith, you need to see wether the event handler will be called after the swith. If yes, this means we need m_isUpdatingUI. This means programmatically change the menu item status will cause its event handler be called.
dmoore:
Ok, seems to work fine without the m_isUpdatingUI check. Go ahead and commit your change.
ollydbg:
--- Quote from: dmoore on October 04, 2013, 06:22:58 pm ---Ok, seems to work fine without the m_isUpdatingUI check. Go ahead and commit your change.
--- End quote ---
Thank you for testing.
Committed in r9382, I also did some code clean up. Please adjust if I did something wrong. :)
ollydbg:
BTW: I see the same EVT_UPDATE_UI issue in Editor Tweak Plugin. By search the forum, I found that it was discussed several years ago in Re: wxUpdateUIEvent performance issues.
My idea is the same as Jens said, if we bind same function to many menu items. The function will be called many times for each menu item.
Oh, here is new idea: can we set a timer in the update function(maybe a static member variable to remember the time stamp the function was called), then check if we have already called the function in 100ms, we can simply return from the function to avoid the redundant/unnecessary updates.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version