From xemacs-m  Mon Aug 18 19:30:29 1997
Received: from komtron.com (root@gatekeeper.komtron.com [194.77.5.33])
	by xemacs.org (8.8.5/8.8.5) with SMTP id TAA08953
	for <xemacs-beta@xemacs.org>; Mon, 18 Aug 1997 19:30:21 -0500 (CDT)
Received: from slave1.komtron.com by komtron.com; Tue, 19 Aug 1997 02:35:24 +0200
Received: (from Ufga@localhost) by slave1.komtron.com (8.7.5/8.7.3) with UUCP id CAA17748 for xemacs-beta@xemacs.org; Tue, 19 Aug 1997 02:36:03 +0200
X-Authentication-Warning: slave1.komtron.com: Ufga set sender to ograf@fga.de using -f
Received: by fga.de (8.8.5/8.8.5) id XAA15732 for <xemacs-beta@xemacs.org>; Mon, 18 Aug 1997 23:36:53 +0200
Received: by fga.de (8.8.5/8.8.5) id XAA00429
To: xemacs-beta@xemacs.org
Subject: OffiX DnD in XEmacs 20.3 Bratislava (b18)
X-Face: [8r}|"6`WFUT0kiC9dBT%edO~lI5Gwog0Z@Cl=Inx|2F=+DjY#0nGtclM)9lU
        c/8JJ%b&&^:&pWh&nYlQbGSk=WdL^%f!<6a:?n)V_snw7Zc+AW10az=||e8Kv
        1PV49Qe64*68G2`)M8O$mlLQ\!O}$d8]T\L?i@$;=WA~0B[k)O.^T'x?O^=EX
        %=gt6(:hG!-|%$EZGq-Dn6r%N6xqOC4voztttHxOMp!2$o+qPAcT2k&dgO~`%
        kVcW7C<3hK[g9vVpk'#B2(f"pN,jBh`
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Aug_18_23:36:41_1997-1"
Content-Transfer-Encoding: 7bit
From: Oliver Graf <ograf@fga.de>
Date: 18 Aug 1997 23:36:41 +0200
Message-Id: <m3203rrx5i.fsf@indie.fga-intern.de>
Lines: 104
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta18) - "Bratislava"

--Multipart_Mon_Aug_18_23:36:41_1997-1
Content-Type: text/plain; charset=US-ASCII

Hi OffiX users (and perhaps those who must use CDE...)!

Perhaps nobody has sensed it, but XEmacs 20.3 b18 can now drag stuff using the 
OffiX protocol. There is a small, simple and stupid demo (stupid because it
modifies the global map) called $XEMACS_SRC/tests/Dnd/dragtest.el.

For those who want the real thing: here it is! Dragging of regions.

Test it at your own risk, because for now the drag code will start the drag
immediately after the click (i.e. no start-drag-distance).

I'm now working on Drop emacs events. With those you can bind drops to
specific widget (drop a font from xfontsel+DnD onto the font-widget of
customize...).

Regards,
  Oliver.

P.S.: Theoretically this should also work with CDE, if the internal functions
work correctly...


--Multipart_Mon_Aug_18_23:36:41_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="xemacs-20.3-drag-region.patch"
Content-Transfer-Encoding: 8bit

*** xemacs-20.3-b16/lisp/prim/mouse.el.orig	Fri Aug 15 11:03:27 1997
--- xemacs-20.3-b16/lisp/prim/mouse.el	Fri Aug 15 11:29:31 1997
***************
*** 32,38 ****
  (global-set-key '(control shift button1) 'mouse-track-delete-and-insert)
  (global-set-key '(meta button1) 'mouse-track-do-rectangle)
  
! (global-set-key 'button2 'mouse-yank)
  
  (defcustom mouse-track-rectangle-p nil
    "*If true, then dragging out a region with the mouse selects rectangles
--- 32,42 ----
  (global-set-key '(control shift button1) 'mouse-track-delete-and-insert)
  (global-set-key '(meta button1) 'mouse-track-do-rectangle)
  
! ;; enable drag regions (ograf@fga.de)
! (if (or (featurep 'offix) ;; do we have DnD support?
! 	(featurep 'cde))
!     (global-set-key 'button2 'mouse-drag-or-yank)
!   (global-set-key 'button2 'mouse-yank))
  
  (defcustom mouse-track-rectangle-p nil
    "*If true, then dragging out a region with the mouse selects rectangles
***************
*** 141,156 ****
    (or (point-inside-extent-p primary-selection-extent)
        (point-inside-extent-p zmacs-region-extent)))
  
! ;;; #### - finish this...
! ;;; (defun mouse-drag-or-yank (event)
! ;;;   "Either drag or paste the current selection.  If the variable
! ;;; `mouse-yank-at-point' is non-nil, then moves the cursor to the location of
! ;;; the click before pasting."
! ;;;   (interactive "e")
! ;;;   (if (click-inside-selection-p event)
! ;;;       ;; okay, this is a drag
! ;;;       )
! ;;;   )
  
  (defun mouse-eval-sexp (click force-window)
    "Evaluate the sexp under the mouse.  Usually, this is the last sexp before
--- 145,174 ----
    (or (point-inside-extent-p primary-selection-extent)
        (point-inside-extent-p zmacs-region-extent)))
  
! (defun mouse-drag-or-yank (event)
!   "Either drag or paste the current selection.  If the variable
!  `mouse-yank-at-point' is non-nil, then moves the cursor to the location of
!  the click before pasting.
!  This functions has to be improved. Until now it is just a (working) test."
!   ;; by ograf@fga.de
!   (interactive "e")
!   (if (click-inside-extent-p event zmacs-region-extent)
!       ;; okay, this is a drag
!       (cond ((featurep 'offix)
! 	     (offix-start-drag-region event
! 				      (extent-start-position zmacs-region-extent)
! 				      (extent-end-position zmacs-region-extent)))
! 	    ((featurep 'cde)
! 	     ;; should also work with CDE
! 	     (cde-start-drag
! 	      (extent-start-position zmacs-region-extent)
! 	      (extent-end-position zmacs-region-extent)))
! 	    (t ding))
!     ;; no drag, call region-funct
!     (and (not mouse-yank-at-point)
! 	 (mouse-set-point event))
!     (funcall mouse-yank-function))
!   )
  
  (defun mouse-eval-sexp (click force-window)
    "Evaluate the sexp under the mouse.  Usually, this is the last sexp before

--Multipart_Mon_Aug_18_23:36:41_1997-1--

