Hi Sven,
you can define cg:widget-device method specialized to your
widget-subclass to return the name of a pane-class which is a subclass
of outline-top-pane. The system will always create an instance of this
pane-class when creating window for a widget of your subclass.
Then you can specialize your mouse-right-down to your own subclass only
so you don't redefine the default one which you can call with
(call-next-method) of course.
(in-package :cg-user)
(defclass my-outline (outline)
()
)
(defclass my-outline-top-pane (outline-top-pane)
()
)
(defmethod widget-device ((widget my-outline) (dialog t))
'my-outline-top-pane
)
(defmethod mouse-right-down ((window my-outline-top-pane)
buttons cursor-position)
(declare (ignore buttons cursor-position))
(pop-up-message-dialog window "mouse-right-down"
(format nil "mouse-right-down on ~A~%" window)
nil "OK")
(call-next-method)
)
;; ....
#|
(setq w (make-window :w
:dialog-items (list (make-instance 'my-outline))))
|#
Bye.
_________________________________________________
Petr Broz C.P.E. Plzen
programator - analytik Perlova 9, 301 14
CZECH REPUBLIC
<cpe.cz at bro> tel: +420-19-7236444
http://www.cpe.cz fax: +420-19-7235675
_________________________________________________
Sven Naumann wrote:
> I ’ve been trying to add pop-up menus for outline-widgets. For other
> types of widgets (list-views e.g.) everything works fine: just define
> a specialized widget-class (my-list-view) and use mouse-right-down,
> pop-up-menu, open-menu as described in the on-line documentation. But
> for outline-widgets this solution doesn’t work: The mouse-right-down
> method doesn’t take an instance of the specialized outline-class as an
> argument but an instance of the outline-top-pane class. If I define
> a mouse-right-down for the outline-top-pane, I overwrite the default
> menu which is used for all
>
> outline-widgets and using different menus for different
> outline-widgets gets a bit acquit.
>
> Is there any solution, but to overwrite the default pop-up-menu for
> the outline-top-pane?
>
> With best regards
>
> Sven Naumann
>
> Dr. Sven Naumann
>
> Linguistische Datenverarbeitung
>
> Universität Trier
>
> Universitätsring 15
>
> 54286 Trier
>
> Tel.: 0651/2012251
>