diff --git a/Nasal/gui.nas b/Nasal/gui.nas index 83435e683..c993dc25b 100644 --- a/Nasal/gui.nas +++ b/Nasal/gui.nas @@ -109,9 +109,10 @@ showWeightDialog = func { gwg = dialog.addChild("group"); gwg.set("layout", "hbox"); gwg.addChild("empty").set("stretch", 1); - gwg.addChild("text").set("label", "Gross Weight (lb):"); + gwg.addChild("text").set("label", "Gross Weight:"); txt = gwg.addChild("text"); txt.set("label", "0123456789"); + txt.set("format", "%.0f lb"); txt.set("property", "/yasim/gross-weight-lbs"); txt.set("live", 1); gwg.addChild("empty").set("stretch", 1); @@ -181,12 +182,14 @@ showWeightDialog = func { lbs = tcell(fuelTable, "text", i+1, 3); lbs.set("property", tankprop ~ "/level-lbs"); - lbs.set("label", "0123456789"); + lbs.set("label", "0123456"); + lbs.set("format", "%.3f"); lbs.set("live", 1); gals = tcell(fuelTable, "text", i+1, 4); gals.set("property", tankprop ~ "/level-gal_us"); - gals.set("label", "0123456789"); + gals.set("label", "0123456"); + gals.set("format", "%.3f"); gals.set("live", 1); } @@ -221,7 +224,8 @@ showWeightDialog = func { lbs = tcell(weightTable, "text", i+1, 2); lbs.set("property", wprop); - lbs.set("label", "0123456789"); + lbs.set("label", "0123456"); + lbs.set("format", "%.0f"); lbs.set("live", 1); } diff --git a/Nasal/props.nas b/Nasal/props.nas index 2860e02d4..9a0db0b09 100644 --- a/Nasal/props.nas +++ b/Nasal/props.nas @@ -28,6 +28,14 @@ Node = { removeChild : func { wrap(_removeChild(me._g, arg)) }, getNode : func { wrap(_getNode(me._g, arg)) }, + getPath : func { + name = getName(); + if(getIndex() != 0) { name = name ~ "[" ~ getIndex() ~ "]"; } + if(getParent()) { name = getParent().getPath() ~ "/" ~ name; } + else { name = "/" ~ name; } + return name; + }, + getBoolValue : func { val = me.getValue(); if(me.getType() == "STRING" and val == "false") { 0 }