changeset 55:f0f354a97581 wasm

simplification
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Apr 2017 17:24:18 +0200
parents 01aa453d4d5b
children 9e3c2e75b870
files Framework/Viewport/WidgetViewport.cpp Framework/Widgets/EmptyWidget.h Framework/Widgets/IWidget.h Framework/Widgets/IWorldSceneInteractor.h Framework/Widgets/LayoutWidget.cpp Framework/Widgets/LayoutWidget.h Framework/Widgets/TestCairoWidget.h Framework/Widgets/TestWorldSceneWidget.cpp Framework/Widgets/TestWorldSceneWidget.h Framework/Widgets/WidgetBase.h Framework/Widgets/WorldSceneWidget.cpp Framework/Widgets/WorldSceneWidget.h
diffstat 12 files changed, 15 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Viewport/WidgetViewport.cpp	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Viewport/WidgetViewport.cpp	Fri Apr 28 17:24:18 2017 +0200
@@ -244,7 +244,7 @@
     }
     else
     {
-      repaint = centralWidget_->HasRenderMouseOver(x, y);
+      repaint = centralWidget_->HasRenderMouseOver();
     }
 
     if (repaint)
--- a/Framework/Widgets/EmptyWidget.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/EmptyWidget.h	Fri Apr 28 17:24:18 2017 +0200
@@ -110,8 +110,7 @@
 
     virtual void UpdateContent();
 
-    virtual bool HasRenderMouseOver(int x,
-                                    int y)
+    virtual bool HasRenderMouseOver()
     {
       return false;
     }
--- a/Framework/Widgets/IWidget.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/IWidget.h	Fri Apr 28 17:24:18 2017 +0200
@@ -70,8 +70,7 @@
                                  int x,
                                  int y) = 0;
 
-    virtual bool HasRenderMouseOver(int x,
-                                    int y) = 0;
+    virtual bool HasRenderMouseOver() = 0;
 
     virtual void MouseWheel(MouseWheelDirection direction,
                             int x,
--- a/Framework/Widgets/IWorldSceneInteractor.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/IWorldSceneInteractor.h	Fri Apr 28 17:24:18 2017 +0200
@@ -47,11 +47,6 @@
                                                         double y,
                                                         IStatusBar* statusBar) = 0;
 
-    virtual bool HasMouseOver(const WorldSceneWidget& widget,
-                              const SliceGeometry& slice,
-                              double x,
-                              double y) = 0;
-
     virtual void MouseOver(CairoContext& context,
                            WorldSceneWidget& widget,
                            const SliceGeometry& slice,
--- a/Framework/Widgets/LayoutWidget.cpp	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/LayoutWidget.cpp	Fri Apr 28 17:24:18 2017 +0200
@@ -190,17 +190,9 @@
       }
     }
     
-    bool HasRenderMouseOver(int x,
-                            int y)
+    bool HasRenderMouseOver()
     {
-      if (Contains(x, y))
-      {
-        return widget_->HasRenderMouseOver(x - left_, y - top_);
-      }
-      else
-      {
-        return false;
-      }
+      return widget_->HasRenderMouseOver();
     }
   };
 
@@ -519,12 +511,11 @@
   }
 
 
-  bool LayoutWidget::HasRenderMouseOver(int x,
-                                        int y)
+  bool LayoutWidget::HasRenderMouseOver()
   {
     for (size_t i = 0; i < children_.size(); i++)
     {
-      if (children_[i]->HasRenderMouseOver(x, y))
+      if (children_[i]->HasRenderMouseOver())
       {
         return true;
       }
--- a/Framework/Widgets/LayoutWidget.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/LayoutWidget.h	Fri Apr 28 17:24:18 2017 +0200
@@ -134,7 +134,6 @@
 
     virtual void UpdateContent();
 
-    virtual bool HasRenderMouseOver(int x,
-                                    int y);
+    virtual bool HasRenderMouseOver();
   };
 }
--- a/Framework/Widgets/TestCairoWidget.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/TestCairoWidget.h	Fri Apr 28 17:24:18 2017 +0200
@@ -68,8 +68,7 @@
       
       virtual void UpdateContent();
 
-      virtual bool HasRenderMouseOver(int x,
-                                      int y)
+      virtual bool HasRenderMouseOver()
       {
         return true;
       }
--- a/Framework/Widgets/TestWorldSceneWidget.cpp	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/TestWorldSceneWidget.cpp	Fri Apr 28 17:24:18 2017 +0200
@@ -48,14 +48,6 @@
         return NULL;
       }
 
-      virtual bool HasMouseOver(const WorldSceneWidget& widget,
-                                const SliceGeometry& slice,
-                                double x,
-                                double y)
-      {
-        return true;
-      }
-
       virtual void MouseOver(CairoContext& context,
                              WorldSceneWidget& widget,
                              const SliceGeometry& slice,
--- a/Framework/Widgets/TestWorldSceneWidget.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/TestWorldSceneWidget.h	Fri Apr 28 17:24:18 2017 +0200
@@ -54,6 +54,11 @@
       }
 
       virtual void UpdateContent();
+
+      virtual bool HasRenderMouseOver()
+      {
+        return true;
+      }
     };
   }
 }
--- a/Framework/Widgets/WidgetBase.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/WidgetBase.h	Fri Apr 28 17:24:18 2017 +0200
@@ -106,8 +106,7 @@
 
     virtual void UpdateContent();
 
-    virtual bool HasRenderMouseOver(int x,
-                                    int y)
+    virtual bool HasRenderMouseOver()
     {
       return false;
     }
--- a/Framework/Widgets/WorldSceneWidget.cpp	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/WorldSceneWidget.cpp	Fri Apr 28 17:24:18 2017 +0200
@@ -409,18 +409,4 @@
       interactor_->KeyPressed(*this, key, modifiers, GetStatusBar());
     }
   }
-
-  
-  bool WorldSceneWidget::HasRenderMouseOver(int x,
-                                            int y)
-  {
-    if (interactor_)
-    {
-      return interactor_->HasMouseOver(*this, GetSlice(), x, y);
-    }
-    else
-    {
-      return false;
-    }
-  }
 }
--- a/Framework/Widgets/WorldSceneWidget.h	Thu Apr 27 17:49:29 2017 +0200
+++ b/Framework/Widgets/WorldSceneWidget.h	Fri Apr 28 17:24:18 2017 +0200
@@ -137,8 +137,5 @@
 
     virtual void KeyPressed(char key,
                             KeyboardModifiers modifiers);
-    
-    virtual bool HasRenderMouseOver(int x,
-                                    int y);
   };
 }