Re: Setting the cursor type in editor
"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
I see that my MOUSE-MOVE is referenced in the plotter pane class as part of the input model:
(defclass plotter-pane (capi:output-pane)
;; stuff used by 2-D plot scaling and plotting
;; The mixin has all the information needed to produce plots
;; but has nothing to draw on...
((xlog :accessor plotter-xlog :initform nil)
(xmin :accessor plotter-xmin :initform 0.0d0)
...
(plot-cursor :accessor plotter-cursor :initform (or *cross-cursor* :crosshair))
)
(:default-initargs
:nominal-width 400
:nominal-height 300
:display-callback 'display-callback
:resize-callback 'resize-callback
:default-width 400
:default-height 300
:background :white
:foreground :black
:visible-min-width 200
:visible-min-height 150
:visible-max-width 800
:visible-max-height 600
:draw-with-buffer t ;; MSWindows performance is miserable without this...
:pane-menu 'popup-menu
:input-model '((:motion mouse-move)
((:button-1 :motion) drag-legend)
((:button-1 :press) mouse-button-press)
((:button-1 :release) undrag-legend)
((:button-1 :press :shift) mouse-shift-button-press)
((:gesture-spec "Backspace")
maybe-remove-legend)
((:gesture-spec "Delete")
maybe-remove-legend)
((:gesture-spec "Control-c")
copy-image-to-clipboard)
((:gesture-spec "Control-p")
print-plotter-pane)
((:gesture-spec "Control-s")
save-image-from-menu))
))
> On Feb 19, 2025, at 14:46, David McClain (as dbm at refined-audiometrics dot com) <[email protected]> wrote:
>
> In my Plotter package, I have the ability to set the window cursor to different forms, depending on context.
>
> To do so I perform:
>
> (defmethod mouse-move ((pane plotter-pane) x y &rest args)
> (declare (ignore args))
> (cond ((on-legend pane x y)
> (highlight-legend pane)
> (setf (capi:simple-pane-cursor pane) :move))
> (t
> (unhighlight-legend pane)
> (setf (capi:simple-pane-cursor pane)
> (plotter-cursor pane))
> )))
>
> Presumably, if you can get the handle to the IDE editor window you ought to be able to do something similar.
>
>
>> On Feb 19, 2025, at 14:13, Yuri Davidovsky (as work at disclosure dot ie) <[email protected]> wrote:
>>
>> The IDE sets the cursor type to a vertical line when in the mac mode, and to a block cursor in the emacs mode automatically. I would very much like to keep the blocky cursor in the mac mode too.
>>
>> Is there a way to set the cursor type programmatically?
>>
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> [email protected]
>> http://www.lispworks.com/support/lisp-hug.html
>