Author Topic: Editor event information  (Read 6463 times)

Offline fenixk19

  • Multiple posting newcomer
  • *
  • Posts: 15
Editor event information
« 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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Editor event information
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline fenixk19

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Editor event information
« Reply #2 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?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Editor event information
« Reply #3 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Editor event information
« Reply #4 on: January 28, 2010, 08:10:47 pm »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline fenixk19

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: Editor event information
« Reply #5 on: January 29, 2010, 09:54:52 am »
Thanks