diff Framework/Widgets/WidgetBase.h @ 273:f21ba2468570 am-2

force all Widgets to have a name to ease debugging
author am@osimis.io
date Fri, 24 Aug 2018 11:26:59 +0200
parents fccffbf99ba1
children 8a86695fcbc3
line wrap: on
line diff
--- a/Framework/Widgets/WidgetBase.h	Fri Aug 24 09:11:06 2018 +0200
+++ b/Framework/Widgets/WidgetBase.h	Fri Aug 24 11:26:59 2018 +0200
@@ -36,6 +36,7 @@
     bool         backgroundCleared_;
     uint8_t      backgroundColor_[3];
     bool         transmitMouseOver_;
+    std::string  name_;
 
   protected:
     void ClearBackgroundOrthanc(Orthanc::ImageAccessor& target) const;
@@ -52,7 +53,7 @@
     }
 
   public:
-    WidgetBase();
+    WidgetBase(const std::string& name);
 
     virtual void SetDefaultView()
     {
@@ -105,5 +106,11 @@
     }
 
     virtual void NotifyChange();
+
+    const std::string& GetName() const
+    {
+      return name_;
+    }
+
   };
 }