]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWx.h
*** empty log message ***
[bbtk.git] / kernel / src / bbtkWx.h
index c03b4d52c9a7f9406b5a63857794602623d992d8..a27aae1e88a87b5f3439313b68db913facb5d193 100644 (file)
@@ -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