Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

How can I get the full path of the project file the editor displaying?

<< < (3/3)

bruce:

--- Quote from: jens on March 30, 2012, 03:42:12 pm ---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

--- End quote ---

    Your code satisfied my needs, thanks very much for your solution to my problem. I succeeded in getting the full path of the file in the active editor.
    But I encountered another problem that I wanted to know what is the definition of the Manager class. I have used this class before. I searched my CB sdk documentation for its definition , but in vain, I only get its members, and its members' usage. Which website can help to query the main purpose of the Manager class?

bruce:

--- Quote from: oBFusCATed on March 30, 2012, 03:17:13 pm ---Ollydbg: I doubt it is that.
Bruce: If you really want to help you, you have to try harder to explain what do you want to achieve.

As far as I can understand, you want to find a way to get the full path to the active file?

--- End quote ---

Yes, that is my aim. I have accomplished this task, Thanks very much.

killerbot:

--- Quote from: oBFusCATed on March 30, 2012, 06:25:24 pm ---killerbot: you can use: "right click on the tab->show file in the project tree"

--- End quote ---

 ;D

killerbot:

--- Quote from: MortenMacFly on March 30, 2012, 08:30:09 pm ---
--- 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?

--- End quote ---

I guess this is something we could do. Will be easier to make a choice from the selected alternatives, then manual search .

Navigation

[0] Message Index

[*] Previous page

Go to full version