Sign in to follow this  
Guest Skymed

SImple Switch

Recommended Posts

Hi all!I started with gauge design lately doing very basic things.I use FSpanel studio a lot, but even though I read a lot of stuff I'm still stuck with many xml code.I have made a new windows in one of the panels an Autopilot window accessed through the View - Instruments menu, it works OK, but I want to make a switch to show the Autopilot window on and off.I tried to modify simple switches code but no joy.I can't get the click code correct to address the window.Any help?Thanks allregardsbahri

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

The key is making the mouse click reference the panel window ID that you want to show. Make sure that your panel window has an ident window identifier:Example:[Window05]Background_color=0,0,0 size_mm=125,25window_size_ratio=1.000 position=0visible=1ident=125window_size= 0.600, 0.160window_pos= 0.200, 0.030gauge00=HUDT!Annunciator_Panel, 1,5,104,12Notice the ident=125This is the window identifier.Now in the switch code for the mouse click, reference that Ident like this: 125 (>K:PANEL_ID_TOGGLE) Which says......every time I click it will turn on/off window ident 125.Hope this helps.Steve

Share this post


Link to post
Share on other sites

Hi!Thanks a lot Steve, this was very helpfull and now the switch works.However the bmp is not changing always showing the bitmap for the on state. May be you could spare another monent and help me out.Regardsbahri

Share this post


Link to post
Share on other sites

OKSo add your own variable in the click line that will change the state of the switch bitmap. An L var bool can be triggered to a state of either 1 or 0 with the same mouse click that changes the panels, so in the mouse area, make your own L:Var,bool and then use that boolean to change the bitmaps:(L:Changebitmap,bool)Element> 125 (>K:PANEL_ID_TOGGLE) (L:Changebitmap,bool) ! (>L:Changebitmap,bool)You can make the L:Var any thing you want to call it.(L:Changebitmap,bool) ! changes the state of (L:Changebitmap,bool) to a 1 or a 0 every time you click the mose, then the state of it is loaded into (>L:Changebitmap,bool) and read by the Value tag in the switch.Hope that makes sense?Steve

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this