Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: David Perfors on July 17, 2005, 06:18:59 pm

Title: Closing tabs..
Post by: David Perfors on July 17, 2005, 06:18:59 pm
I am playing with my new plugin UML::Blocks and I run into a problem...

I made a new tab in the editor like this(this is the whole source of the BaseView class header file):
Code
class BaseView : public EditorBase
{
public:
BaseView(wxWindow* parent, const wxString& title);
virtual ~BaseView();
virtual bool Close();
protected:
private:
};

I throw the parameters of the constructor to EditorBase.

I can open this tab by creating a new instance of BaseView. But I can't close this tab. Howto do this?[/code]
Title: Closing tabs..
Post by: mandrav on July 17, 2005, 06:36:39 pm
EditorBase has this:
Code
bool EditorBase::Close()
{
    Destroy();
    return true;
}


Or you could call Manager::Get()->GetEditorManager()->Close(EditorBase*). EditorManager is responsible for all editors after all...

Yiannis.
Title: Closing tabs..
Post by: David Perfors on July 17, 2005, 07:17:37 pm
hmm, ok, but the option "close" in the file menu is disabled, how could I enable it?
Title: Closing tabs..
Post by: mandrav on July 17, 2005, 08:06:11 pm
It's enabled in CVS now. File/Close and File/Save was checking for active cbEditor. Changed it to check for active EditorBase-derived editors.

Yiannis.
Title: Closing tabs..
Post by: David Perfors on July 17, 2005, 08:16:20 pm
Now it works :)