Jump to content
Sign in to follow this  
bliksimpie

Clickspot to show up when curser access area

Recommended Posts

Is it possible to have a clickspot to be highlighted/indicated with overlaying image with some degree of transparency, the moment you move your curser over that spot.so when curser is not over area you see normal guage. if curser is moved over the clickspot it is highlighted.Hope you understand what I want to accomplish. and this is fir an XML gauge that I want to add this functionalityAny ideas?

Share this post


Link to post
Share on other sites

Not tested but you could try something like this...

<Area Name="MULTIPLE FUNCTION CLICK AREA" Left="0" Top="0" Width="10" Height="10"><Cursor Type="Hand"/><Click Kind="Move+Leave+LeftSingle">(M:Event) 'Move' scmp 0 == if{ 1 (>L:ShowAltBmp, bool) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:ShowAltBmp, bool) } (M:Event) 'LeftSingle' scmp 0 == if{ DO THE THING YOU WANT TO DO WITH A CLICK }</Click></Area>

In the main code base have a <Visiblity> tag using (L:ShowAltBmp, bool) to show and hide your bitmap.Hope this may help, again not tested fully, parts of it is from my previous projects.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

thank you kindly. will play with this.I know I had to put the code in the click area, but was not sure how and SDk is not much help, or I am missing it.from what I read it sounds promising.Anyway thanks at least I have something to begin working with.

Share this post


Link to post
Share on other sites

OK that work but not 100%here is my test gauge

<Gauge Name="TEST" Version="1.0">    <Image Name="Test.bmp" Luminous="Yes" ImageSizes="50,30"/>	<Element>		<Visible>(L:ShowAltBmp, bool) !=</Visible>		<Position X="10" Y="10"/>		<Rectangle Width="30" Height="15" LineWidth="0" FillColor="Blue" Bright="Yes"></Rectangle>	</Element>   	<Mouse>   		<Area Name="MULTIPLE FUNCTION CLICK AREA" Left="10" Top="10" Width="30" Height="15">      			<Tooltip ID="">Panels</Tooltip>      			<Cursor Type="Hand"/>        	        <Click Kind="Move+Leave+LeftSingle">(M:Event) 'Move' scmp 0 == if{ 1 (>L:ShowAltBmp, bool) } (M:Event) 'Leave' scmp 0 == if{ 0 (>L:ShowAltBmp, bool) } (M:Event) 'LeftSingle' scmp 0 == if{ 1140 (>K:PANEL_ID_TOGGLE) }</Click>		</Area>     	</Mouse></Gauge> 

When the gauge is up all is perfect and rectangle do not show.When I move the curser over the clickspot, then the blue regtangle pop up indicating the clickspot as well as curser chnage to hand (100% as I expect that to happen)When I then click the clickspot for that moment the regtangle dissapear (still ok)then with first movement to start to move the curser away the blue rectangle is back (still 100% OK - I expect that)but when the curser leave the clickspot area the blue rectangle stay up. (not OK) rectangle should now dissapear again.testresults.jpgany ideas?Thank you so much. I already have made huge inroads to what I try and accomplish.

Share this post


Link to post
Share on other sites

bliksimpie, Ahhh, now I remember barking up this same tree & the same problem cropped up,,, I cannot get "Leave" to work. I Believe that "Leave" is reserved for C++ .gau designers only. Any how I have 2 versions here, the latter being the better one in my opinion.Note - (L:ShowAltBmp, bool) has been replaced by (G:Var1) for testing, L:Vars donot reset themselves on a panel reload, G:Vars do.VERSION #1 - This one think of a click area inside of another, where, as you reach the center click (child) area the bitmap will show. Upon leaving the center click area but inside the outer click area (parent) it will turn off the bitmap... Here lies the problem, the difference between the parent & child click areas has to be kind of large so that fast mouse movements can register. And even in the code I provided here it still cannot catch all the "parent" movements if I moved the mouse fast enough.

