Mark, here is a stripped version. With this I only get TORIGHT messages.


page1 = .Page1~new(,,,"Page1",,12)
page2 = .Page2~new(,,,"Page2",,12)
page2~cx = 300
page2~cy = 300
pages = .Array~of(page1,page2)
ps = .psDialog~new(pages,,"Property Sheet")
say ps~execute
--------------------------
::class psDialog subclass PropertySheetDialog
----------------------------
::class Page1 subclass UserPSPDialog
-----------------------------
::class Page2 subclass UserPSPDialog

::method defineDialog
  expose tree cmenu
  self~createTreeView(2000,10,10,self~cx-20,self~cy-20,"ALL NODRAG","TREE_VIEW")
  cmenu = .PopupMenu~new(2100)
  cmenu~insertItem(1, 2101, "Toggle All", , , .true)

::method initDialog
  expose tree cmenu
  tree = self~newTreeView(2000)
  tree~add("ITEM1",0,,,1)
  tree~add(,"ITEM1A",0,,,0)
  cmenu~assignTo(self)
  cmenu~connectContextMenu(onTreeviewContext, tree~hwnd)
  cmenu~connectCommandEvent(2101, "onToggle")

::method onTreeviewContext unguarded
  expose tree cmenu
  use arg hwnd, x, y
  pos = .Point~new(x, y)
  say tree~hittestinfo(pos)~hitem tree~hittestinfo(pos)~location
  if tree~hitTestInfo(pos)~hItem <> 0 then cmenu~show(pos)

::method onToggle
x=infomessage("onToggle")

::requires "oodialog.cls"