From 3eb794cd1538a44f79edff43a70649b6bcb58c21 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 18 Jan 2006 16:19:10 +0000
Subject: [PATCH] disable lasso selection when in "Mouse selection OFF" mode.
 This makes more sense.

---
 Fltk/Callbacks.cpp     |  6 +++---
 Fltk/Opengl_Window.cpp | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index e424e4529e..91567dd007 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.400 2006-01-18 04:33:51 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.401 2006-01-18 16:19:10 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -470,7 +470,7 @@ void status_xyz1p_cb(CALLBACK_ARGS)
   }
   else if(!strcmp(str, "S")){ // mouse selection
     if(Fl::event_state(FL_SHIFT)){
-      CTX.enable_mouse_selection = 1; // mouse click only (no hover)
+      CTX.enable_mouse_selection = 1; // mouse selection only (no hover)
       Msg(STATUS1N, "Mouse hover OFF");
       WID->g_status_butt[9]->color(FL_GREEN);
     }
@@ -481,7 +481,7 @@ void status_xyz1p_cb(CALLBACK_ARGS)
       WID->g_opengl_window->cursor(FL_CURSOR_DEFAULT, FL_BLACK, FL_WHITE);      
     }
     else{
-      CTX.enable_mouse_selection = 2; // mouse hover and click (default)
+      CTX.enable_mouse_selection = 2; // mouse hover and select (default)
       Msg(STATUS1N, "Mouse selection ON");
       WID->g_status_butt[9]->color(FL_BACKGROUND_COLOR);
     }
diff --git a/Fltk/Opengl_Window.cpp b/Fltk/Opengl_Window.cpp
index ca415cd806..d373d29218 100644
--- a/Fltk/Opengl_Window.cpp
+++ b/Fltk/Opengl_Window.cpp
@@ -1,4 +1,4 @@
-// $Id: Opengl_Window.cpp,v 1.59 2006-01-18 04:33:52 geuzaine Exp $
+// $Id: Opengl_Window.cpp,v 1.60 2006-01-18 16:19:10 geuzaine Exp $
 //
 // Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
 //
@@ -121,7 +121,7 @@ void Opengl_Window::draw()
     glLoadIdentity();
     glColor3d(1., 1., 1.);
     glDisable(GL_DEPTH_TEST);
-    if(SelectionMode){
+    if(SelectionMode && CTX.enable_mouse_selection){
       glEnable(GL_LINE_STIPPLE);
       glLineStipple(1, 0x0F0F);
     }
@@ -140,7 +140,7 @@ void Opengl_Window::draw()
       if(!i) lasso.set();
     }
     glDisable(GL_BLEND);
-    if(SelectionMode)
+    if(SelectionMode && CTX.enable_mouse_selection)
       glDisable(GL_LINE_STIPPLE);
     glEnable(GL_DEPTH_TEST);
   }
@@ -208,7 +208,7 @@ int Opengl_Window::handle(int event)
       }
       else if(LassoMode) {
         LassoMode = false;
-	if(SelectionMode){
+	if(SelectionMode && CTX.enable_mouse_selection){
 	  WID->try_selection = 2; // will try to select multiple entities
 	  WID->try_selection_xywh[0] = (int)(click.win[0] + curr.win[0])/2;
 	  WID->try_selection_xywh[1] = (int)(click.win[1] + curr.win[1])/2;
@@ -351,7 +351,7 @@ int Opengl_Window::handle(int event)
       sprintf(str, "%g", point[2]); WID->context_geometry_input[4]->value(str);
       redraw();
     }
-    else if(CTX.enable_mouse_selection > 1){
+    else if(CTX.enable_mouse_selection >= 2){ // hover mode
       if(curr.win[0] != prev.win[0] || curr.win[1] != prev.win[1]){
 	WID->make_opengl_current();
 	v[0] = NULL; c[0] = NULL; s[0] = NULL;
-- 
GitLab