From 0b8c907ec5a456d20a5998c26ffda6ab29b8430e Mon Sep 17 00:00:00 2001 From: slava Date: Fri, 28 Jul 2006 23:15:03 +0000 Subject: [PATCH] editor gadget now uses gadget-selection protocol --- library/ui/text/commands.factor | 6 +++--- library/ui/text/editor.factor | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/library/ui/text/commands.factor b/library/ui/text/commands.factor index efaebcd7d7..8fba52e13f 100644 --- a/library/ui/text/commands.factor +++ b/library/ui/text/commands.factor @@ -14,8 +14,8 @@ sequences ; dup editor-caret click-loc ; : editor-copy ( editor clipboard -- ) - over editor-selection? [ - >r [ editor-selection ] keep r> copy-clipboard + over gadget-selection? [ + >r [ gadget-selection ] keep r> copy-clipboard ] [ 2drop ] if ; @@ -24,7 +24,7 @@ sequences ; dupd editor-copy remove-editor-selection ; : delete/backspace ( elt editor quot -- | quot: caret editor -- from to ) - over editor-selection? [ + over gadget-selection? [ drop nip remove-editor-selection ] [ over >r >r dup editor-caret* swap control-model diff --git a/library/ui/text/editor.factor b/library/ui/text/editor.factor index 900b62e0de..be585be194 100644 --- a/library/ui/text/editor.factor +++ b/library/ui/text/editor.factor @@ -186,10 +186,10 @@ M: editor draw-gadget* ( gadget -- ) M: editor pref-dim* ( editor -- dim ) dup editor-width swap editor-height 2array ; -: editor-selection? ( editor -- ? ) +M: editor gadget-selection? ( editor -- ? ) selection-start/end = not ; -: editor-selection ( editor -- str ) +M: editor gadget-selection ( editor -- str ) [ selection-start/end ] keep control-model doc-range ; : remove-editor-selection ( editor -- )