Program: bbtk
Module: $RCSfile: bbtkWxGUIConsole.cxx,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:15 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2009/05/28 08:12:06 $
+ Version: $Revision: 1.16 $
=========================================================================*/
/* ---------------------------------------------------------------------
// Set the parent window of all bbtk windows as a child of this
- bbtk::Wx::SetTopWindowParent(this);
+ // bbtk::Wx::SetTopWindowParent(this);
+ bbtk::Wx::SetTopWindow(this);
// Top Window Auto Destroys when no more black box window alive
// : this is the default
// bbtk::Wx::SetAutoDestroyTopWindow(true);
}
//================================================================
+ //================================================================
+ void WxGUIConsole::OnClose(wxCloseEvent& event)
+ {
+ bbtkDebugMessage("widget",9,"bbi::OnClose()"<<std::endl);
+ //Wx::SetWindowsHaveBeenDestroyedByParent();
+ //mInterpreter.reset();
+ wxWindowList& list = GetChildren();
+ wxWindowList::iterator iter;
+ for (iter = list.begin(); iter != list.end(); ++iter)
+ {
+ (*iter)->Close();
+ }
+ this->Destroy();
+ }
+ //================================================================
+
//================================================================
void WxGUIConsole::OnWxSignal()
{
- if ((!Wx::TopWindowExists())&&(!IsShown()))
+ if ((!bbtk::Wx::IsSomeWindowAlive())&&(!IsShown()))
{
bbtkDebugMessage("wx",2," --> bbtk top window destroyed and WxGUIConsole not shown => destructing"<<std::endl);
+ /*
+ wxWindowList& list = GetChildren();
+ wxWindowList::iterator iter;
+ for (iter = list.begin(); iter != list.end(); ++iter)
+ {
+ (*iter)->Close();
+ }
+ */
Close();
}
}
//================================================================
// Overloaded Show method to handle bbtk::Wx::TopWindow auto-destruction
+ // OBSOLETE !!!
bool WxGUIConsole::Show(bool show)
{
- bbtk::Wx::SetAutoDestroyTopWindow(!show);
+ // bbtk::Wx::SetAutoDestroyTopWindow(!show);
return wxFrame::Show(show);
}
//================================================================
//================================================================
BEGIN_EVENT_TABLE(WxGUIConsole, wxFrame)
+ EVT_CLOSE( WxGUIConsole::OnClose)
EVT_MENU(ID_Menu_Quit , WxGUIConsole::OnMenuQuit)
EVT_MENU(ID_Menu_About , WxGUIConsole::OnMenuAbout)
EVT_MENU(ID_Menu_EditConfig , WxGUIConsole::OnMenuEditConfig)