make manual input work
This commit is contained in:
parent
7b7966dbb1
commit
ff8992d1a2
1 changed files with 17 additions and 13 deletions
|
@ -49,6 +49,10 @@
|
|||
<command>dialog-apply</command>
|
||||
<object-name>source-selection</object-name>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-update</command>
|
||||
<object-name>metar</object-name>
|
||||
</binding>
|
||||
</combo>
|
||||
|
||||
<textbox>
|
||||
|
@ -81,7 +85,7 @@
|
|||
<slider>20</slider>
|
||||
<editable>true</editable>
|
||||
<wrap>true</wrap>
|
||||
<live>true</live>
|
||||
<live>false</live>
|
||||
<property>sim/gui/dialogs/weather-scenario/metar</property>
|
||||
</textbox>
|
||||
|
||||
|
@ -165,7 +169,7 @@
|
|||
if( src[i] == `\n` or src[i] == `\r` )
|
||||
src[i] = ` `;
|
||||
|
||||
if( i != 0 and src[i] == 32 and src[i-1] == 32 )
|
||||
if( i != 0 and src[i] == ` ` and src[i-1] == ` ` )
|
||||
continue;
|
||||
|
||||
dst = dst ~ " ";
|
||||
|
@ -186,6 +190,17 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
var findElementByName = func(rootN, name) {
|
||||
foreach( var child; rootN.getChildren() ) {
|
||||
var n = child.getNode( "name" );
|
||||
if( n != nil and n.getValue() == name )
|
||||
return child;
|
||||
var f = findElementByName(child,name);
|
||||
if( f != nil ) return f;
|
||||
}
|
||||
return nil;
|
||||
};
|
||||
|
||||
var propertyChangeListener = setlistener( "sim/gui/dialogs/weather-scenario/source-selection", func(n) {
|
||||
description = "";
|
||||
metar = "nil";
|
||||
|
@ -209,17 +224,6 @@
|
|||
setprop( "sim/gui/dialogs/weather-scenario/metar", normalize_string(getprop("environment/metar/data")) );
|
||||
|
||||
|
||||
var findElementByName = func(rootN, name) {
|
||||
foreach( var child; rootN.getChildren() ) {
|
||||
var n = child.getNode( "name" );
|
||||
if( n != nil and n.getValue() == name )
|
||||
return child;
|
||||
var f = findElementByName(child,name);
|
||||
if( f != nil ) return f;
|
||||
}
|
||||
return nil;
|
||||
};
|
||||
|
||||
# fill the METAR source combo box
|
||||
var combo = findElementByName( dlg_root, "source-selection" );
|
||||
var wsn = props.globals.getNode( "/environment/weather-scenarios" );
|
||||
|
|
Loading…
Reference in a new issue