Jump to content
Sign in to follow this  
Guest Schindi

Order of mouse areas in XML-gauges?

Recommended Posts

Guest Schindi

Hello there!I'm still working on my UFC for the PC-21 and it's coming along nicely, but still I got one bugging detail that I just can't get right: the click-areas! I assume I did something wrong with the order of mouse areas and how they're arranged in the xml-file...My question: how should the areas be ordered in the file? I worked with "areas are ordered from left to right for each line, and one line after the other". I mean a rectangular gauge with areas (leters) looking like this:A__B__C_D__E___F__G__would result in the area-codes arranged like:ABCDEFHowever if I do that I get strange results, like clicking the course affects the altitude and similar. I made sure I avoided overlapping areas, so this shouldn't be a problem. Could it be "A,D,F,B,E,G,C" would be the right answer? What are the 'rules' for that?So, if anyone could tell me where I went wrong this time, that would be really appreciated! Thanks a lot and have a nice weekend! :DCheers,Markus

Share this post


Link to post
Share on other sites

Markus,Really cannot tell you what is wrong because it seems so right...Just maybe some things to try...1. Because this is a self contained attribute you may want to try2.same as above --- OR ---3.Change how you handle the clicks completely.FromTo(>K:COM_RADIO_WHOLE_DEC)Maybe there is a bug in how click "events" are handled in FS. I for one have never used the "events" and just stuck to the (>K:) type handler and never had any problems with the situation you are describing.Hope this can help, wish I had a definite answer for you, kinda stumped also :-)Regards,Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites

Hi Markus,Have you tried e.g.:instead of??So define Right/Bottom instead of Width/Height.Which is what I always use (I wasn't even aware you could use Height/Width)Cheers, Rob Barendregt

Share this post


Link to post
Share on other sites

Also,Instead oftry,I've never tried this with the click on the end of the line in this format.We have a tutorial on our site covering the mouse area, so have a read and see if it helps,nick

Share this post


Link to post
Share on other sites

Hi Rob,For sure the problem does not lay there.I use Height/Width instead of Right/Bottom, and it works perfect.Cheers,Tom

Share this post


Link to post
Share on other sites

Hi Schindi,From your code:<?xml version="1.0" encoding="UTF-8"?>Now, just try putting :<?xml version="1.0" encoding="UTF-8"?>See it? You need to define the size of your gauge. What you defined was the IMAGE size, not the gauge one.I guess this should resolve the problem.About ordering those structures, well, there is NO order by default; it means you can put code in any sequence and it will work fine providing there is NO overlapping sectors, as Nick said.Another point: if you plan to make your gauge for FS2004 only, there is no need to use "Imagesize". That will save you a lot of coding.Hope this helpsTom

Share this post


Link to post
Share on other sites

I think the whole problem is with the coordinates of your click spots. You have overlapping click spots, and some aren't located correctly. I mapped a few of them out in Photoshop using a different "color fill" layer for each click spot. See attached image, note the overlaps and placement:http://www.cat-tamer.com/attach/CMA-9000_AP.jpgI also use Width="X" Height="X" without any problems. Nice autopilot, BTW.Jim

Share this post


Link to post
Share on other sites
Guest Schindi

Ok, gentlemen, I got it now! Thank you all for your contributions! They all taught me some new tricks to optimise my codes. And especially thanks Jim, for you pointed me the right way for the problem at hand...So, to make a short story even shorter: Schindi is just too stupid!!!Jim, when I saw your pic (thanks for the effort) I thought "wait a minute - those are not the areas I defined!!!" I actually use a CorelDraw vector graphic to plan the gauge, so I can just draw the elements and then read their coordinates and enter them into my code. Now that all would work really well if the idiot which is me wouldn't mix up "Left" and "Width", ha ha!!!I switched now those two words in all cases, and now everything works just perfectly as I want it! Surprise surprise!!!Ok, thanks again for your insights! Gotta go back now and add the last few buttons...With kind regards from Switzerland,Markus

Share this post


Link to post
Share on other sites

Now that's funny! Sounds like something I'd do, that's for sure. Glad you got it ironed out and thanks for posting back.Jim

Share this post


Link to post
Share on other sites

I was just playing with your code, I think you meant that you swapped every occurance of "Height" and "Top" rather than "Left" and "Width", correct?Anyway I just tried it and your click spots work perfectly now.http://www.cat-tamer.com/attach/CMA-9000_AP-fixed.jpgGood job of pinpointing the problem :)Jim

Share this post


Link to post
Share on other sites
Guest Schindi

>>Good job of pinpointing the problem :)>>JimThanks to YOU, buddy! :DCheers,Markus

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...