Jump to content
Sign in to follow this  
Guest dek

left click and hold...

Recommended Posts

Guest dek

Hi all, I want to be able to left click on .bmp A, and as long as the left mouse button is held down, .bmpB will replace it. However, I want .bmpB to disappear and .bmpA to reappear when the left mouse button is released. Just one click of the left button.An example are the buttons on the default GPS. Click on one, and as long as the left mouse button is depressed, the button will be "in". Release and it goes back "out".Thanks, don

Share this post


Link to post
Share on other sites

Hey Don. If we're talking about a C gauge, it's pretty simple. Start out with a MAKE_ICON macro set up to display the UP bitmap. You'll have a BOOL such as bMouseDown that will tell that element's callback that the mouse button is down. If the button is down, draw the 2nd one.For your mouse callback, you can use MOUSE_LEFTSINGLE to alert you when the button goes down, and MOUSE_LEFTRELEASE when it's released. The mouse function would check to see if the MOUSE_LEFTRELEASE or MOUSE_LEFTSINGLE bits are set in mouse_flags, using a bitwise AND.If you need some sample code, let me know. :-)

Share this post


Link to post
Share on other sites
Guest dek

Thanks for the response Matt! But, no I'm not a programmer per se. Just an XML hacker that understands enough to get himself into trouble. I'm not even sure what a "macro" is (sort of know). But I think that is what Microsoft used in the default GPS. Take care, donp.s. You know you've been simming too much when you press on the button on the yoke of a real C172 and wonder why the trim is not working!

Share this post


Link to post
Share on other sites

Hi,Try:(M:Event) 'LeftSingle' scmp 0 == if{ (your event 1) } (M:Event) 'Leave' scmp 0 == if{ (your event 2) } Jan"Beatus Ille Procul Negotiis"

Share this post


Link to post
Share on other sites
Guest dek

Thanks Jan and Roman for the responses! I guess I need to learn about M:events. I follow what you are doing, but what is scmp?Cheers, don

Share this post


Link to post
Share on other sites
Guest bartels

FS9 Panels_SDK:scmp Compares strings.if two strings are equal the result is 0.Arne Bartels

Share this post


Link to post
Share on other sites
Guest dek

Thanks Arne, I'll look at the SDK.Cheers, don

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