Author Topic: Closing tabs..  (Read 6888 times)

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Closing tabs..
« 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: [Select]
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]
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Closing tabs..
« Reply #1 on: July 17, 2005, 06:36:39 pm »
EditorBase has this:
Code: [Select]
bool EditorBase::Close()
{
    Destroy();
    return true;
}


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

Yiannis.
Be patient!
This bug will be fixed soon...

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Closing tabs..
« Reply #2 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?
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Closing tabs..
« Reply #3 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.
Be patient!
This bug will be fixed soon...

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Closing tabs..
« Reply #4 on: July 17, 2005, 08:16:20 pm »
Now it works :)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring