Results 1 to 3 of 3

Thread: Open/Close Windows and Popups in C

  1. #1
    Join Date
    Mar 2005
    Location
    Hammond, IN USA
    Posts
    4,796

    Default Open/Close Windows and Popups in C

    Opening and closing windows or popup panels:

    The method isn't really difficult, and is listed in the SDK key_events:

    trigger_key_event (KEY_PANEL_ID_OPEN,nn) ;

    trigger_key_event (KEY_PANEL_ID_CLOSE,nn) ;

    trigger_key_event (KEY_PANEL_ID_TOGGLE,nn) ;

    where nn is the panel ident number/name

    For example, to open 80 and close 90, the following would be in your mouse callback:

    {
    trigger_key_event (KEY_PANEL_ID_OPEN,80) ;
    trigger_key_event (KEY_PANEL_ID_CLOSE,90) ;
    }

    The above would be used to "swap panels."

    For a simple "popup window" you would use the TOGGLE version:

    trigger_key_event (KEY_PANEL_ID_TOGGLE,100) ;

    or

    trigger_key_event (KEY_PANEL_ID_TOGGLE,IDENT_GPS_PANEL) ;

    A full list of all the "predefined panel idents" is listed in the gauges.h file:
    Code:
     // Panel identifiers
    #define IDENT_MAIN_PANEL                        0
    #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_USER                              10000
    #define IDENT_USER_MAX                          19999
    #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 IDENT_LSO_WINDOW                        22000
    Last edited by n4gix; 03-26-2008 at 11:54 PM.
    Bill Leaming
    Gauge Programming - 3d Modeling Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - EVGA GTX770 4GB - Win7 64bit Home Premium
    Development Rig1: Intel Core i7-3770k - 16GB DDR3 - Dual Radeon HD7770 SLI 1GB - Win7 64bit Professional
    Development Rig2: Intel Core i7-860 - 8GB DDR3 Corsair - GeForce GTS240 1GB - Win7 64bit Home Premium
    NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...

  2. #2

    Default

    Bill, What FS are you using this on? Would it work in FS2000? Just wanna know before going to all the trouble to do it. LOL
    TurboFIRE

    "No accidents in one year"

  3. #3
    Join Date
    Mar 2005
    Location
    Hammond, IN USA
    Posts
    4,796

    Default

    The above is valid for both FS2004 and FSX. I no longer have the SDK for FS2000, so I cannot provide a definitive answer. I suspect that it will still work though.
    Bill Leaming
    Gauge Programming - 3d Modeling Military Visualizations
    Flightsim.com Panels & Gauges Forum Moderator
    Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - EVGA GTX770 4GB - Win7 64bit Home Premium
    Development Rig1: Intel Core i7-3770k - 16GB DDR3 - Dual Radeon HD7770 SLI 1GB - Win7 64bit Professional
    Development Rig2: Intel Core i7-860 - 8GB DDR3 Corsair - GeForce GTS240 1GB - Win7 64bit Home Premium
    NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...

Similar Threads

  1. Panel hot spots and popups question.
    By n4gix in forum Aircraft Design
    Replies: 1
    Last Post: 03-18-2005, 08:16 AM
  2. Them bloomin popups man.
    By capn_sonic in forum MSFS Multiplayer Adventures
    Replies: 7
    Last Post: 05-13-2004, 08:38 AM
  3. Popups on Flightsim.com
    By Gadgt in forum FS2002
    Replies: 25
    Last Post: 04-13-2003, 07:16 PM
  4. Cessna,Close...close...close...
    By joby in forum MSFS Screen Shot Forum
    Replies: 3
    Last Post: 02-07-2003, 03:12 AM
  5. Popups
    By sorman in forum The Outer Marker
    Replies: 12
    Last Post: 12-19-2002, 06:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •