I'm trying to add a context menu to a group box but cannot get the menu to
appear when right-clicking within the box. It works fine if I change the
control to for example a treeview. I haven't found anything in the doc
saying that it won't work for a group box control. A sample program to
illustrate this follows. Thanks.

Staffan

a=.dialog~new
a~execute
return

::class dialog subclass userdialog
::requires "oodialog.cls"

::method init
forward class(super) continue
self~createCenter(200,200,"Dialog Title")

::method defineDialog
expose menu
--self~createGroupBox(100,10,10,180,150,,"GroupBox")
self~createTreeview(100,10,10,180,150)
menu=.PopupMenu~new(200)
menu~insertItem(1,201,"Exit",,,.TRUE)

::method initDialog
expose menu
--box = self~newGroupBox(100)
box=self~newTreeview(100)
menu~assignTo(self)
menu~connectContextMenu(onContext,box~hwnd)
menu~connectCommandEvent(201,onExit)

::method onContext unguarded
expose menu
use arg h,x,y
reply 0
menu~~show(.Point~new(x,y))

::method onExit unguarded
self~cancel:super()
self~finished = 0
return self~finished
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to