I invite everybody to share about problems or solutions to have "C" gauges working fine, so here is the first note on how to show and hide an image in a gauge, after many "trials and errors".
The macro to use to show/hide an image within a gauge is MAKE_ICON, if you have a look at the sample gauge from the FS2kSDK, the relevant example is the "SDK.Fuel_Selector.c", and in the old FS98SDK, the example is "SDK.magnetos.c."
Both are a bit confusing, explaining how to show an image between others, but nothing is said on how to show and hide a unique image.
Dai Griffiths shows a fine way to do it in his tutorials serie, I highly recommend his tutorials study, I wouldn't have succeeded on anything without it, see "SHOW/HIDE Macros" for that, but the way he does it needs the implementation of "SHOW_LISTELEMENT" and "HIDE_LISTELEMENT" in the gauges.h file, and that's not in the gauges.h from the FS2kSDK, there is somehow several meanings to do it using the original gauges.h
The return awaited for a single image to show in a MAKE_ICON macro is "0", that's the default value if you don't set up a gauge callback, the image name for value 0 is defined in the macro on line 2. if there are several images to show, the next is 1, 2, 3, etc... and the order is defined in the .h file, with intervals between images numbers of 1, in hexadecimal, so when you'll have image 1009, the next one must be 100A, then 100B, 100C, 100D,100E, 100F, and only now 1010.
Suppose you want all the images to be hidden, you can act in the icon-callback, returning -1 or any negative value, or you can define a flag for the entire macro to be hidden ( "HIDE_IMAGE(pelement)" and "SHOW_IMAGE(pelement)" )
Here is in a zip a sample of left and right magnetos as they are on a Sopwith Tripe panel, using only three bitmaps, with the different files and a gauge sample, and only three images:
-the background with the states "off" for both mags
-a left "on" image for the left mag
-a right "on" image for the right mag
The macro for the left mag uses the first meaning, and the one for the right mag the second.
Perhaps I believe I re-invented the wheel ? let me know
cheers
Martin
The macro to use to show/hide an image within a gauge is MAKE_ICON, if you have a look at the sample gauge from the FS2kSDK, the relevant example is the "SDK.Fuel_Selector.c", and in the old FS98SDK, the example is "SDK.magnetos.c."
Both are a bit confusing, explaining how to show an image between others, but nothing is said on how to show and hide a unique image.
Dai Griffiths shows a fine way to do it in his tutorials serie, I highly recommend his tutorials study, I wouldn't have succeeded on anything without it, see "SHOW/HIDE Macros" for that, but the way he does it needs the implementation of "SHOW_LISTELEMENT" and "HIDE_LISTELEMENT" in the gauges.h file, and that's not in the gauges.h from the FS2kSDK, there is somehow several meanings to do it using the original gauges.h
The return awaited for a single image to show in a MAKE_ICON macro is "0", that's the default value if you don't set up a gauge callback, the image name for value 0 is defined in the macro on line 2. if there are several images to show, the next is 1, 2, 3, etc... and the order is defined in the .h file, with intervals between images numbers of 1, in hexadecimal, so when you'll have image 1009, the next one must be 100A, then 100B, 100C, 100D,100E, 100F, and only now 1010.
Suppose you want all the images to be hidden, you can act in the icon-callback, returning -1 or any negative value, or you can define a flag for the entire macro to be hidden ( "HIDE_IMAGE(pelement)" and "SHOW_IMAGE(pelement)" )
Here is in a zip a sample of left and right magnetos as they are on a Sopwith Tripe panel, using only three bitmaps, with the different files and a gauge sample, and only three images:
-the background with the states "off" for both mags
-a left "on" image for the left mag
-a right "on" image for the right mag
The macro for the left mag uses the first meaning, and the one for the right mag the second.
Perhaps I believe I re-invented the wheel ? let me know
cheers
Martin