Lisp HUG Maillist Archive

Supporting Cut Copy Paste

I'm designing a LispWorks application that needs to provide a window  
containing text-input-panes, and I want to support Cut, Copy, and  
Paste in those panes.

I've got it to work by providing menus such as:

(make-instance 'capi:menu-item :title "Cut"
      :accelerator #\x
      :callback-type :none
      :callback #'(lambda () (capi:text-input-pane-cut (find-focus- 
pane))))

where I've defined find-focus-pane as:

(defun find-focus-pane ()
   (capi:map-pane-descendant-children
    (first
     (capi:collect-interfaces 'capi:interface :sort-by :visible))
    #'(lambda (p)
        (when (capi:pane-has-focus-p p)
          (return-from find-focus-pane p)))))

Is this the correct way to do it? This seems quite a roundabout way  
of finding where the selection is, but I can't find any examples.

Many thanks,
David Johnson-Davies

+------------------------------------------------------------+
David Johnson-Davies, Human-Computer Interface Ltd
17 Signet Court, Swanns Road, Cambridge, CB5 8LA, England.

Tel: +44 1223 314934, Fax: +44 1223 462562
Email: david@interface.co.uk, Web: http://www.interface.co.uk/
+------------------------------------------------------------+


Re: Supporting Cut Copy Paste

Hello David,

| I'm designing a LispWorks application that needs to provide a window
| containing text-input-panes, and I want to support Cut, Copy, and
| Paste in those panes.
|
| I've got it to work by providing menus such as:
|
| (make-instance 'capi:menu-item :title "Cut"
|       :accelerator #\x
|       :callback-type :none
|       :callback #'(lambda () (capi:text-input-pane-cut (find-focus-
| pane))))
|
| ...snip...|

Specifying :focus as :callback-type is a bit simpler provided your interface
contains only text input panes. For example:

(make-instance 'capi:menu-item :title "Cut"
       :accelerator #\x
       :callback-type '(:focus)
       :callback  'capi:text-input-pane-cut)
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


Re: Supporting Cut Copy Paste

Unable to parse email body. Email id is 9585

Updated at: 2020-12-10 08:40 UTC