X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWx.cxx;h=aa05db7b0633e969f12352490573b3335a180011;hb=13304e56deca37fe54072b423bc1214687ec503a;hp=e186c7923a6b8342a768dcc99996ed0164c9324e;hpb=5934ccb7ca0fabdbe6c1907b2aea3696e19a0251;p=bbtk.git diff --git a/kernel/src/bbtkWx.cxx b/kernel/src/bbtkWx.cxx index e186c79..aa05db7 100644 --- a/kernel/src/bbtkWx.cxx +++ b/kernel/src/bbtkWx.cxx @@ -2,40 +2,65 @@ #include "bbtkWx.h" #include "bbtkMessageManager.h" +#include +//#include namespace bbtk { -//EED static wxWindow* mgTopWindow = 0; static int mgNbWindowsAlive = 0; static int mgNbWindowsShown = 0; + static bool mgAutoDestroyTopWindow = true; - void Wx::CreateInvisibleTopWindow() + // BBTKWXSIG + static Wx::Signal_type mgWxSignal; + // \BBTKWXSIG + + + //========================================================================= + void Wx::CreateTopWindow(wxWindow* parent, bool autodestroy) { - wxWindow* top = new wxFrame(0,-1,_T("TOP (YOU SHOULD NOT SEE ME !!)")); + wxWindow* top = + new wxFrame(parent, + -1, + _T("TOP BBTK FRAME (YOU SHOULD NOT SEE ME !!)")); top->Hide(); Wx::SetTopWindow(top); + mgAutoDestroyTopWindow = autodestroy; } - - void Wx::ResetCursor() + //========================================================================= + + //========================================================================= + wxWindow* Wx::GetTopWindow() + { + if (mgTopWindow==0) Wx::CreateTopWindow(0); + return mgTopWindow; + } + //========================================================================= + + //========================================================================= + bool Wx::TopWindowExists() { - if (!GetTopWindow()) return; - bbtkDebugMessage("wx",9,"wx::ResetCursor()"< Destructing top window"<Close(); + mgTopWindow = 0; } - */ + // BBTKWXSIG + mgWxSignal(); + // \BBTKWXSIG + } + //========================================================================= + + //========================================================================= + void Wx::IncNbWindowsShown() + { + mgNbWindowsShown++; + bbtkDebugMessage("wx",2,"* Number of windows shown = "<IsShown())) + bbtkDebugMessage("wx",2,"* Number of windows shown = "<Close(); + bbtkDebugMessage("wx",2," --> Destructing top window"<Close(); + mgTopWindow = 0; } + // BBTKWXSIG + mgWxSignal(); + // \BBTKWXSIG } //========================================================================= + //========================================================================= -/*EED - // Static members - wxWindow* Wx::mgTopWindow = 0; - int Wx::mgNbWindowsAlive = 0; - int Wx::mgNbWindowsShown = 0; -*/ + int Wx::GetNbWindowsAlive() + { + return mgNbWindowsAlive; + } + //========================================================================= + + //========================================================================= + bool Wx::IsSomeWindowAlive() + { + return (mgNbWindowsAlive>0); + } + //========================================================================= + + + //========================================================================= + int Wx::GetNbWindowsShown() + { + return mgNbWindowsShown; + } + //========================================================================= + + //========================================================================= + bool Wx::IsSomeWindowShown() + { + return (mgNbWindowsShown>0); + } + //========================================================================= + + //========================================================================= + void Wx::ResetCursor() + { + if (!TopWindowExists()) return; + bbtkDebugMessage("wx",9,"Wx::ResetCursor()"<0); - } - - void Wx::IncNbWindowsShown() - { - mgNbWindowsShown++; - } - - int Wx::GetNbWindowsShown() - { - return mgNbWindowsShown; - } - - bool Wx::IsSomeWindowShown() - { - return (mgNbWindowsShown>0); - } - } #endif