diff libinterp/dldfcn/__init_fltk__.cc @ 19021:9609f345823e

Implement figure property SelectionType for FLTK * graphics.in.h: Rename "alt" to "alternate" for Matlab compatibility * __init_fltk__.cc: Add selectiontype implementation * plot.txi: Add documentation for selectiontype
author Andreas Weber <andy.weber.aw@gmail.com>
date Sun, 17 Aug 2014 23:34:16 +0200
parents d74cdfc5d5c3
children 0ee9daa71273
line wrap: on
line diff
--- a/libinterp/dldfcn/__init_fltk__.cc	Sun Aug 17 22:34:37 2014 +0200
+++ b/libinterp/dldfcn/__init_fltk__.cc	Sun Aug 17 23:34:16 2014 +0200
@@ -1426,6 +1426,18 @@
 
             set_currentpoint (pos_x, pos_y);
 
+            if (Fl::event_button () == FL_LEFT_MOUSE
+                && Fl::event_shift ())
+              fp.set_selectiontype ("extend");
+            else if ((Fl::event_button () == FL_LEFT_MOUSE
+                      && Fl::event_ctrl ())
+                      || Fl::event_button () == FL_RIGHT_MOUSE)
+              fp.set_selectiontype ("alternate");
+            else if (Fl::event_clicks ())
+              fp.set_selectiontype ("open");
+            else
+              fp.set_selectiontype ("normal");
+
             if (fp.get_windowbuttondownfcn ().is_defined ())
               fp.execute_windowbuttondownfcn (Fl::event_button ());