1
0
Fork 0

Norman Vine's mouse cursor tweaks fixes.

This commit is contained in:
curt 2001-11-12 19:37:23 +00:00
parent 2b28f7c41b
commit d227398525
4 changed files with 20 additions and 15 deletions

View file

@ -183,16 +183,16 @@ void guiToggleMenu(void)
if( gui_menu_on ) {
// printf("Hiding Menu\n");
mainMenuBar->hide ();
#if defined(WIN32_CURSOR_TWEAKS)
#if defined(WIN32_CURSOR_TWEAKS_OFF)
if( mouse_mode == MOUSE_POINTER )
TurnCursorOff();
#endif // #ifdef WIN32_CURSOR_TWEAKS
#endif // WIN32_CURSOR_TWEAKS_OFF
} else {
// printf("Showing Menu\n");
mainMenuBar->reveal();
#ifdef WIN32
TurnCursorOn();
#endif // #ifdef WIN32
#endif // WIN32
}
gui_menu_on = ~gui_menu_on;
}
@ -303,7 +303,7 @@ void LoadDialogOk(puObject *) {
}
}
// Do this is the person presses cancel
// Do this if the person presses cancel
void LoadDialogCancel(puObject *) {
FG_POP_PUI_DIALOG( LoadDialog );
}
@ -418,7 +418,6 @@ void ConfirmExitDialogInit(void)
int y = (fgGetInt("/sim/startup/ysize")/2 - 100/2);
YNdialogBox = new puDialogBox (x, y); // 150, 50
// YNdialogBox = new puDialogBox (150, 50);
{
YNdialogFrame = new puFrame (0,0,400, 100);
@ -460,6 +459,7 @@ void helpCb (puObject *)
SGPath path( globals->get_fg_root() );
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 ) {
@ -467,8 +467,10 @@ void helpCb (puObject *)
} else {
command = help_app + " " + path.str();
}
#if !defined(WIN32)
command += " &";
#else // WIN32
command = "start ";
command += path.str();
#endif
system( command.c_str() );

View file

@ -8,6 +8,8 @@
#if defined(WIN32) || defined(__CYGWIN32__)
#define WIN32_CURSOR_TWEAKS
// uncomment this for cursor to turn off when menu is disabled
// #define WIN32_CURSOR_TWEAKS_OFF
#elif (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
#define X_CURSOR_TWEAKS
#endif

View file

@ -167,7 +167,7 @@ static inline int right_button( void ) {
void TurnCursorOn( void )
{
mouse_active = ~0;
#if defined(WIN32_CURSOR_TWEAKS)
#if defined(WIN32)
switch (mouse_mode) {
case MOUSE_POINTER:
glutSetCursor(GLUT_CURSOR_INHERIT);
@ -510,16 +510,18 @@ void guiMouseFunc(int button, int updown, int x, int y)
globals->get_current_view()->set_goal_view_offset(0.0);
#ifdef NO_SMOOTH_MOUSE_VIEW
globals->get_current_view()->set_view_offset(0.0);
#endif
#endif // RESET_VIEW_ON_LEAVING_MOUSE_VIEW
#endif // NO_SMOOTH_MOUSE_VIEW
#endif // RESET_VIEW_ON_LEAVING_MOUSE_VIEW
glutSetCursor(GLUT_CURSOR_INHERIT);
#if defined(WIN32_CURSOR_TWEAKS_OFF)
if(!gui_menu_on)
TurnCursorOff();
#endif // WIN32_CURSOR_TWEAKS_OFF
SG_LOG( SG_INPUT, SG_INFO, "Mouse in pointer mode" );
break;
}
} // end switch (mouse_mode)
glutWarpPointer( x, y );
} // END RIGHT BUTTON
} // END UPDOWN == GLUT_DOWN

View file

@ -103,8 +103,7 @@ void NewNetIdInit(void)
{
sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign").c_str() );
// sprintf( NewNetId, "%s", fgd_callsign );
int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
NewNetIdLabel ) / 2;
int len = 150 - puGetDefaultLabelFont().getStringWidth( NewNetIdLabel ) / 2;
NetIdDialog = new puDialogBox (150, 50);
{
@ -236,8 +235,8 @@ void NewNetFGDInit(void)
{
// sprintf( NewNetId, "%s", fgGetString("/sim/networking/call-sign").c_str() );
// sprintf( NewNetId, "%s", fgd_callsign );
int len = 170 - puGetStringWidth( puGetDefaultLabelFont(),
NewNetFGDLabel ) / 2;
int len = 170
- puGetDefaultLabelFont().getStringWidth( NewNetFGDLabel ) / 2;
NetFGDDialog = new puDialogBox (310, 30);
{