changeset 27135:bf2f533d2d45

Document the figure "selectiontype" property * genpropdoc.m: Add documentation for figure "selectiontype" * QtHandlesUtils.cc: Remove window system specific section to conform to ML behavior whatever the platform.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Sat, 01 Jun 2019 19:57:45 +0200
parents 8229d4e15a28
children 512399fefc1b
files doc/interpreter/genpropdoc.m libgui/graphics/QtHandlesUtils.cc
diffstat 2 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/genpropdoc.m	Sat Jun 01 19:31:00 2019 +0200
+++ b/doc/interpreter/genpropdoc.m	Sat Jun 01 19:57:45 2019 +0200
@@ -549,7 +549,19 @@
         s.valid = valid_fcn;
 
       case "selectiontype"
-        ## FIXME: docstring explaining what "{normal}|open|alt|extend" mean.
+        s.doc = "Selection type of the latest mouse click.\n\n\
+__prop__ may take different values depending on the combination of mouse \
+button and keyboard modifier that were used:\n\
+@table @code\n\
+@item normal:\n\
+Left-click.\n\
+@item alt:\n\
+Right-click or Ctrl+Left-click.\n\
+@item extend:\n\
+Shitf+Left-click, Middle click, or combined Left-click and Right-click.\n\
+@item open:\n\
+Double Left-click.\
+@end table";
 
       case "sizechangedfcn"
         s.doc = "Callback triggered when the figure window size is changed.\
--- a/libgui/graphics/QtHandlesUtils.cc	Sat Jun 01 19:31:00 2019 +0200
+++ b/libgui/graphics/QtHandlesUtils.cc	Sat Jun 01 19:57:45 2019 +0200
@@ -184,13 +184,9 @@
                 return "normal";
               else if (buttons == Qt::RightButton)
                 return "alt";
-#if defined (Q_WS_WIN)
-              else if (buttons == (Qt::LeftButton | Qt::RightButton))
+              else if (buttons == Qt::MidButton
+                       || buttons == (Qt::LeftButton | Qt::RightButton))
                 return "extend";
-#elif defined (Q_WS_X11)
-              else if (buttons == Qt::MidButton)
-                return "extend";
-#endif
             }
           else if (buttons == Qt::LeftButton)
             {