Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: fenixk19 on January 28, 2010, 12:31:25 am

Title: Editor event information
Post by: fenixk19 on January 28, 2010, 12:31:25 am
Hello. I'm writing a session management plugin, like in kate editor - it manages opened files, without using a project. First, i'm not sure that i'm not inventing a bicycle. Tell me please, if there is some way to save and restore information on opened files. And my main question is:
how to get name of just opened file, when i catch cbEVT_EDITOR_OPEN event?
Title: Re: Editor event information
Post by: MortenMacFly on January 28, 2010, 07:03:16 am
how to get name of just opened file, when i catch cbEVT_EDITOR_OPEN event?
Code
        cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(event.GetEditor());
        if (ed)
            wxString filename = ed->GetFilename();
Please have a look at how it's done in other plugins. Also we have a SDK reference which is very helpful here.  You can even build yourself using doxygen from the sources in SVN.
Title: Re: Editor event information
Post by: fenixk19 on January 28, 2010, 08:01:28 am
Thanks. I didn't know what plugin to look at.
Quote
we have a SDK reference
You mean SDK reference in wiki?
Title: Re: Editor event information
Post by: Jenna on January 28, 2010, 09:10:14 am
Thanks. I didn't know what plugin to look at.
The easiest way in such a case is to use ThreadSearch plugin and search for the keyword, either in the project (it's enough in this case) or in C::B's source-directory.
Title: Re: Editor event information
Post by: MortenMacFly on January 28, 2010, 08:10:47 pm
You mean SDK reference in wiki?
No, I meant the CHM file on BerliOS here:
http://developer.berlios.de/project/showfiles.php?group_id=5358

Namely "codeblocks_sdk_doc_r6117.chm", this link:
http://prdownload.berlios.de/codeblocks/codeblocks_sdk_doc_r6117.chm
Title: Re: Editor event information
Post by: fenixk19 on January 29, 2010, 09:54:52 am
Thanks