Jump to content
Sign in to follow this  
Guest Baumgarten

Press and Hold XML Button

Recommended Posts

Guest Baumgarten

Hello again Gurus, can anyone help me how to create a Press and Hold Button that my condition only appears after i remaing clicking that buttin and holding for 2 seconds?

Share this post


Link to post
Share on other sites

Gustavo,Some extra info would be great. For instance, does the condition need to remain active after releasing the button passing the 2 seconds, or it should reset (dissapear)? Do you know how to deal with events, (M:Event) structures, etc in XML code?Tom

Share this post


Link to post
Share on other sites
Guest Patrick_Waugh

>Hello again Gurus, can anyone help me how to create a Press>and Hold Button that my condition only appears after i remaing>clicking that buttin and holding for 2 seconds?Ummm you want us to write it for you? What have you tried? Where are you stuck? Please at least attempt to do it and then ask a specific question.A good example of push button code can be found in the Baron's gauge .cab file.

Share this post


Link to post
Share on other sites
Guest Baumgarten

Hello Guys, thanks for the answer.I first, yes I Do know how to work with click events, let me try to be more clear about my doubt. I making a brand new freeware Aspen AT300 gauge in XML code. I

Share this post


Link to post
Share on other sites

Gustavo,Ok, you can use this kind of approach:Put this at the beginning of the gauge, before any : (P:Absoulte time,seconds)in ,,(M:Event) 'LeftSingle' scmp 0 == if{ (L:Var1,seconds) 0 == if{ @Time (>L:Var1,seconds) 0 (>L:YOURVARDIMM,bool) } els{ (L:Var1,seconds) 2 + @Time < if{ 1 (>L:YOURVARDIMM,bool) } } } (M:Event) 'LeftRelease' scmp 0 ==if{ 0 (>L:Var1,seconds) 0 (>L:YOURVARDIMM,bool) }In this example, (L:YOURVARDIMM,bool) var will control the dimming status (0=off/1=on).If you need the dimming to remain ON when releasing the button AFTER a 2 seconds continious push, then remove the 0 (>L:YOURVARDIMM,bool) code within the 'LeftRelease' structure.You'll have to figure out how to insert the code for the other two pages in the snippet above :-) Hope this makes sense to you.TomPS: Please check for proper closing structures and replace "<" symbols with "& lt;" (without spaces) . Code is not tested.

Share this post


Link to post
Share on other sites

Hi,Something similar is to find in the Message Button of the MS GPS.Look at the macros, update and click section.25(@g:messagesOff) ! (>@g:messagesOff)(@g:messagePopup) @kOff == if{ @kOn (>@g:messagePopup) 1 (>@c:NewMessagesConfirm) } els{ @kOff (>@g:messagePopup) }(@g:msgButtonDown) 0 != if{ (@g:msgButtonCount) ++ d (>@g:msgButtonCount) @MSGButtonDelay == if{ @MSGToggle } }(M:Event) 'LeftSingle' scmp 0 == if{ (@g:msgButtonDown) 0 == if{ 1 (>@g:msgButtonDown) 0 (>@g:msgButtonCount) } }(M:Event) 'Leave' scmp 0 == if{ (@g:msgButtonDown) 1 == if{ 0 (>@g:msgButtonDown) (@g:msgButtonCount) @MSGButtonDelay < if{ @MSGButton } } }Essential is the update:When you press the button, the clock goes on and after the desired time (25) the event happens, "your dimpage becomes visible".When you stop pressing before the desired time is achieved the event cannot happen but another one can("your pages 1 or 2").I know this one works, cause i have such a button function in mu FMCYou still need some puzzling, but may be this is of help,Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Guest Baumgarten

Masters of Gauge Programing THANKSSS A LOTTTTTTTTTT I

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