User forums > General (but related to Code::Blocks)

Modifying Code::Blocks for students at Cambridge/MIT

<< < (2/2)

srhb2:
Hi,

Thank you for these ideas. I think I'm pretty much in agreement.

So far I am trying to do everything only using the .xrc files and wizard scripts, and have been able to do much of what I'd like to do. Just very simple things - getting rid of a lot of the extra menus etc. I don't think I'm the right person to be making detailed changes to C::B anyway, and as you say, I don't want to break it. Also, it needs to be updatable from the SVN insofar as possible.

I'll look at the idea of using a plug-in to catch events, a good way of decoupling any customizations I have to make. (The project PI is of course happy to give away any useful code that might come out of our efforts - it's for educational purposes afterall. There's no point in adding department/course specific stuff though I guess.)

The one problem with the way I've been doing it as compared to your suggestion of having the "easy mode" toggable is that editing the .xrc files etc doesn't neatly toggle on and off like a plugin. Hmm...

Anyway, will get back to you - need to try to figure out plugins and registering event handlers now...

Regards,

Steven

thomas:
Something like this should be nicely pluggable:

--- Code: ---LowEntryBarrierPlugin::OnAppFinishedLoading()
{
    // this is some hefty pseudo-code, but you get the idea  :-)
    for(filename, patchedfilename in all_xrc_files_to_replace)
    {
        wxXmlResource::Get()->UnLoad(_T("memory:") + filename );
        wxXmlResource::Get()->Load(patchedfilename);
    }
}
--- End code ---

It first unloads the resouces loaded by the application, and then loads the patched versions instead. Not the most efficient thing to do, but it should work seamlessly.

Please do note that you absolutely need the memory: prefix for unloading, since we do batch loading on the resources for performance reasons (especially over NFS) and let the XRC functions solely read from a memory stream.

srhb2:
Thanks very much - I'll give this a try.

Regards,

Steven

Navigation

[0] Message Index

[*] Previous page

Go to full version