From 401597a387add5b52111d1dd954d6250ee2b2688 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Sun, 31 Aug 2008 23:35:32 -0500 Subject: [PATCH] Update old accessors from 'ui.gestures' --- basis/ui/gestures/gestures-docs.factor | 18 +++++++++--------- basis/ui/gestures/gestures.factor | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/basis/ui/gestures/gestures-docs.factor b/basis/ui/gestures/gestures-docs.factor index bcf7eb5ca8..0575ff17f0 100644 --- a/basis/ui/gestures/gestures-docs.factor +++ b/basis/ui/gestures/gestures-docs.factor @@ -30,13 +30,13 @@ HELP: motion { $examples { $code "T{ motion }" } } ; HELP: drag -{ $class-description "Mouse drag gesture. The " { $link drag-# } " slot is either set to a mouse button number, or " { $link f } " indicating no specific button is expected." } ; +{ $class-description "Mouse drag gesture. The " { $snippet "#" } " slot is either set to a mouse button number, or " { $link f } " indicating no specific button is expected." } ; HELP: button-up { $class-description "Mouse button up gesture. Instances have two slots:" { $list - { { $link button-up-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } - { { $link button-up-# } " - a mouse button number, or " { $link f } " indicating no specific button is expected" } + { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } + { { $snippet "#" } " - a mouse button number, or " { $link f } " indicating no specific button is expected" } } } { $examples { $code "T{ button-up f f 1 }" "T{ button-up }" } } ; @@ -44,8 +44,8 @@ HELP: button-up HELP: button-down { $class-description "Mouse button down gesture. Instances have two slots:" { $list - { { $link button-down-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } - { { $link button-down-# } " - a mouse button number, or " { $link f } " indicating no specific button is expected" } + { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } + { { $snippet "#" } " - a mouse button number, or " { $link f } " indicating no specific button is expected" } } } { $examples { $code "T{ button-down f f 1 }" "T{ button-down }" } } ; @@ -109,8 +109,8 @@ HELP: S+ HELP: key-down { $class-description "Key down gesture. Instances have two slots:" { $list - { { $link key-down-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } - { { $link key-down-sym } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } } + { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } + { { $snippet "sym" } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } } } } { $examples { $code "T{ key-down f { C+ } \"a\" }" "T{ key-down f f \"TAB\" }" } } ; @@ -118,8 +118,8 @@ HELP: key-down HELP: key-up { $class-description "Key up gesture. Instances have two slots:" { $list - { { $link key-up-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } - { { $link key-up-sym } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } } + { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } } + { { $snippet "sym" } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } } } } { $examples { $code "T{ key-up f { C+ } \"a\" }" "T{ key-up f f \"TAB\" }" } } ; diff --git a/basis/ui/gestures/gestures.factor b/basis/ui/gestures/gestures.factor index 95417ac71f..6b53d25ea1 100755 --- a/basis/ui/gestures/gestures.factor +++ b/basis/ui/gestures/gestures.factor @@ -226,14 +226,14 @@ SYMBOL: drag-timer : send-button-down ( gesture loc world -- ) move-hand start-drag-timer - dup button-down-# + dup #>> dup update-click# hand-buttons get-global push update-clicked button-gesture ; : send-button-up ( gesture loc world -- ) move-hand - dup button-up-# hand-buttons get-global delete + dup #>> hand-buttons get-global delete stop-drag-timer button-gesture ; @@ -261,21 +261,21 @@ GENERIC: gesture>string ( gesture -- string/f ) [ name>> ] map concat >string ; M: key-down gesture>string - dup key-down-mods modifiers>string - swap key-down-sym append ; + dup mods>> modifiers>string + swap sym>> append ; M: button-up gesture>string [ - dup button-up-mods modifiers>string % + dup mods>> modifiers>string % "Click Button" % - button-up-# [ " " % # ] when* + #>> [ " " % # ] when* ] "" make ; M: button-down gesture>string [ - dup button-down-mods modifiers>string % + dup mods>> modifiers>string % "Press Button" % - button-down-# [ " " % # ] when* + #>> [ " " % # ] when* ] "" make ; M: left-action gesture>string drop "Swipe left" ;