Howto:Prototyping a new NavDisplay Style: Difference between revisions

Jump to navigation Jump to search
m
Line 140: Line 140:
{{Note|The following patch contains changes that move the definition of aircraft specific switches back into the navdisplay.styles file, adding GUI related fields to the hash, so that these can be used to procedurally create a UI without requiring an actual cockpit (including an optional values vector). In addition, this makes deletion of the Canvas by the ND optional, so that PUI based CanvasWidgets can reuse the ND without having to reallocate a new Canvas. Also, changes references to properly resolve to canvas.Path.
{{Note|The following patch contains changes that move the definition of aircraft specific switches back into the navdisplay.styles file, adding GUI related fields to the hash, so that these can be used to procedurally create a UI without requiring an actual cockpit (including an optional values vector). In addition, this makes deletion of the Canvas by the ND optional, so that PUI based CanvasWidgets can reuse the ND without having to reallocate a new Canvas. Also, changes references to properly resolve to canvas.Path.
}}
}}
<syntaxhighlight lang="diff">diff --git a/Nasal/canvas/api.nas b/Nasal/canvas/api.nas
<syntaxhighlight lang="diff">diff --git a/Nasal/canvas/map/navdisplay.mfd b/Nasal/canvas/map/navdisplay.mfd
index ea67217..8fd77e5 100644
index 89996f4..43080cb 100644
--- a/Nasal/canvas/api.nas
+++ b/Nasal/canvas/api.nas
@@ -462,7 +462,7 @@ var Map = {
  },
  del: func()
  {
-    #print("canvas.Map.del()");
+    # print("canvas.Map.del()");
    if (me.controller != nil)
      me.controller.del(me);
    foreach (var k; keys(me.layers)) {
diff --git a/Nasal/canvas/map/navdisplay.mfd b/Nasal/canvas/map/navdisplay.mfd
index 89996f4..7f8f4f8 100644
--- a/Nasal/canvas/map/navdisplay.mfd
--- a/Nasal/canvas/map/navdisplay.mfd
+++ b/Nasal/canvas/map/navdisplay.mfd
+++ b/Nasal/canvas/map/navdisplay.mfd
Line 202: Line 189:
  foreach(var t; me.timers)
  foreach(var t; me.timers)
  t.stop();
  t.stop();
foreach(var l; me.listeners)
- foreach(var l; me.listeners)
- removelistener(l);
- removelistener(l);
+ foreach(var l; me.listeners)
+ # removelistener(l);
+ # removelistener(l);
+ call(removelistener, [l]);
+ call(removelistener, [l]);

Navigation menu