X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWxGUIConsole.cxx;h=8f3c4e80452d361d2f0b6d3d3357184bfd81e029;hb=a280c10c9ba7730cd9105a91bf1a40e72503a6e3;hp=ae431dc9cb1cd6570949f29e969dc2a6d720e067;hpb=6575a389b71b1b85c79e4444885becb76ecf16e4;p=bbtk.git diff --git a/kernel/src/bbtkWxGUIConsole.cxx b/kernel/src/bbtkWxGUIConsole.cxx index ae431dc..8f3c4e8 100644 --- a/kernel/src/bbtkWxGUIConsole.cxx +++ b/kernel/src/bbtkWxGUIConsole.cxx @@ -2,8 +2,8 @@ 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 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -169,7 +169,8 @@ namespace bbtk // 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); @@ -199,12 +200,36 @@ namespace bbtk } //================================================================ + //================================================================ + void WxGUIConsole::OnClose(wxCloseEvent& event) + { + bbtkDebugMessage("widget",9,"bbi::OnClose()"<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"<Close(); + } + */ Close(); } } @@ -428,15 +453,17 @@ namespace bbtk //================================================================ // 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)