diff Framework/Widgets/LayoutWidget.cpp @ 54:01aa453d4d5b wasm

IWidget::HasRenderMouseOver
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Apr 2017 17:49:29 +0200
parents c2dc924f1a63
children f0f354a97581
line wrap: on
line diff
--- a/Framework/Widgets/LayoutWidget.cpp	Thu Apr 27 16:57:49 2017 +0200
+++ b/Framework/Widgets/LayoutWidget.cpp	Thu Apr 27 17:49:29 2017 +0200
@@ -189,6 +189,19 @@
         widget_->MouseWheel(direction, x - left_, y - top_, modifiers);
       }
     }
+    
+    bool HasRenderMouseOver(int x,
+                            int y)
+    {
+      if (Contains(x, y))
+      {
+        return widget_->HasRenderMouseOver(x - left_, y - top_);
+      }
+      else
+      {
+        return false;
+      }
+    }
   };
 
 
@@ -504,4 +517,19 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
     }
   }
+
+
+  bool LayoutWidget::HasRenderMouseOver(int x,
+                                        int y)
+  {
+    for (size_t i = 0; i < children_.size(); i++)
+    {
+      if (children_[i]->HasRenderMouseOver(x, y))
+      {
+        return true;
+      }
+    }
+
+    return false;
+  }
 }