Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Howto pass mouse events for two gauges?

Featured Replies

I made a gauge that adds funcionalities for an almost dummy button. My gauge detects a mouse click and perform some actions, however the dummy gauge under my gauge must also receive the mouse click. As far I understood putting my gauge over the button blocks the mouse detection for the button. Is it possible to have both gauges receiving the mouse event?ThanksJos

Not directly. If both gauges are part of the same multigauge you can use variables that are accesable from both gauges though. You could use the same mouse function for both gauges, etc..Arne Bartels

Hey Jose,Arne is right, easiest way is to use the same mouse function in the MOUSE_CHILD_FUNCT for the second gauge.

Thanks, the gauges are distinct. It seems that I will have to intercept the mouse messages or make a direct input function and check it instead of using the MOUSE_CHILD_FUNCT. Jos

  • Author
  • Moderator

>Thanks, the gauges are distinct. It seems that I will have to>intercept the mouse messages or make a direct input function>and check it instead of using the MOUSE_CHILD_FUNCT. Why not simply pass the event via a broadcast variable to your 'dummy gauge?' The 'dummy gauge' could then execute whatever function you want based on the bool value of the received variable... :)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

I'm new to gauge programming but from my other (real?) job, I'd try to use a windows message and send it to the handle of the second gauge (message forwarding). That's commonly done with cascading controls. The only thing you need to know is how FS9 handles messages but redirect the target.Of course, it implies you can trap the message through the linkage, perhaps through a registered panel var?

  • Author
  • Moderator

That's too complicated a solution to a trivial problem.In the 'transmitting gauge,' simply create a 'broadcast' (i.e. shared) variable: for example, master_warnIn the 'receiving gauge,' create a 'receive' variable with the same name as before, but prefixed with an asterisk, e.g., *master_warn," as well as a local version of the same variable, "warn_on."To 'bullet proof' the code and prevent any errors, simply check that the memory location actually has the value stored from the broadcast gauge:if ( master_warn != NULL ) { warn_on = *master_warn ; }the later on,if warn_on = 1 { do something } else { do something else ; }

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.