]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/CanvasEvent.cxx
Update for OpenSceneGraph 3.3.2 API changes.
[simgear.git] / simgear / canvas / CanvasEvent.cxx
index 6c2684bc47ef724fc545b2557059d426bd6a9503..a438472b0380cf0c55a362cd645f08bea873d9bc 100644 (file)
@@ -27,7 +27,8 @@ namespace canvas
   Event::Event():
     type(UNKNOWN),
     time(-1),
-    propagation_stopped(false)
+    propagation_stopped(false),
+    default_prevented(false)
   {
 
   }
@@ -80,6 +81,18 @@ namespace canvas
     propagation_stopped = true;
   }
 
+  //----------------------------------------------------------------------------
+  void Event::preventDefault()
+  {
+    default_prevented = true;
+  }
+
+  //----------------------------------------------------------------------------
+  bool Event::defaultPrevented() const
+  {
+    return default_prevented;
+  }
+
   //----------------------------------------------------------------------------
   int Event::getOrRegisterType(const std::string& type_str)
   {
@@ -125,7 +138,7 @@ namespace canvas
 
     if( type_map.empty() )
     {
-#   define ENUM_MAPPING(type, str)\
+#   define ENUM_MAPPING(type, str, class_name)\
       type_map.insert(TypeMap::value_type(str, type));
 #     include "CanvasEventTypes.hxx"
 #   undef ENUM_MAPPING