Norman's fix to make the help system start on Win32.
And fixed up some other non-sensical code in the vicinity which was generating compiler warnings.
This commit is contained in:
parent
42f1849975
commit
66ab510a3e
3 changed files with 67 additions and 45 deletions
|
@ -53,6 +53,14 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
// for help call back
|
||||
#ifdef WIN32
|
||||
# include <shellapi.h>
|
||||
# ifdef __CYGWIN__
|
||||
# include <sys/cygwin.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/debug/logstream.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
|
@ -526,6 +534,7 @@ void helpCb (puObject *)
|
|||
path.append( "Docs/index.html" );
|
||||
|
||||
#if !defined(WIN32)
|
||||
|
||||
string help_app = fgGetString("/sim/startup/browser-app");
|
||||
|
||||
if ( system("xwininfo -name Netscape > /dev/null 2>&1") == 0 ) {
|
||||
|
@ -534,12 +543,26 @@ void helpCb (puObject *)
|
|||
command = help_app + " " + path.str();
|
||||
}
|
||||
command += " &";
|
||||
system( command.c_str() );
|
||||
|
||||
#else // WIN32
|
||||
command = "start ";
|
||||
command += path.str();
|
||||
|
||||
// Look for favorite browser
|
||||
char Dummy[1024], ExecName[1024], browserParameter[1024];
|
||||
char win32_name[1024];
|
||||
# ifdef __CYGWIN__
|
||||
cygwin32_conv_to_full_win32_path(path.c_str(),win32_name);
|
||||
# else
|
||||
strcpy(win32_name,path.c_str());
|
||||
# endif
|
||||
Dummy[0] = 0;
|
||||
FindExecutable(win32_name, Dummy, ExecName);
|
||||
sprintf(browserParameter, "file:///%s", win32_name);
|
||||
ShellExecute ( NULL, "open", ExecName, browserParameter, Dummy,
|
||||
SW_SHOWNORMAL ) ;
|
||||
|
||||
#endif
|
||||
|
||||
system( command.c_str() );
|
||||
mkDialog ("Help started in your web browser window.");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,45 @@
|
|||
#include <Main/fg_props.hxx>
|
||||
#include <simgear/sg_inlines.h>
|
||||
|
||||
static void
|
||||
setPilotXOffset (float value)
|
||||
{
|
||||
PilotOffsetSet(0, value);
|
||||
}
|
||||
|
||||
static float
|
||||
getPilotXOffset ()
|
||||
{
|
||||
return( PilotOffsetGetSetting(0) );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
setPilotYOffset (float value)
|
||||
{
|
||||
PilotOffsetSet(1, value);
|
||||
}
|
||||
|
||||
static float
|
||||
getPilotYOffset ()
|
||||
{
|
||||
return( PilotOffsetGetSetting(1) );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
setPilotZOffset (float value)
|
||||
{
|
||||
PilotOffsetSet(2, value);
|
||||
}
|
||||
|
||||
static float
|
||||
getPilotZOffset ()
|
||||
{
|
||||
return( PilotOffsetGetSetting(2) );
|
||||
}
|
||||
|
||||
|
||||
class FloatSlider : public puSlider
|
||||
{
|
||||
|
||||
|
@ -484,9 +523,9 @@ sgVec3 *PilotOffsetGet()
|
|||
// external function used to tie to FG properties
|
||||
float PilotOffsetGetSetting(int opt)
|
||||
{
|
||||
float setting;
|
||||
float setting = 0.0;
|
||||
if( PO_vec == 0 ) {
|
||||
PilotOffsetInit();
|
||||
PilotOffsetInit();
|
||||
}
|
||||
sgVec3Slider *me = (sgVec3Slider *)PO_vec -> getUserData();
|
||||
sgVec3 vec;
|
||||
|
|
|
@ -25,43 +25,3 @@ void PilotOffsetSet( int opt, float setting);
|
|||
float PilotOffsetGetSetting( int opt );
|
||||
|
||||
#endif // _VEC3_SLIDER_H
|
||||
|
||||
/* binding functions for chase view offset */
|
||||
|
||||
static void
|
||||
setPilotXOffset (float value)
|
||||
{
|
||||
PilotOffsetSet(0, value);
|
||||
}
|
||||
|
||||
static float
|
||||
getPilotXOffset ()
|
||||
{
|
||||
return( PilotOffsetGetSetting(0) );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
setPilotYOffset (float value)
|
||||
{
|
||||
PilotOffsetSet(1, value);
|
||||
}
|
||||
|
||||
static float
|
||||
getPilotYOffset ()
|
||||
{
|
||||
return( PilotOffsetGetSetting(1) );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
setPilotZOffset (float value)
|
||||
{
|
||||
PilotOffsetSet(2, value);
|
||||
}
|
||||
|
||||
static float
|
||||
getPilotZOffset ()
|
||||
{
|
||||
return( PilotOffsetGetSetting(2) );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue