Jump to content
Sign in to follow this  
Guest FLEX_45

Easy XML Code (Not for me though) - Please help!

Recommended Posts

Guest FLEX_45

Hello guys,I am very very new to XML coding, however I want to create a simple (I think) :-) XML gauge but I cannot find the code for it. I would really appreciate it if anyone can help me with the code.I want to make a gauge so that there will be an invisible clickspost on a panel that will show/hide a bitmap that I will assign to it, when clicked. The problem is that I don't want that bitmap to be a panel window and to be shown when I click the spot. I want it to be a bitmap in the gauge itselt and be able to assign the clickspot area and the area/size for the gauge (bitmap) to be displayed on the panel.I have searched the forum but I can only find codes for toggling on/off windows using the ident....I didn't find the code for the way I want it to be.I would really appreciate any help.Thanks in advance,Marios.P.S. If it is of any help, the bitmap will be 300x300 and will be a new ecam page for an airbus panel. The invisible clickspot will be placed over the respective button on the ecam control panel. :-)

Share this post


Link to post
Share on other sites
Guest Skymed

Kinda like this:"main image" is the part of the gauge on which you want "second_image" to appear. second image is made visible when the statement inside the tags is true.A mouse click on any area of the gauge main body can be assigned via an area, and then when you click in the defined area, you will make the variable (L:Visible,bool) true or false, turning the second image on or off.(L:Visible,bool) (L:Visible,bool)!(>L:Visible,bool) /Click>Make me Visible

Share this post


Link to post
Share on other sites
Guest FLEX_45

Hello Skymed,Thanks for the code, but that's 98% of what I am looking for :-)I don't want to have two bmps....I want to have only one bmp so that when it is made visible (by clicking the hotspot) will show up and when it is not made visible (by clicking again the hotspot) to disappear.....not to appear another bmp.Also the hotspot if I understood correctly will be anywhere in the bitmap area? It has to be outside the bitmap though to match the button on the ecam control panel :-) Is this possible to be done?To help you understand what I mean I attached a screenshot showing the hotspot (small red box) and the bitmap display area (big box on ecam). To make it simpler, when I click once on the STS button the Status page bitmap will be displayed on the ecam infront of the other page. When pressed again it should go away :-)Thanks Marios http://forums.avsim.net/user_files/91118.jpg

Share this post


Link to post
Share on other sites
Guest Skymed

Ok. 2 steps:First make the STS button , like this: (L:Visible,bool) (L:Visible,bool)!(>L:Visible,bool)Make me VisibleWe will use the (L:Visible,bool) in the click to do 2 things: 1 it will make the button go up and down ( if you have the right graphics) and it will also be used in the visible tag later. (L:Visible,bool)!(>L:Visible,bool)What the click does is change (L:Visible,bool)from a 1 to a 0 every time you click on the mouse.So thats our button.Now, in the gauge, we use the (L:Visible,bool)to make the bitmap visible.So, put some code like this in your gauge,(L:Visible,bool)So that when you click on your button, (L:Visible) switches from 1 to 0 turning the bitmap on and off.Hope that helps?Steve

Share this post


Link to post
Share on other sites

I get the impression that you are wanting to have one gauge appear OVER an existing gauge.If this is what you want, that is going to be a real problem... 'cause it won't work. XML gauges cannot be "stacked" on top of each other...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Hi,For the EICAS i use a knob with 7 positions.The same can be done done with 7 push-buttons.The clickspots are the push-buttons and the EICAS shows the different bitmaps, or in my case text, in 1 gauge.So give the push-buttons some code: 0 (L:Eicas,enum) 1 (L:Eicas,enum) 2 (L:Eicas,enum)etc.In the EICAS then you can show the different bitmaps according: (L:Eicas,enum}etc.In this way always only one bitmap will be visible.If you also want to move or enlighten the push-button do something like (Button_0): (L:Eicas,enum) 0 ==Hope it helps,Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest FLEX_45

Hello guys,Thanks for the replies but.....(I really feel stupid) I didn't manage to make the gauge work :-(All it happens it's that I find the clickspot but when I click on it neither the button iluminates nor the gauge bitmap appears :-( (I have all the bmps correctly in the gauge - I must be doing something wrong with the code....the very little left for me to do) :-)Here is what I have done:Button Gauge:(L:Visible,bool)(L:Visible,bool)!(>L:Visible,bool)Make me VisibleBitmap Gauge:(L:Visible,bool)A320 STS Page(L:clickevent, bool) ! (>L:clickevent, bool)What's wrong guys? Does spacing has to do anything here?I am lost :-hmmmThanks againMariosP.S. I also tried it over a plain bitmap window, not over other gauges just to make sure and still nothing!

Share this post


Link to post
Share on other sites

Hi,Spacing is very important, also (!After rewriting: (L:Visible,bool) (L:Visible,bool) ! (>L:Visible,bool)Make me VisibleBitmap Gauge: (L:Visible,bool)A320 STS Page (L:clickevent, bool) ! (>L:clickevent, bool)Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest FLEX_45

Hello guys,The code now is working great! Thanks! :-)However there is a small problem though....which is what Bill suggested in a previous post...the gauge bitmap that we did loads behind the existing ecam page gauge thus making the new gauge show/hide when clicked but behind the existing gauge :-(Is there a way to force the new gauge to show on top of everything else? Btw in the panel.cfg it is added last. :-) Or is there another approach I have to consider to achieve this effect? Thanks again for the great great help guys....you are the best! ;-)Marios.

Share this post


Link to post
Share on other sites
Guest FLEX_45

Hello Jan,The problem is that the other ecam pages are not done by me...so there will always be a page displayed....what I had in mind was to make a bitmap 1,1,1 (black but not transparent) to show infront of the ecam when the sts button is pressed covering the existing ecam page....now the code works fine but the new bitmap is displayed behind the existing ecam page...any clues? :-)ThanksMarios

Share this post


Link to post
Share on other sites

Hi,Are that other pages also in XML?If so, you can try to edit the other ecam-page(s)and add your page, some work i know, but possible.If not, then it will be impossible.Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest FLEX_45

Hi,Unfortunately the others are in .gau format :-(If I keep only the button xml gauge and set it to call up a new window (the gauge bitmap) will this allow it to appear infront of the other gauges?ThanksMarios

Share this post


Link to post
Share on other sites

Marios,Yes it will and that seems to be the only solution.Jan"Beatus Ille Procul Negotiis"

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...