wxString message;
wxCommandEvent evt(...);
evt.SetString(message.c_str());
wxPostEvent(m_Parent, evt);
CodeBlocksEvent evt = CodeBlocksEvent(cbEVT_THREADTASK_ALLDONE, m_ID);
wxPostEvent(m_pOwner, evt);
Solution:Yes, we should always do. As a matter of fact, for wx events its a good thing to always implement the clone method once you are using member vars.
If the event need to carry wxString from worker thread to main GUI thread, we should implement a Clone method which deep copy its m_cmdString. Just like the new event type wxThreadEvent in wx 2.9.x.
Ok, this is the first draft patch.Could you do a proper SVN based patch? This patch does not apply.
Could you do a proper SVN based patch? This patch does not apply.
Won't it be proper that defining the event in sdk_events.h and sdk_events.cpp instead ofIts not meant to be captured form outside. CC is a plugin, not the SDK. So the event is in the correct place.
cclogger.cpp and it's own header?
Also about that profiling stuff, I don't want to pay for something that I don't need. This should beIts only for debugging atm and surely will be in #defines to be explicitly compiled in or even removed after all. Patches posted here are fr playing with and will be cleaned-up before application. Don't you worry...
optional.
Its not meant to be captured form outside. CC is a plugin, not the SDK. So the event is in the correct place.I think it more of a general-purpose event than something exclusive to CC as the name
@Morten, this is the patch against SVN.OK, thanks for that - it applied safely.
This is (however) most likely a design issue in the SpellChecker plugin.
Is OccurrenceHighlighter still needed? I don't see in the contrib subdir...
Should I add it into contrib subdir?I think so, yes (in fact I was under the assumption its there already...). I find it quite useful!
Should I add it into contrib subdir?I'd say core and also extract the other highlight occurrence code from the sdk in it.
Note my patch is only a draft patch, which show the direction, but it surely need all your comments. So, thanks for all your comments.Now, I add the class implementation in a cpp file.
@golgepapaz
I think a good place to put the new event in sdk_events.h and sdk_events.cpp. But for me, I just put it in a new file, because once I change the sdk_events.h, then I need to rebuild all my targets..... That's some times waste a lot of time.
I believe that sending event cross thread not only happens in CC.
I still thinkthat the event does not need its own header and implementation file.sdk_events will do fine.OK, I agree with you, and I will change the code.
That profilingOK, I will add the preprocessor directive, and do my best, note I only have a windows and wx2.8.12, so adding to other project files may cause some build issue. :)
stuff is still not optional and please don't forget to update the other project configurations . (If you are commited to
going with a separate file please also add header file to the projects for the sake of convention.)
$ git format-patch -M -C --output-directory /f/cb_sf_git/patches master...90654
dbd50701149639
OK, this is the new patches, by using the "git rebase -i" tool, I can nicely split one commit to two. (Git is wonderful [...]...except that both patches (as expected) do not apply to our SVN source tree. >:(
OK, I will create the svn patches soon.OK, this is the new patches, by using the "git rebase -i" tool, I can nicely split one commit to two. (Git is wonderful [...]...except that both patches (as expected) do not apply to our SVN source tree. >:(
Note, I'm using the patch utility from MSYS.None of the version of patch for Windows ever worked for me. Yiannis used to send me a very old version which was working, hence it got lost on the way... (and it was incompatible with Windows Vista+ to my knowledge...)
I just successfully apply the git style patches in my svn local copy, then create two svn patches, see attachment. The second patch was a combination of 0001 and 0002 patch.Note, I'm using the patch utility from MSYS.None of the version of patch for Windows ever worked for me. Yiannis used to send me a very old version which was working, hence it got lost on the way... (and it was incompatible with Windows Vista+ to my knowledge...)