When "Help" is selected from the menu check to see if netscape is running.
If so, command it to go to the flight gear user guide url. Otherwise start a new version of netscape with this url.
This commit is contained in:
parent
2aa7ec8fd5
commit
16d135954c
7 changed files with 127 additions and 22 deletions
|
@ -1,3 +1,7 @@
|
|||
if ENABLE_XMESA_FX
|
||||
DEFS += -DXMESA -DFX
|
||||
endif
|
||||
|
||||
noinst_LIBRARIES = libGUI.a
|
||||
|
||||
libGUI_a_SOURCES = gui.cxx gui.h
|
||||
|
|
53
GUI/gui.cxx
53
GUI/gui.cxx
|
@ -23,6 +23,25 @@
|
|||
**************************************************************************/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <XGL/xgl.h>
|
||||
|
||||
#if defined(FX) && defined(XMESA)
|
||||
# include <GL/xmesa.h>
|
||||
#endif
|
||||
|
||||
#include STL_STRING
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -31,6 +50,8 @@
|
|||
|
||||
#include "gui.h"
|
||||
|
||||
FG_USING_STD(string);
|
||||
|
||||
|
||||
puMenuBar *mainMenuBar;
|
||||
puButton *hideMenuButton;
|
||||
|
@ -103,6 +124,36 @@ void notCb (puObject *)
|
|||
mkDialog ("This function isn't implemented yet");
|
||||
}
|
||||
|
||||
void helpCb (puObject *)
|
||||
{
|
||||
#if defined(FX) && !defined(WIN32)
|
||||
# if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
|
||||
if ( global_fullscreen ) {
|
||||
global_fullscreen = false;
|
||||
XMesaSetFXmode( XMESA_FX_WINDOW );
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(WIN32)
|
||||
string url = "http://www.flightgear.org/Docs/InstallGuide/getstart.html";
|
||||
string command;
|
||||
|
||||
if ( system("xwininfo -name Netscape > /dev/null 2>&1") == 0 ) {
|
||||
command = "netscape -remote \"openURL(" + url + ")\" &";
|
||||
} else {
|
||||
command = "netscape " + url + " &";
|
||||
}
|
||||
|
||||
system( command.c_str() );
|
||||
string text = "Help started in netscape window.";
|
||||
#else
|
||||
string text = "Help not yet implimented for Win32.";
|
||||
#endif
|
||||
|
||||
mkDialog (text.c_str());
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
The menu stuff
|
||||
---------------------------------------------------------------------*/
|
||||
|
@ -120,7 +171,7 @@ puCallback viewSubmenuCb [] = { notCb, notCb, NULL, notCb, NULL };
|
|||
puCallback aircraftSubmenuCb [] = { notCb, notCb, notCb,notCb, NULL };
|
||||
puCallback environmentSubmenuCb [] = { notCb, notCb, notCb, NULL };
|
||||
puCallback optionsSubmenuCb [] = { notCb, notCb, NULL};
|
||||
puCallback helpSubmenuCb [] = { notCb, notCb, NULL };
|
||||
puCallback helpSubmenuCb [] = { notCb, helpCb, NULL };
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,11 @@
|
|||
|
||||
#include <GL/glut.h>
|
||||
#include <XGL/xgl.h>
|
||||
|
||||
#if defined(FX) && defined(XMESA)
|
||||
#include <GL/xmesa.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -52,11 +57,6 @@
|
|||
#include "options.hxx"
|
||||
#include "views.hxx"
|
||||
|
||||
#if defined(FX) && defined(XMESA)
|
||||
# include <GL/xmesa.h>
|
||||
static int fullscreen = 1;
|
||||
#endif
|
||||
|
||||
|
||||
// Force an update of the sky and lighting parameters
|
||||
static void local_update_sky_and_lighting_params( void ) {
|
||||
|
@ -151,10 +151,11 @@ void GLUTkey(unsigned char k, int x, int y) {
|
|||
return;
|
||||
case 87: // W key
|
||||
#if defined(FX) && !defined(WIN32)
|
||||
fullscreen = ( !fullscreen );
|
||||
#if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
|
||||
XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW);
|
||||
#endif
|
||||
global_fullscreen = ( !global_fullscreen );
|
||||
# if defined(XMESA_FX_FULLSCREEN) && defined(XMESA_FX_WINDOW)
|
||||
XMesaSetFXmode( global_fullscreen ?
|
||||
XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW );
|
||||
# endif
|
||||
#endif
|
||||
return;
|
||||
case 88: // X key
|
||||
|
@ -434,6 +435,11 @@ void GLUTspecialkey(int k, int x, int y) {
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.43 1999/03/11 23:09:46 curt
|
||||
// When "Help" is selected from the menu check to see if netscape is running.
|
||||
// If so, command it to go to the flight gear user guide url. Otherwise
|
||||
// start a new version of netscape with this url.
|
||||
//
|
||||
// Revision 1.42 1999/02/26 22:09:46 curt
|
||||
// Added initial support for native SGI compilers.
|
||||
//
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include <GL/glut.h>
|
||||
#include <XGL/xgl.h>
|
||||
|
||||
|
||||
/* Handle keyboard events */
|
||||
void GLUTkey(unsigned char k, int x, int y);
|
||||
void GLUTspecialkey(int k, int x, int y);
|
||||
|
@ -54,11 +53,16 @@ void GLUTspecialkey(int k, int x, int y);
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.2 1998/04/24 00:49:18 curt
|
||||
/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
|
||||
/* Trying out some different option parsing code.
|
||||
/* Some code reorganization.
|
||||
/* Revision 1.3 1999/03/11 23:09:47 curt
|
||||
/* When "Help" is selected from the menu check to see if netscape is running.
|
||||
/* If so, command it to go to the flight gear user guide url. Otherwise
|
||||
/* start a new version of netscape with this url.
|
||||
/*
|
||||
* Revision 1.2 1998/04/24 00:49:18 curt
|
||||
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
|
||||
* Trying out some different option parsing code.
|
||||
* Some code reorganization.
|
||||
*
|
||||
* Revision 1.1 1998/04/22 13:25:41 curt
|
||||
* C++ - ifing the code.
|
||||
* Starting a bit of reorganization of lighting code.
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <XGL/xgl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
@ -41,8 +44,6 @@
|
|||
|
||||
#include STL_STRING
|
||||
|
||||
#include <Include/fg_constants.h>
|
||||
|
||||
#include <Debug/logstream.hxx>
|
||||
#include <Aircraft/aircraft.hxx>
|
||||
#include <Airports/simple.hxx>
|
||||
|
@ -51,6 +52,8 @@
|
|||
#include <Astro/solarsystem.hxx>
|
||||
#include <Autopilot/autopilot.hxx>
|
||||
#include <Cockpit/cockpit.hxx>
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Include/general.hxx>
|
||||
#include <Joystick/joystick.hxx>
|
||||
#include <Math/fg_geodesy.hxx>
|
||||
#include <Math/point3d.hxx>
|
||||
|
@ -68,6 +71,10 @@
|
|||
#include "views.hxx"
|
||||
#include "fg_serial.hxx"
|
||||
|
||||
#if defined(FX) && defined(XMESA)
|
||||
#include <GL/xmesa.h>
|
||||
#endif
|
||||
|
||||
FG_USING_STD(string);
|
||||
|
||||
extern const char *default_root;
|
||||
|
@ -126,7 +133,7 @@ int fgInitPosition( void ) {
|
|||
// General house keeping initializations
|
||||
int fgInitGeneral( void ) {
|
||||
string root;
|
||||
// int i;
|
||||
char *mesa_win_state;
|
||||
|
||||
FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" );
|
||||
FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" );
|
||||
|
@ -141,10 +148,20 @@ int fgInitGeneral( void ) {
|
|||
}
|
||||
FG_LOG( FG_GENERAL, FG_INFO, "FG_ROOT = " << root << endl );
|
||||
|
||||
// prime the frame rate counter pump
|
||||
// for ( i = 0; i < FG_FRAME_RATE_HISTORY; i++ ) {
|
||||
// general.frames[i] = 0.0;
|
||||
// }
|
||||
#if defined(FX) && defined(XMESA)
|
||||
// initialize full screen flag
|
||||
global_fullscreen = false;
|
||||
if ( strstr ( general.get_glRenderer(), "Glide" ) ) {
|
||||
// Test for the MESA_GLX_FX env variable
|
||||
if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
|
||||
// test if we are fullscreen mesa/glide
|
||||
if ( (mesa_win_state[0] == 'f') ||
|
||||
(mesa_win_state[0] == 'F') ) {
|
||||
global_fullscreen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ( 1 );
|
||||
}
|
||||
|
@ -391,6 +408,11 @@ int fgInitSubsystems( void )
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.70 1999/03/11 23:09:49 curt
|
||||
// When "Help" is selected from the menu check to see if netscape is running.
|
||||
// If so, command it to go to the flight gear user guide url. Otherwise
|
||||
// start a new version of netscape with this url.
|
||||
//
|
||||
// Revision 1.69 1999/03/08 21:56:39 curt
|
||||
// Added panel changes sent in by Friedemann.
|
||||
// Added a splash screen randomization since we have several nice splash screens.
|
||||
|
|
|
@ -26,6 +26,10 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(FX) && defined(XMESA)
|
||||
bool global_fullscreen = true;
|
||||
#endif
|
||||
|
||||
#include <Include/compiler.h>
|
||||
|
||||
#include <math.h> // rint()
|
||||
|
@ -637,6 +641,11 @@ fgOPTIONS::~fgOPTIONS( void ) {
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.42 1999/03/11 23:09:50 curt
|
||||
// When "Help" is selected from the menu check to see if netscape is running.
|
||||
// If so, command it to go to the flight gear user guide url. Otherwise
|
||||
// start a new version of netscape with this url.
|
||||
//
|
||||
// Revision 1.41 1999/03/02 01:03:17 curt
|
||||
// Tweaks for building with native SGI compilers.
|
||||
//
|
||||
|
|
|
@ -43,6 +43,10 @@
|
|||
#include <GL/glut.h>
|
||||
#include <XGL/xgl.h>
|
||||
|
||||
#if defined(FX) && defined(XMESA)
|
||||
extern bool global_fullscreen;
|
||||
#endif
|
||||
|
||||
#include STL_STRING
|
||||
#include <vector>
|
||||
|
||||
|
@ -241,6 +245,11 @@ extern fgOPTIONS current_options;
|
|||
|
||||
|
||||
// $Log$
|
||||
// Revision 1.30 1999/03/11 23:09:51 curt
|
||||
// When "Help" is selected from the menu check to see if netscape is running.
|
||||
// If so, command it to go to the flight gear user guide url. Otherwise
|
||||
// start a new version of netscape with this url.
|
||||
//
|
||||
// Revision 1.29 1999/03/02 01:03:19 curt
|
||||
// Tweaks for building with native SGI compilers.
|
||||
//
|
||||
|
|
Loading…
Add table
Reference in a new issue