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

Closing tabs..

(1/1)

David Perfors:
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:
};
--- End code ---

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]

mandrav:
EditorBase has this:

--- Code: ---bool EditorBase::Close()
{
    Destroy();
    return true;
}
--- End code ---


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

Yiannis.

David Perfors:
hmm, ok, but the option "close" in the file menu is disabled, how could I enable it?

mandrav:
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.

David Perfors:
Now it works :)

Navigation

[0] Message Index

Go to full version