• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

set_gauge_flags ?

Messages
3
Country
turkey
I am trying to use C++ Gauges Function Reference (set_gauge_flags and panel_window_close_ident).

"panel_window_close_ident" working well but i can't got worked "set_gauge_flags" reference.

i havealways got that ;
": error C2447: '{' : missing function header (old-style formal list?)"

Where is the error or how shoud i use "set_gauge_flags" ?
Code:
/////////////////////////////////////////////////////////////////////////////
{
           void set_gauge_flags(PCSTRINGZ  hostes_vc, FLAGS32  0x2)
	}
/////////////////////////////////////////////////////////////////////////////
BOOL window_close_ident (UINT32 panel_id)
{
	return  panel_window_close_ident (12100);
}
/////////////////////////////////////////////////////////////////////////////
 
It's defined in the gauges.h file.

Code:
void		(FSAPI *set_gauge_flags) (PCSTRINGZ name, FLAGS32 newflags);		// newflags is GAUGE_FLAG_NORMAL, GAUGE_FLAG_HIDDEN...

I've never had any reason to use the function myself. What are you actually wanting to do with it? I guess you are wanting this gauge element to "blink" based on the 0x2 parameter...

Notes on usage are here:

http://msdn.microsoft.com/en-us/library/cc526958.aspx
set_gauge_flags
The set_gauge_flags function is used to specify the flags for a gauge.

Syntax:
Code:
void set_gauge_flags(
  PCSTRINGZ  name,
  FLAGS32  newflags
);


Parameters
name
[in] Specifies the name of the gauge.
newflags
[in] One or more of the following flags:

Flag Value
GAUGE_FLAG_NORMAL 0
GAUGE_FLAG_HIDDEN 0x1
GAUGE_FLAG_BLINKING 0x2
GAUGE_FLAG_GRAYED 0x4
GAUGE_FLAG_HILIGHTED 0x8

Return Values
This function does not return a value.
 
Last edited:
Thank you for answer n4gix.but i haven't got any solition.

I just want to hide .bmp files and get transparency black zone on a guage (like huds).
 
Thank you for answer n4gix.but i haven't got any solition.

I just want to hide .bmp files and get transparency black zone on a guage (like huds).

It is far simpler to use the SHOW_IMAGE and HIDE_IMAGE macro functions.

Code:
FLOAT64 FSAPI ELEC2_callback8( PELEMENT_ICON pelement)
{
	FLOAT64 rword=pelement->source_var.var_value.n;
	if ( dim == 1 ) { rword = 1 ; } else { rword = 0 ; } 
	if ( test == 1 || mbat == 1  &&  pulselightovrd == 1 ) { SHOW_IMAGE(pelement) ;   LIGHT_IMAGE(pelement) ; } else { HIDE_IMAGE(pelement) ; } 
	return rword;
}

There are also alternate methods one may use, which are very well described and exampled in Dai Griffith's massive C++ Gauge Tutorial (free) sd2gau29.zip

FS2K and CFS Gauge Creation Tutorial Rev.29

File Description:
Not for non-programmers but can be used by non-C programmers. Many updates; some major, most minor. See the ToC for additional info.

http://library.avsim.net/download.php?DLID=141364
 
It is far simpler to use the SHOW_IMAGE and HIDE_IMAGE macro functions.

Code:
FLOAT64 FSAPI ELEC2_callback8( PELEMENT_ICON pelement)
{
	FLOAT64 rword=pelement->source_var.var_value.n;
	if ( dim == 1 ) { rword = 1 ; } else { rword = 0 ; } 
	if ( test == 1 || mbat == 1  &&  pulselightovrd == 1 ) { SHOW_IMAGE(pelement) ;   LIGHT_IMAGE(pelement) ; } else { HIDE_IMAGE(pelement) ; } 
	return rword;
}

There are also alternate methods one may use, which are very well described and exampled in Dai Griffith's massive C++ Gauge Tutorial (free) sd2gau29.zip

FS2K and CFS Gauge Creation Tutorial Rev.29

File Description:
Not for non-programmers but can be used by non-C programmers. Many updates; some major, most minor. See the ToC for additional info.

http://library.avsim.net/download.php?DLID=141364

Thank you.I am going to try that.

Happy new year to all...
 
i can't got worked "set_gauge_flags" reference.

i havealways got that ;
": error C2447: '{' : missing function header (old-style formal list?)"

Where is the error or how shoud i use "set_gauge_flags" ?
Code:
/////////////////////////////////////////////////////////////////////////////
{
           void set_gauge_flags(PCSTRINGZ  hostes_vc, FLAGS32  0x2)
	}
/////////////////////////////////////////////////////////////////////////////

If that is part of your code, it's farily normal you get that error, because what you wrote looks like a function declaration, ( which you shouldn't do anyway, since the function is already declared in gauges.h ), but it's also wrong as a function declaration, because you can't specify a constant ( 0x2 ) as a formal parameter in a function declaration.

However, I guess your intention wasn't to declare the function, but simply call it so, it should be like this:

Code:
{
   void set_gauge_flags(  hostes_vc,  0x2 );
}

Note that, that call is NOT an equivalent of the SHOW_IMAGE, HIDE_IMAGE, etc, macros. The set_gauge_flags is acting at a global level and is setting flags that are relative to the gauge itself.

Instead, the SHOW_IMAGE/HIDE_IMAGE macros are relative to a single element ( a .BMP, an Icon, a slider, etc. ) of the gauge, that can be selectively enabled/disabled, as can be seen from the macro declaration, which is in fact just a way to set the image_flags member of the element structure ( ELEMENT_INFO ) in a gauge, and it takes a pointer to that specific element as a parameter, not the name of the whole gauge, like the set_gauge_flags call. So, SHOW_IMAGE/HIDE_IMAGE are probably what you'll probably want to do.

Also, other than doing different things, I guess the SHOW_IMAGE/HIDE_IMAGE macros are probably much faster to execute, since they just set a value in a structure, while the set_gauge_flags is surely slower because, since it takes the name of the gauge as a string parameter in input, I guess it'll have to search for the gauge with that name, every time you call that function.
 
Last edited:
Back
Top