Sign in to follow this  
Guest bartels

Panel Control Icons

Recommended Posts

I know that it is possible to get around the 0-9 panel limit using XML code, by using "ident" in the code, e.g.:225 (>K:PANEL_ID_TOGGLE)The question is whether it is possible to duplicate this in C gauges? I'd really rather avoid having to use XML for panel control, but don't see anyway to implement this scheme in C...

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Bill,The answer is yes. Have a look near the bottom of GAUGES.H, in the same block of code where "check_named_variable" and "set_named_variable_value" functions are defined. I think the name of the function is "panel_window_id_toggle". I will verify when I get home from work if you don't find it...DougEdit:Curiousity got the better of me - I looked them up: BOOL (FSAPI *is_panel_window_visible_ident) (UINT32 panel_id); BOOL (FSAPI *panel_window_toggle) (UINT32 panel_id); BOOL (FSAPI *panel_window_close_ident) (UINT32 panel_id); BOOL (FSAPI *panel_window_open_ident) (UINT32 panel_id);

Share this post


Link to post
Share on other sites

>Edit:>Curiousity got the better of me - I looked them up:>> BOOL (FSAPI *is_panel_window_visible_ident) (UINT32>panel_id);> BOOL (FSAPI *panel_window_toggle) (UINT32 panel_id); > BOOL (FSAPI *panel_window_close_ident) (UINT32>panel_id); > BOOL (FSAPI *panel_window_open_ident) (UINT32>panel_id); Thanks, I already figured it out (once I entered the engage-brain-before-mouth mode)... ;)However, your reply has already answered another question I had, specifically: "Is it possible to determine whether a specific panel is open?"is_panel_window_visible_ident will do just fine!I am building a "control gauge" that will, as the final step "auto pop-up" a subpanel whenever the user switches to Spot View, providing all other conditions are met... :)

Share this post


Link to post
Share on other sites

>However, your reply has already answered another question I>had, specifically: "Is it possible to determine whether a>specific panel is open?">>is_panel_window_visible_ident will do just fine!>>I am building a "control gauge" that will, as the final step>"auto pop-up" a subpanel whenever the user switches to Spot>View, providing all other conditions are met... :)"Actually, on reflection this won't 'do just fine' at all!" I lament, as I dejectedly walk down the long, cold, dark corridor in my desperate quest for a light at the end of the tunnel... *:-* :-sword

Share this post


Link to post
Share on other sites

My first thought was "Well why not???" Then it struck me that in the situation you describe, the panel window has to be opened undocked, or it will disappear along with the rest of the panel when the user switches views. Probably do-able, but 'how?' is a pretty good question!Is this the problem?Doug

Share this post


Link to post
Share on other sites

>My first thought was "Well why not???" Then it struck me>that in the situation you describe, the panel window has to be>opened undocked, or it will disappear along with the rest of>the panel when the user switches views. Probably do-able, but>'how?' is a pretty good question!>Is this the problem?Yep, that's precisely the problem. When the simpilot panics, and decides his/her only option is to deploy the CAPS, a hidden mouseclick will bring up a CAPS sub-panel with control gauge.1st click removes cover2nd click removes safety pin w/tag3rd click lowers handle and cocks firing system4th click simulates pulling the handle and firing the ballistic rocket(note that this could also be done from the VC version of the same gauge)At this point in the sequence, the pilot will likely switch to Spot View to enjoy the blown hatch cover, the rocket deployment, etc. and will remain there throughout the descent, so they can "enjoy" the cool effects...The problem being, of course, that since switching views from VC or 2d means the CAPS sub-panel is now not displayed.I was hoping that I could realize my goal thusly:if (panel not open) and (spot view active) then (open panel)This is important, because there's another series of sub-actions that the gauge will control, such as displaying the "after deployment checklist" as well as a "repair the CAPS system" button. ;)

Share this post


Link to post
Share on other sites

Solution found! See new message thread for details... ;)

Share this post


Link to post
Share on other sites

Just for the sake of completeness: ALL ... (>K:...) constructs are always replicable with C gauges by using trigger_key_event or send_key_event.E.g.:trigger_key_event(KEY_PANEL_ID_TOGGLE,225);ortrigger_key_event(KEY_PANEL_ID_TOGGLE,IDENT_GPS_PANEL);The fucctions mentioned by Doug do also work of course. The event KEY_PANEL_ID_TOGGLE was introduced with FS2002, the functions "panel_window_close_ident" and "panel_window_open_ident" were introduced with Fs2000. "panel_window_toggle" is older.Arne Bartels

Share this post


Link to post
Share on other sites

On a related note, is there a way in XML to determine if a particular panel is currently open?CheersBob ScottATP IMEL Gulfstream II-III-IV-VSantiago de Chile

Share this post


Link to post
Share on other sites

Hi Bob,Not directly.But Doug Dawson (who else :-) ) made a gauge that let's you define several panelwindow numbers (= Window Idents) that you can monitor in XML L:vars; it's called dsd_window_status.gau.Since there are several versions around (a.o. for FS9 and FSX), you best contact Doug for the latest one, since I don't think he upoloaded this gauge to the library.Cheers, Rob Barendregt

Share this post


Link to post
Share on other sites

Thanks Rob...I think I'll give this one a try in C rather than XML.CheersBob ScottATP IMEL Gulfstream II-III-IV-VSantiago de Chile

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