Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Using 'cbEVT_COMPILER_STARTED'

<< < (3/3)

oBFusCATed:
Still this is hardly a reliable implementation, every time we decide to change the menu items, your plugin will break!

BlueHazzard:
Someone should implement a event CB_PRE_BUILD/ CB_PRE_RUN  that gets fired prior the compiling, and can stop the compiling/run process....

LETARTARE:
@oBFusCATed
you are right, but if you change the menus, you too will change plugin 'CompilerGCC', 'CodeCompletion', ... because it is hard coded, so I would adapt my plugin too.


--- Quote ---It is hard and unreliable, so don't do it.
--- End quote ---
In my case is fast enough :

--- Code: ---void cbPre::OnPrebuild(CodeBlocksEvent& event)
{
    cbPlugin * plug =  event.GetPlugin();
if (plug) {
                // -> 4 = ptCompiler soit cbCompilerplugin
PluginType type = plug->GetType() ; 
if (type == ptCompiler)  {
print(_T("plugin type = ") + (wxString()<<type) )  ;
}
}
}
--- End code ---
but to use it, take great care !!

@BlueHazzard
it is worth exploring, but that requires change 'sdk/sdk_events.*', so API 'sdk'. It's too complicated for me for now. This is my first binary plugin.

Modifying 'CompilerGCC', I propose above, highlights a feature of 'CodeBlocksEvent', which was not used, again this is a very minor change.

I will propose a patch when my plugin code will be correct, with a use case.

Thank you again, has both, for your advice.

Note : I have updated the wiki http://wiki.codeblocks.org/index.php?title=Code::Blocks_SDK_events with sdk 1.19.0 (13.12), I hope I have not made any mistakes.

LETARTARE:
Hello,
I would like to thank @BlueHazzard and @oBFusCATed who gave me good advice and allowed me to provide a plugin 'QtPregenForCB'.
Now,with your help,  I will try to modify it to make it more reliable. Inter alia, I can develop only under Win32 ' and that's a shame.

Here is the result : http://forums.codeblocks.org/index.php/topic,20000.new.html#new

Have a nice evening

Navigation

[0] Message Index

[*] Previous page

Go to full version