Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
Compile on demand plugin
MortenMacFly:
--- Quote from: oBFusCATed on February 16, 2012, 09:38:16 am ---I don't like the practice of making plugins compile from inside the c::b tree.
--- End quote ---
As I have in mind to submit it later, I didn't want to change it at that time. ;-)
ptDev:
I'm trying to make CompileOnDemand add a check item to the Build menu instead of using that single-checkbox dialog to turn it on or off. It just makes more sense IMHO. I made it inherit from cbPlugin instead of cbToolPlugin and added the needed BuildMenu(...) and event handler.
The problem is that it always fails to find the Build menu. Why is this the case? Is it being loaded before the Compiler plugin? Is there a simple way to fix it?
I'm also wondering whether it wouldn't be better to simply add the functionality to the Compiler plugin...
MortenMacFly:
--- Quote from: ptDev on March 03, 2012, 12:18:15 pm ---The problem is that it always fails to find the Build menu. Why is this the case? Is it being loaded before the Compiler plugin?
--- End quote ---
Yes - that most likely the reason. And keep in mind that in the future it may have way more config options! I don't kn ow if that is such a good idea... (see below).
--- Quote from: ptDev on March 03, 2012, 12:18:15 pm ---Is there a simple way to fix it?
--- End quote ---
You'll need to delay the attachment to the menu.
--- Quote from: ptDev on March 03, 2012, 12:18:15 pm ---I'm also wondering whether it wouldn't be better to simply add the functionality to the Compiler plugin...
--- End quote ---
I ad in mind to enhance it step by step: So that in the end it will sit in the background and compile what's needed not only on save.
And btw: As of now it has a serious bug that it interferes with C::B (and makes it hang) if you have modified files open and hit compile. At that time the interim compilation will make C::B hang. Solution: If the build process is started, ignore the events from Compile n demand (or don't send them from the plugin).
ptDev:
--- Quote from: MortenMacFly on March 03, 2012, 12:39:05 pm ---Yes - that most likely the reason. And keep in mind that in the future it may have way more config options! I don't know if that is such a good idea...
--- End quote ---
I'll keep the options dialog here too, then. On the other hand, how do I delay attaching the menus, if building the plugins menu is called from CodeBlocks through the cbPlugin interface?
--- Quote ---As of now it has a serious bug that it interferes with C::B (and makes it hang) if you have modified files open and hit compile. At that time the interim compilation will make C::B hang. Solution: If the build process is started, ignore the events from Compile n demand (or don't send them from the plugin).
--- End quote ---
I'll learn if I can check if a compilation is already started and make CompileOnDemand skip the event handler in that case.
MortenMacFly:
--- Quote from: ptDev on March 03, 2012, 12:52:56 pm ---how do I delay attaching the menus, if building the plugins menu is called from CodeBlocks through the cbPlugin interface?
--- End quote ---
I.e. storing the menu pointers and adjusting the menu after the startup complete event.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version