]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.gestures[-docs]: add the file-drop gesture and the dropped-files symbol
authorAlexander Iljin <ajsoft@yandex.ru>
Thu, 24 Aug 2017 00:59:40 +0000 (03:59 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 22 Jan 2018 21:09:41 +0000 (13:09 -0800)
basis/ui/gestures/gestures-docs.factor
basis/ui/gestures/gestures.factor

index dfb9e8bc38c43766834f4c2e79ef2f1aa98a9406..508da88258f82501bad65b0bc5a93a23160a8a4c 100644 (file)
@@ -261,7 +261,9 @@ ARTICLE: "gesture-differences" "Gesture handling differences between platforms"
 }
 "On Windows, " { $link key-up } " gestures are not reported for all keyboard events."
 $nl
-{ $link "multitouch-gestures" } " are only supported on Mac OS X." ;
+{ $link "multitouch-gestures" } " are only supported on Mac OS X."
+$nl
+{ $link "filedrop-gestures" } " are only supported on Windows." ;
 
 ARTICLE: "ui-gestures" "UI gestures"
 "User actions such as keyboard input and mouse button clicks deliver " { $emphasis "gestures" } " to gadgets. If the direct receiver of the gesture does not handle it, the gesture is passed on to the receiver's parent, and this way it travels up the gadget hierarchy. Gestures which are not handled at some point are ignored."
@@ -283,6 +285,7 @@ $nl
 { $subsections
     "mouse-gestures"
     "multitouch-gestures"
+    "filedrop-gestures"
 }
 "Guidelines for cross-platform applications:"
 { $subsections "gesture-differences" }
@@ -418,6 +421,18 @@ $nl
     zoom-out-action
 } ;
 
+ARTICLE: "filedrop-gestures" "File drop gestures"
+"File drop gestures are only supported on Windows. When user drags-and-drops a file or a group of files from another application, the following gesture can be handled:"
+{ $subsections file-drop } ;
+
+HELP: file-drop
+{ $class-description "File drop gesture. The " { $slot "mods" } " slot contains the keyboard modifiers active at the time of the drop (see " { $link "keyboard-gestures" } "). The " { $link dropped-files } " global variable contains an array of full paths of the files that were dropped."
+$nl
+"The " { $link hand-loc } " global variable contains the drop location. If the user dropped files onto the non-client area of a window (the caption or the border), the gesture will not be triggered, but the contents of the " { $link dropped-files } " will be updated." } ;
+
+HELP: dropped-files
+{ $var-description "The global variable holds an array of full paths of the files that were dropped by the last " { $link file-drop } " gesture." } ;
+
 ARTICLE: "action-gestures" "Action gestures"
 "Action gestures exist to keep keyboard shortcuts for common application operations consistent."
 { $subsections
index 833f642236355e99c748c80b98c0c5b950b61810..edabf341f658e635e99fc51a6ad2fd2337a89382 100644 (file)
@@ -79,6 +79,9 @@ M: user-input-tuple send-queued-gesture
 TUPLE: drag # ;             C: <drag> drag
 TUPLE: button-up mods # ;   C: <button-up> button-up
 TUPLE: button-down mods # ; C: <button-down> button-down
+TUPLE: file-drop mods ;     C: <file-drop> file-drop
+
+SYMBOL: dropped-files
 
 SINGLETONS:
     motion