I'm really just putting this here for my own future references as I am sure I will forget this and I couldn't find anything similar by searching.
To find out if a 2D panel is open use the C function is_panel_window_visible_ident. It will return 1 of true and 0 if false.
For example:
The ident is specified in the panel.cfg aircraft for each 2D window. For example:
ident=MAIN_PANEL
The definitions are from fsxgauges_sp2.h:
Note how in the C gauge you need to prefix IDENT_
If you want to use your own ident in the panel.cfg then make sure it is in the range 10000 to 19999. For example in the panel.cfg you can use:
ident=15533
and in the C gauge use:
To find out if a 2D panel is open use the C function is_panel_window_visible_ident. It will return 1 of true and 0 if false.
For example:
Code:
config_is_open = is_panel_window_visible_ident(IDENT_MAIN_PANEL);
ident=MAIN_PANEL
The definitions are from fsxgauges_sp2.h:
Code:
// Panel identifiers
#define IDENT_MAIN_PANEL 0
#define IDENT_MAIN_PANEL_ALT1 1
#define IDENT_MAIN_PANEL_ALT2 2
#define IDENT_MAIN_PANEL_ALT3 3
#define IDENT_MAIN_PANEL_ALT4 4
#define IDENT_MAIN_PANEL_ALT5 5
#define IDENT_MAIN_PANEL_ALT6 6
#define IDENT_MAIN_PANEL_ALT7 7
#define IDENT_MAIN_PANEL_ALT8 8
#define IDENT_MAIN_PANEL_ALT9 9
#define IDENT_THROTTLE_PANEL 10
#define IDENT_RADIO_STACK_PANEL 50
#define IDENT_COMPASS_PANEL 75
#define IDENT_MINI_CONTROLS_PANEL 100
#define IDENT_ANNUNCIATOR_PANEL 125
#define IDENT_ANNUNCIATOR2_PANEL 150
#define IDENT_IFR_MAIN_PANEL 175
#define IDENT_COLLECTIVE_PANEL 200
#define IDENT_GPS_PANEL 225
#define IDENT_OVERHEAD_PANEL 250
#define IDENT_PARKING_BRAKE_PANEL 251
#define IDENT_FLAPS_TRIM_PANEL 252
#define IDENT_FUEL_PANEL 253
#define IDENT_ELECTRICAL_PANEL 254
#define IDENT_TRIM_PANEL 255
#define IDENT_LANDING_GEAR_PANEL 256
#define IDENT_MISC_POPUP_1 260
#define IDENT_MISC_POPUP_2 261
#define IDENT_MISC_POPUP_3 262
#define IDENT_MISC_POPUP_4 263
#define IDENT_MISC_POPUP_5 264
#define IDENT_MISC_POPUP_6 265
#define IDENT_MISC_POPUP_7 266
#define IDENT_MISC_POPUP_8 267
#define IDENT_MISC_POPUP_9 268
#define IDENT_MISC_POPUP_10 269
#define IDENT_USER 10000
#define IDENT_USER_MAX 19999
#define MIN_HUD_IDENT 20000
#define IDENT_AIRCRAFT_HUD_3D_PANEL 20000
#define IDENT_HELICOPTER_HUD_3D_PANEL 20001
#define IDENT_CONTROLS_HUD_3D_PANEL 20002
#define IDENT_TEXT_HUD_3D_PANEL 20003
#define IDENT_DAMAGE_HUD_3D_PANEL 20004
#define IDENT_SCORE_HUD_3D_PANEL 20005
#define MAX_HUD_IDENT 20006
#define IDENT_LSO_WINDOW 22000
#define IDENT_POI_WINDOW 22001
#define IDENT_TIMER_WINDOW 22002
#define IDENT_DROPPABLE_OBJ_WINDOW 22003
#define IDENT_INVALID 4294967295
Note how in the C gauge you need to prefix IDENT_
If you want to use your own ident in the panel.cfg then make sure it is in the range 10000 to 19999. For example in the panel.cfg you can use:
ident=15533
and in the C gauge use:
Code:
config_is_open = is_panel_window_visible_ident(15533);




