Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
How can I get the full path of the project file the editor displaying?
Jenna:
If you just want to get the name of the file in the active editor, something like this should work:
--- Code: ---
wxString theName;
EditorManager* em = Manager::Get()->GetEditorManager();
if (em)
{
EditorBase* eb = em->GetActiveEditor();
if (eb)
{
theName = eb->GetFilename();
}
}
--- End code ---
Warning: not tested, just written from memory
killerbot:
I think he wants the the full path of the project (cbp file) which is the parant (owner) of the file open in the active editor.
To be honest we should do something similar on the inside, since I also have a nice use case for this :
addition in our right click menu : activate project containing "this" file.
Why : my workspace contains a whole lot of projects, sometimes starting from project x I include file open and end up at file foo.h (F11 to foo.cpp) and suddenly I want to change it's code and build the project it belongs too ...., and searching for the project is hard, even with the find file (since that one is really case sensitive, and no wildcards)
oBFusCATed:
killerbot: you can use: "right click on the tab->show file in the project tree"
MortenMacFly:
--- Quote from: killerbot on March 30, 2012, 05:41:00 pm ---To be honest we should do something similar on the inside, since I also have a nice use case for this :
addition in our right click menu : activate project containing "this" file.
--- End quote ---
Well a file can belong to many projects/targets. What would you do then? Ask which one to activate?
ollydbg:
--- Quote from: MortenMacFly on March 30, 2012, 08:30:09 pm ---Well a file can belong to many projects/targets. What would you do then? Ask which one to activate?
--- End quote ---
CodeCompletion plugin also have such issue. Currently, we just search every opened projects, and choose the first one matches the file.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version