News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Editor event information

Started by fenixk19, January 28, 2010, 12:31:25 AM

Previous topic - Next topic

fenixk19

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?

MortenMacFly

Quote from: fenixk19 on January 28, 2010, 12:31:25 AM
how to get name of just opened file, when i catch cbEVT_EDITOR_OPEN event?
       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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

fenixk19

Thanks. I didn't know what plugin to look at.
Quotewe have a SDK reference
You mean SDK reference in wiki?

Jenna

Quote from: fenixk19 on January 28, 2010, 08:01:28 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.

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

fenixk19