X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FGUI%2Fgui_funcs.cxx;h=a4a30ee62e8ecb8619907c07976b4a347c98eec4;hb=db2ef57049102506238db6c98199af6314da8c9c;hp=9f595d2bf7a36b9f55b0f033f61d5f6691bdee6a;hpb=66ab510a3e30b6010e3a0afd3d083fb2aa5f4edb;p=flightgear.git diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx index 9f595d2bf..a4a30ee62 100644 --- a/src/GUI/gui_funcs.cxx +++ b/src/GUI/gui_funcs.cxx @@ -40,7 +40,6 @@ # include #endif -#include #include #if defined(FX) && defined(XMESA) @@ -70,20 +69,16 @@ #include #include #include -#include #include #include #include +#include
#include
#include
#include
#include
#include
-#ifdef FG_NETWORK_OLK -#include -#endif - #if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__) # include # include @@ -91,32 +86,18 @@ #include "gui.h" #include "gui_local.hxx" -#include "apt_dlg.hxx" -#include "net_dlg.hxx" -#include "sgVec3Slider.hxx" +#include "preset_dlg.hxx" #include "prop_picker.hxx" +#include "sgVec3Slider.hxx" SG_USING_STD(string); - -#ifndef SG_HAVE_NATIVE_SGI_COMPILERS SG_USING_STD(cout); -#endif - -// main.cxx hack, should come from an include someplace -extern void fgInitVisuals( void ); -extern void fgReshape( int width, int height ); -extern void fgRenderFrame( void ); -extern FGInterface cur_view_fdm; extern void fgHUDalphaAdjust( puObject * ); // from cockpit.cxx extern void fgLatLonFormatToggle( puObject *); -#ifdef FG_NETWORK_OLK -extern void net_fgd_scan(puObject *cb); -#endif // #ifdef FG_NETWORK_OLK - #if defined( TR_HIRES_SNAP) #include extern void trRenderFrame( void ); @@ -124,8 +105,6 @@ extern void fgUpdateHUD( GLfloat x_start, GLfloat y_start, GLfloat x_end, GLfloat y_end ); #endif -extern puMenuBar *mainMenuBar; - puDialogBox *dialogBox = 0; puFrame *dialogFrame = 0; puText *dialogBoxMessage = 0; @@ -173,23 +152,20 @@ const __fg_gui_fn_t __fg_gui_fn[] = { {"prop_pickerView", prop_pickerView}, // Environment - {"NewAirport", NewAirport}, - - // Network -#ifdef FG_NETWORK_OLK - {"net_display_toggle", net_display_toggle}, - {"NewCallSign", NewCallSign}, - {"net_fgd_scan", net_fgd_scan}, - {"net_register", net_register}, - {"net_unregister", net_unregister}, -#endif + {"fgPresetAirport", fgPresetAirport}, + {"fgPresetRunway", fgPresetRunway}, + {"fgPresetOffsetDistance", fgPresetOffsetDistance}, + {"fgPresetAltitude", fgPresetAltitude}, + {"fgPresetGlideslope", fgPresetGlideslope}, + {"fgPresetAirspeed", fgPresetAirspeed}, + {"fgPresetCommit", fgPresetCommit}, // Autopilot {"NewAltitude", NewAltitude}, + {"NewHeading", NewHeading}, {"AddWayPoint", AddWayPoint}, {"PopWayPoint", PopWayPoint}, {"ClearRoute", ClearRoute}, - {"fgAPAdjust", fgAPAdjust}, {"fgLatLonFormatToggle", fgLatLonFormatToggle}, // Help @@ -243,26 +219,6 @@ void guiErrorMessage (const char *txt, const sg_throwable &throwable) mkDialog(msg.c_str()); } -// Toggle the Menu and Mouse display state -void guiToggleMenu(void) -{ - if( gui_menu_on ) { - // printf("Hiding Menu\n"); - mainMenuBar->hide (); -#if defined(WIN32_CURSOR_TWEAKS_OFF) - if( mouse_mode == MOUSE_POINTER ) - TurnCursorOff(); -#endif // WIN32_CURSOR_TWEAKS_OFF - } else { - // printf("Showing Menu\n"); - mainMenuBar->reveal(); -#ifdef WIN32 - TurnCursorOn(); -#endif // WIN32 - } - gui_menu_on = ~gui_menu_on; -} - // Intercept the Escape Key void ConfirmExitDialog(void) { @@ -307,7 +263,7 @@ void SaveDialogOk(puObject*) { SaveDialogInput->getValue(&s); ofstream output(s); - cout << saveFile << endl; + // cout << saveFile << endl; if (output.good() && fgSaveFlight(output)) { output.close(); mkDialog("Saved flight"); @@ -421,12 +377,6 @@ void guiTogglePanel(puObject *cb) fgReshape(fgGetInt("/sim/startup/xsize"), fgGetInt("/sim/startup/ysize")); } - -//void MenuHideMenuCb(puObject *cb) -void hideMenuCb (puObject *cb) -{ - guiToggleMenu(); -} void goodBye(puObject *) { @@ -434,12 +384,6 @@ void goodBye(puObject *) // "Program exiting normally at user request." ); cout << "Program exiting normally at user request." << endl; -#ifdef FG_NETWORK_OLK - if ( fgGetBool("/sim/networking/network-olk") ) { - if ( net_is_registered == 0 ) fgd_send_com( "8", FGFS_host); - } -#endif - // close all external I/O connections globals->get_io()->shutdown_all(); @@ -572,7 +516,6 @@ void fgHiResDump() FILE *f; string message; bool show_pu_cursor = false; - bool show_menu = false; char *filename = new char [24]; static int count = 1; @@ -584,11 +527,6 @@ void fgHiResDump() fgSetBool("/sim/freeze/master", true); } - if(gui_menu_on) { - show_menu = true; - guiToggleMenu(); - } - if ( !puCursorIsHidden() ) { show_pu_cursor = true; puHideCursor(); @@ -684,8 +622,8 @@ void fgHiResDump() GLfloat hud_row_step = 480.0 / nrows; bool do_panel = fgPanelVisible(); - GLfloat panel_col_step = current_panel->getWidth() / ncols; - GLfloat panel_row_step = current_panel->getHeight() / nrows; + GLfloat panel_col_step = globals->get_current_panel()->getWidth() / ncols; + GLfloat panel_row_step = globals->get_current_panel()->getHeight() / nrows; /* Draw tiles */ int more = 1; @@ -698,7 +636,8 @@ void fgHiResDump() fgUpdateHUD( curColumn*hud_col_step, curRow*hud_row_step, (curColumn+1)*hud_col_step, (curRow+1)*hud_row_step ); if (do_panel) - current_panel->update( curColumn*panel_col_step, panel_col_step, + globals->get_current_panel()->update( + curColumn*panel_col_step, panel_col_step, curRow*panel_row_step, panel_row_step ); more = trEndTile(tr); @@ -748,9 +687,6 @@ void fgHiResDump() delete [] filename; - if( show_menu ) - guiToggleMenu(); - if ( show_pu_cursor ) { puShowCursor(); } @@ -809,7 +745,6 @@ void printScreen ( puObject *obj ) { puHideCursor(); } // BusyCursor( 0 ); - mainMenuBar->hide(); CGlPrinter p( CGlPrinter::PRINT_BITMAP ); int cur_width = fgGetInt("/sim/startup/xsize"); @@ -817,9 +752,6 @@ void printScreen ( puObject *obj ) { p.Begin( "FlightGear", cur_width*3, cur_height*3 ); p.End( hiResScreenCapture(3) ); - if( gui_menu_on ) { - mainMenuBar->reveal(); - } // BusyCursor(1); if ( show_pu_cursor ) { puShowCursor(); @@ -854,7 +786,6 @@ void fgDumpSnapShot () { fgSetBool("/sim/freeze/master", true); } - mainMenuBar->hide(); TurnCursorOff(); if ( !puCursorIsHidden() ) { show_pu_cursor = true; @@ -898,34 +829,9 @@ void fgDumpSnapShot () { } TurnCursorOn(); - if( gui_menu_on ) { - mainMenuBar->reveal(); - } if ( !freeze ) { fgSetBool("/sim/freeze/master", false); } } -#ifdef FG_NETWORK_OLK -void net_display_toggle( puObject *cb) -{ - net_hud_display = (net_hud_display) ? 0 : 1; - printf("Toggle net_hud_display : %d\n", net_hud_display); -} - -void net_register( puObject *cb) -{ - fgd_send_com( "1", FGFS_host ); - net_is_registered = 0; - printf("Registering to deamon\n"); -} - -void net_unregister( puObject *cb) -{ - fgd_send_com( "8", FGFS_host ); - net_is_registered = -1; - printf("Unregistering from deamon\n"); -} - -#endif // #ifdef FG_NETWORK_OLK