<Gauge Name="Test" Version="1.0">
  <Image Name="Test.bmp" Luminous="Yes" ImageSizes="50,30"/>
  <Element>
    <Visible>(G:Var1)</Visible>
    <Rectangle Width="50" Height="30" LineWidth="0" FillColor="Blue" Transparency="0.75" Bright="Yes"></Rectangle>
  </Element>
  <Mouse>
    <!-- THIS VERSION HAS A X=15, Y=10 AREA ON ALL SIDES FOR BITMAP HIDE. LEAVING ONLY A 20 X 10 PIXEL FOR THE MAIN (CHILD) CLICKSPOT -->
    <Area Name="MULTIPLE FUNCTION CLICK AREA DISENGAGE" Left="0" Top="0" Width="50" Height="30">
      <Cursor Type="None"/>
      <Click Kind="Move">(M:Event) 'Move' scmp 0 == if{ 0 (>G:Var1) }</Click>
      <Area Name="MULTIPLE FUNCTION CLICK AREA ENGAGE" Left="15" Top="10" Width="20" Height="10">
        <Tooltip ID="">Panels</Tooltip>
        <Cursor Type="Hand"/>
        <Click Kind="Move+LeftSingle">
          (M:Event) 'Move' scmp 0 == 
             if{ 1 (>G:Var1) } 
          (M:Event) 'LeftSingle' scmp 0 == 
             if{ 1140 (>K:PANEL_ID_TOGGLE) }
        </Click>
      </Area>
    </Area>
  </Mouse>
</Gauge>

VERSION #2 - Basically a timed "bitmap show during mouse movement" The only big problem with this version is that it DOES NOT work when the sim is paused... ( Who flys with a paused sim? LOL! ) A small problem with this is that if you park the mouse over the area & leave it there without movement, the bitmap will eventually turn off until the mouse is moved again. The timing can be adjusted.

<Gauge Name="Test" Version="1.0">
  <Image Name="Test.bmp" Luminous="Yes" ImageSizes="50,30"/>
  <Element>
    <Visible>(P:ABSOLUTE TIME, seconds) (G:Var1) <</Visible>
    <Rectangle Width="50" Height="30" LineWidth="0" FillColor="Blue" Transparency="0.75" Bright="Yes"></Rectangle>
  </Element>
  <Mouse>
    <!-- TO ADJUST TIMING, SUBSTITUTE ANOTHER VALUE IN THE FOLLOWING - " (P:ABSOLUTE TIME, seconds) 0.5 +" -->
    <Area Name="MULTIPLE FUNCTION CLICK AREA, TIMED" Left="0" Top="0" Width="50" Height="30">
      <Tooltip ID="">Panels</Tooltip>
      <Cursor Type="Hand"/>
      <Click Kind="Move+LeftSingle">
        (M:Event) 'Move' scmp 0 == 
          if{ (P:ABSOLUTE TIME, seconds) 0.5 + (>G:Var1) } 
        (M:Event) 'LeftSingle' scmp 0 == 
          if{ 1140 (>K:PANEL_ID_TOGGLE) }
      </Click>
    </Area>
  </Mouse>
</Gauge>

Both have been tested, hope this helps, have fun..Roman

Edited by n4gix
Resurrected and Formatted XML Script

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

 

Share this post


Link to post
Share on other sites

thank you kindly sir.I really appreciate the effort you willing to help me. I like the "timed" one from what I read here, but I am going to try them bothedit I tested. The second one is a winner for me..! The idea is anyway to have it only displayed short time. So that one is most perfect..thank you very much!/edit

Share this post


Link to post
Share on other sites

I have now added this to my proper gauge where I wanted to use it and it is working great..! I decided to go with the timed option. Work very nicely.thanks againJB

Share this post


Link to post
Share on other sites

(* bumped back to top of forum after resurrecting the XML Scripts Roman so kindly provided! *)


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

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