none
CTreeCtrl context menu and full row select RRS feed

  • Question

  • Hi All,

    I have my own tree control derived from CTreeCtrl which handles context menu (ON_WM_CONTEXTMENU).
    This is hosted inside a CDockablePane and all works well, right click on a node and you get a context menu etc.

    However if I bind it to a tree control on a dialog via DDX_Control when I right click I do not get a context menu.
    Additionally if right click changes the selection, when you release the right button the selection then flicks back to the previous selection.

    The call to my OnContextMenu() is not been invoked from what I can tell in the dialog case.

    Any ideas what is trapping/re-directing my message? There are no handlers in the dialog either!

    Note if I double right click I do get a context menu!

    Lastly TVS_FULLROWSELECT does not work when I specify it in the style parameters for creating the control that is in the CDockable pane, but just fine on a dialog!

    Thanks
    Wednesday, April 8, 2009 3:00 PM

Answers

  • After a bit more googling I found this , pure genius!

    So right click is interpreted as a begin drag message, even if drag and drop is disabled!

    This is only apparent in dialog boxes as normal views seem to ignore this... odd!

    As for the full row select, still not rectified.

    Thanks.
    • Marked as answer by Mark Duffill Wednesday, May 6, 2009 8:23 PM
    Wednesday, April 8, 2009 3:34 PM

All replies

  • After a bit more googling I found this , pure genius!

    So right click is interpreted as a begin drag message, even if drag and drop is disabled!

    This is only apparent in dialog boxes as normal views seem to ignore this... odd!

    As for the full row select, still not rectified.

    Thanks.
    • Marked as answer by Mark Duffill Wednesday, May 6, 2009 8:23 PM
    Wednesday, April 8, 2009 3:34 PM
  • More for posterity at this point, since it's been a decade since your post, but...

    Evidently, full row selection doesn't work if you have DRAWLINES set, too.

    Wednesday, August 14, 2019 7:51 PM