X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkWx.h;h=a27aae1e88a87b5f3439313b68db913facb5d193;hb=6ea571ab3b7a539aaaca066db3941f5017920209;hp=c03b4d52c9a7f9406b5a63857794602623d992d8;hpb=a26195c366a89795288009cf7e20f11afa494970;p=bbtk.git diff --git a/kernel/src/bbtkWx.h b/kernel/src/bbtkWx.h index c03b4d5..a27aae1 100644 --- a/kernel/src/bbtkWx.h +++ b/kernel/src/bbtkWx.h @@ -35,17 +35,39 @@ namespace bbtk { //================================================================== /// Global wx handlers (cursor...) - - struct BBTK_EXPORT wx - { public: - static void ResetCursor(); - static void BeginBusyCursor(); - static void EndBusyCursor(); - static int mBeginBusyCallsCount; - }; // struct wx -//================================================================== - - + + struct BBTK_EXPORT Wx + { + public: + static void ResetCursor(); + static void BeginBusyCursor(); + static void EndBusyCursor(); + static int mBeginBusyCallsCount; + + /// Returns the global parent of all bbtk windows + static wxWindow* GetTopWindow() { return mgTopWindow; } + /// Sets the global parent of all bbtk windows + static void SetTopWindow(wxWindow*); + + static void IncNbWindowsAlive() { mgNbWindowsAlive++; } + static void DecNbWindowsAlive(); + static int GetNbWindowsAlive() { return mgNbWindowsAlive; } + static bool IsSomeWindowAlive() { return (mgNbWindowsAlive>0);} + + static void IncNbWindowsShown() { mgNbWindowsShown++; } + static void DecNbWindowsShown(); + static int GetNbWindowsShown() { return mgNbWindowsShown; } + static bool IsSomeWindowShown() { return (mgNbWindowsShown>0);} + + private: + static wxWindow* mgTopWindow; + static int mgNbWindowsAlive; + static int mgNbWindowsShown; + + }; // struct Wx + //================================================================== + + //================================================================== /// Conversion std::string to wxString inline wxString std2wx(const std::string& s){ @@ -88,12 +110,23 @@ namespace bbtk namespace bbtk { - struct BBTK_EXPORT wx - { - static void ResetCursor() {} - static void BeginBusyCursor() {} - static void EndBusyCursor() {} - }; // struct wx + struct BBTK_EXPORT Wx + { + static void ResetCursor() {} + static void BeginBusyCursor() {} + static void EndBusyCursor() {} + static wxWindow* GetTopWindow() { return 0; } + static void SetTopWindow(wxWindow*) {} + static void IncNbWindowsAlive() {} + static void DecNbWindowsAlive() {} + static int GetNbWindowsAlive() { return 0; } + static bool IsSomeWindowAlive() { return false; } + + static void IncNbWindowsShown() {} + static void DecNbWindowsShown() {} + static int GetNbWindowsShown() { return 0; } + static bool IsSomeWindowShown() { return false; } + }; // struct Wx } // namespace bbtk