Deano1973
Resource contributor
- Messages
- 384
- Country

Hi folks, another quick XML question. I've searched far and wide on this one and there are many threads and answers, but it's very hard to pick out how things come together from the replies. In brief, I have an MFD with 5 screens. I've got my code together and can select each screen using a mouse click on the surrounding MFD buttons. So far, so "easy peasy". What I can't do is exclude the other four screens when selecting a particular screen - I have to turn off screen 1 in order to not have screen 2 overlay it when screen two is switched on, if that makes sense. I did cheat a bit and include a "background" image to screen 2 to cover screen 1, but I suspect I shouldn't need to do that.
Here's my modeldef button code for the first two switches of five, and my gauge XML below - would an "if" and "els" entry in the gauge code have any effect on Lvars perhaps? I should add that one of the screens has mouse click areas upon it - I'm hoping that they won't show up on other screens as they do at the moment. Will post the solution if I figure it out first.
Here's my modeldef button code for the first two switches of five, and my gauge XML below - would an "if" and "els" entry in the gauge code have any effect on Lvars perhaps? I should add that one of the screens has mouse click areas upon it - I'm hoping that they won't show up on other screens as they do at the moment. Will post the solution if I figure it out first.
Code:
<PartInfo>
<Name>MFD Button 1</Name>
<MouseRect>
<Cursor>Hand</Cursor>
<CallbackCode>(L:MFD Button 1, enum) ! (>L:MFD Button 1, enum)</CallbackCode>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>MFD Button 2</Name>
<MouseRect>
<Cursor>Hand</Cursor>
<CallbackCode>(L:MFD Button 2, enum) ! (>L:MFD Button 2, enum)</CallbackCode>
</MouseRect>
</PartInfo>
Code:
<Gauge Name="DCD F-18 Super Hornet MFD" Version="1.0">
<!--Checklist Screen-->
<Element>
<Visible>(A:Circuit Avionics on, bool) (L:MFD Button 1, enum) 0 == &&</Visible>
<Image Name="Checklist.bmp"/>
</Element>
<Element>
<Position X="190" Y="424"/>
<Select>
<Value>(L:Chains, bool)</Value>
<Case Value="1">
<Image Name="Chains.bmp" ImageSizes="153,17"/>
</Case>
</Select>
</Element>
<Element>
<Visible>(A:Circuit Avionics on, bool) (L:MFD Button 1, enum) 0 == &&</Visible>
<Position X="16" Y="400"/>
<Text X="120" Y="20" Bright="Yes" Length="20" Font="Tahoma" Color="Lime"
Adjust="Left" VerticalAdjust="Center">
<String>ELV TRIM: %((A:ELEVATOR TRIM PCT, PERCENT) 10 / 100 %) %!3d!%</String>
</Text>
</Element>
<Mouse>
<Area Left="215" Top="422" Width="140" Height="30">
<Cursor Type="Hand"/>
<Click Kind="LeftSingle">(L:Chains, bool) ! (>L:Chains, bool)</Click>
<Tooltip>Deck chains</Tooltip>
</Area>
</Mouse>
<!--HSI Screen-->
<Element>
<Visible>(A:Circuit Avionics on, bool) (L:MFD Button 2, enum) 1 == &&</Visible>
<Image Name="Background.bmp"/>
<Element>
<Visible>(A:Circuit Avionics on, bool) (L:MFD Button 2, enum) 1 == &&</Visible>
<Image Name="DCD_HSI.bmp"/>
xml coding for HSI continues on from here...
Last edited:


