]> git.mxchange.org Git - flightgear.git/commitdiff
Norman Vine's mouse cursor tweaks fixes.
authorcurt <curt>
Mon, 12 Nov 2001 19:37:23 +0000 (19:37 +0000)
committercurt <curt>
Mon, 12 Nov 2001 19:37:23 +0000 (19:37 +0000)
src/GUI/gui.cxx
src/GUI/gui_local.hxx
src/GUI/mouse.cxx
src/GUI/net_dlg.cxx

index 74078a6e2bee1b6c988878ca5a7101e3ba59bcbf..8bd6f6c16791f8cddfd08800ed2fc5cc605d73e7 100644 (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() );
index 6958f71183a466a4dd3b28930e3ca5ee301595f4..7c386851d9c37160b072ff6da44deb6980b6429c 100644 (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
index 8ecb107338d8425263c25c56206777c7bae02c82..8fdb598c78657c777d8c603bf9618d2cda0b6c93 100644 (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
index 0aea38dcd3b0f4d83202f3e56b1b6bbb88a9b5ed..ebbb1e1c1f002129838674e9905c441a6129e420 100644 (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);
        {