DG,
I'm afraid all of your conclusions regarding visibility and line break are very wrong, I believe mostly because of an unproper understanding on how the XML parser works.
I took some time and wrote a test gauge that you and everyone else can install and try to get the idea.
Just copy the gauge in Gauges folder, then in an aircraft of your choice add:
[Window Titles]
.....
windowNN=Visibility Test
[WindowNN]
size_mm=500,500
position=6
visible=0
ident=10222
gauge00=VisibilityTest, 0,0,500,500
Ok, let's see what we are talking about:
The first three elements do not contain <Visible> condition. Two of them have broken lines, and one of these even a break within a parameter definition (Color) :
Code:
<Element>
<Position X="6" Y="24" />
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>NORMAL STRING - STRAIGHT LINE</String>
</Text>
</Element>
<Element>
<Position X="6" Y="32" />
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center"
VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>NORMAL STRING - BROKEN LINE</String>
</Text>
</Element>
<Element>
<Position X="6" Y="40" />
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="Wh
te" Adjust="Center"
VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>NORMAL STRING - VERY BROKEN LINE</String>
</Text>
</Element>
The second group of elements has a <Visible> condition which is FALSE (0) when the gauge loads, both straight and broken lines:
Code:
<Element>
<Position X="6" Y="48" />
<Visible>(L:ClickTest)</Visible>
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>(VISIBLE STRING) - STRAIGHT LINE</String>
</Text>
</Element>
<Element>
<Position X="6" Y="56" />
<Visible>(L:ClickTest)</Visible>
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center"
VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>(VISIBLE STRING) - BROKEN LINE</String>
</Text>
</Element>
The third group of elements has a common parent <Element> with a <Visible> condition which is FALSE (0) when the gauge loads, both straight and broken lines:
Code:
<Element>
<Visible>(L:ClickTest)</Visible>
<Element>
<Position X="6" Y="64" />
<Visible>(L:ClickTest)</Visible>
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>(PARENT VISIBLE STRING) - STRAIGHT LINE</String>
</Text>
</Element>
<Element>
<Position X="6" Y="72" />
<Visible>(L:ClickTest)</Visible>
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center"
VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>(PARENT VISIBLE STRING) - BROKEN LINE</String>
</Text>
</Element>
</Element>
The fourth group of elements does not have a common parent <Element>, but each one has a <Visible> condition which is TRUE (1) when the gauge loads:
Code:
<Element>
<Position X="6" Y="80" />
<Visible>(L:ClickTest) !</Visible>
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>(VISIBLE STRING TRUE ON STARTUP) - STRAIGHT LINE</String>
</Text>
</Element>
<Element>
<Position X="6" Y="88" />
<Visible>(L:ClickTest) !</Visible>
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center"
VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>(VISIBLE STRING TRUE ON STARTUP) - BROKEN LINE</String>
</Text>
</Element>
The last group of elements has a common parent <Element> with a <Visible> condition which is FALSE (0) when the gauge loads, one of them also has a <Visible> condition itself, and both display a counter variable as well:
Code:
<Element>
<Visible>(L:ClickTest)</Visible>
<Element>
<Position X="6" Y="96" />
<Visible>(L:ClickTest)</Visible>
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>%((L:Counter,number))%!d! (PARENT+OWN VISIBLE STRING W/ COUNTER) - ST LINE</String>
</Text>
</Element>
<Element>
<Position X="6" Y="104" />
<Text X="324" Y="7" Bright="Yes" Length="54" Font="Arial" Color="White" Adjust="Center"
VerticalAdjust="Center" Multiline="No" Fixed="Yes">
<String>%((L:Counter2,number) ++ d (>L:Counter2,number))%!d! (PARENT VISIBLE STRING WITH COUNTER) - BROKEN LINE</String>
</Text>
</Element>
</Element>
Now, when the gauge displays, this is the first result:
The first group of elements shows as expected. Notice VERY BROKEN one changes its color because the break is in the color name. It seems the parser then uses the CR and LF chars as hex codes and displays the resultant color. Nice uh?
The second group does not show, also as expected, because the individual <Visible> conditions are FALSE (0) at gauge's load.
The third group does not show as well, because its parent <Element> has its <Visible> condition FALSE (0) at gauge's load.
The fourth group shows, even without having a parent <Element> , because the individual <Visible> conditions are TRUE (1) at gauge's load.
The last group does not show as its <Visible> condition is FALSE (0) at gauge's load.
When clicking on the
T at the bottom right, (L:ClickTest) changes from FALSE (0) to TRUE (1):
And a new situtation is displayed:
The first group of elements shows as expected, nothing special here.
The second group still doesn't show because, even <Visible> condition is TRUE (1) now, it was FALSE (0) at gauge's load. This is the main issue's source of this entire thread!.
The third group now shows, because its parent <Element> <Visible> condition is TRUE (1).
The fourth group doesn't show because the individual <Visible> conditions are now FALSE (0).
The last group now shows, as expected.
Let's see what happens if the 2D window is resized :
Now the second group becomes visible, because the rezise forced all of the window elements to refresh their buffers!.
Hope this helps to clarify things out.
Bottom line: when testing <Visible> conditionals, don't use (A) vars because they can load TRUE or FALSE depending on flight conditions, aircraft model and reload/reset situations; use (L) vars as in this example, where it is certain that they will load FALSE.
Tom