1 /**************************************************************************
4 * Written 1998 by Durk Talsma, started Juni, 1998. For the flight gear
7 * Additional mouse supported added by David Megginson, 1999.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 **************************************************************************/
31 #include <Include/compiler.h>
33 #ifdef FG_MATH_EXCEPTION_CLASH
44 #if defined(FX) && defined(XMESA)
45 # include <GL/xmesa.h>
53 #include <Include/general.hxx>
54 #include <Debug/logstream.hxx>
55 #include <Aircraft/aircraft.hxx>
56 #include <Airports/simple.hxx>
57 #include <Cockpit/panel.hxx>
58 #include <FDM/flight.hxx>
59 #include <Main/options.hxx>
60 #include <Main/fg_init.hxx>
61 #include <Main/views.hxx>
62 #include <Misc/fgpath.hxx>
63 #include <Network/network.h>
64 #include <Time/fg_time.hxx>
70 #ifndef FG_HAVE_NATIVE_SGI_COMPILERS
75 fntTexFont *guiFntHandle = 0;
77 static puMenuBar *mainMenuBar = 0;
78 //static puButton *hideMenuButton = 0;
80 static puDialogBox *dialogBox = 0;
81 static puFrame *dialogFrame = 0;
82 static puText *dialogBoxMessage = 0;
83 static puOneShot *dialogBoxOkButton = 0;
86 static puDialogBox *YNdialogBox = 0;
87 static puFrame *YNdialogFrame = 0;
88 static puText *YNdialogBoxMessage = 0;
89 static puOneShot *YNdialogBoxOkButton = 0;
90 static puOneShot *YNdialogBoxNoButton = 0;
92 static char msg_OK[] = "OK";
93 static char msg_NO[] = "NO";
94 static char msg_YES[] = "YES";
95 static char msg_CANCEL[] = "Cancel";
96 static char msg_RESET[] = "Reset";
98 char *gui_msg_OK; // "OK"
99 char *gui_msg_NO; // "NO"
100 char *gui_msg_YES; // "YES"
101 char *gui_msg_CANCEL; // "CANCEL"
102 char *gui_msg_RESET; // "RESET"
104 static char global_dialog_string[256];
106 extern void NewAltitude( puObject *cb );
107 extern void NewHeading( puObject *cb );
108 extern void fgAPAdjust( puObject * );
109 extern void fgLatLonFormatToggle( puObject *);
110 extern void NewTgtAirport( puObject *cb );
112 /* --------------------------------------------------------------------
114 ---------------------------------------------------------------------*/
118 static int _savedX = 0;
119 static int _savedY = 0;
120 static int last_buttons = 0 ;
121 static int mouse_active = 0;
122 static int menu_on = 0;
124 /* --------------------------------------------------------------------
125 Support for mouse as control yoke (david@megginson.com)
127 - right button toggles between pointer and yoke
128 - horizontal drag with no buttons moves ailerons
129 - vertical drag with no buttons moves elevators
130 - horizontal drag with left button moves brakes (left=on)
131 - vertical drag with left button moves throttle (up=more)
132 - horizontal drag with middle button moves rudder
133 - vertical drag with middle button moves trim
135 For the *_sensitivity variables, a lower number means more sensitive.
137 TODO: figure out how to keep pointer from leaving window in yoke mode.
138 TODO: add thresholds and null zones
139 TODO: sensitivity should be configurable at user option.
140 TODO: allow differential braking (this will be useful if FlightGear
141 ever supports tail-draggers like the DC-3)
142 ---------------------------------------------------------------------*/
144 static int mouse_yoke = 0;
145 static float aileron_sensitivity = 500.0;
146 static float elevator_sensitivity = 500.0;
147 static float brake_sensitivity = 250.0;
148 static float throttle_sensitivity = 250.0;
149 static float rudder_sensitivity = 500.0;
150 static float trim_sensitivity = 1000.0;
152 void guiMotionFunc ( int x, int y )
155 int ww = current_view.get_winWidth();
156 int wh = current_view.get_winHeight();
158 if (last_buttons & (1 << GLUT_LEFT_BUTTON)) {
159 float brake_offset = (_mX - x) / brake_sensitivity;
160 float throttle_offset = (_mY - y) / throttle_sensitivity;
161 controls.move_brake(FGControls::ALL_WHEELS, brake_offset);
162 controls.move_throttle(FGControls::ALL_ENGINES, throttle_offset);
163 } else if (last_buttons & (1 << GLUT_MIDDLE_BUTTON)) {
164 float rudder_offset = (x - _mX) / rudder_sensitivity;
165 float trim_offset = (_mY - y) / trim_sensitivity;
166 controls.move_rudder(rudder_offset);
167 controls.move_elevator_trim(trim_offset);
169 float aileron_offset = (x - _mX) / aileron_sensitivity;
170 float elevator_offset = (_mY - y) / elevator_sensitivity;
171 controls.move_aileron(aileron_offset);
172 controls.move_elevator(elevator_offset);
174 if (x < 5 || x > ww-5 || y < 5 || y > wh-5) {
177 glutWarpPointer(x, y);
181 glutPostRedisplay () ;
187 void guiMouseFunc(int button, int updown, int x, int y)
189 // Toggle mouse as pointer or yoke
190 if (updown == GLUT_DOWN && (button & GLUT_RIGHT_BUTTON)) {
191 FG_LOG( FG_INPUT, FG_INFO, "Toggling mouse as yoke" );
192 mouse_yoke = !mouse_yoke;
194 FG_LOG( FG_INPUT, FG_INFO, "Mouse in yoke mode" );
197 glutSetCursor(GLUT_CURSOR_NONE);
201 glutWarpPointer(x, y);
202 glutSetCursor(GLUT_CURSOR_INHERIT);
203 FG_LOG( FG_INPUT, FG_INFO, "Mouse in pointer mode" );
208 if ( updown == PU_DOWN ) {
209 last_buttons |= ( 1 << button ) ;
211 last_buttons &= ~( 1 << button ) ;
214 puMouse (button, updown, x,y);
215 glutPostRedisplay ();
219 int guiGetMouseButton(void)
224 void guiGetMouse(int *x, int *y)
230 static inline void TurnCursorOn( void )
233 #if defined ( WIN32 ) || defined(__CYGWIN32__)
234 glutSetCursor(GLUT_CURSOR_INHERIT);
236 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
237 glutWarpPointer( glutGet(GLUT_SCREEN_WIDTH)/2, glutGet(GLUT_SCREEN_HEIGHT)/2);
241 static inline void TurnCursorOff( void )
244 #if defined ( WIN32 ) || defined(__CYGWIN32__)
245 glutSetCursor(GLUT_CURSOR_NONE);
246 #else // I guess this is what we want to do ??
247 #if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
248 glutWarpPointer( glutGet(GLUT_SCREEN_WIDTH), glutGet(GLUT_SCREEN_HEIGHT));
253 void maybeToggleMouse( void )
256 static int first_time = ~0;
257 static int mouse_changed = 0;
261 mouse_changed = ~mouse_changed;
265 if( mouse_changed ) {
266 mouse_changed = ~mouse_changed;
272 first_time = ~first_time;
273 #endif // #ifdef WIN32
276 // Call with FALSE to init and TRUE to restore
277 void BusyCursor( int restore )
279 static int cursor = 0;
281 glutSetCursor(cursor);
283 cursor = glutGet( GLUT_WINDOW_CURSOR );
287 glutSetCursor( GLUT_CURSOR_WAIT );
290 /* ================ General Purpose Functions ================ */
292 // Intercept the Escape Key
293 void ConfirmExitDialog(void)
295 FG_PUSH_PUI_DIALOG( YNdialogBox );
298 // General Purpose Message Box
299 void mkDialog (const char *txt)
301 strncpy(global_dialog_string, txt, 256);
302 dialogBoxMessage->setLabel(global_dialog_string);
303 FG_PUSH_PUI_DIALOG( dialogBox );
306 // Repair any damage done to the Panel by other Gui Items
307 void guiFixPanel( void )
311 if ( current_options.get_panel_status() ) {
312 FGView *v = ¤t_view;
313 FGTime *t = FGTime::cur_time_params;
315 if( (toggle_pause = !t->getPause()) )
316 t->togglePauseMode();
318 // this seems to be the only way to do this :-(
319 // problem is the viewport has been mucked with
320 xglViewport(0, 0 , (GLint)(v->winWidth), (GLint)(v->winHeight) );
321 FGPanel::OurPanel->ReInit(0, 0, 1024, 768);
324 t->togglePauseMode();
328 // Toggle the Menu and Mouse display state
329 void guiToggleMenu(void)
332 // printf("Hiding Menu\n");
333 mainMenuBar->hide ();
336 #endif // #ifdef WIN32
338 // printf("Showing Menu\n");
339 mainMenuBar->reveal();
342 #endif // #ifdef WIN32
347 /* -----------------------------------------------------------------------
348 the Gui callback functions
349 ____________________________________________________________________*/
351 void reInit(puObject *cb)
354 fgReInitSubsystems();
358 // This is the accessor function
359 void guiTogglePanel(puObject *cb)
361 current_options.toggle_panel();
364 //void MenuHideMenuCb(puObject *cb)
365 void hideMenuCb (puObject *cb)
370 void goodBye(puObject *)
372 // FG_LOG( FG_INPUT, FG_ALERT,
373 // "Program exiting normally at user request." );
374 cout << "Program exiting normally at user request." << endl;
383 void goAwayCb (puObject *me)
385 FG_POP_PUI_DIALOG( dialogBox );
388 void mkDialogInit (void)
390 // printf("mkDialogInit\n");
391 int x = (current_options.get_xsize()/2 - 400/2);
392 int y = (current_options.get_ysize()/2 - 100/2);
393 dialogBox = new puDialogBox (x, y); // 150, 50
395 dialogFrame = new puFrame (0,0,400,100);
396 dialogBoxMessage = new puText (10, 70);
397 dialogBoxMessage -> setLabel ("");
398 dialogBoxOkButton = new puOneShot (180, 10, 240, 50);
399 dialogBoxOkButton -> setLegend (gui_msg_OK);
400 dialogBoxOkButton -> makeReturnDefault (TRUE );
401 dialogBoxOkButton -> setCallback (goAwayCb);
403 FG_FINALIZE_PUI_DIALOG( dialogBox );
406 void MayBeGoodBye(puObject *)
411 void goAwayYesNoCb(puObject *me)
413 FG_POP_PUI_DIALOG( YNdialogBox);
416 void ConfirmExitDialogInit(void)
418 char msg[] = "Really Quit";
421 // printf("ConfirmExitDialogInit\n");
422 int len = 200 - puGetStringWidth( puGetDefaultLabelFont(), msg )/2;
424 int x = (current_options.get_xsize()/2 - 400/2);
425 int y = (current_options.get_ysize()/2 - 100/2);
427 YNdialogBox = new puDialogBox (x, y); // 150, 50
428 // YNdialogBox = new puDialogBox (150, 50);
430 YNdialogFrame = new puFrame (0,0,400, 100);
432 YNdialogBoxMessage = new puText (len, 70);
433 YNdialogBoxMessage -> setDefaultValue (msg);
434 YNdialogBoxMessage -> getDefaultValue (&s);
435 YNdialogBoxMessage -> setLabel (s);
437 YNdialogBoxOkButton = new puOneShot (100, 10, 160, 50);
438 YNdialogBoxOkButton -> setLegend (gui_msg_OK);
439 YNdialogBoxOkButton -> setCallback (goodBye);
441 YNdialogBoxNoButton = new puOneShot (240, 10, 300, 50);
442 YNdialogBoxNoButton -> setLegend (gui_msg_NO);
443 // YNdialogBoxNoButton -> makeReturnDefault (TRUE );
444 YNdialogBoxNoButton -> setCallback (goAwayYesNoCb);
446 FG_FINALIZE_PUI_DIALOG( YNdialogBox );
449 void notCb (puObject *)
451 mkDialog ("This function isn't implemented yet");
454 void helpCb (puObject *)
458 #if defined(FX) && !defined(WIN32)
459 # if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
460 if ( global_fullscreen ) {
461 global_fullscreen = false;
462 XMesaSetFXmode( XMESA_FX_WINDOW );
468 string url = "http://www.flightgear.org/Docs/InstallGuide/getstart.html";
470 if ( system("xwininfo -name Netscape > /dev/null 2>&1") == 0 ) {
471 command = "netscape -remote \"openURL(" + url + ")\" &";
473 command = "netscape " + url + " &";
476 command = "webrun.bat";
479 system( command.c_str() );
480 //string text = "Help started in netscape window.";
482 //mkDialog (text.c_str());
483 mkDialog ("Help started in netscape window.");
486 /// The beginnings of teleportation :-)
487 // Needs cleaning up but works
488 // These statics should disapear when this is a class
489 static puDialogBox *AptDialog = 0;
490 static puFrame *AptDialogFrame = 0;
491 static puText *AptDialogMessage = 0;
492 static puInput *AptDialogInput = 0;
494 static char NewAirportId[16];
495 static char NewAirportLabel[] = "Enter New Airport ID";
497 static puOneShot *AptDialogOkButton = 0;
498 static puOneShot *AptDialogCancelButton = 0;
499 static puOneShot *AptDialogResetButton = 0;
501 void AptDialog_Cancel(puObject *)
503 FG_POP_PUI_DIALOG( AptDialog );
506 void AptDialog_OK (puObject *)
511 FGTime *t = FGTime::cur_time_params;
512 int PauseMode = t->getPause();
514 t->togglePauseMode();
517 AptDialogInput->getValue(&s);
520 cout << "AptDialog_OK " << AptId << " " << AptId.length() << endl;
522 AptDialog_Cancel( NULL );
524 if ( AptId.length() ) {
525 // set initial position from airport id
526 FG_LOG( FG_GENERAL, FG_INFO,
527 "Attempting to set starting position from airport code "
530 airports.load("apt_simple");
531 if ( airports.search( AptId, &a ) )
533 current_options.set_airport_id( AptId.c_str() );
535 fgReInitSubsystems();
538 AptId += " not in database.";
539 mkDialog(AptId.c_str());
542 if( PauseMode != t->getPause() )
543 t->togglePauseMode();
546 void AptDialog_Reset(puObject *)
548 // strncpy( NewAirportId, current_options.get_airport_id().c_str(), 16 );
549 sprintf( NewAirportId, "%s", current_options.get_airport_id().c_str() );
550 AptDialogInput->setValue ( NewAirportId );
551 AptDialogInput->setCursor( 0 ) ;
554 void NewAirport(puObject *cb)
556 // strncpy( NewAirportId, current_options.get_airport_id().c_str(), 16 );
557 sprintf( NewAirportId, "%s", current_options.get_airport_id().c_str() );
558 // cout << "NewAirport " << NewAirportId << endl;
559 AptDialogInput->setValue( NewAirportId );
561 FG_PUSH_PUI_DIALOG( AptDialog );
564 static void NewAirportInit(void)
566 sprintf( NewAirportId, "%s", current_options.get_airport_id().c_str() );
567 int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
568 NewAirportLabel ) / 2;
570 AptDialog = new puDialogBox (150, 50);
572 AptDialogFrame = new puFrame (0,0,350, 150);
573 AptDialogMessage = new puText (len, 110);
574 AptDialogMessage -> setLabel (NewAirportLabel);
576 AptDialogInput = new puInput (50, 70, 300, 100);
577 AptDialogInput -> setValue (NewAirportId);
578 AptDialogInput -> acceptInput();
580 AptDialogOkButton = new puOneShot (50, 10, 110, 50);
581 AptDialogOkButton -> setLegend (gui_msg_OK);
582 AptDialogOkButton -> setCallback (AptDialog_OK);
583 AptDialogOkButton -> makeReturnDefault(TRUE);
585 AptDialogCancelButton = new puOneShot (140, 10, 210, 50);
586 AptDialogCancelButton -> setLegend (gui_msg_CANCEL);
587 AptDialogCancelButton -> setCallback (AptDialog_Cancel);
589 AptDialogResetButton = new puOneShot (240, 10, 300, 50);
590 AptDialogResetButton -> setLegend (gui_msg_RESET);
591 AptDialogResetButton -> setCallback (AptDialog_Reset);
593 cout << "NewAirportInit " << NewAirportId << endl;
594 FG_FINALIZE_PUI_DIALOG( AptDialog );
597 /// The beginnings of networking :-)
598 // Needs cleaning up but works
599 // These statics should disapear when this is a class
600 static puDialogBox *NetIdDialog = 0;
601 static puFrame *NetIdDialogFrame = 0;
602 static puText *NetIdDialogMessage = 0;
603 static puInput *NetIdDialogInput = 0;
605 static char NewNetId[16];
606 static char NewNetIdLabel[] = "Enter New Callsign";
608 static puOneShot *NetIdDialogOkButton = 0;
609 static puOneShot *NetIdDialogCancelButton = 0;
611 void NetIdDialog_Cancel(puObject *)
613 FG_POP_PUI_DIALOG( NetIdDialog );
616 void NetIdDialog_OK (puObject *)
620 FGTime *t = FGTime::cur_time_params;
621 int PauseMode = t->getPause();
623 t->togglePauseMode();
625 The following needs some cleanup because
626 "string options.NetId" and "char *net_callsign"
628 NetIdDialogInput->getValue(&net_callsign);
629 NetId = net_callsign;
631 NetIdDialog_Cancel( NULL );
632 current_options.set_net_id( NetId.c_str() );
633 /* Entering a callsign indicates : user wants Net HUD Info */
636 if( PauseMode != t->getPause() )
637 t->togglePauseMode();
640 void NewCallSign(puObject *cb)
642 sprintf( NewNetId, "%s", current_options.get_net_id().c_str() );
643 NetIdDialogInput->setValue( NewNetId );
645 FG_PUSH_PUI_DIALOG( NetIdDialog );
648 static void NewNetIdInit(void)
650 sprintf( NewNetId, "%s", current_options.get_net_id().c_str() );
651 int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
654 NetIdDialog = new puDialogBox (150, 50);
656 NetIdDialogFrame = new puFrame (0,0,350, 150);
657 NetIdDialogMessage = new puText (len, 110);
658 NetIdDialogMessage -> setLabel (NewNetIdLabel);
660 NetIdDialogInput = new puInput (50, 70, 300, 100);
661 NetIdDialogInput -> setValue (NewNetId);
662 NetIdDialogInput -> acceptInput();
664 NetIdDialogOkButton = new puOneShot (50, 10, 110, 50);
665 NetIdDialogOkButton -> setLegend (gui_msg_OK);
666 NetIdDialogOkButton -> setCallback (NetIdDialog_OK);
667 NetIdDialogOkButton -> makeReturnDefault(TRUE);
669 NetIdDialogCancelButton = new puOneShot (240, 10, 300, 50);
670 NetIdDialogCancelButton -> setLegend (gui_msg_CANCEL);
671 NetIdDialogCancelButton -> setCallback (NetIdDialog_Cancel);
674 FG_FINALIZE_PUI_DIALOG( NetIdDialog );
677 static void net_display_toggle( puObject *cb)
679 net_hud_display = (net_hud_display) ? 0 : 1;
680 printf("Toggle net_hud_display : %d\n", net_hud_display);
683 static void net_blaster_toggle( puObject *cb)
685 net_blast_toggle = (net_blast_toggle) ? 0 : -1;
686 printf("Toggle net_blast : %d\n", net_blast_toggle);
689 /*************** End Networking **************/
693 /* -----------------------------------------------------------------------
695 ---------------------------------------------------------------------*/
696 char *fileSubmenu [] = {
697 "Exit", "Close", "---------", "Print", "---------", "Save", "Reset", NULL
699 puCallback fileSubmenuCb [] = {
700 MayBeGoodBye, hideMenuCb, NULL, notCb, NULL, notCb, reInit, NULL
703 char *editSubmenu [] = {
706 puCallback editSubmenuCb [] = {
710 char *viewSubmenu [] = {
711 "Cockpit View > ", "View >","------------", "Toggle Panel...", NULL
713 puCallback viewSubmenuCb [] = {
714 notCb, notCb, NULL, guiTogglePanel, NULL
717 char *aircraftSubmenu [] = {
718 "Autopilot", "Heading", "Altitude", "Navigation", "Airport",
719 "Communication", NULL
721 puCallback aircraftSubmenuCb [] = {
722 fgAPAdjust, NewHeading, NewAltitude, fgLatLonFormatToggle, NewTgtAirport,
726 char *environmentSubmenu [] = {
727 "Airport", "Terrain", "Weather", NULL
729 puCallback environmentSubmenuCb [] = {
730 NewAirport, notCb, notCb, NULL
733 char *optionsSubmenu [] = {
734 "Preferences", "Realism & Reliablity...", NULL
736 puCallback optionsSubmenuCb [] = {
740 #ifdef FG_NETWORK_OLK
741 char *networkSubmenu [] = {
742 "Unregister from FGD ", "Send MSG to All", "Send MSG", "Show Pilots",
744 "Scan for Deamons", "Enter Callsign", "Display Netinfos", "Toggle Display",
747 puCallback networkSubmenuCb [] = {
748 notCb, notCb, notCb, notCb, notCb, notCb, NewCallSign, notCb,
749 net_display_toggle, net_blaster_toggle, NULL
753 char *helpSubmenu [] = {
754 "About...", "Help", NULL
756 puCallback helpSubmenuCb [] = {
761 /* -------------------------------------------------------------------------
763 _____________________________________________________________________*/
768 char *mesa_win_state;
772 puSetDefaultStyle ( PUSTYLE_SMALL_BEVELLED ); //PUSTYLE_DEFAULT
773 puSetDefaultColourScheme (0.8, 0.8, 0.8, 0.4);
775 // Initialize our GLOBAL GUI STRINGS
776 gui_msg_OK = msg_OK; // "OK"
777 gui_msg_NO = msg_NO; // "NO"
778 gui_msg_YES = msg_YES; // "YES"
779 gui_msg_CANCEL = msg_CANCEL; // "CANCEL"
780 gui_msg_RESET = msg_RESET; // "RESET"
782 // Next check home directory
784 char* envp = ::getenv( "FG_FONTS" );
785 if ( envp != NULL ) {
788 fntpath.set( current_options.get_fg_root() );
789 fntpath.append( "Fonts" );
792 // Install our fast fonts
793 fntpath.append( "typewriter.txf" );
794 guiFntHandle = new fntTexFont ;
795 guiFntHandle -> load ( (char *)fntpath.c_str() ) ;
796 puFont GuiFont ( guiFntHandle, 15 ) ;
797 puSetDefaultFonts( GuiFont, GuiFont ) ;
798 guiFnt = puGetDefaultLabelFont();
800 if ( current_options.get_mouse_pointer() == 0 ) {
801 // no preference specified for mouse pointer, attempt to autodetect...
802 // Determine if we need to render the cursor, or if the windowing
803 // system will do it. First test if we are rendering with glide.
804 if ( strstr ( general.get_glRenderer(), "Glide" ) ) {
805 // Test for the MESA_GLX_FX env variable
806 if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
807 // test if we are fullscreen mesa/glide
808 if ( (mesa_win_state[0] == 'f') ||
809 (mesa_win_state[0] == 'F') ) {
814 mouse_active = ~mouse_active;
815 } else if ( current_options.get_mouse_pointer() == 1 ) {
816 // don't show pointer
817 } else if ( current_options.get_mouse_pointer() == 2 ) {
818 // force showing pointer
820 mouse_active = ~mouse_active;
823 // Set up our Dialog Boxes
824 ConfirmExitDialogInit();
826 #ifdef FG_NETWORK_OLK
832 mainMenuBar = new puMenuBar ();
833 mainMenuBar -> add_submenu ("File", fileSubmenu, fileSubmenuCb);
834 mainMenuBar -> add_submenu ("Edit", editSubmenu, editSubmenuCb);
835 mainMenuBar -> add_submenu ("View", viewSubmenu, viewSubmenuCb);
836 mainMenuBar -> add_submenu ("Aircraft", aircraftSubmenu, aircraftSubmenuCb);
837 mainMenuBar -> add_submenu ("Environment", environmentSubmenu, environmentSubmenuCb);
838 mainMenuBar -> add_submenu ("Options", optionsSubmenu, optionsSubmenuCb);
839 #ifdef FG_NETWORK_OLK
840 mainMenuBar -> add_submenu ("Network", networkSubmenu, networkSubmenuCb);
842 mainMenuBar -> add_submenu ("Help", helpSubmenu, helpSubmenuCb);
843 mainMenuBar-> close ();
844 // Set up menu bar toggle